Skip to content

Commit

Permalink
Merge remote-tracking branch 'emc/develop' into feature/spack-stack
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidHuber-NOAA committed Nov 30, 2023
2 parents 906a9fc + c19810c commit e1dbf68
Show file tree
Hide file tree
Showing 15 changed files with 289 additions and 94 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ experiment:

arguments:
pslot: {{ 'pslot' | getenv }}
app: S2SA
app: S2SWA
resdet: 48
resens: 48
nens: 2
Expand Down
3 changes: 3 additions & 0 deletions jobs/JGDAS_ENKF_FCST
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ fi
export ENSEND=$((NMEM_EFCSGRP * 10#${ENSGRP}))
export ENSBEG=$((ENSEND - NMEM_EFCSGRP + 1))

if [[ ${DO_WAVE} == "YES" ]]; then
declare -rx RUNwave="${RUN}wave"
fi

###############################################################
# Run relevant script
Expand Down
43 changes: 43 additions & 0 deletions jobs/JGFS_ATMOS_VERIFICATION
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#! /usr/bin/env bash

source "${HOMEgfs}/ush/preamble.sh"
source "${HOMEgfs}/ush/jjob_header.sh" -e "metp" -c "base metp"

###############################################################
## Abstract:
## Inline METplus verification and diagnostics driver script
## HOMEgfs : /full/path/to/workflow
## EXPDIR : /full/path/to/config/files
## CDATE : current analysis date (YYYYMMDDHH)
## CDUMP : cycle name (gdas / gfs)
## PDY : current date (YYYYMMDD)
## cyc : current cycle (HH)
## SDATE_GFS : first date of GFS cycle (YYYYMMDDHHMM)
## METPCASE : METplus verification use case (g2g1 | g2o1 | pcp1)
###############################################################

# TODO: This should not be permitted as DATAROOT is set at the job-card level.
# TODO: DATAROOT is being used as DATA in metp jobs. This should be rectified in metp.
# TODO: The temporary directory is DATA and is created at the top of the J-Job.
# TODO: remove this line
export DATAROOT=${DATA}

VDATE=$(date --utc +%Y%m%d%H -d "${PDY} ${cyc} - ${VRFYBACK_HRS} hours")
export VDATE=${VDATE:0:8}

# Since this is currently a one-element list, shellcheck things we would rather run this as a command
# shellcheck disable=SC2041
for grid in '1p00'; do
prod_dir="COM_ATMOS_GRIB_${grid}"
GRID=${grid} YMD=${PDY} HH=${cyc} generate_com -rx "${prod_dir}:COM_ATMOS_GRIB_GRID_TMPL"
done

# TODO: If none of these are on, why are we running this job?
if [[ "${RUN_GRID2GRID_STEP1}" == "YES" || "${RUN_GRID2OBS_STEP1}" == "YES" || "${RUN_PRECIP_STEP1}" == "YES" ]]; then
${VERIF_GLOBALSH}
status=$?
if (( status != 0 )); then exit "${status}"; fi
fi

if [[ ${KEEPDATA:-"NO"} = "NO" ]] ; then rm -rf "${DATAROOT}" ; fi # TODO: This should be $DATA

88 changes: 4 additions & 84 deletions jobs/rocoto/metp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,93 +3,13 @@
source "${HOMEgfs}/ush/preamble.sh"

###############################################################
## Abstract:
## Inline METplus verification and diagnostics driver script
## HOMEgfs : /full/path/to/workflow
## EXPDIR : /full/path/to/config/files
## CDATE : current analysis date (YYYYMMDDHH)
## CDUMP : cycle name (gdas / gfs)
## PDY : current date (YYYYMMDD)
## cyc : current cycle (HH)
## SDATE_GFS : first date of GFS cycle (YYYYMMDDHHMM)
## METPCASE : METplus verification use case (g2g1 | g2o1 | pcp1)
###############################################################

###############################################################
echo
echo "=============== START TO SOURCE FV3GFS WORKFLOW MODULES ==============="
. ${HOMEgfs}/ush/load_fv3gfs_modules.sh
source "${HOMEgfs}/ush/load_fv3gfs_modules.sh"
status=$?
[[ ${status} -ne 0 ]] && exit ${status}
if (( status != 0 )); then exit "${status}"; fi

export job="metp${METPCASE}"
export jobid="${job}.$$"

##############################################
# make temp directory
##############################################
export DATA=${DATA:-${DATAROOT}/${jobid}}
mkdir -p ${DATA}
cd ${DATA}


##############################################
# Run setpdy and initialize PDY variables
##############################################
export cycle="t${cyc}z"
setpdy.sh
. ./PDY

###############################################################
echo
echo "=============== START TO SOURCE RELEVANT CONFIGS ==============="
configs="base metp"
for config in ${configs}; do
. ${EXPDIR}/config.${config}
status=$?
[[ ${status} -ne 0 ]] && exit ${status}
done


###############################################################
echo
echo "=============== START TO SOURCE MACHINE RUNTIME ENVIRONMENT ==============="
. ${BASE_ENV}/${machine}.env metp
status=$?
[[ ${status} -ne 0 ]] && exit ${status}

###############################################################
export COMPONENT="atmos"
export VDATE="$(echo $(${NDATE} -${VRFYBACK_HRS} ${CDATE}) | cut -c1-8)"
export COMIN="${ROTDIR}/${CDUMP}.${PDY}/${cyc}/${COMPONENT}"

# TODO: This should not be permitted as DATAROOT is set at the job-card level.
# TODO: DATAROOT is being used as DATA in metp jobs. This should be rectified in metp.
# TODO: The temporary directory is DATA and is created at the top of the J-Job.
# TODO: remove this line
export DATAROOT=${DATA}

###############################################################
echo
echo "=============== START TO RUN METPLUS VERIFICATION ==============="
if [ ${CDUMP} = "gfs" ]; then

if [ ${RUN_GRID2GRID_STEP1} = "YES" -o ${RUN_GRID2OBS_STEP1} = "YES" -o ${RUN_PRECIP_STEP1} = "YES" ]; then

${VERIF_GLOBALSH}
status=$?
[[ ${status} -ne 0 ]] && exit ${status}
[[ ${status} -eq 0 ]] && echo "Succesfully ran ${VERIF_GLOBALSH}"
fi
fi


if [ ${CDUMP} = "gdas" ]; then
echo "METplus verification currently not supported for CDUMP=${CDUMP}"
fi
###############################################################
# Force Exit out cleanly
if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf ${DATAROOT} ; fi # TODO: This should be $DATA

"${HOMEgfs}/jobs/JGFS_ATMOS_VERIFICATION"

exit 0
exit $?
5 changes: 4 additions & 1 deletion parm/config/gefs/config.base.emc.dyn
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,10 @@ export FHMAX_ENKF=${FHMAX_GFS}
export FHOUT_ENKF=${FHOUT_GFS}

# GFS restart interval in hours
export restart_interval_gfs=0
export restart_interval_gfs=12
# NOTE: Do not set this to zero. Instead set it to $FHMAX_GFS
# TODO: Remove this variable from config.base and reference from config.fcst
# TODO: rework logic in config.wave and push it to parsing_nameslist_WW3.sh where it is actually used

export QUILTING=".true."
export OUTPUT_GRID="gaussian_grid"
Expand Down
2 changes: 1 addition & 1 deletion parm/config/gefs/config.efcs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ export SPPT_LSCALE=500000.
export SPPT_LOGIT=".true."
export SPPT_SFCLIMIT=".true."

export restart_interval=${restart_interval:-6}
export restart_interval=${restart_interval_gfs}

echo "END: config.efcs"
1 change: 0 additions & 1 deletion parm/config/gefs/config.wave

This file was deleted.

185 changes: 185 additions & 0 deletions parm/config/gefs/config.wave
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
#! /usr/bin/env bash

########## config.wave ##########
# Wave steps specific

echo "BEGIN: config.wave"

# Parameters that are common to all wave model steps

# System and version
export wave_sys_ver=v1.0.0

export EXECwave="${HOMEgfs}/exec"
export FIXwave="${HOMEgfs}/fix/wave"
export PARMwave="${HOMEgfs}/parm/wave"
export USHwave="${HOMEgfs}/ush"

# This config contains variables/parameters used in the fcst step
# Some others are also used across the workflow in wave component scripts

# General runtime labels
export CDUMPwave="${RUN}wave"

# In GFS/GDAS, restart files are generated/read from gdas runs
export CDUMPRSTwave="gdas"

# Grids for wave model
export waveGRD=${waveGRD:-'mx025'}

#grid dependent variable defaults
export waveGRDN='1' # grid number for ww3_multi
export waveGRDG='10' # grid group for ww3_multi
export USE_WAV_RMP='NO' # YES/NO rmp grid remapping pre-processed coefficients
export waveMULTIGRID='.false.' # .true./.false. for multi or shel
export MESH_WAV="mesh.${waveGRD}.nc" # Mesh grid for wave model for CMEPS
export waveesmfGRD=' ' # input grid for multigrid

#Grid dependent variables for various grids
case "${waveGRD}" in
"gnh_10m;aoc_9km;gsh_15m")
#GFSv16 settings:
export waveGRDN='1 2 3'
export waveGRDG='10 20 30'
export USE_WAV_RMP='YES'
export waveMULTIGRID='.true.'
export IOSRV='3'
export MESH_WAV=' '
export waveesmfGRD='glox_10m'
export waveuoutpGRD='points'
export waveinterpGRD='glo_15mxt at_10m ep_10m wc_10m glo_30m'
export wavepostGRD='gnh_10m aoc_9km gsh_15m'
;;
"gwes_30m")
#Grid used for P8
export waveinterpGRD=''
export wavepostGRD='gwes_30m'
export waveuoutpGRD=${waveGRD}
;;
"mx025")
#Grid used for HR1 (tripolar 1/4 deg)
export waveinterpGRD='reg025'
export wavepostGRD=''
export waveuoutpGRD=${waveGRD}
;;
"glo_025")
#GEFSv13 regular lat/lon 1/4 deg grid
export waveinterpGRD=''
export wavepostGRD='glo_025'
export waveuoutpGRD=${waveGRD}
;;
"glo_200")
#Global regular lat/lon 2deg deg grid
export waveinterpGRD=''
export wavepostGRD='glo_200'
export waveuoutpGRD=${waveGRD}
;;
"glo_500")
#Global regular lat/lon 5deg deg grid
export waveinterpGRD=''
export wavepostGRD='glo_500'
export waveuoutpGRD=${waveGRD}
;;
*)
echo "FATAL ERROR: No grid specific wave config values exist for ${waveGRD}. Aborting."
exit 1
;;
esac

# Grids for input wind fields
export WAVEWND_DID=
export WAVEWND_FID=

# The start time reflects the number of hindcast hours prior to the cycle initial time
export FHMAX_WAV=${FHMAX_GFS}
export WAVHINDH=0
export FHMIN_WAV=0
export FHOUT_WAV=3
export FHMAX_HF_WAV=120
export FHOUT_HF_WAV=1
export FHMAX_WAV_IBP=180
if (( FHMAX_WAV < FHMAX_WAV_IBP )); then export FHMAX_WAV_IBP=${FHMAX_GFS} ; fi

# gridded and point output rate
export DTFLD_WAV=$(( FHOUT_HF_WAV * 3600 ))
export DTPNT_WAV=3600
export FHINCP_WAV=$(( DTPNT_WAV / 3600 ))

# Selected output parameters (gridded)
export OUTPARS_WAV="WND CUR ICE HS T01 T02 DIR FP DP PHS PTP PDIR CHA"

# Restart file config
export WAVHCYC=${assim_freq:-6}
export FHMAX_WAV_CUR=192 # RTOFS forecasts only out to 8 days

# Restart timing business

export RSTTYPE_WAV='T' # generate second tier of restart files
rst_dt_gfs=$(( restart_interval_gfs * 3600 )) # TODO: This calculation needs to move to parsing_namelists_WW3.sh
if [[ ${rst_dt_gfs} -gt 0 ]]; then
export DT_1_RST_WAV=0 #${rst_dt_gfs:-0} # time between restart files, set to DTRST=1 for a single restart file
#temporarily set to zero to avoid a clash in requested restart times
#which makes the wave model crash a fix for the model issue will be coming
export DT_2_RST_WAV=${rst_dt_gfs:-0} # restart stride for checkpointing restart
else
rst_dt_fhmax=$(( FHMAX_WAV * 3600 ))
export DT_1_RST_WAV=0 # time between restart files, set to DTRST=1 for a single restart file
export DT_2_RST_WAV=${rst_dt_fhmax:-0} # use checkpoint restart file name for creating restart at end of run
fi
export RSTIOFF_WAV=0 # first restart file offset relative to model start
#
# Set runmember to default value if not GEFS cpl run
# (for a GFS coupled run, RUNMEN would be unset, this should default to -1)
export RUNMEM=${RUNMEM:--1}
# Set wave model member tags if ensemble run
# -1: no suffix, deterministic; xxxNN: extract two last digits to make ofilename prefix=gwesNN
if [[ ${RUNMEM} = -1 ]]; then
# No suffix added to model ID in case of deterministic run
export waveMEMB=
else
# Extract member number only
export waveMEMB="${RUNMEM: -2}"
fi

# Determine if wave component needs input and/or is coupled
export WW3ATMINP='CPL'
if [[ ${DO_ICE} == "YES" ]]; then
export WW3ICEINP='CPL'
export WAVEICE_FID=
else
export WW3ICEINP='YES'
export WAVEICE_FID=glix_10m
fi

export WAVECUR_DID=rtofs
if [[ ${DO_OCN} == "YES" ]]; then
export WW3CURINP='CPL'
export WAVECUR_FID=
else
export WW3CURINP='YES'
export WAVECUR_FID=glix_10m
fi

# Determine if input is from perturbed ensemble (T) or single input file (F) for all members
export WW3ATMIENS='F'
export WW3ICEIENS='F'
export WW3CURIENS='F'

export GOFILETYPE=1 # GOFILETYPE=1 one gridded file per output step
export POFILETYPE=1 # POFILETYPE=1 one point file per output step

# Parameters for ww3_multi/shel.inp
# Unified output T or F
export FUNIPNT='T'
# Output server type (see ww3_shel/multi.inp in WW3 repo)
export IOSRV=${IOSRV:-'1'}
# Flag for dedicated output process for unified points
export FPNTPROC='T'
# Flag for grids sharing dedicated output processes
export FGRDPROC='F'
# Flag for masking computation in two-way nesting
export FLAGMASKCOMP="F"
# Flag for masking at printout time.
export FLAGMASKOUT="F"

echo "END: config.wave"
1 change: 1 addition & 0 deletions parm/config/gefs/config.waveinit
3 changes: 3 additions & 0 deletions parm/config/gfs/config.prepoceanobs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

echo "BEGIN: config.prepoceanobs"

export OCNOBS2IODAEXEC=${HOMEgfs}/sorc/gdas.cd/build/bin/gdas_obsprovider2ioda.x

export OBS_YAML_DIR=${HOMEgfs}/sorc/gdas.cd/parm/soca/obs/config
export OBSPROC_YAML=@OBSPROC_CONFIG@
export OBS_LIST=@SOCA_OBS_LIST@
[[ -n "${OBS_LIST}" ]] || export OBS_LIST=${HOMEgfs}/sorc/gdas.cd/parm/soca/obs/obs_list.yaml
export OBS_YAML=${OBS_LIST}
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit e1dbf68

Please sign in to comment.