Skip to content

Commit

Permalink
Code change to compile.sh enables the following:
Browse files Browse the repository at this point in the history
DEBUG flag is passed down as an environment variable.
Subsequently, DEBUG or REPRO is automatically selected.
  • Loading branch information
MinsukJi-NOAA authored and JessicaMeixner-NOAA committed Jan 21, 2020
1 parent 058f937 commit 575f570
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ BASEDIR=`pwd`
MACHINE_ID=${platform}
COMPILE_OPTION=${MACHINE_ID}-intel.mk

# Build in debug mode. If DEBUG=Y, enable DEBUG compilation.
# Otherwise, default to REPRO compilation. This flag is
# set in ${ROOTDIR}/coupledFV3_MOM6_CICE_debug.appBuilder file.
DEBUG=${DEBUG:-}
REPRO=${REPRO:-}
if [[ ${DEBUG} == "Y" ]] ; then
DEBUG=1
else
REPRO=1
fi
echo "MOM6 compile.sh ... DEBUG=${DEBUG}, REPRO=${REPRO}"

compile_MOM6_LIB=1
compile_ocean_only=0
compile_MOM6_SIS2=0
Expand All @@ -61,14 +73,6 @@ if [[ ${compile_MOM6_LIB} == 1 ]] ; then
echo "generating makefile ..."
../../../../src/mkmf/bin/mkmf -t ../../../../src/mkmf/templates/${COMPILE_OPTION} -p lib_ocean.a -o "-I${FMS_DIR}" path_names

#to build debug mode
#REPRO=
#DEBUG=1
#otherwise
REPRO=1
DEBUG=


echo "compiling MOM6 library..."
if ( ! make NETCDF=4 REPRO=${REPRO} DEBUG=${DEBUG} lib_ocean.a ) ; then
sadness "compiling MOM6 failed"
Expand Down

0 comments on commit 575f570

Please sign in to comment.