Skip to content

Compile

wfcooke edited this page Dec 12, 2016 · 13 revisions

Create a build directory and set up some variables.

set platform={intel|gnu|pgi}

set target={debug|repro-openmp|prod-openmp}

mkdir -p build/LOAR2.$platform.$target/

cd build/LOAR2.$platform.$target/;

Preprocess the land model

mkdir land_lad2

set GIT_VERS_STR=`../../src/mkmf/bin/git-version-string ../../src/land_lad2/land_model.F90`

../../src/mkmf/bin/list_paths -o land_lad2/pathnames_land_lad2 ../../src/land_lad2 

sed -e 's/<TAB>/\t/' > land_lad2/Makefile-cpp << EOF

CPPDEFS = -DINTERNAL_FILE_NML -g -Dintel14_bug -D_FILE_VERSION="$GIT_VERS_STR"
FRETARGET = $target

ifneq (\$(findstring hdf5,\${FRETARGET}),)

else

  CPPDEFS += -Duse_LARGEFILE

endif

vpath %.F90 \$(shell find ../../src/land_lad2 -type d)

land_lad2/%.f90: %.F90

<TAB>cpp \${CPPDEFS} -C -v -I ../../src/shared/include -o \$@ \$<

EOF

foreach foo ( `find ../../src/land_lad2 -type f -name \*.F90` )

  make -f land_lad2/Makefile-cpp land_lad2/$foo:t:r.f90

end

Compile the code

Use the non-symmetric setup for MOM6.

rm -f path_names ; 

../../src/mkmf/bin/list_paths land_lad2/* ../../src/MOM6/{config_src/dynamic,config_src/coupled_driver,src/*,src/*/*}/ ../../src/{shared/*,SIS2/*,ice_param/*,icebergs/*,coupler/*} ../../src/{atmos_drivers/coupled/*,atmos_param_am3/*,atmos_shared/*,atmos_cubed_sphere/{model/*,model_nh_null/*,tools/*,driver/coupled/*}}

../../src/mkmf/bin/mkmf -t ../../src/mkmf/templates/ncrc-$platform.mk -p MOM6 -c "-DINTERNAL_FILE_NML -DSPMD -Duse_libMPI -Duse_netCDF -DMAX_FIELDS_=100 -Duse_AM3_physics -DLAND_BND_TRACERS -DUSE_OCEAN_BGC -Duse_shared_pointers -DENABLE_ODA" path_names 

Pick one of the following

source ../env/$platform ; make NETCDF=3 DEBUG=1 -j

source ../env/$platform ; make NETCDF=3 REPRO=1 OPENMP=1 -j

source ../env/$platform ; make NETCDF=3 PROD=1 OPENMP=1 -j

Clone this wiki locally