0
votes

I have checked all the formats of the implicit type declaration but have not been able to find out the error in the following line . I have been running the code using f77 to compile this.

implicit real*4 (a-h,o-z)

while running the program it gives the following error for the above statement.

implicit real*4 (a-h,o-z)

               1

Error: Unexpected character in variable list at (1)

1
1) Does it start in column 7? 2) What is above and below the code? - cup
No it doesn't start in column 7. Actually the full code is 1550 lines long and before that line only one line is there which is: intrinsic atan2 - Kuntal Chaudhuri
Put the implicit line first and start the code in column 7. cols 1-5 are for labels, col 6 for continuation. If you wish to use free format, use one of the later versions of fortran. - cup
Thank You. It worked. :D - Kuntal Chaudhuri
@cup, please turn that into an answer, that way it will be more visible for future searchers. - paxdiablo

1 Answers

1
votes

A few basic rules if you are using F77 or earlier versions.

  1. Put the implicit line first
  2. Columns 1-5 are for labels
  3. Column 6 is for continuation
  4. Start the code in column 7
  5. The code should not go past column 72. Some compilers have an option to extend the line length to 80 or 120 or 132 (widths of line printers when F77 first came out)

If you wish to use free format, use one of the later versions of fortran