Compiling and executing magfld.f routine

Hello FLUKA experts,

I have been attempting to write a magfld routine that will apply certain field strengths and cosines to different regions in my simulation, but find that the routine will not compile due to syntax errors that I do not understand. If anybody would be willing to look at it and give some pointers, it would be much appreciated. I have attached the routine to this post.

Thank you,
James R. Bowers
SPmagfld.f (12.7 KB)

Hello James,

Upon a first glance, it would be worthwhile to:

  • Get rid of tabs at the beginning of line and replace them with spaces, making sure you statements always start at the 7th column (see comment on continuation character below).
  • Make sure nothing exceeds the 72nd column


Hi James,

in addition to Cesc’ answer:

  • The continuation character (&) always should be in column 6.
  • The maximum length of a line has been extended to 132 characters in FLUKA 4.