KUL-RSDA / AquaCrop

AquaCrop source code endorsed by FAO
https://www.fao.org/aquacrop/en/
Other
54 stars 17 forks source link

Intel Fortran support #307

Closed MaximeVdB closed 2 years ago

MaximeVdB commented 2 years ago

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:

By propagating the WPi value from one time step to the next (commit a05d037695c9ebb8c3897f23513b414881e9543d), the full testsuite passes in all cases:

mbechtold commented 2 years ago

Successful runs with LIS - AC70 compiled with ifort.