Open rburghol opened 2 years ago
First attempts.
FC = pgf90
to FC = gfortran
make jameswq 2>&1 >/dev/null | grep "" > make.errors
Expecting variable in READ statement at (1)
unrecognized command line option
(see below).ifort
specific compiler things, ifort
is no longer preferred in favor of gfortranFFLAGS=
, though we may need to revisitrob@deq2:/opt/model/james-chla/src$ make
gfortran -Mpreprocess -fastsse -O2 -Mipa=fast -tp amd64 -mcmodel=medium *.for -o jameswq
gfortran: error: amd64: No such file or directory
gfortran: error: unrecognized command line option ‘-Mpreprocess’; did you mean ‘--preprocess’?
gfortran: error: unrecognized command line option ‘-fastsse’
gfortran: error: unrecognized command line option ‘-Mipa=fast’
gfortran: error: unrecognized command line option ‘-tp’; did you mean ‘-p’?
make: *** [Makefile:53: jameswq] Error 1
rob@deq2:/opt/model/james-chla/src$ https://gcc.gnu.org/onlinedocs/gfortran/Preprocessing-Options.htmlhttps://gcc.gnu.org/onlinedocs/gfortran/Preprocessing-Options.html
Error: FORM specifier in OPEN statement at (1) has invalid value ‘binary’
form='binary'
to access='stream'
form='binary'
to form='unformatted'
access=append
: this gives an error because we use "access=stream" to specify binary, so need to change this to position=append
Error: Duplicate ACCESS specification at (1)
zwqdump3.for:409:68:
409 | open(1,file='wqsed3d'//iyear//'.bin',access='stream',ACCESS='APPEND')
| 1
Some, but not all, OPEN statements fail with fom='unformatted' (fix put in for form='binary'):
zwq3dinp.for:195:72:
195 | OPEN(555,FILE='Algaeavg.bin',STATUS='UNKNOWN',form='unformatted')
| 1
Error: Syntax error in OPEN statement at (1)
make: *** [Makefile:54: jameswq] Error 1
Make fails to find functions because they are in a source file with upper case FOR extension. Gives errors like this:
/usr/bin/ld: /tmp/ccgObvDi.o: in function `calmmt_':
calmmt.for:(.text+0xb8d4): undefined reference to `rvelplth_'
Rename source files:
for i in `ls *.FOR`; do
newname=`echo $i | tr '[.FOR]' '[.for]'`
mv $i $newname
done
Getting close:
gfortran -w *.for -o jameswq
/usr/bin/ld: /tmp/ccVjyjZW.o: in function `ssedtox_pcb_':
ssedtox_pcb.for:(.text+0xba94): undefined reference to `vmrmhp_'
/usr/bin/ld: /tmp/cc85DhzW.o: in function `timelog_':
timelog.for:(.text+0x1f): undefined reference to `time_'
collect2: error: ld returned 1 exit status
make: *** [Makefile:54: jameswq] Error 1
The above in ssedtox_pcb.for was another long line error, that somehow slipped past the compiler, i.e., it did not give a syntax error, but dropped the "," between vmrm
and the first argument on the next line HP
, (done in fortran function call format "inputs on one line, function rewritten outputs on the next line") and concatenated:
CALL doboundary(Os,Asss,TEM(L,KC),SAL(L,KC),WINDST(L),umrm,vmrm,
1 HP(L),DZC(KC),0,IWQKA)
Changed to:
CALL doboundary(Os,Asss,TEM(L,KC),SAL(L,KC),WINDST(L),
& umrm,vmrm,
1 HP(L),DZC(KC),0,IWQKA)
To fix the final timelog.for:(.text+0x1f): undefined reference to
time_', I grepped for "subtroutine time" elsewhere, and found that all other calls were to function
TIMEF()`, so I just replaced it with that.
See also:
Command:
FFLAGS = -w
make jameswq 2>&1 >/dev/null | grep " " > make.errors
ln -s /opt/model/james-chla/src/jameswq /usr/local/bin/jameswq