Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GLDAS scripts & fix GLDAS job #1018

Merged
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
93c7cf3
Remove GLDAS scripts from .gitignore
KateFriedman-NOAA Sep 8, 2022
016c8c2
Remove GLDAS script symlinks from link_workflow.sh
KateFriedman-NOAA Sep 8, 2022
858cbfc
Add GLDAS scripts to global-workflow
KateFriedman-NOAA Sep 8, 2022
8f45611
Updates to GLDAS scripts
KateFriedman-NOAA Sep 8, 2022
72bba7e
Cleanup GLDAS script doc blocks more
KateFriedman-NOAA Sep 12, 2022
4d7a6db
Address linter warnings and remove obsolete platforms
KateFriedman-NOAA Sep 12, 2022
79f747c
Address linter warnings in JGDAS_ATMOS_GLDAS
KateFriedman-NOAA Sep 12, 2022
11e59b0
Address linter warning for KEEPDATA and assign gldas_spinup_hours
KateFriedman-NOAA Sep 12, 2022
e27275e
Address linter warning for SC1091 in JGDAS_ATMOS_GLDAS
KateFriedman-NOAA Sep 12, 2022
7187860
Update linter directive for machine env line in JGDAS_ATMOS_GLDAS
KateFriedman-NOAA Sep 12, 2022
3bdf47a
Make machine for env file uppercase
KateFriedman-NOAA Sep 12, 2022
63b34f6
Address linter warnings in scripts/exgdas_atmos_gldas.sh
KateFriedman-NOAA Sep 12, 2022
fda1481
Resolve SC2250 (curly brace) shellcheck warnings in GLDAS ush scripts
KateFriedman-NOAA Sep 13, 2022
dd6651f
Address SC2086 shellcheck warnings in GLDAS ush scripts
KateFriedman-NOAA Sep 13, 2022
cae328b
Correct env sourcing in jobs/JGDAS_ATMOS_GLDAS
KateFriedman-NOAA Sep 13, 2022
341b965
Address SC2086 warnings in scripts/exgdas_atmos_gldas.sh
KateFriedman-NOAA Sep 13, 2022
5cc40f1
Address SC2086 warnings in ush/gldas_get_data.sh
KateFriedman-NOAA Sep 13, 2022
1cf810e
Address a number of linter warnings in GLDAS scripts
KateFriedman-NOAA Sep 13, 2022
9f94a97
Address some linter warnings in GLDAS scripts
KateFriedman-NOAA Sep 13, 2022
2e810c3
Address linter warnings in ush/gldas_archive.sh and ush/gldas_post.sh
KateFriedman-NOAA Sep 13, 2022
82780bd
A couple syntax corrections in ush/gldas_forcing.sh
KateFriedman-NOAA Sep 14, 2022
236c968
Address a couple linter warnings
KateFriedman-NOAA Sep 14, 2022
a908c82
Removing gldas_archive.sh and gldas_post.sh
KateFriedman-NOAA Sep 14, 2022
c2b3e20
Address linter warnings in jobs/JGDAS_ATMOS_GLDAS and ush/gldas_forci…
KateFriedman-NOAA Sep 14, 2022
235a85b
Convert GLDAS script to replace machine checks with CFP variables
KateFriedman-NOAA Sep 14, 2022
887ba66
Address double quote linter warning in ush/gldas_get_data.sh
KateFriedman-NOAA Sep 14, 2022
617d425
Remove exports of local variables in scripts/exgdas_atmos_gldas.sh
KateFriedman-NOAA Sep 14, 2022
7f35d55
Removing exports for local variables in ush/gldas_liscrd.sh
KateFriedman-NOAA Sep 14, 2022
272539c
Remove unnecessary variable setting in ush/gldas_liscrd.sh
KateFriedman-NOAA Sep 14, 2022
9a6a112
GLDAS fix file updates for FRAC_GRID
KateFriedman-NOAA Sep 19, 2022
38a5f98
Address linter warnings and use iter as argument to gldas_process_dat…
KateFriedman-NOAA Sep 19, 2022
dbf588d
Address linter warnings in config.fcst for SC2108
KateFriedman-NOAA Sep 19, 2022
e0e271a
Add shellcheck disable for SC1091 in JGDAS_ATMOS_GLDAS
KateFriedman-NOAA Sep 19, 2022
f53f1ee
Also disable SC1090 in JGDAS_ATMOS_GLDAS
KateFriedman-NOAA Sep 19, 2022
2aa8d51
Indent while loops in GLDAS scripts
KateFriedman-NOAA Sep 20, 2022
37d869e
Provide exit code values in JGDAS_ATMOS_GLDAS
KateFriedman-NOAA Sep 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ sorc/wafs_setmissing.fd
# Ignore scripts from externals
#------------------------------
# jobs symlinks
jobs/JGDAS_ATMOS_GLDAS
jobs/JGFS_ATMOS_WAFS
jobs/JGFS_ATMOS_WAFS_BLENDING
jobs/JGFS_ATMOS_WAFS_BLENDING_0P25
Expand All @@ -144,7 +143,6 @@ jobs/JGFS_ATMOS_WAFS_GRIB2
jobs/JGFS_ATMOS_WAFS_GRIB2_0P25
# scripts symlinks
scripts/exemcsfc_global_sfc_prep.sh
scripts/exgdas_atmos_gldas.sh
scripts/exgfs_atmos_wafs_blending.sh
scripts/exgfs_atmos_wafs_blending_0p25.sh
scripts/exgfs_atmos_wafs_gcip.sh
Expand All @@ -160,12 +158,6 @@ ush/fv3gfs_driver_grid.sh
ush/fv3gfs_filter_topo.sh
ush/fv3gfs_make_grid.sh
ush/fv3gfs_make_orog.sh
ush/gldas_archive.sh
ush/gldas_forcing.sh
ush/gldas_get_data.sh
ush/gldas_liscrd.sh
ush/gldas_post.sh
ush/gldas_process_data.sh
ush/global_chgres.sh
ush/global_chgres_driver.sh
ush/global_cycle.sh
Expand Down
129 changes: 129 additions & 0 deletions jobs/JGDAS_ATMOS_GLDAS
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
#! /usr/bin/env bash

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

#############################
# Source relevant config files
#############################
export EXPDIR=${EXPDIR:-${HOMEgfs}/parm/config}
configs="base gldas"
config_path=${EXPDIR:-${NWROOT}/gfs.${gfs_ver}/parm/config}
for config in ${configs}; do
# shellcheck source=parm/config/${config}
. "${config_path}/config.${config}"
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"
done


if [ "${cyc:?}" -ne "${gldas_cyc:?}" ]; then
echo "GLDAS only runs for ${gldas_cyc} cycle; Skip GLDAS step for cycle ${cyc}"
exit 0
fi

gldas_spinup_hours=${gldas_spinup_hours-:72}
xtime=$((gldas_spinup_hours+12))
if [ "${CDATE}" -le "$(${NDATE:?} +"${xtime}" "${SDATE:?}")" ]; then
echo "GLDAS needs fluxes as forcing from cycles in previous ${xtime} hours"
echo "starting from ${SDATE}. This gldas cycle is skipped"
exit 0
fi

##########################################
# Source machine runtime environment
##########################################
# shellcheck source=env/WCOSS2.env
. "${HOMEgfs}/env/${machine:?}.env gldas"
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"


##############################################
# Obtain unique process id (pid) and make temp directory
##############################################
export pid=${pid:-$$}
export outid=${outid:-"LL${job}"}

export DATA=${DATA:-${DATAROOT}/${jobid:?}}
mkdir -p "${DATA}"
cd "${DATA}" || exit
WalterKolczynski-NOAA marked this conversation as resolved.
Show resolved Hide resolved


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


##############################################
# Determine Job Output Name on System
##############################################
export pgmout="OUTPUT.${pid}"
export pgmerr=errfile


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


##############################################
# Begin JOB SPECIFIC work
##############################################
export gldas_ver=${gldas_ver:-v2.3.0}
export HOMEgldas=${HOMEgldas:-${HOMEgfs}}
export FIXgldas=${FIXgldas:-${HOMEgldas}/fix/fix_gldas}
export PARMgldas=${PARMgldas:-${HOMEgldas}/parm/gldas}
export EXECgldas=${EXECgldas:-${HOMEgldas}/exec}
export USHgldas=${USHgldas:-${HOMEgldas}/ush}
export PARA_CONFIG=${HOMEgfs}/parm/config/config.gldas

if [ "${RUN_ENVIR:?}" = "nco" ]; then
export COMIN=${COMIN:-${ROTDIR}/${RUN}.${PDY}/${cyc}/${COMPONENT}}
export COMOUT=${COMOUT:-${ROTDIR}/${RUN}.${PDY}/${cyc}/${COMPONENT}}
else
export COMIN="${ROTDIR}/${CDUMP}.${PDY}/${cyc}/${COMPONENT}"
export COMOUT="${ROTDIR}/${CDUMP}.${PDY}/${cyc}/${COMPONENT}"
fi
[[ ! -d ${COMOUT} ]] && mkdir -m 775 -p "${COMOUT}"
Fixed Show fixed Hide fixed

export COMINgdas=${COMINgdas:-${ROTDIR}}
export DCOMIN=${DCOMIN:-${DCOMROOT:-"/lfs/h1/ops/prod/dcom"}}

export model=${model:-noah}
export MODEL=${MODEL:-$(echo "${model} |tr 'a-z' 'A-Z'")}
Fixed Show fixed Hide fixed


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

${GLDASSH:-${HOMEgldas}/scripts/exgdas_atmos_gldas.sh}
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
WalterKolczynski-NOAA marked this conversation as resolved.
Show resolved Hide resolved
[[ ${KEEPDATA:?} = "NO" ]] && rm -rf "${DATA}"

exit 0

Loading