Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WINDOWS to LINUX compile issues #51

Open
millerta opened this issue May 3, 2024 · 3 comments
Open

WINDOWS to LINUX compile issues #51

millerta opened this issue May 3, 2024 · 3 comments

Comments

@millerta
Copy link
Collaborator

millerta commented May 3, 2024

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
@millerta
Copy link
Collaborator Author

release version of code compiles with GNU Fortran (GCC) 13.2.0 and has successful tests on Test Suite and fehmpytests.

@millerta millerta reopened this Jan 29, 2025
@millerta
Copy link
Collaborator Author

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)).

@millerta
Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant