#!/bin/bash date export PS4='+ $SECONDS + ' set -xue #----------------------------------------------------------------------- export USHaqm=${USHaqm:-${HOMEaqm}/ush} export PARMaqm=${PARMaqm:-${HOMEaqm}/parm} export subcyc=0 export pid=${pid:-$$} export outid=${outid:-"LL$job"} export DATA=${DATA:-${DATAROOT}/${jobid}} mkdir -p ${DATA} cd ${DATA} . $USHaqm/aqm_nco_config.sh . $USHaqm/source_util_funcs.sh export cycle=${cycle:-t${cyc}z} setpdy.sh . ./PDY . $USHaqm/job_preamble.sh export SENDDBN=${SENDDBN:-YES} export SENDECF=${SENDECF:-YES} export SENDCOM=${SENDCOM:-YES} export SENDDBN_NTC=${SENDDBN_NTC:-NO} export EXECaqm=${EXECaqm:-${HOMEaqm}/exec} export PARMaqm=${PARMaqm:-${HOMEaqm}/parm} export FIXaqm=${FIXaqm:-${HOMEaqm}/fix} export COMIN="${COMIN:-$(compath.py ${NET}/${aqm_ver}/${RUN}.${PDY})}" export COMINm1="${COMINm1:-$(compath.py ${NET}/${aqm_ver}/${RUN}.${PDYm1})}" export COMOUT="${COMOUT:-$(compath.py -o ${NET}/${aqm_ver}/${RUN}.${PDY}/${cyc})}" export DCOMINairnow="${DCOMINairnow:-${DCOMROOT}}" export COMINbicor="${COMINbicor:-$(compath.py ${NET}/${aqm_ver})}" export COMOUTbicor="${COMOUTbicor:-$(compath.py -o ${NET}/${aqm_ver})}" #----------------------------------------------------------------------- # 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-PM25. ========================================================================" # #----------------------------------------------------------------------- # Set the run directory. #----------------------------------------------------------------------- # DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}/tmp_BIAS_CORRECTION_PM25}" if [ "${cyc}" = "06" ] || [ "${cyc}" = "12" ]; then export COMOUTwmo=${COMOUTwmo:-${COMOUT}/wmo} if [ ! -d "${COMOUTwmo}" ]; then mkdir -p "${COMOUTwmo}" fi fi export PARMaqm_utils="${PARMaqm_utils:-${HOMEaqm}/parm/aqm_utils}" TMP_STDAY=`${NDATE} -2160 ${PDY}${cyc} | cut -c1-8` # 1 year back export BC_STDAY=${BC_STDAY:-${TMP_STDAY}} #env #----------------------------------------------------------------------- # Call the ex-script for this J-job and pass to it the necessary varia- # bles. #----------------------------------------------------------------------- # ${HOMEaqm}/scripts/exaqm_bias_correction_pm25.sh export err=$?; err_chk # #====================================================================== msg="JOB ${job} HAS COMPLETED NORMALLY." postmsg "${msg}" if [ "${KEEPDATA}" != "YES" ]; then rm -rf ${DATA} fi #======================================================================= # Print exit message print_info_msg " ======================================================================== Exiting script: \"${scrfunc_fn}\" In directory: \"${scrfunc_dir}\" ========================================================================" # #----------------------------------------------------------------------- # Restore the shell options saved at the beginning of this script/func- # tion. #----------------------------------------------------------------------- # { restore_shell_opts; } > /dev/null 2>&1 date