Mohid-Water-Modelling-System / Mohid

Official MOHID Water Modelling System repository
http://www.mohid.com
70 stars 58 forks source link

Correct type inconsistencies and stop using archaic intrinsic functions #29

Open RBCanelas opened 5 years ago

RBCanelas commented 5 years ago

Compiling Base1 & Base2 with GNU Fortran (GFortran) with naive compiler flags renders a list of errors related to type mismatches. Example:

ModuleFunctions.F90:6230:25: aux1 = dmod (aux, DTD) 1 Error: 'a' argument of 'dmod' intrinsic at (1) must be double precision

ModuleFunctions.F90:6231:33: MinError = min (dabs(aux1), dabs(DTD - aux1)) 1 Error: 'a' argument of 'dabs' intrinsic at (1) must be double precision

These are related to the use of dabs and dmod, that shouldn't be used (using abs and mod is enough).

ModuleVoronoi3D.f:71:72:

ModuleVoronoi3D is laden with these issues. More might show elsewhere once these get corrected.

iFort and compilation flags for GFortran might work with this, but the outcome is typically a wildcard and might produce unstable results. This might be the reason GFort compiles but then execution throws segfaults.