I am struggling with READ in fortran 77. This code:
OPEN (UNIT=11,FILE=DRDFIL,ACCESS='DIRECT',
* STATUS='OLD',FORM='FORMATTED',RECORD SIZE=360)
NFRD=1
READ (11''NFRD,FMT=90019,ERR=11) AO,DHI,B,NR,NC,FS,FAR,ASP,APP,AOP,
* AIP,KF,LT,NT,L,H,LS,LEB,TUBETYPE,AIRSIDE,LD
11''NFRD
will not compile with Intel Compiler.
The code will continue with this:
11 NFRD=2
READ (11''NFRD,FMT=90029) A1,B1,C1,D1,A2,B2,C2,D2,E2,A3,B3,
* (DRYCF(I),I=1,3),(WETCF(I),I=1,3)
I do not understand what the 11 1 and 11 2 are intending.
The error is:
error #5082: Syntax error, found IDENTIFIER 'NFRD' when expecting one of: :: ) , : * <END-OF-STATEMENT> ; . (/ + - ] /) ' ** > PRIVATE / // ...
READ (11 NFRD,ERR=11) AO,DHI,B,NR,NC,FS,FAR,ASP,APP,AOP,
---------------^
The opened file is one long space separated string of numbers. Like these:
0.12066861E+03 0.29457249E-01 0.69446688E+01 0.10000000E+01 0.40000000E+02 0.27042252E+03 0.79557860E+00 0.32429367E+02 0.37945886E+01 0.36223957E+02 0.52160816E+01
This is code from the 1980-90's.
I am struggling with READ in fortran 77. This code:
OPEN (UNIT=11,FILE=DRDFIL,ACCESS='DIRECT',
* STATUS='OLD',FORM='FORMATTED',RECORD SIZE=360)
NFRD=1
READ (11''NFRD,FMT=90019,ERR=11) AO,DHI,B,NR,NC,FS,FAR,ASP,APP,AOP,
* AIP,KF,LT,NT,L,H,LS,LEB,TUBETYPE,AIRSIDE,LD
11''NFRD
will not compile with Intel Compiler.
The code will continue with this:
11 NFRD=2
READ (11''NFRD,FMT=90029) A1,B1,C1,D1,A2,B2,C2,D2,E2,A3,B3,
* (DRYCF(I),I=1,3),(WETCF(I),I=1,3)
I do not understand what the 11 1 and 11 2 are intending.
The error is:
error #5082: Syntax error, found IDENTIFIER 'NFRD' when expecting one of: :: ) , : * <END-OF-STATEMENT> ; . (/ + - ] /) ' ** > PRIVATE / // ...
READ (11 NFRD,ERR=11) AO,DHI,B,NR,NC,FS,FAR,ASP,APP,AOP,
---------------^
The opened file is one long space separated string of numbers. Like these:
0.12066861E+03 0.29457249E-01 0.69446688E+01 0.10000000E+01 0.40000000E+02 0.27042252E+03 0.79557860E+00 0.32429367E+02 0.37945886E+01 0.36223957E+02 0.52160816E+01
This is code from the 1980-90's.
Share Improve this question edited 2 days ago Craig 2,4741 gold badge22 silver badges27 bronze badges asked Feb 5 at 17:21 Glen HermanGlen Herman 1762 silver badges12 bronze badges 5 |2 Answers
Reset to default 0This code does run and is very old. I found the answer by talking to some engineers. The syntax is an undocumented "feature" and little supported. It is as some commented, a portion of the record. Unit space X, where x is the portion. x+1 is the next portion. Parsed by the format. My compiler does not recognize it, so I am changing the data source. So, it is not gibberish after all.
The considered READ operator is compatible with both ifort and ifx Intel compilers (Windows). For that it is only needed to change '' -> ' in the READ operator. Possible, also RECORD SIZE to RECL in the OPEN operator.
An alternate to the UNIT=u, REC=rn form is as follows: READ( u 'rn … ) iolist. https://docs.oracle.com/cd/E19957-01/805-4941/805-4941.pdf
11''NFRD
is gibberish, but there's far from enough information here for me to guess what was intended. – francescalus Commented Feb 5 at 17:28RECORD SIZE =
is not Fortran 77 either. Do you know which compiler used to accept this code? Is this something you found printed somewhere or does it come from somewhere where it actually compiled and ran? – Vladimir F Героям слава Commented Feb 5 at 19:44unit=11'97
(for record 97 of unit 11). An extra'
and a variable name isn't so far from that. – francescalus Commented Feb 5 at 23:11