WINDOWS to LINUX compile issues
When compiling code written on Windows, these are some common problems. GNU Fortran (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
Long line length is the most common issue and can cause hidden problems. In some cases there is a long blank string after end of line, remove these. FIX: split the line and use continuation character.
Suggest using this to find long lines on any file coming from Windows environment:
cat fehmn.f | awk '(length($0) > 72) { print NR ":" $0 }'
Logicals comparison error. FIX with eqv replacing eq
co2ctr.f has many errors, many from lines too long, FIX with continuation.
1344 | & phase_nr(2).eq..false. .and.phase_nr(3).eq..false.) then
| 1
Error: Logicals at (1) must be compared with .eqv. instead of .eq.
Windows close argument not supported. FIX by removing dispose argument ie. close(lu)
avs_io.f:498:28:
498 | close(lu,dispose = 'delete')
new module not recognized. FIX by adding to Makefile.depends
varchk_simple_awh.f:17:9:
17 | use commass_AWH
| 1
Fatal Error: Cannot open module file ‘commass_awh.mod’ for reading at (1): No such file or directory
compilation terminated.
Makefile.depends example for modules: Add modulename.o to files that contain the mod name Add modulename.mod: filename.o
varchk_simple_awk.o: commass_AWH.o
commass_AWH.mod: commass_AWH.o
New files with modules will need to be added to Makefile.depends.
grep use innondarcy.f
innondarcy.f: use comdi
innondarcy.f: use comdti
innondarcy.f: use comai
innondarcy.f: use comki
innondarcy.f: use com_nondarcy
Edit Makefile.depends
innondarcy.o: comdi.o cmodti.o comai.o cmoki.o com_nondarcy.o
com_nondarcy.mod: com_nondarcy.o
release version of code compiles with GNU Fortran (GCC) 13.2.0 and has successful tests on Test Suite and fehmpytests.
George's new nondarcy code issues:
long lines fixed with continuation lines
Zero arguments changed to double using 0.0d0
fehmn.f:1575:29:
1296 | call steady(1, 0.0, 0.0) | 2 1575 | call steady(2,dabs(inflow_thstime),dabs(inen_thstime)) | 1 Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(8)/REAL(4)).
Definition for hdflow not found in new files:
input.f:678:45:
678 | if(.not.allocated(hdflow)) allocate(hdflow(n0)) | 1 Error: Allocate-object at (1) is neither a data pointer nor an allocatable variable