Created
January 13, 2017 19:43
-
-
Save raphaeldussin/a9c8c6c7a17ee88a52ad48dd30b56a08 to your computer and use it in GitHub Desktop.
Compiling MOM6 on triton (linux cluster gcc4.4.7+openmpi1.8.5+netcdf4.3.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
MOM6_installdir=#'where you cloned ESMG-configs' | |
MOM6_rundir=#'where you want to run the code (usually scratch)' | |
compile_fms=1 | |
compile_mom=1 | |
debug=0 | |
#--------------------------------------------------------------- | |
# nothing needs to be changed below this line | |
#--------------------------------------------------------------- | |
# load netcdf and openmpi | |
module load netcdf/4.3.0-gcc4.4.7 | |
module load openmpi/1.8.5_gcc4.4.7 | |
mkdir -p $MOM6_rundir | |
cd $MOM6_rundir | |
# Create blank env file | |
rm -Rf $MOM6_rundir/build | |
mkdir -p build/gnu/shared/repro/ | |
echo > build/gnu/env | |
# copy mkmf | |
mkdir -p build/mkmf | |
cp -r $MOM6_installdir/src/mkmf/bin $MOM6_rundir/build/mkmf/bin | |
cp -r $MOM6_installdir/src/mkmf/templates $MOM6_rundir/build/mkmf/templates | |
# compile FMS | |
if [ $compile_fms == 1 ] ; then | |
cd $MOM6_rundir | |
rm -Rf build/gnu/shared/repro/ | |
mkdir -p build/gnu/shared/repro/ | |
(cd build/gnu/shared/repro/; rm -f path_names; \ | |
$MOM6_rundir/build/mkmf/bin/list_paths $MOM6_installdir/src/FMS; \ | |
$MOM6_rundir/build/mkmf/bin/mkmf -t $MOM6_rundir/build/mkmf/templates/triton-gnu.mk -p libfms.a -c "-Duse_libMPI -Duse_netCDF -DSPMD" path_names) | |
if [ $debug == 1 ] ; then | |
(cd build/gnu/shared/repro/; source ../../env; make NETCDF=4 DEBUG=1 FC=mpif90 CC=mpicc libfms.a -j 6) | |
else | |
(cd build/gnu/shared/repro/; source ../../env; make NETCDF=4 REPRO=1 FC=mpif90 CC=mpicc libfms.a -j 6) | |
fi | |
fi | |
# compile MOM6 | |
if [ $compile_mom == 1 ] ; then | |
cd $MOM6_rundir | |
rm -Rf build/gnu/ice_ocean_SIS2/repro/ | |
mkdir -p build/gnu/ice_ocean_SIS2/repro/ | |
(cd build/gnu/ice_ocean_SIS2/repro/; rm -f path_names; \ | |
$MOM6_rundir/build/mkmf/bin/list_paths ./ $MOM6_installdir/src/MOM6/config_src/{dynamic,coupled_driver} $MOM6_installdir/src/MOM6/src/{*,*/*}/ $MOM6_installdir/src/{atmos_null,coupler,land_null,ice_ocean_extras,icebergs,SIS2,FMS/coupler,FMS/include}/) | |
(cd build/gnu/ice_ocean_SIS2/repro/; \ | |
$MOM6_rundir/build/mkmf/bin/mkmf -t $MOM6_rundir/build/mkmf/templates/triton-gnu.mk -o '-I../../shared/repro' -p 'MOM6 -L../../shared/repro -lfms' -c '-Duse_libMPI -Duse_netCDF -DSPMD -DUSE_LOG_DIAG_FIELD_INFO' path_names ) | |
if [ $debug == 1 ] ; then | |
(cd build/gnu/ice_ocean_SIS2/repro/; source ../../env; make NETCDF=4 DEBUG=1 MOM6 -j) | |
else | |
(cd build/gnu/ice_ocean_SIS2/repro/; source ../../env; make NETCDF=4 REPRO=1 MOM6 -j) | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment