Skip to content

Commit

Permalink
Add coupled support and update UFS (#500)
Browse files Browse the repository at this point in the history
Adds support for full coupled model except aerosols (FV3-WW3-MOM6-CICE) following the prototype settings. Support for aerosols will be added soon.

This also updates the UFS version to develop as of Oct 7. There are associated additions or changes to settings, but we've tried to have defaults maintain the same behavior as previously.

Issues related to memory in prep and ocnpost on Hera and Orion due to changes in the slurm configuration have been addressed.

Due to a change in the dycore that uses the checksum in the NetCDF files to check for data integrity, warm start ICs may need an additional offline step before use to update the checksum:
```
ncatted -a checksum,,d,, ${RESTARTinp}/${PDY}.${cyc}0000.fv_core.res.tile1.nc ./fv_core.res.tile1.nc
ncatted -a checksum,,d,, ${RESTARTinp}/${PDY}.${cyc}0000.fv_tracer.res.tile1.nc ./fv_tracer.res.tile1.nc
```

A new setting APP controls what components (and their respective jobs) are turned on. The setting can be found in config.base, but can be set at experiment setup time using the new --app option. Recognized values are ATM (atm-only), ATMW (atm and waves), S2S (atm-ocn-ice), S2SW (atm-ocn-ice-wav). If no value is given, the default is ATM, so there is no change in behavior if you omit the option. For now, these values follow their UFS equivalents, but they may diverge in the future based on the needs of global workflow. ATMW is known to not quite work; S2S is so far untested.

When run using the S2SW app, the workflow will automatically substitute the coupled IC copying job in place of the normal gfsprep jobs and use roughly the settings from prototype 7.2 (except aerosols). The alternate settings for the coupled configuration (compared to ATM) are taken from the config.defaults.s2sw file.

Coupled prototype ICs are currently being maintained on Hera, Orion, and WCOSS-Dell. The locations are set in the config.coupled_ic. There is a base location (BASE_CPLIC) and a setting for each component specifying a subdirectory within the base location.

There are new options available for the checkout.sh, build_all, and link_fv3 scripts:
- checkout.sh has a new -m option that allows you to override the UFS hash that is checked out.
- build_all.sh has two new options: -c to build UFS as the coupled model, and -a to build UFS as ATM-GOCART (but aerosols are not fully supported yet). These options are then passed to build_ufs.sh. The options are temporary, as all configurations will be available from a single executable soon. When building for coupled, the subcomponents built is controlled by cpl_build.cfg.
- link_fv3.sh is renamed to link_workflow.sh and adds an optional third argument, "coupled". When provided, the files necessary for coupled are linked. This option is also temporary, as the link script will be updated to always link these files.

### To run in coupled mode with prototype settings/inputs
1. Clone as usual
2. Run checkout.sh
3. Run build_all.sh with the -c option `./build_all.sh -c` (the -c option is temporary)
4. Run link using the coupled argument: `./link_workflow.sh emc <machine> coupled`
5. Run setup_expt_fcstonly.py using the --app option S2SW
6. Modify config files as necessary. config.defaults.s2sw will automatically override some settings when app is S2SW
7. Run setup_workflow_fcstonly.py as usual
8. Setup rocoto to run your experiment

### Technical udpates
Converts global forecast into a set of modular scripts. The scripts define a bunch of functions to be called, with separate functions for each component in each classification. For instance, there is an FV3_GFS_predet, MOM6_predet, CICE_predet, etc. that are conditionally run if the associated component is on.

The diag table for AOD 550 (diag_table_aod) is reduced to just the portion needed in addition to the normal diag table so it can be appended. Ideally, in the future, we extend this treatment so diag tables can be built based on settings instead of having separate ones for each combination.

Wave input file templates that were formerly kept in the fix directory are now more appropriately moved inside the global-workflow in parm.

The group labels for the post jobs now indicates the forecast hours included instead of just an index. This required minor updates to check for 'anl' instead of 0 for analysis jobs.

The checkout script now writes its logs to the logs/ directory the same way as build does, instead of leaving them in sorc/

The UFS model source has been moved to a ufs_model.fd directory, and the build script has been renamed build_ufs.sh.

Error checking was added to the build_ww3prepost.sh script.

The archive script has been streamlined and the section that saves gaussian grid files was fixed, but turned off by default (see PR #517).

rocoto_viewer has been updated to python3 and the dependency on prod_utils was removed, which makes the script more portable. Be sure to load a sufficient version of python to use.

For those coming from coupled-crow: ice and ocean output files are now linked to COM from the forecast run directory instead of being copied at the end of the forecast. This allows post to run as files are produced instead of after the forecast is complete. Ocean post jobs are handled the same as atmosphere post: forecast hours are grouped into a number of tasks determined by NPOSTGRP in config.ocnpost. The ocean and ice output are now also located in their own component directories in COM (the joint ocean-ice files are located in the ocean directory for now). The atmosphere latitudes are reversed from coupled-crow (see c59260b).

Co-authored-by: jikuang <jikuang@umd.edu>
Co-authored-by: Kate.Friedman <Kate.Friedman@noaa.gov>
Co-authored-by: Rahul Mahajan <aerorahul@users.noreply.github.com>
Co-authored-by: JessicaMeixner-NOAA <Jessica.Meixner@noaa.gov>
Co-authored-by: JianKuang-UMD <51758200+JianKuang-UMD@users.noreply.github.com>
Co-authored-by: lgannoaa <37596169+lgannoaa@users.noreply.github.com>
  • Loading branch information
7 people authored Dec 10, 2021
1 parent 8abe1df commit dd03ed0
Show file tree
Hide file tree
Showing 150 changed files with 57,539 additions and 3,381 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ parm/wafs
#--------------------------------------------
sorc/*log
sorc/logs
sorc/fv3gfs.fd
sorc/ufs_model.fd
sorc/gfs_post.fd
sorc/gfs_wafs.fd
sorc/gldas.fd
Expand Down
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ The global-workflow current supports the following machines:
* WCOSS-Dell
* WCOSS-Cray
* Hera
* Orion

Quick-start instructions are below. Full instructions are available in the [wiki](https://github.com/NOAA-EMC/global-workflow/wiki/Run-Global-Workflow)

## Build global-workflow:

Expand All @@ -25,15 +28,26 @@ $ sh checkout.sh
### 2. Build components

While in /sorc folder:

Uncoupled
```
$ sh build_all.sh
```
Coupled
```
$ sh build_all.sh -c
```

### 3. Link components

While in /sorc folder:

Uncoupled
```
$ sh link_fv3gfs.sh emc $MACHINE
$ sh link_workflow.sh emc $MACHINE
```

...where $MACHINE is "dell", "cray", or "hera".
Coupled
```
$ sh link_workflow.sh emc $MACHINE coupled
```
...where $MACHINE is "dell", "cray", "hera", or "orion".
7 changes: 5 additions & 2 deletions env/HERA.env
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@ elif [ $step = "fcst" ]; then
export NTHREADS_FV3=${nth_fv3:-$nth_max}
[[ $NTHREADS_FV3 -gt $nth_max ]] && export NTHREADS_FV3=$nth_max
export cores_per_node=$npe_node_max
export APRUN_FV3="$launcher"
if [[ $CDUMP == "gfs" ]]; then
npe_fcst=$npe_fcst_gfs
fi
export APRUN_FV3="$launcher -n $npe_fcst"

export NTHREADS_REGRID_NEMSIO=${nth_regrid_nemsio:-1}
[[ $NTHREADS_REGRID_NEMSIO -gt $nth_max ]] && export NTHREADS_REGRID_NEMSIO=$nth_max
Expand All @@ -152,7 +155,7 @@ elif [ $step = "efcs" ]; then
export NTHREADS_FV3=${nth_efcs:-$nth_max}
[[ $NTHREADS_FV3 -gt $nth_max ]] && export NTHREADS_FV3=$nth_max
export cores_per_node=$npe_node_max
export APRUN_FV3="$launcher"
export APRUN_FV3="$launcher -n $npe_efcs"

export NTHREADS_REGRID_NEMSIO=${nth_regrid_nemsio:-1}
[[ $NTHREADS_REGRID_NEMSIO -gt $nth_max ]] && export NTHREADS_REGRID_NEMSIO=$nth_max
Expand Down
7 changes: 5 additions & 2 deletions env/ORION.env
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ elif [ $step = "fcst" ]; then
export NTHREADS_FV3=${nth_fv3:-$nth_max}
[[ $NTHREADS_FV3 -gt $nth_max ]] && export NTHREADS_FV3=$nth_max
export cores_per_node=$npe_node_max
export APRUN_FV3="$launcher"
if [[ $CDUMP == "gfs" ]]; then
npe_fcst=$npe_fcst_gfs
fi
export APRUN_FV3="$launcher -n $npe_fcst"

export NTHREADS_REGRID_NEMSIO=${nth_regrid_nemsio:-1}
[[ $NTHREADS_REGRID_NEMSIO -gt $nth_max ]] && export NTHREADS_REGRID_NEMSIO=$nth_max
Expand All @@ -148,7 +151,7 @@ elif [ $step = "efcs" ]; then
export NTHREADS_FV3=${nth_efcs:-$nth_max}
[[ $NTHREADS_FV3 -gt $nth_max ]] && export NTHREADS_FV3=$nth_max
export cores_per_node=$npe_node_max
export APRUN_FV3="$launcher"
export APRUN_FV3="$launcher -n $npe_efcs"

export NTHREADS_REGRID_NEMSIO=${nth_regrid_nemsio:-1}
[[ $NTHREADS_REGRID_NEMSIO -gt $nth_max ]] && export NTHREADS_REGRID_NEMSIO=$nth_max
Expand Down
21 changes: 6 additions & 15 deletions jobs/JGLOBAL_FORECAST
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ date
if [ $RUN_ENVIR = "emc" ]; then
#--------------------------------

##############################################
# Set variables used in the exglobal script
##############################################
export CDATE=${CDATE:-${PDY}${cyc}}
export CDUMP=${CDUMP:-${RUN:-"gfs"}}

#############################
# Source relevant config files
#############################
Expand All @@ -20,15 +26,6 @@ for config in $configs; do
status=$?
[[ $status -ne 0 ]] && exit $status
done
# Source additional configs
if [ ${DO_WAVE:-"NO"} = "YES" ]; then
configs="wave"
for config in $configs; do
. $config_path/config.$config
status=$?
[[ $status -ne 0 ]] && exit $status
done
fi

##########################################
# Source machine runtime environment
Expand Down Expand Up @@ -65,12 +62,6 @@ export pgmout="OUTPUT.${pid}"
export pgmerr=errfile


##############################################
# Set variables used in the exglobal script
##############################################
export CDATE=${CDATE:-${PDY}${cyc}}
export CDUMP=${CDUMP:-${RUN:-"gfs"}}

if [ $RUN_ENVIR = "nco" ]; then
export ROTDIR=${COMROOT:?}/$NET/$envir
export RSTDIR=${GESROOT:?}/$envir
Expand Down
30 changes: 17 additions & 13 deletions jobs/JGLOBAL_WAVE_PREP
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,23 @@ if [ $RUN_ENVIR = "nco" ]; then
export COMIN_WAV_ICE=${COMIN_WAV_ICE:-$(compath.py gfs/prod)}/${CDUMP}.${PDY}/${cyc}/atmos
export COMIN_WAV_RTOFS=${COMIN_WAV_RTOFS:-$(compath.py ${WAVECUR_DID}/prod)}
else
if [ ! -d $DMPDIR/${WAVECUR_DID}.${RPDY} ]; then export RPDY=`$NDATE -24 ${PDY}00 | cut -c1-8`; fi
if [ ! -L $ROTDIR/${WAVECUR_DID}.${RPDY} ]; then # Check if symlink already exists in ROTDIR
$NLN $DMPDIR/${WAVECUR_DID}.${RPDY} $ROTDIR/${WAVECUR_DID}.${RPDY}
fi
BRPDY=`$NDATE -24 ${RPDY}00 | cut -c1-8`
if [ ! -L $ROTDIR/${WAVECUR_DID}.${BRPDY} ]; then # Check if symlink already exists in ROTDIR
$NLN $DMPDIR/${WAVECUR_DID}.${BRPDY} $ROTDIR/${WAVECUR_DID}.${BRPDY}
fi
if [ ! -L $ROTDIR/${CDUMP}.${PDY}/${cyc}/atmos/${WAVICEFILE} ]; then # Check if symlink already exists in ROTDIR
$NLN $DMPDIR/$CDUMP.${PDY}/$cyc/${WAVICEFILE} $ROTDIR/$CDUMP.${PDY}/$cyc/atmos/${WAVICEFILE}
fi
export COMIN_WAV_ICE=${COMIN_WAV_ICE:-$ROTDIR/$RUN.$PDY/$cyc/atmos}
export COMIN_WAV_RTOFS=${COMIN_WAV_RTOFS:-$ROTDIR}
if [ $WW3CURINP = "YES" ]; then
if [ ! -d $DMPDIR/${WAVECUR_DID}.${RPDY} ]; then export RPDY=`$NDATE -24 ${PDY}00 | cut -c1-8`; fi
if [ ! -L $ROTDIR/${WAVECUR_DID}.${RPDY} ]; then # Check if symlink already exists in ROTDIR
$NLN $DMPDIR/${WAVECUR_DID}.${RPDY} $ROTDIR/${WAVECUR_DID}.${RPDY}
fi
BRPDY=`$NDATE -24 ${RPDY}00 | cut -c1-8`
if [ ! -L $ROTDIR/${WAVECUR_DID}.${BRPDY} ]; then # Check if symlink already exists in ROTDIR
$NLN $DMPDIR/${WAVECUR_DID}.${BRPDY} $ROTDIR/${WAVECUR_DID}.${BRPDY}
fi
export COMIN_WAV_RTOFS=${COMIN_WAV_RTOFS:-$ROTDIR}
fi
if [ $WW3ICEINP = "YES" ]; then
if [ ! -L $ROTDIR/${CDUMP}.${PDY}/${cyc}/atmos/${WAVICEFILE} ]; then # Check if symlink already exists in ROTDIR
$NLN $DMPDIR/$CDUMP.${PDY}/$cyc/${WAVICEFILE} $ROTDIR/$CDUMP.${PDY}/$cyc/atmos/${WAVICEFILE}
fi
export COMIN_WAV_ICE=${COMIN_WAV_ICE:-$ROTDIR/$RUN.$PDY/$cyc/atmos}
fi
fi

# Execute the Script
Expand Down
106 changes: 31 additions & 75 deletions jobs/rocoto/arch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -175,59 +175,35 @@ cd $ROTDIR

if [ $CDUMP = "gfs" ]; then

#for targrp in gfsa gfsb - NOTE - do not check htar error status
for targrp in gfsa gfsb; do
htar -P -cvf $ATARDIR/$CDATE/${targrp}.tar `cat $ARCH_LIST/${targrp}.txt`
done
targrp_list="gfsa gfsb"

#for targrp in gfs_flux gfs_netcdf/nemsio gfs_pgrb2b; do
if [ ${SAVEFCSTNEMSIO:-"YES"} = "YES" ]; then
if [ ${ARCH_GAUSSIAN:-"NO"} = "YES" ]; then
targrp_list="$targrp_list gfs_flux gfs_${format}b gfs_pgrb2b"
if [ $MODE = "cycled" ]; then
targrp_list=`gfs_flux gfs_${format}a gfs_${format}b gfs_pgrb2b`
elif [ $MODE = "free" ]; then
targrp_list=`gfs_flux gfs_${format}b gfs_pgrb2b`
targrp_list="$targrp_list gfs_${format}a"
fi
#for targrp in gfs_flux gfs_${format}a gfs_${format}b gfs_pgrb2b; do
for targrp in $targrp_list; do
htar -P -cvf $ATARDIR/$CDATE/${targrp}.tar `cat $ARCH_LIST/${targrp}.txt`
status=$?
if [ $status -ne 0 -a $CDATE -ge $firstday ]; then
echo "HTAR $CDATE ${targrp}.tar failed"
exit $status
fi
done
fi

#for targrp in gfswave
if [ $DO_WAVE = "YES" -a "$WAVE_CDUMP" != "gdas" ]; then
for targrp in gfswave; do
htar -P -cvf $ATARDIR/$CDATE/${targrp}.tar `cat $ARCH_LIST/${targrp}.txt`
status=$?
if [ $status -ne 0 -a $CDATE -ge $firstday ]; then
echo "HTAR $CDATE ${targrp}.tar failed"
exit $status
fi
done
targrp_list="$targrp_list gfswave"
fi

if [ $DO_OCN = "YES" ]; then
targrp_list="$targrp_list ocn_ice_grib2_0p5 ocn_ice_grib2_0p25 ocn_2D ocn_3D ocn_xsect ocn_daily wavocn gfs_flux_1p00"
fi

if [ $DO_ICE = "YES" ]; then
targrp_list="$targrp_list ice"
fi

#for restarts
if [ $SAVEFCSTIC = "YES" ]; then
htar -P -cvf $ATARDIR/$CDATE/gfs_restarta.tar `cat $ARCH_LIST/gfs_restarta.txt`
status=$?
if [ $status -ne 0 -a $CDATE -ge $firstday ]; then
echo "HTAR $CDATE gfs_restarta.tar failed"
exit $status
fi
targrp_list="$targrp_list gfs_restarta"
fi

#for downstream products
if [ $DO_BUFRSND = "YES" -o $WAFSF = "YES" ]; then
htar -P -cvf $ATARDIR/$CDATE/gfs_downstream.tar `cat $ARCH_LIST/gfs_downstream.txt`
status=$?
if [ $status -ne 0 -a $CDATE -ge $firstday ]; then
echo "HTAR $CDATE gfs_downstream.tar failed"
exit $status
fi
targrp_list="$targrp_list gfs_downstream"
fi

#--save mdl gfsmos output from all cycles in the 18Z archive directory
Expand All @@ -239,57 +215,37 @@ if [ $CDUMP = "gfs" ]; then
exit $status
fi
fi
elif [ $CDUMP = "gdas" ]; then

fi


if [ $CDUMP = "gdas" ]; then

htar -P -cvf $ATARDIR/$CDATE/gdas.tar `cat $ARCH_LIST/gdas.txt`
status=$?
if [ $status -ne 0 -a $CDATE -ge $firstday ]; then
echo "HTAR $CDATE gdas.tar failed"
exit $status
fi
targrp_list="gdas"

#gdaswave
if [ $DO_WAVE = "YES" ]; then
htar -P -cvf $ATARDIR/$CDATE/gdaswave.tar `cat $ARCH_LIST/gdaswave.txt`
status=$?
if [ $status -ne 0 -a $CDATE -ge $firstday ]; then
echo "HTAR $CDATE gdaswave.tar failed"
exit $status
fi
targrp_list="$targrp_list gdaswave"
fi

if [ $SAVEWARMICA = "YES" -o $SAVEFCSTIC = "YES" ]; then
htar -P -cvf $ATARDIR/$CDATE/gdas_restarta.tar `cat $ARCH_LIST/gdas_restarta.txt`
status=$?
if [ $status -ne 0 -a $CDATE -ge $firstday ]; then
echo "HTAR $CDATE gdas_restarta.tar failed"
exit $status
fi
targrp_list="$targrp_list gdas_restarta"

if [ $DO_WAVE = "YES" ]; then
htar -P -cvf $ATARDIR/$CDATE/gdaswave_restart.tar `cat $ARCH_LIST/gdaswave_restart.txt`
status=$?
if [ $status -ne 0 -a $CDATE -ge $firstday ]; then
echo "HTAR $CDATE gdaswave_restart.tar failed"
exit $status
fi
targrp_list="$targrp_list gdaswave_restart"
fi
fi

if [ $SAVEWARMICB = "YES" -o $SAVEFCSTIC = "YES" ]; then
htar -P -cvf $ATARDIR/$CDATE/gdas_restartb.tar `cat $ARCH_LIST/gdas_restartb.txt`
status=$?
if [ $status -ne 0 -a $CDATE -ge $firstday ]; then
echo "HTAR $CDATE gdas_restartb.tar failed"
exit $status
fi
targrp_list="$targrp_list gdas_restartb"
fi

fi

for targrp in $targrp_list; do
htar -P -cvf $ATARDIR/$CDATE/${targrp}.tar $(cat $ARCH_LIST/${targrp}.txt)
status=$?
if [ $status -ne 0 -a $CDATE -ge $firstday ]; then
echo "HTAR $CDATE ${targrp}.tar failed"
exit $status
fi
done

###############################################################
fi ##end of HPSS archive
###############################################################
Expand Down
Loading

0 comments on commit dd03ed0

Please sign in to comment.