Skip to content

WW3 in UFS

Jessica Meixner edited this page May 12, 2021 · 9 revisions

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)

Quick Links to UFS information

Frequently Asked Questions

Which WW3 switch is used?

model/esmf/switch

Which program(s) is the NUOPC cap?

model/ftn/wmesmfmd.ftn

How to port WW3 to a new machine to use in a UFS app?

Here are two example commits of porting WW3 to new platforms:

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'.

How to make new mod_def files for regression tests?

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.

How to turn on debug flags?

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.

How to turn on field dumps?

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

Where to get additional timing information from WW3 cap?

Where to find information about cap in manual?