Don't know what they were used for specifically but I was sad witness to a Marineflieger F-104G crash back in my youth. They were impressive machines and the Vikings aerobatic duo a sight to see.
There were many crashes. The Spanish air force had the best record with them, losing the least. Due to the limited range, they were primarily intercepters in the German Navy.