HARPgroup / james-chla

0 stars 0 forks source link

compiling #1

Open rburghol opened 2 years ago

rburghol commented 2 years ago

See also:

Command:

rburghol commented 2 years ago

First attempts.

rburghol commented 2 years ago
rburghol commented 2 years ago
rob@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
rburghol commented 2 years ago

Error: FORM specifier in OPEN statement at (1) has invalid value ‘binary’

rburghol commented 2 years ago
Error: Duplicate ACCESS specification at (1)
zwqdump3.for:409:68:

  409 |    open(1,file='wqsed3d'//iyear//'.bin',access='stream',ACCESS='APPEND')
      |                                                                    1
rburghol commented 2 years ago

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
rburghol commented 2 years ago

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
rburghol commented 2 years ago

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 totime_', I grepped for "subtroutine time" elsewhere, and found that all other calls were to functionTIMEF()`, so I just replaced it with that.