In my fortran code, I'm attempting to include a DO loop, but I'm ending up with a "DO loop or BLOCK IF not closed." It appears if any other DO loops after the INCLUDE statement are opened it treats them as nested loops, indicating to me the included opening DO line is interpreted correctly, but not the END DO statement. I've reduced the included code to bare-bones to make sure it's the loop and not the statements in the loop giving a problem. The control variable is declared before the DO loop.
DO A = 1,3
END DO
Does Fortran77 not allow for DO loops in INCLUDE files?
I'm using gfortran for my compiler if it changes much.
Edit: grammar
Edit2: I'm using GCC 4.6.2. Now to note, if this makes a difference, gfortran is being run from a makefile made by PSCAD. I can provide info on that if it's pertinent.
Here's code that is experiencing this issue:
TEST.F:
SUBROUTINE TESTFX()
INTEGER A
INCLUDE '../HDR.INC'
END
HDR.INC:
DO A = 1,3
END DO
Edit3: Edited typos in code and removed RETURN from subroutine.
Your INCLUDE must be placed on a new line, it is not part of the statement declaring A. Why do you have apostrophes at your ENDs? They cannot be there. The RETURN statement before the END is totally superfluous also. Try:
TEST.F:
HDR.INC: