Skip to content

Commit

Permalink
Merge branch 'NOAA-EMC:develop' into feature/bugzilla_1227
Browse files Browse the repository at this point in the history
  • Loading branch information
KateFriedman-NOAA authored May 8, 2024
2 parents a8e43b6 + 0cf0349 commit 9d0f5fc
Show file tree
Hide file tree
Showing 44 changed files with 376 additions and 154 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ parm/post/ice.csv
parm/post/ocnicepost.nml.jinja2
parm/ufs/noahmptable.tbl
parm/ufs/model_configure.IN
parm/ufs/model_configure_nest.IN
parm/ufs/MOM_input_*.IN
parm/ufs/MOM6_data_table.IN
parm/ufs/ice_in.IN
Expand Down
3 changes: 3 additions & 0 deletions ci/cases/pr/C96_atm3DVar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ arguments:
gfs_cyc: 1
start: cold
yaml: {{ HOMEgfs }}/ci/cases/yamls/gfs_defaults_ci.yaml

skip_ci_on_hosts:
- wcoss2
22 changes: 22 additions & 0 deletions ci/cases/pr/C96_atm3DVar_extended.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
experiment:
system: gfs
mode: cycled

arguments:
pslot: {{ 'pslot' | getenv }}
app: ATM
resdetatmos: 96
comroot: {{ 'RUNTESTS' | getenv }}/COMROOT
expdir: {{ 'RUNTESTS' | getenv }}/EXPDIR
icsdir: {{ 'ICSDIR_ROOT' | getenv }}/C96C48
idate: 2021122018
edate: 2021122118
nens: 0
gfs_cyc: 4
start: cold
yaml: {{ HOMEgfs }}/ci/cases/yamls/gfs_extended_ci.yaml

skip_ci_on_hosts:
- hera
- orion
- hercules
12 changes: 12 additions & 0 deletions ci/cases/yamls/gfs_extended_ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
defaults:
!INC {{ HOMEgfs }}/parm/config/gfs/yaml/defaults.yaml

base:
ACCOUNT: {{ 'SLURM_ACCOUNT' | getenv }}
DO_GOES: "YES"
DO_BUFRSND: "YES"
DO_GEMPAK: "YES"
DO_AWIPS: "NO"
DO_NPOESS: "YES"
DO_GENESIS_FSU: "NO"
FHMAX_GFS: 384
4 changes: 4 additions & 0 deletions env/HERA.env
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ elif [[ "${step}" = "prepsnowobs" ]]; then

export APRUN_CALCFIMS="${launcher} -n 1"

elif [[ "${step}" = "prep_emissions" ]]; then

export APRUN="${launcher} -n 1"

elif [[ "${step}" = "waveinit" ]] || [[ "${step}" = "waveprep" ]] || [[ "${step}" = "wavepostsbs" ]] || [[ "${step}" = "wavepostbndpnt" ]] || [[ "${step}" = "wavepostbndpntbll" ]] || [[ "${step}" = "wavepostpnt" ]]; then

export CFP_MP="YES"
Expand Down
4 changes: 4 additions & 0 deletions env/HERCULES.env
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ case ${step} in

export APRUN_CALCFIMS="${launcher} -n 1"
;;
"prep_emissions")

export APRUN="${launcher} -n 1"
;;
"waveinit" | "waveprep" | "wavepostsbs" | "wavepostbndpnt" | "wavepostpnt" | "wavepostbndpntbll")

export CFP_MP="YES"
Expand Down
4 changes: 4 additions & 0 deletions env/JET.env
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ elif [[ "${step}" = "prepsnowobs" ]]; then

export APRUN_CALCFIMS="${launcher} -n 1"

elif [[ "${step}" = "prep_emissions" ]]; then

export APRUN="${launcher} -n 1"

elif [[ "${step}" = "waveinit" ]] || [[ "${step}" = "waveprep" ]] || [[ "${step}" = "wavepostsbs" ]] || [[ "${step}" = "wavepostbndpnt" ]] || [[ "${step}" = "wavepostbndpntbll" ]] || [[ "${step}" = "wavepostpnt" ]]; then

export CFP_MP="YES"
Expand Down
4 changes: 4 additions & 0 deletions env/ORION.env
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ elif [[ "${step}" = "prepsnowobs" ]]; then

export APRUN_CALCFIMS="${launcher} -n 1"

elif [[ "${step}" = "prep_emissions" ]]; then

export APRUN="${launcher} -n 1"

elif [[ "${step}" = "waveinit" ]] || [[ "${step}" = "waveprep" ]] || [[ "${step}" = "wavepostsbs" ]] || \
[[ "${step}" = "wavepostbndpnt" ]] || [[ "${step}" = "wavepostpnt" ]] || [[ "${step}" == "wavepostbndpntbll" ]]; then

Expand Down
4 changes: 4 additions & 0 deletions env/S4.env
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ elif [[ "${step}" = "prepsnowobs" ]]; then

export APRUN_CALCFIMS="${launcher} -n 1"

elif [[ "${step}" = "prep_emissions" ]]; then

export APRUN="${launcher} -n 1"

elif [[ "${step}" = "waveinit" ]] || [[ "${step}" = "waveprep" ]] || [[ "${step}" = "wavepostsbs" ]] || [[ "${step}" = "wavepostbndpnt" ]] || [[ "${step}" = "wavepostbndpntbll" ]] || [[ "${step}" = "wavepostpnt" ]]; then

export CFP_MP="YES"
Expand Down
4 changes: 4 additions & 0 deletions env/WCOSS2.env
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ elif [[ "${step}" = "prepsnowobs" ]]; then

export APRUN_CALCFIMS="${launcher} -n 1"

elif [[ "${step}" = "prep_emissions" ]]; then

export APRUN="${launcher} -n 1"

elif [[ "${step}" = "waveinit" ]] || [[ "${step}" = "waveprep" ]] || [[ "${step}" = "wavepostsbs" ]] || [[ "${step}" = "wavepostbndpnt" ]] || [[ "${step}" = "wavepostbndpntbll" ]] || [[ "${step}" = "wavepostpnt" ]]; then

export USE_CFP="YES"
Expand Down
4 changes: 2 additions & 2 deletions gempak/ush/gfs_meta_opc_na_ver
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ fcsthr="f00"
# seq won't give us any splitting problems, ignore warnings
# shellcheck disable=SC2207,SC2312
case ${cyc} in
00 | 12) IFS=$'\n' lookbacks=($(seq 6 6 84) $(seq 96 12 120)) ;;
06 | 18) IFS=$'\n' lookbacks=($(seq 6 6 84) $(seq 90 12 126)) ;;
00 | 12) lookbacks=($(IFS=$'\n' seq 6 6 84) $(IFS=$'\n' seq 96 12 120)) ;;
06 | 18) lookbacks=($(IFS=$'\n' seq 6 6 84) $(IFS=$'\n' seq 90 12 126)) ;;
*)
echo "FATAL ERROR: Invalid cycle ${cyc} passed to ${BASH_SOURCE[0]}"
exit 100
Expand Down
4 changes: 2 additions & 2 deletions gempak/ush/gfs_meta_opc_np_ver
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ fcsthr="f00"
# seq won't give us any splitting problems, ignore warnings
# shellcheck disable=SC2207,SC2312
case ${cyc} in
00 | 12) IFS=$'\n' lookbacks=($(seq 6 6 84) $(seq 96 12 120)) ;;
06 | 18) IFS=$'\n' lookbacks=($(seq 6 6 84) $(seq 90 12 126)) ;;
00 | 12) lookbacks=($(IFS=$'\n' seq 6 6 84) $(IFS=$'\n' seq 96 12 120)) ;;
06 | 18) lookbacks=($(IFS=$'\n' seq 6 6 84) $(IFS=$'\n' seq 90 12 126)) ;;
*)
echo "FATAL ERROR: Invalid cycle ${cyc} passed to ${BASH_SOURCE[0]}"
exit 100
Expand Down
2 changes: 1 addition & 1 deletion gempak/ush/gfs_meta_ver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ MDL2="GFSHPC"
#GENERATING THE METAFILES.
# seq won't give us any splitting problems, ignore warnings
# shellcheck disable=SC2207,SC2312
IFS=$'\n' lookbacks=($(seq 6 6 180) $(seq 192 12 216))
lookbacks=($(IFS=$'\n' seq 6 6 180) $(IFS=$'\n' seq 192 12 216))
for lookback in "${lookbacks[@]}"; do
init_time="$(date --utc +%Y%m%d%H -d "${PDY} ${cyc} - ${lookback} hours")"
init_PDY=${init_time:0:8}
Expand Down
35 changes: 35 additions & 0 deletions jobs/JGLOBAL_PREP_EMISSIONS
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#! /usr/bin/env bash

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

##############################################
# Set variables used in the script
##############################################
# TODO: Set local variables used in this script e.g. GDATE may be needed for previous cycle

##############################################
# Begin JOB SPECIFIC work
##############################################
# Generate COM variables from templates
# TODO: Add necessary COMIN, COMOUT variables for this job

###############################################################
# Run relevant script
EXSCRIPT=${PREP_EMISSIONS_PY:-${SCRgfs}/exglobal_prep_emissions.py}
${EXSCRIPT}
status=$?
(( status != 0 )) && ( echo "FATAL ERROR: Error executing ${EXSCRIPT}, ABORT!"; exit "${status}" )

##############################################
# End JOB SPECIFIC work
##############################################

##############################################
# Final processing
##############################################
if [[ -e "${pgmout}" ]] ; then
cat "${pgmout}"
fi

exit 0
23 changes: 23 additions & 0 deletions jobs/rocoto/prep_emissions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#! /usr/bin/env bash

source "${HOMEgfs}/ush/preamble.sh"

###############################################################
# Source UFSDA workflow modules
source "${HOMEgfs}/ush/load_fv3gfs_modules.sh"
status=$?
(( status != 0 )) && exit "${status}"

export job="prep_emissions"
export jobid="${job}.$$"

###############################################################
# setup python path for workflow utilities and tasks
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${HOMEgfs}/ush/python"
export PYTHONPATH

###############################################################
# Execute the JJOB
"${HOMEgfs}/jobs/JGLOBAL_PREP_EMISSIONS"
status=$?
exit "${status}"
6 changes: 3 additions & 3 deletions parm/config/gefs/config.base
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ export NOSCRUB="@NOSCRUB@"
export BASE_GIT="@BASE_GIT@"

# Toggle to turn on/off GFS downstream processing.
export DO_BUFRSND="NO" # BUFR sounding products
export DO_GEMPAK="NO" # GEMPAK products
export DO_AWIPS="NO" # AWIPS products
export DO_BUFRSND="@DO_BUFRSND@" # BUFR sounding products
export DO_GEMPAK="@DO_GEMPAK@" # GEMPAK products
export DO_AWIPS="@DO_AWIPS@" # AWIPS products

# NO for retrospective parallel; YES for real-time parallel
# arch.sh uses REALTIME for MOS. Need to set REALTIME=YES
Expand Down
11 changes: 11 additions & 0 deletions parm/config/gefs/config.prep_emissions
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#! /usr/bin/env bash

########## config.prep_emissions ##########
# aerosol emissions preprocessing specific

echo "BEGIN: config.prep_emissions"

# Get task specific resources
source "${EXPDIR}/config.resources" prep_emissions

echo "END: config.prep_emissions"
8 changes: 8 additions & 0 deletions parm/config/gefs/config.resources
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ case ${step} in
export memory_waveinit="2GB"
;;

"prep_emissions")
export wtime_prep_emissions="00:10:00"
export npe_prep_emissions=1
export nth_prep_emissions=1
export npe_node_prep_emissions=$(( npe_node_max / nth_prep_emissions ))
export memory_prep_emissions="1GB"
;;

"fcst" | "efcs")
export is_exclusive=True

Expand Down
3 changes: 3 additions & 0 deletions parm/config/gefs/yaml/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ base:
DO_JEDIOCNVAR: "NO"
DO_JEDISNOWDA: "NO"
DO_MERGENSST: "NO"
DO_BUFRSND: "NO"
DO_GEMPAK: "NO"
DO_AWIPS: "NO"
KEEPDATA: "NO"
FHMAX_GFS: 120
USE_OCN_PERTURB_FILES: "false"
Expand Down
2 changes: 1 addition & 1 deletion parm/config/gfs/config.aeroanl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export JEDI_FIX_YAML="${PARMgfs}/gdas/aero_jedi_fix.yaml.j2"
export io_layout_x=@IO_LAYOUT_X@
export io_layout_y=@IO_LAYOUT_Y@

export JEDIEXE="${EXECgfs}/fv3jedi_var.x"
export JEDIEXE="${EXECgfs}/gdas.x"

if [[ "${DOIAU}" == "YES" ]]; then
export aero_bkg_times="3,6,9"
Expand Down
2 changes: 1 addition & 1 deletion parm/config/gfs/config.atmanl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ export layout_y_atmanl=@LAYOUT_Y_ATMANL@
export io_layout_x=@IO_LAYOUT_X@
export io_layout_y=@IO_LAYOUT_Y@

export JEDIEXE=${EXECgfs}/fv3jedi_var.x
export JEDIEXE=${EXECgfs}/gdas.x

echo "END: config.atmanl"
2 changes: 1 addition & 1 deletion parm/config/gfs/config.atmensanl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ export layout_y_atmensanl=@LAYOUT_Y_ATMENSANL@
export io_layout_x=@IO_LAYOUT_X@
export io_layout_y=@IO_LAYOUT_Y@

export JEDIEXE=${EXECgfs}/fv3jedi_letkf.x
export JEDIEXE=${EXECgfs}/gdas.x

echo "END: config.atmensanl"
24 changes: 12 additions & 12 deletions parm/config/gfs/config.base
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,18 @@ export NOSCRUB="@NOSCRUB@"
export BASE_GIT="@BASE_GIT@"

# Toggle to turn on/off GFS downstream processing.
export DO_GOES="@DO_GOES@" # GOES products
export DO_BUFRSND="NO" # BUFR sounding products
export DO_GEMPAK="NO" # GEMPAK products
export DO_AWIPS="NO" # AWIPS products
export DO_NPOESS="NO" # NPOESS products
export DO_TRACKER="YES" # Hurricane track verification
export DO_GENESIS="YES" # Cyclone genesis verification
export DO_GENESIS_FSU="NO" # Cyclone genesis verification (FSU)
export DO_VERFOZN="YES" # Ozone data assimilation monitoring
export DO_VERFRAD="YES" # Radiance data assimilation monitoring
export DO_VMINMON="YES" # GSI minimization monitoring
export DO_MOS="NO" # GFS Model Output Statistics - Only supported on WCOSS2
export DO_GOES="@DO_GOES@" # GOES products
export DO_BUFRSND="@DO_BUFRSND@" # BUFR sounding products
export DO_GEMPAK="@DO_GEMPAK@" # GEMPAK products
export DO_AWIPS="@DO_AWIPS@" # AWIPS products
export DO_NPOESS="@DO_NPOESS@" # NPOESS products
export DO_TRACKER="@DO_TRACKER@" # Hurricane track verification
export DO_GENESIS="@DO_GENESIS@" # Cyclone genesis verification
export DO_GENESIS_FSU="@DO_GENESIS_FSU@" # Cyclone genesis verification (FSU)
export DO_VERFOZN="YES" # Ozone data assimilation monitoring
export DO_VERFRAD="YES" # Radiance data assimilation monitoring
export DO_VMINMON="YES" # GSI minimization monitoring
export DO_MOS="NO" # GFS Model Output Statistics - Only supported on WCOSS2

# NO for retrospective parallel; YES for real-time parallel
# arch.sh uses REALTIME for MOS. Need to set REALTIME=YES
Expand Down
2 changes: 1 addition & 1 deletion parm/config/gfs/config.snowanl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ source "${EXPDIR}/config.resources" snowanl
export OBS_LIST="${PARMgfs}/gdas/snow/obs/lists/gdas_snow.yaml.j2"

# Name of the JEDI executable and its yaml template
export JEDIEXE="${EXECgfs}/fv3jedi_letkf.x"
export JEDIEXE="${EXECgfs}/gdas.x"
export JEDIYAML="${PARMgfs}/gdas/snow/letkfoi/letkfoi.yaml.j2"

# Ensemble member properties
Expand Down
7 changes: 7 additions & 0 deletions parm/config/gfs/yaml/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ base:
DO_JEDISNOWDA: "NO"
DO_MERGENSST: "NO"
DO_GOES: "NO"
DO_BUFRSND: "NO"
DO_GEMPAK: "NO"
DO_AWIPS: "NO"
DO_NPOESS: "NO"
DO_TRACKER: "YES"
DO_GENESIS: "YES"
DO_GENESIS_FSU: "NO"
FHMAX_GFS: 120
DO_VRFY_OCEANDA: "NO"
GSI_SOILANAL: "NO"
Expand Down
3 changes: 2 additions & 1 deletion scripts/exgfs_atmos_grib2_special_npoess.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ for (( fhr=SHOUR; fhr <= FHOUR; fhr = fhr + FHINC )); do
# existence of the restart files
###############################
export pgm="postcheck"
grib_file="${COM_ATMOS_MASTER}/${RUN}.t${cyc}z.goesmasterf${fhr3}.grb2"
# grib_file="${COM_ATMOS_MASTER}/${RUN}.t${cyc}z.goesmasterf${fhr3}.grb2"
grib_file="${COM_ATMOS_MASTER}/${RUN}.t${cyc}z.special.grb2f${fhr3}"
if ! wait_for_file "${grib_file}" "${SLEEP_INT}" "${SLEEP_LOOP_MAX}"; then
echo "FATAL ERROR: GOES master grib file ${grib_file} not available after max sleep time"
export err=9
Expand Down
25 changes: 25 additions & 0 deletions scripts/exglobal_prep_emissions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env python3
# exglobal_prep_emissions.py
# This script creates a emissions object
# which perform the pre-processing for aerosol emissions
import os

from wxflow import Logger, cast_strdict_as_dtypedict
from pygfs import AerosolEmissions


# Initialize root logger
logger = Logger(level=os.environ.get("LOGGING_LEVEL", "DEBUG"), colored_log=True)


if __name__ == '__main__':

# Take configuration from environment and cast it as python dictionary
config = cast_strdict_as_dtypedict(os.environ)

# Instantiate the emissions pre-processing task
emissions = AerosolEmissions(config)
emissions.initialize()
emissions.configure()
emissions.execute(emissions.task_config.DATA, emissions.task_config.APRUN)
emissions.finalize()
Loading

0 comments on commit 9d0f5fc

Please sign in to comment.