GEOS-Chem "Science Codebase" repository. Contains GEOS-Chem science routines, run directory generation scripts, and interface code. This repository is used as a submodule within the GCClassic and GCHP wrappers, as well as in other modeling contexts (external ESMs).
This is known behavior and also occurs when you compile GEOS-Chem with GNU Make. But in the GNU Makefiles, we have to add a special rule to compile ocean_mercury_mod.F as -O1 in order to avoid the error:
ocean_mercury_mod.o : ocean_mercury_mod.F \
dao_mod.o depo_mercury_mod.o \
diag03_mod.o toms_mod.o \
hco_interface_mod.o
##############################################################################
# NOTE: For some reason gfortran 8.x.x throws an internal compiler error
# in this routine. The error does not happen when optimization is turned
# off. For now, lower the optimization level to get around this issue.
# The ocean mercury module might eventually be replaced later on.
# -- Bob Yantosca, 17 Aug 2018
ifeq ($(IS_GNU_8),1)
$(F90) -c -O1 $<
endif
##############################################################################
This appears to be present in gfortran 8 and higher. I think it is because gfortran 8+ cannot handle and/or optimize some old-timey legacy code in ocean_mercury_mod.F.
To Reproduce
Steps to reproduce the behavior:
Create a rundir geosfp_4x5_TransportTracers from the UT branch dev/12.6.0
cd geosfp_4x5_TransportTracers
mkdir build
cd build
cmake ../CodeDir
make -j8
Expected behavior
The executable should be built.
Error message:
[ 88%] Building Fortran object GeosCore/CMakeFiles/GeosCore.dir/ocean_mercury_mod.F.o
[ 88%] Building Fortran object GeosCore/CMakeFiles/GeosCore.dir/land_mercury_mod.F.o
[ 89%] Building Fortran object GeosCore/CMakeFiles/GeosCore.dir/wetscav_mod.F.o
during GIMPLE pass: ccp
/local/ryantosca/GC/rundirs/12.6.0/geosfp_4x5_TransportTracers/CodeDir/GeosCore/ocean_mercury_mod.F:404:0:
USE CMN_SIZE_MOD
internal compiler error: Segmentation fault
0xad755f crash_signal
../.././gcc/toplev.c:325
0xbaeb0c gimple_code
../.././gcc/gimple.h:1679
0xbaeb0c gimple_nop_p
../.././gcc/gimple.h:6346
0xbaeb0c get_default_value
../.././gcc/tree-ssa-ccp.c:279
0xbb04bc get_value
../.././gcc/tree-ssa-ccp.c:354
0xbb04bc ccp_finalize
../.././gcc/tree-ssa-ccp.c:962
0xbb04bc do_ssa_ccp
../.././gcc/tree-ssa-ccp.c:2475
0xbb04bc execute
../.././gcc/tree-ssa-ccp.c:2518
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
make[2]: *** [GeosCore/CMakeFiles/GeosCore.dir/ocean_mercury_mod.F.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [GeosCore/CMakeFiles/GeosCore.dir/all] Error 2
make: *** [all] Error 2
Required information
Out of the box" GEOS-Chem dev/12.6.0 running on CentOS7:
Linux holyjacob01.rc.fas.harvard.edu 3.10.0-957.12.1.el7.x86_64 #1 SMP Mon Apr 29 14:59:59 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
The gfortran 8.2.0 compiler was built by our Research Computing staff. There might be some issues with it. If time allows I will try to build a fresh version of gfortran 8.2.0 (and maybe also gfortran 9.3) cleanly with Spack and see if we still get the error.
The ocean_mercury_mod.F90 is not used for fullchem simulations, but it is compiled into the executable. It is a bit of a mess, so there must be some kind of construct that the newer gfortran (which skews to the newer Fortran standards like F2003, F2008) cannot parse. Or perhaps could parse but doesn't want to.
Describe the bug
GEOS-Chem in the dev/12.6.0 branch (commit https://github.com/geoschem/geos-chem/commit/8ab5a66eb789ad02801977baef1009a7e1d40477) dies with an internal compiler error when trying to compile ocean_mercury_mod.F.
This is known behavior and also occurs when you compile GEOS-Chem with GNU Make. But in the GNU Makefiles, we have to add a special rule to compile ocean_mercury_mod.F as -O1 in order to avoid the error:
This appears to be present in gfortran 8 and higher. I think it is because gfortran 8+ cannot handle and/or optimize some old-timey legacy code in ocean_mercury_mod.F.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The executable should be built.
Error message:
Required information
Out of the box" GEOS-Chem dev/12.6.0 running on CentOS7:
with these modules
Other info:
The gfortran 8.2.0 compiler was built by our Research Computing staff. There might be some issues with it. If time allows I will try to build a fresh version of gfortran 8.2.0 (and maybe also gfortran 9.3) cleanly with Spack and see if we still get the error.
The ocean_mercury_mod.F90 is not used for fullchem simulations, but it is compiled into the executable. It is a bit of a mess, so there must be some kind of construct that the newer gfortran (which skews to the newer Fortran standards like F2003, F2008) cannot parse. Or perhaps could parse but doesn't want to.