This PR brings support for the ifort Intel Fortran compiler
(in part because LIS seems to have better support for it, compared to GNU Fortran).
You can use ifort by specifying FC=ifort in your make command
(otherwise the FC=gfortran default is used).
Porting to Intel Fortran mainly involved changes to global variables of allocatable string type,
requiring a different implementation of the corresponding getters and an explicit
initialization (to empty strings).
As such, this yielded incorrect results in the Europe tests with both gfortran and ifort,
unless the -fPIC flag got omitted (as e.g. happens when compiling with DEBUG=0).
Digging deeper revealed that this was due to the following combination of events:
The AdvanceOneTimeStep reorganization introduced a bug causing the WPi variable
to be uninitialized upon entry of AdvanceOneTimeStep (while it should have been passed
on from a previous time step).
Previously, this bug seemed to have no real effect, presumably because the same
memory/cache location is being used for the WPi variable and because this location
happened to not get overwritten.
Using the different getter implementation (with allocatable strings instead of fixed-length
strings) now breaks this behavior and exposes the bug (presumably by overwriting the WPi
memory address at some point).
By propagating the WPi value from one time step to the next (commit a05d037695c9ebb8c3897f23513b414881e9543d),
the full testsuite passes in all cases:
[x] DEBUG=1 FORTRAN_EXE=1 and DEBUG=0 FORTRAN_EXE=0 for FC=gfortran
with both the foss-2018a toolchain and the Singularity image.
[x] DEBUG=1 and DEBUG=0 (both with FORTRAN_EXE=1) for FC=ifort with the intel-2018a
toolchain.
This PR brings support for the
ifort
Intel Fortran compiler (in part because LIS seems to have better support for it, compared to GNU Fortran).You can use
ifort
by specifyingFC=ifort
in yourmake
command (otherwise theFC=gfortran
default is used).Porting to Intel Fortran mainly involved changes to global variables of allocatable string type, requiring a different implementation of the corresponding getters and an explicit initialization (to empty strings).
As such, this yielded incorrect results in the Europe tests with both
gfortran
andifort
, unless the-fPIC
flag got omitted (as e.g. happens when compiling withDEBUG=0
).Digging deeper revealed that this was due to the following combination of events:
AdvanceOneTimeStep
reorganization introduced a bug causing theWPi
variable to be uninitialized upon entry ofAdvanceOneTimeStep
(while it should have been passed on from a previous time step).WPi
variable and because this location happened to not get overwritten.getter
implementation (with allocatable strings instead of fixed-length strings) now breaks this behavior and exposes the bug (presumably by overwriting theWPi
memory address at some point).By propagating the
WPi
value from one time step to the next (commit a05d037695c9ebb8c3897f23513b414881e9543d), the full testsuite passes in all cases:DEBUG=1 FORTRAN_EXE=1
andDEBUG=0 FORTRAN_EXE=0
forFC=gfortran
with both thefoss-2018a
toolchain and the Singularity image.DEBUG=1
andDEBUG=0
(both withFORTRAN_EXE=1
) forFC=ifort
with theintel-2018a
toolchain.