Skip to content

Commit

Permalink
update UFS-DA atm ens components to python g-w (NOAA-EMC#1313)
Browse files Browse the repository at this point in the history
  • Loading branch information
RussTreadon-NOAA committed Feb 28, 2023
1 parent c3bb84b commit e3b71f0
Show file tree
Hide file tree
Showing 20 changed files with 816 additions and 34 deletions.
12 changes: 11 additions & 1 deletion env/HERA.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if [[ $# -ne 1 ]]; then
echo "Must specify an input argument to set runtime environment variables!"
echo "argument can be any one of the following:"
echo "atmanalrun atmensanalrun"
echo "atmanlrun aeroanlrun"
echo "atmanlrun atmensanlrun aeroanlrun"
echo "anal sfcanl fcst post vrfy metp"
echo "eobs eupd ecen efcs epos"
echo "postsnd awips gempak"
Expand Down Expand Up @@ -83,6 +83,16 @@ elif [[ "${step}" = "atmanlrun" ]]; then
[[ ${NTHREADS_ATMANL} -gt ${nth_max} ]] && export NTHREADS_ATMANL=${nth_max}
export APRUN_ATMANL="${launcher} -n ${npe_atmanlrun}"

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

export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}"

nth_max=$((npe_node_max / npe_node_atmensanlrun))

export NTHREADS_ATMENSANL=${nth_atmensanlrun:-${nth_max}}
[[ ${NTHREADS_ATMENSANL} -gt ${nth_max} ]] && export NTHREADS_ATMENSANL=${nth_max}
export APRUN_ATMENSANL="${launcher} -n ${npe_atmensanlrun}"

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

export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}"
Expand Down
62 changes: 62 additions & 0 deletions jobs/JGLOBAL_ATMENS_ANALYSIS_FINALIZE
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#! /usr/bin/env bash

source "${HOMEgfs}/ush/preamble.sh"
export WIPE_DATA="NO"
export DATA=${DATA:-${DATAROOT}/${RUN}atmensanl_${cyc}}
source "${HOMEgfs}/ush/jjob_header.sh" -e "atmensanlfinal" -c "base atmensanl atmensanlfinal"

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


##############################################
# Begin JOB SPECIFIC work
##############################################

GDATE=$(date +%Y%m%d%H -d "${CDATE:0:8} ${CDATE:8:2} - ${assim_freq} hours")
export GDATE
gPDY=${GDATE:0:8}
export gcyc=${GDATE:8:2}
export GDUMP=${GDUMP:-"gdas"}

export OPREFIX="${CDUMP}.t${cyc}z."
export GPREFIX="${GDUMP}.t${gcyc}z."
export APREFIX="${CDUMP}.t${cyc}z."

export COMOUT=${COMOUT:-${ROTDIR}/${CDUMP}.${PDY}/${cyc}}

mkdir -p "${COMOUT}"

# COMIN_GES and COMIN_GES_ENS are used in script
export COMIN_GES="${ROTDIR}/${GDUMP}.${gPDY}/${gcyc}/chem"
export COMIN_GES_ENS="${ROTDIR}/enkf${GDUMP}.${gPDY}/${gcyc}/chem"

###############################################################
# Run relevant script

EXSCRIPT=${GDASATMENSFINALPY:-${HOMEgfs}/scripts/exglobal_atmens_analysis_finalize.py}
${EXSCRIPT}
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"

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

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

##########################################
# Remove the Temporary working directory
##########################################
cd "${DATAROOT}" || exit 1
[[ ${KEEPDATA} = "NO" ]] && rm -rf "${DATA}"

exit 0
55 changes: 55 additions & 0 deletions jobs/JGLOBAL_ATMENS_ANALYSIS_INITIALIZE
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#! /usr/bin/env bash

source "${HOMEgfs}/ush/preamble.sh"
export DATA=${DATA:-${DATAROOT}/${RUN}atmensanl_${cyc}}
source "${HOMEgfs}/ush/jjob_header.sh" -e "atmensanlinit" -c "base atmensanl atmensanlinit"

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


##############################################
# Begin JOB SPECIFIC work
##############################################

GDATE=$(date +%Y%m%d%H -d "${CDATE:0:8} ${CDATE:8:2} - ${assim_freq} hours")
export GDATE
export gPDY=${GDATE:0:8}
export gcyc=${GDATE:8:2}
export GDUMP=${GDUMP:-"gdas"}

export OPREFIX="${CDUMP_OBS}.t${cyc}z."
export GPREFIX="${GDUMP}.t${gcyc}z."
export APREFIX="${CDUMP}.t${cyc}z."

export COMOUT=${COMOUT:-${ROTDIR}/${CDUMP}.${PDY}/${cyc}/chem}

mkdir -p "${COMOUT}"

# COMIN_GES and COMIN_GES_ENS are used in script
export COMIN_GES="${ROTDIR}/${GDUMP}.${gPDY}/${gcyc}/atmos"
export COMIN_GES_ENS="${ROTDIR}/enkf${GDUMP}.${gPDY}/${gcyc}"

###############################################################
# Run relevant script

EXSCRIPT=${GDASATMENSINITPY:-${HOMEgfs}/scripts/exglobal_atmens_analysis_initialize.py}
${EXSCRIPT}
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"

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

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

exit 0
56 changes: 56 additions & 0 deletions jobs/JGLOBAL_ATMENS_ANALYSIS_RUN
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#! /usr/bin/env bash

source "${HOMEgfs}/ush/preamble.sh"
export WIPE_DATA="NO"
export DATA=${DATA:-${DATAROOT}/${RUN}atmensanl_${cyc}}
source "${HOMEgfs}/ush/jjob_header.sh" -e "atmensanlrun" -c "base atmensanl atmensanlrun"

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


##############################################
# Begin JOB SPECIFIC work
##############################################

GDATE=$(date +%Y%m%d%H -d "${CDATE:0:8} ${CDATE:8:2} - ${assim_freq} hours")
export GDATE
gPDY=${GDATE:0:8}
export gcyc=${GDATE:8:2}
export GDUMP=${GDUMP:-"gdas"}

export OPREFIX="${CDUMP}.t${cyc}z."
export GPREFIX="${GDUMP}.t${gcyc}z."
export APREFIX="${CDUMP}.t${cyc}z."

export COMOUT=${COMOUT:-${ROTDIR}/${CDUMP}.${PDY}/${cyc}/chem}

mkdir -p "${COMOUT}"

# COMIN_GES and COMIN_GES_ENS are used in script
export COMIN_GES="${ROTDIR}/${GDUMP}.${gPDY}/${gcyc}/chem"
export COMIN_GES_ENS="${ROTDIR}/enkf${GDUMP}.${gPDY}/${gcyc}/chem"

###############################################################
# Run relevant script

EXSCRIPT=${GDASATMENSRUNSH:-${HOMEgfs}/scripts/exglobal_atmens_analysis_run.sh}
${EXSCRIPT}
status=$?
[[ ${status} -ne 0 ]] && 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/atmensanlfinal.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
. "${HOMEgfs}/ush/load_ufsda_modules.sh"
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"

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

###############################################################
# setup python path for workflow utilities and tasks
pygwPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/pygw/src"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${pygwPATH}"
export PYTHONPATH
###############################################################
# Execute the JJOB
"${HOMEgfs}/jobs/JGLOBAL_ATMENS_ANALYSIS_FINALIZE"
status=$?
exit "${status}"
24 changes: 24 additions & 0 deletions jobs/rocoto/atmensanlinit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#! /usr/bin/env bash

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

###############################################################
# Source UFSDA workflow modules
. "${HOMEgfs}/ush/load_ufsda_modules.sh"
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"

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

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

###############################################################
# Execute the JJOB
"${HOMEgfs}/jobs/JGLOBAL_ATMENS_ANALYSIS_INITIALIZE"
status=$?
exit "${status}"
18 changes: 18 additions & 0 deletions jobs/rocoto/atmensanlrun.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#! /usr/bin/env bash

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

###############################################################
# Source UFSDA workflow modules
. "${HOMEgfs}/ush/load_ufsda_modules.sh"
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"

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

###############################################################
# Execute the JJOB
"${HOMEgfs}/jobs/JGLOBAL_ATMENS_ANALYSIS_RUN"
status=$?
exit "${status}"
31 changes: 31 additions & 0 deletions parm/config/config.atmensanl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash -x

########## config.atmanal ##########
# configuration common to all atm analysis tasks

echo "BEGIN: config.atmanal"

export OBS_YAML_DIR=${HOMEgfs}/sorc/gdas.cd/parm/atm/obs/config/
export OBS_LIST=${HOMEgfs}/sorc/gdas.cd/parm/atm/obs/lists/gdas_prototype.yaml
export ATMVARYAML=${HOMEgfs}/sorc/gdas.cd/parm/atm/variational/3dvar_dripcg.yaml
export STATICB_TYPE="identity"
export BERROR_YAML=${HOMEgfs}/sorc/gdas.cd/parm/atm/berror/staticb_${STATICB_TYPE}.yaml
export FV3JEDI_FIX=${HOMEgfs}/fix/gdas
export R2D2_OBS_DB='ufsda_test'
export R2D2_OBS_DUMP='oper_gdas'
export R2D2_OBS_SRC='ncdiag'
export R2D2_BC_SRC='gsi'
export R2D2_BC_DUMP='oper_gdas'
export R2D2_ARCH_DB='local'
export INTERP_METHOD='barycentric'

export layout_x=1
export layout_y=1

export io_layout_x=1
export io_layout_y=1

export JEDIVAREXE=${HOMEgfs}/exec/fv3jedi_var.x
export CRTM_VER="2.3.0"

echo "END: config.atmanal"
10 changes: 10 additions & 0 deletions parm/config/config.atmensanlfinal
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash -x

########## config.atmanlfinal ##########
# Post Atm Analysis specific

echo "BEGIN: config.atmanlfinal"

# Get task specific resources
. $EXPDIR/config.resources atmanlfinal
echo "END: config.atmanlfinal"
10 changes: 10 additions & 0 deletions parm/config/config.atmensanlinit
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash -x

########## config.atmanlinit ##########
# Pre Atm Analysis specific

echo "BEGIN: config.atmanlinit"

# Get task specific resources
. $EXPDIR/config.resources atmanlinit
echo "END: config.atmanlinit"
11 changes: 11 additions & 0 deletions parm/config/config.atmensanlrun
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash -x

########## config.atmanlrun ##########
# Atmsol Analysis specific

echo "BEGIN: config.atmanlrun"

# Get task specific resources
. $EXPDIR/config.resources atmanlrun

echo "END: config.atmanlrun"
Loading

0 comments on commit e3b71f0

Please sign in to comment.