Compile Using a Different Build Option

Compile Using a Different Build Option carson Wed, 03/06/2019 - 12:09

OPTIONAL exercise: 

Re-compile using the "STATIC=N" option, and run each of these cases using the new executable.  With the dynamic build option (STATIC=N), different SDFs can be used at runtime with the same executable.

Be sure to use the "clean-before" option YES, so that the code and libraries are recompiled correctly!  This is the 5th argument to compile.sh

Compile

Repeat the steps in the Compile section of the first example, this time using the dynamic build (no build-time SDF needed).

  • For bash shell

./compile.sh $PWD/../FV3 theia.intel "CCPP=Y HYBRID=N STATIC=N " ccpp3 YES NO 2>&1 | tee compile.log

  • For t/csh shell

./compile.sh $PWD/../FV3 theia.intel "CCPP=Y HYBRID=N STATIC=N" ccpp3 YES NO |& tee compile.log

 

Run

You may re-use the previous run directories (fv3_ccpp_control or fv3_ccpp_gfdl) to run either case with this dynamic executable.

Link (or copy) your dynamic executable into this run directory:

rm fv3.exe

ln -s ${YOUR_WORK_DIR}/NEMSfv3gfs/tests/fv3_ccpp3.exe fv3.exe

When using the dynamic build options, be sure to add the ccpp library path to your LD_LIBRARY_PATH envar.  For example, in this run directory, in the file module-setup.sh file, update:

export LD_LIBRARY_PATH=${YOUR_WORK_DIR}/NEMSfv3gfs/ccpp/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}

Submit the run script to the batch queue:

qsub run_ccpp.sh