0

I attempted to run some old Fortran code that I "inherited" from a colleague long ago using the gfortran compiler. In principle, I should be able to get what I need from it just by changing some constants corresponding to a model parameter. Upon execution of the script, I get a syntax error

Error: Format label 201 on (1) not defined

and

Error: Unexpected end of format string in format string at (1)    

which apparently refers to certain command lines being too long. Not having any familiarity with Fortran syntax, my preference is to modify the code as little as possible. I found a stackoverflow posting that referenced the use of

-ffree-line-length-n

to get around this error. My question is, how do I use this to allow lines of arbitrary length? Is it something that I use as a header in the code itself, or in the gfortran call to execute the code?

Max
  • 487
  • 5
  • 19
  • 2
    You should show the code but most likely you need `-ffixed-line-length-n`. – Vladimir F Героям слава Mar 07 '22 at 20:55
  • 1
    I neglected to provide the other error message, i.e. unexpected end of format string in format string at (1), which I searched on this site and found that it corresponded to excessively long lines in the code. Perhaps this isn't the case, as I mentioned, I have almost no experience with fortran – Max Mar 07 '22 at 21:06
  • In any case, -ffixed-line-length-n seems to have resolved this problem – Max Mar 07 '22 at 21:08

0 Answers0