Skip to content

Commit

Permalink
[develop] Integrate 'online-cmaq' branch into 'develop' branch: Part …
Browse files Browse the repository at this point in the history
…1, jjob and ex- scripts (#536)

* Add j-job and ex- scripts files for online-cmaq

* reviewers comments on ufs-srw-app

* remove unnecessary commands

Co-authored-by: chan-hoo <[email protected]>
Co-authored-by: chan-hoo <[email protected]>
  • Loading branch information
3 people authored Jan 17, 2023
1 parent 70da0e8 commit 23b9852
Show file tree
Hide file tree
Showing 24 changed files with 4,212 additions and 0 deletions.
108 changes: 108 additions & 0 deletions jobs/JREGIONAL_AQM_ICS
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
#!/bin/bash

#
#-----------------------------------------------------------------------
#
# This script adds extra species for air quality modeling (AQM) to the
# initial conditions (ICs).
#
#-----------------------------------------------------------------------
#

#
#-----------------------------------------------------------------------
#
# Source the variable definitions file and the bash utility functions.
#
#-----------------------------------------------------------------------
#
. $USHdir/source_util_funcs.sh
source_config_for_task "cpl_aqm_parm" ${GLOBAL_VAR_DEFNS_FP}
. $USHdir/job_preamble.sh
#
#-----------------------------------------------------------------------
#
# Save current shell options (in a global array). Then set new options
# for this script/function.
#
#-----------------------------------------------------------------------
#
{ save_shell_opts; . $USHdir/preamble.sh; } > /dev/null 2>&1
#
#-----------------------------------------------------------------------
#
# Get the full path to the file in which this script/function is located
# (scrfunc_fp), the name of that file (scrfunc_fn), and the directory in
# which the file is located (scrfunc_dir).
#
#-----------------------------------------------------------------------
#
scrfunc_fp=$( $READLINK -f "${BASH_SOURCE[0]}" )
scrfunc_fn=$( basename "${scrfunc_fp}" )
scrfunc_dir=$( dirname "${scrfunc_fp}" )
#
#-----------------------------------------------------------------------
#
# Print message indicating entry into script.
#
#-----------------------------------------------------------------------
#
print_info_msg "
========================================================================
Entering script: \"${scrfunc_fn}\"
In directory: \"${scrfunc_dir}\"
This is the J-job script for the task that copies/fetches to a local
directory (either from disk or HPSS) the aqm boundary conditions from
which the model needs.
========================================================================"
#
#-----------------------------------------------------------------------
#
# Set the name of and create the directory in which the output from this
# script will be placed (if it doesn't already exist).
#
#-----------------------------------------------------------------------
#
if [ $RUN_ENVIR = "nco" ]; then
export INPUT_DATA="${COMIN}"
else
export INPUT_DATA="${COMIN}${SLASH_ENSMEM_SUBDIR}/INPUT"
fi
mkdir_vrfy -p "${INPUT_DATA}"
#
#-----------------------------------------------------------------------
#
# Set the run directory
#
#-----------------------------------------------------------------------
#
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}}"
mkdir_vrfy -p "${DATA}"
#
#-----------------------------------------------------------------------
#
# Call the ex-script for this J-job and pass to it the necessary variables.
#
#-----------------------------------------------------------------------
#
$SCRIPTSdir/exregional_aqm_ics.sh || \
print_err_msg_exit "\
Call to ex-script corresponding to J-job \"${scrfunc_fn}\" failed."
#
#-----------------------------------------------------------------------
#
# Run job postamble.
#
#-----------------------------------------------------------------------
#
job_postamble
#
#-----------------------------------------------------------------------
#
# Restore the shell options saved at the beginning of this script/function.
#
#-----------------------------------------------------------------------
#
{ restore_shell_opts; } > /dev/null 2>&1

108 changes: 108 additions & 0 deletions jobs/JREGIONAL_AQM_LBCS
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
#!/bin/bash

#
#-----------------------------------------------------------------------
#
# This script adds extra species for air quality modeling (AQM) to the
# lateral boundary conditions (LBCs) files.
#
#-----------------------------------------------------------------------
#

#
#-----------------------------------------------------------------------
#
# Source the variable definitions file and the bash utility functions.
#
#-----------------------------------------------------------------------
#
. $USHdir/source_util_funcs.sh
source_config_for_task "task_get_extrn_lbcs|task_make_orog|task_make_lbcs|cpl_aqm_parm" ${GLOBAL_VAR_DEFNS_FP}
. $USHdir/job_preamble.sh
#
#-----------------------------------------------------------------------
#
# Save current shell options (in a global array). Then set new options
# for this script/function.
#
#-----------------------------------------------------------------------
#
{ save_shell_opts; . $USHdir/preamble.sh; } > /dev/null 2>&1
#
#-----------------------------------------------------------------------
#
# Get the full path to the file in which this script/function is located
# (scrfunc_fp), the name of that file (scrfunc_fn), and the directory in
# which the file is located (scrfunc_dir).
#
#-----------------------------------------------------------------------
#
scrfunc_fp=$( $READLINK -f "${BASH_SOURCE[0]}" )
scrfunc_fn=$( basename "${scrfunc_fp}" )
scrfunc_dir=$( dirname "${scrfunc_fp}" )
#
#-----------------------------------------------------------------------
#
# Print message indicating entry into script.
#
#-----------------------------------------------------------------------
#
print_info_msg "
========================================================================
Entering script: \"${scrfunc_fn}\"
In directory: \"${scrfunc_dir}\"
This is the J-job script for the task that copies/fetches to a local
directory (either from disk or HPSS) the aqm boundary conditions from
which the model needs.
========================================================================"
#
#-----------------------------------------------------------------------
#
# Set the name of and create the directory in which the output from this
# script will be placed (if it doesn't already exist).
#
#-----------------------------------------------------------------------
#
if [ $RUN_ENVIR = "nco" ]; then
export INPUT_DATA="${COMIN}"
else
export INPUT_DATA="${COMIN}${SLASH_ENSMEM_SUBDIR}/INPUT"
fi
mkdir_vrfy -p "${INPUT_DATA}"
#
#-----------------------------------------------------------------------
#
# Set the run directory
#
#-----------------------------------------------------------------------
#
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}}"
mkdir_vrfy -p "${DATA}"
#
#-----------------------------------------------------------------------
#
# Call the ex-script for this J-job and pass to it the necessary variables.
#
#-----------------------------------------------------------------------
#
$SCRIPTSdir/exregional_aqm_lbcs.sh || \
print_err_msg_exit "\
Call to ex-script corresponding to J-job \"${scrfunc_fn}\" failed."
#
#-----------------------------------------------------------------------
#
# Run job postamble.
#
#-----------------------------------------------------------------------
#
job_postamble
#
#-----------------------------------------------------------------------
#
# Restore the shell options saved at the beginning of this script/function.
#
#-----------------------------------------------------------------------
#
{ restore_shell_opts; } > /dev/null 2>&1

101 changes: 101 additions & 0 deletions jobs/JREGIONAL_BIAS_CORRECTION_O3
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#!/bin/bash

#
#-----------------------------------------------------------------------
#
# This script runs BIAS-CORRECTION-O3.
#
#-----------------------------------------------------------------------
#

#
#-----------------------------------------------------------------------
#
# Source the variable definitions file and the bash utility functions.
#
#-----------------------------------------------------------------------
#
. $USHdir/source_util_funcs.sh
source_config_for_task "cpl_aqm_parm|task_run_post" ${GLOBAL_VAR_DEFNS_FP}
. $USHdir/job_preamble.sh
#
#-----------------------------------------------------------------------
#
# Save current shell options (in a global array). Then set new options
# for this script/function.
#
#-----------------------------------------------------------------------
#
{ save_shell_opts; . $USHdir/preamble.sh; } > /dev/null 2>&1
#
#-----------------------------------------------------------------------
#
# Get the full path to the file in which this script/function is located
# (scrfunc_fp), the name of that file (scrfunc_fn), and the directory in
# which the file is located (scrfunc_dir).
#
#-----------------------------------------------------------------------
#
scrfunc_fp=$( $READLINK -f "${BASH_SOURCE[0]}" )
scrfunc_fn=$( basename "${scrfunc_fp}" )
scrfunc_dir=$( dirname "${scrfunc_fp}" )
#
#-----------------------------------------------------------------------
#
# Print message indicating entry into script.
#
#-----------------------------------------------------------------------
#
print_info_msg "
========================================================================
Entering script: \"${scrfunc_fn}\"
In directory: \"${scrfunc_dir}\"
This is the J-job script for the task that runs BIAS-CORRECTION-O3.
========================================================================"
#
#-----------------------------------------------------------------------
#
# Set the run directory.
#
#-----------------------------------------------------------------------
#
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}}"

export PARMaqm_utils="${PARMaqm_utils:-${HOMEdir}/sorc/AQM-utils/parm}"

TMP_STDAY=`${NDATE} -8760 ${PDY}${cyc} | cut -c1-8` # 1 year back
# The earliest day of training data is August 1 2020
if [ ${TMP_STDAY} -le 20220810 ]; then
TMP_STDAY=20220810
fi
export BC_STDAY=${BC_STDAY:-${TMP_STDAY}}
#
#-----------------------------------------------------------------------
#
# Call the ex-script for this J-job and pass to it the necessary varia-
# bles.
#
#-----------------------------------------------------------------------
#
$SCRIPTSdir/exregional_bias_correction_o3.sh || \
print_err_msg_exit "\
Call to ex-script corresponding to J-job \"${scrfunc_fn}\" failed."
#
#-----------------------------------------------------------------------
#
# Run job postamble.
#
#-----------------------------------------------------------------------
#
job_postamble
#
#-----------------------------------------------------------------------
#
# Restore the shell options saved at the beginning of this script/func-
# tion.
#
#-----------------------------------------------------------------------
#
{ restore_shell_opts; } > /dev/null 2>&1

Loading

0 comments on commit 23b9852

Please sign in to comment.