#!/bin/bash date export PS4='+ $SECONDS + ' set -xue #----------------------------------------------------------------------- export USHaqm=${USHaqm:-${HOMEaqm}/ush} export PARMaqm=${PARMaqm:-${HOMEaqm}/parm} export subcyc=0 export SLASH_ENSMEM_SUBDIR='' 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 export CDATE=${PDY}${cyc} . $USHaqm/job_preamble.sh export FIXaqmconfig="${FIXaqmbio:-${HOMEaqm}/fix/aqm/epa/data}" export FIXaqmbio="${FIXaqmbio:-${HOMEaqm}/fix/bio}" export FIXaqmdust="${FIXaqmdust:-${HOMEaqm}/fix/dust}" export FIXaqmcanopy="${FIXaqmcanopy:-${HOMEaqm}/fix/canopy}" export FIXaqmnexus="${FIXaqmnexus:-${HOMEaqm}/fix/nexus}" export FIXaqmnexus_gfs_sfc="${FIXaqmnexus:-${HOMEaqm}/fix/gfs}" export EXECaqm=${EXECaqm:-${HOMEaqm}/exec} export PARMaqm=${PARMaqm:-${HOMEaqm}/parm} export FIXaqm=${FIXaqm:-${HOMEaqm}/fix} export FIXemis="${FIXemis:-${FIXaqm}/emission}" export COMINgfs="${COMINgfs:-$(compath.py gfs/${gfs_ver})}" export COMIN="${COMIN:-$(compath.py ${NET}/${aqm_ver}/${RUN}.${PDY})}" export COMOUT="${COMOUT:-$(compath.py -o ${NET}/${aqm_ver}/${RUN}.${PDY}/${cyc})}" #----------------------------------------------------------------------- # 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 generates the emission files using NEXUS which will output for FV3 (in NetCDF format). ========================================================================" # #----------------------------------------------------------------------- # Set the name of and create the directory in which the output from this # script will be placed (if it doesn't already exist). #----------------------------------------------------------------------- # export INPUT_DATA="${INPUT_DATA:-${COMIN}/${cyc}/NEXUS}" mkdir -p ${INPUT_DATA} # #----------------------------------------------------------------------- # Set the run directory #----------------------------------------------------------------------- # DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}/tmp_NEXUS_EMISSION_${nspt}}" # #----------------------------------------------------------------------- # Set environment only when RUN_TASK_NEXUS_GFS_SFC is false. #----------------------------------------------------------------------- # if [ "${RUN_TASK_NEXUS_GFS_SFC}" = "FALSE" ]; then export TIME_OFFSET_HRS=${NEXUS_GFS_SFC_OFFSET_HRS:-0} yyyymmdd=${PDY} hh=${cyc} export GFS_SFC_CDATE=`$NDATE -${TIME_OFFSET_HRS} $PDY$cyc` SLASH_ENSMEM_SUBDIR=${SLASH_ENSMEM_SUBDIR:-""} export GFS_SFC_STAGING_DIR="${COMIN}${SLASH_ENSMEM_SUBDIR}/tmp_NEXUS_GFS_SFC}" fi # #----------------------------------------------------------------------- # Call the ex-script for this J-job. #----------------------------------------------------------------------- # ${HOMEaqm}/scripts/exaqm_nexus_emission.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