On Apr 4, 11:57 pm, "thogy" <Richard.All@gmail.com> wrote:
Richard Maine has explained in his reply that your code is Fortran 77.
The .f extension indicates (in the gcc compiler family) that it is
fixed format source.
You have a series of cascading errors caused by misaligning your
source code. In addition, one statement is flagged as having an extra
parenthesis on the right.
I moved over some CONTINUE statements so that the statement starts in
column 7 and I moved other statements so that the continuation marker
& appears in column 6. You also have a comment in which the initial c
must be in column one. In addition, I guessed where you might need a
left parenthesis added to match the extra one on the right based on
preceeding statements of similar form.
Here follows the output of 'fc' on your original vs my code:
comparing files EX3_8B.F0 and EX3_8B.F
***** EX3_8B.F0
4 CONTINUE
***** EX3_8B.F
4 CONTINUE
*****
***** EX3_8B.F0
HZ(I,J,K,N)=0
5 CONTINUE
print *, 'initialization complete'
***** EX3_8B.F
HZ(I,J,K,N)=0
5 CONTINUE
print *, 'initialization complete'
*****
***** EX3_8B.F0
EY(I,J,K,NCUR)=CA(M)*EY(I,J,K,NPR1) + CBMRB(M)*
& HX(I,J,K,NCUR)-HX(I,J,K-1,NCUR)+HZ(I-1,J,K,NCUR)
& -HZ(I,J,K,NCUR))
ENDIF
***** EX3_8B.F
EY(I,J,K,NCUR)=CA(M)*EY(I,J,K,NPR1) + CBMRB(M)*
& (HX(I,J,K,NCUR)-HX(I,J,K-1,NCUR)+HZ(I-1,J,K,NCUR)
& -HZ(I,J,K,NCUR))
ENDIF
*****
***** EX3_8B.F0
ENDIF
c---k=kmax
IF(K.EQ.KMAX) THEN
***** EX3_8B.F
ENDIF
c---k=kmax
IF(K.EQ.KMAX) THEN
*****
***** EX3_8B.F0
ENDIF
30 CONTINUE ! I LOOP
C********************************************************
***** EX3_8B.F
ENDIF
30 CONTINUE ! I LOOP
C********************************************************
*****
After making these changes, the program compiles, runs and gives what
appears to be meaningful output both under g77 and g95 (modulo some
noise in the output of the low order digits beyond the expected ~7
significant figures).
I suggest proofreading your program against the source listing,
bearing in mind the restrictions of fixed source format.
HTH
-- elliot