|
| 1 | +#! /usr/bin/env bash |
| 2 | +set -x |
| 3 | +source "${HOMEglobal}/ush/jjob_header.sh" -e "sfcanl_regrid" -c "base sfcanl_regrid" |
| 4 | + |
| 5 | +#{% if false %} |
| 6 | +source "${HOMEglobal}/ush/jjob_standard_vars.sh" |
| 7 | +#{% else %} |
| 8 | +#{% include jjob_var_setup.j2 %} |
| 9 | +#{% endif %} |
| 10 | + |
| 11 | +source "${USHglobal}/jjob_shell_setup.sh" |
| 12 | +# Set strict mode which will exit on error or undefined variable |
| 13 | +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) |
| 14 | +source "${USHglobal}/set_strict.sh" |
| 15 | + |
| 16 | +############################################## |
| 17 | +# Begin JOB SPECIFIC work |
| 18 | +############################################## |
| 19 | +# Ignore possible spelling error (nothing is misspelled) |
| 20 | +# shellcheck disable=SC2153 |
| 21 | +GDATE=$(date --utc -d "${PDY} ${cyc} - ${assim_freq} hours" +%Y%m%d%H) |
| 22 | +export GDATE |
| 23 | + |
| 24 | +BKG_RUN="gdas" |
| 25 | +if [[ "${RUN}" == "gcafs" || "${RUN}" == "gcdas" ]]; then |
| 26 | + BKG_RUN="gcdas" |
| 27 | +fi |
| 28 | + |
| 29 | +declare -rx COMIN_OBS_PREV="${ROTDIR}/${BKG_RUN}.${GDATE:0:8}/${GDATE:8:2}/obs" |
| 30 | +declare -rx COMIN_ATMOS_RESTART_PREV="${ROTDIR}/${BKG_RUN}.${GDATE:0:8}/${GDATE:8:2}/model/atmos/restart" |
| 31 | + |
| 32 | +declare -rx COMIN_OBS="${ROTDIR}/${RUN}.${PDY}/${cyc}/obs" |
| 33 | +declare -rx COMIN_ATMOS_ANALYSIS="${ROTDIR}/${RUN}.${PDY}/${cyc}/analysis/atmos" |
| 34 | +declare -rx COMIN_SNOW_ANALYSIS="${ROTDIR}/${RUN}.${PDY}/${cyc}/analysis/snow" |
| 35 | + |
| 36 | +declare -rx COMOUT_ATMOS_RESTART="${ROTDIR}/${RUN}.${PDY}/${cyc}/model/atmos/restart" |
| 37 | + |
| 38 | +declare -rx COMIN_ATMOS_ENKF_ANALYSIS_STAT="${ROTDIR}/enkfgdas.${PDY}/${cyc}/ensstat/analysis/atmos" |
| 39 | + |
| 40 | +mkdir -p "${COMOUT_ATMOS_RESTART}" |
| 41 | + |
| 42 | +# Use CFP to stage and save files in parallel |
| 43 | +export USE_CFP=YES |
| 44 | + |
| 45 | +############################################################### |
| 46 | +# Run relevant script |
| 47 | + |
| 48 | +${SFCANALSH:-${SCRglobal}/exglobal_atmos_sfcanl_regrid.sh} && true |
| 49 | +export err=$? |
| 50 | +if [[ ${err} -ne 0 ]]; then |
| 51 | + err_exit |
| 52 | +fi |
| 53 | + |
| 54 | +############################################## |
| 55 | +# End JOB SPECIFIC work |
| 56 | +############################################## |
| 57 | + |
| 58 | +############################################## |
| 59 | +# Final processing |
| 60 | +############################################## |
| 61 | +if [[ -e "${pgmout}" ]]; then |
| 62 | + cat "${pgmout}" |
| 63 | +fi |
| 64 | + |
| 65 | +########################################## |
| 66 | +# Remove the Temporary working directory |
| 67 | +########################################## |
| 68 | +cd "${DATAROOT}" || true |
| 69 | +if [[ "${KEEPDATA}" == "NO" ]]; then |
| 70 | + rm -rf "${DATA}" |
| 71 | +fi |
| 72 | + |
| 73 | +exit 0 |
0 commit comments