-
Notifications
You must be signed in to change notification settings - Fork 543
WW3 in UFS
WW3 is being used in multiple UFS applications including the weather, coastal and S2S. The following information is intended to help developers and users of UFS.
(As of now this is a work in progress)
model/esmf/switch
model/ftn/wmesmfmd.ftn
Here are two example commits of porting WW3 to new platforms:
- Orion: https://github.com/NOAA-EMC/WW3/commit/19f3126c832b26ae4c5b27bca6c1dcc676755602
- Hera: https://github.com/NOAA-EMC/WW3/commit/5eaa60999a27c565a76858b0be64330972a7c30f
Note that you will need to add the new machine in the following WW3 subroutines:
- model/esmf/Makefile
- model/bin/w3_setup
- model/bin/cmplr.env
In cmplr.env make sure the options for comp_seq and comp_mpi are appropriate for your machine. Likely you can just follow a template of another machine that is similar to the one you are porting to. If you also add your 'optc' flags, make sure to include '-assume byterecl'.
Use the routine in ${INPUTDATA_ROOT_WW3}/createmoddefs/creategridfiles.sh where INPUTDATA_ROOT_WW3 is defined by ufs-weather-model/tests/rt.sh
The creategridfiles.sh needs to be copied to a location you can edit. Follow the instructions at the top of the script replacing the needed variables. Run this script, create your new mod_def files and then update your INPUTDATA_ROOT_WW3 to get new mod_def files.
Currently, WW3 debug compiler flags cannot be triggered by top level build information, so if you wish to compile WW3 with debug flags, you will need to manually uncomment the "debug" options in ufs-weather-model/WW3/model/bin/cmplr.env for your particular machine/target/compiler setup. For example, search for
"$cmplr" == "orion.intel"
within cmplr.env and then scroll down to the debug option:
if [ ! -z "$(echo $cmplr | grep debug)" ] ; then
and uncomment the "if" parts so that you will get the compiler options:
optc="$optc -O0 -debug all -warn all -check all -check noarg_temp_created -fp-stack-check -heap-arrays -traceback -fpe0"
optl="$optl -O0 -traceback"
Or modify them as your needs arise.
Eventually, this will be streamlined so that a top-level debug option can be passed down from ufs-weather-model, however this is currently not possible.
Activate the appropriate cpp flag in wmesmfmd.ftn, which are all by default disabled:
#define TEST_WMESMFMD___disabled
#define TEST_WMESMFMD_GETIMPORT___disabled
#define TEST_WMESMFMD_SETEXPORT___disabled
#define TEST_WMESMFMD_CREATEIMPGRID___disabled
#define TEST_WMESMFMD_CREATEEXPGRID___disabled
#define TEST_WMESMFMD_SETUPIMPBMSK___disabled
#define TEST_WMESMFMD_CHARNK___disabled
#define TEST_WMESMFMD_ROUGHL___disabled
#define TEST_WMESMFMD_BOTCUR___disabled
#define TEST_WMESMFMD_RADSTR2D___disabled
#define TEST_WMESMFMD_STOKES3D___disabled
#define TEST_WMESMFMD_PSTOKES___disabled
Quick Links