#!/bin/bash #PBS -N obsproc_%JTYP%_dump_post_%PDY%_%CC%_%DESC% #PBS -j oe #PBS -l walltime=00:10:00 #PBS -A OBSPROC-DEV #PBS -q dev #PBS -l place=vscatter,select=1:ncpus=1:mem=2500MB #PBS -l debug=true ############################################## ## Submit notes: ## Run from [ps]tmp when running manually ## When running from cron, output is written to /u/$USER. Bottom of trigger mv's to stmp ## For specific PDY: ## > jtyp=rtma cyc=14 PDY=20170126 desc=somethingfun /u/Shelley.Melchior/bin/cycqsub /path/to/triggers/jrtma_dump_post.wc2.pbs ## cycqsub location: /u/Shelley.Melchior/bin ############################################### set -xu export envir=prod export cyc=%CC% export cycM=%CCM% DESC=%DESC% JTYP=%JTYP% # Test if this is an hourly RTMA run or a Rapid Update RTMA run; assign job accordingly if [ -z "$cycM" ]; then export job=${JTYP}_dump_post_$cyc else export job=${JTYP}_ru_dump_post_${cyc}${cycM} fi export PDY=%PDY% userROOT=/lfs/h2/emc/obsproc/noscrub/$USER export obsproc_ver=v1.0 export obsproc_ver_pckg=v1.0.0 #export bufr_dump_ver=1.0.0 export obsNET=obsproc PACKAGEROOTpara=/lfs/h1/ops/para/packages #export HOMEobsproc=${PACKAGEROOTpara}/obsproc.${obsproc_ver_pckg} # NCO para #export HOMEobsproc=${PACKAGEROOT}/obsproc.${obsproc_ver_pckg} # NCO prod export HOMEobsproc=${userROOT}/install/obsproc-rmprep # local VERSION_FILE=${HOMEobsproc}/versions/run.ver if [ -f $VERSION_FILE ]; then . $VERSION_FILE else echo "Need version info ... Exiting" exit 7 fi # Load the modules specified in $VERSION_FILE module load grib_util/${grib_util_ver} module load netcdf/${netcdf_ver} module load intel/${intel_ver} module load craype/${craype_ver} module load cray-mpich/${cray_mpich_ver} module load cray-pals/${cray_pals_ver} module load cfp/${cfp_ver} # use para installation #module use /apps/ops/para/nco/modulefiles/compiler/intel/19.1.3.304 # use local bufr_dump installation module unload bufr_dump #module use ${userROOT}/install/bufr_dump/modulefiles module use ${userROOT}/install/bufr-dump-rel.1.0.0/modulefiles module load bufr_dump/${bufr_dump_ver} # Be sure the modules are loaded if [[ $(echo $LOADEDMODULES | egrep -c "(^|:)prod_util/") -eq 0 ]]; then echo "prod_util is not loaded!"; fi if [[ $(echo $LOADEDMODULES | egrep -c "(^|:)prod_envir/") -eq 0 ]]; then echo "prod_envir is not loaded!"; fi if [[ $(echo $LOADEDMODULES | egrep -c "(^|:)grib_util/") -eq 0 ]]; then echo "grib_util is not loaded!"; fi if [[ $(echo $LOADEDMODULES | egrep -c "(^|:)netcdf/") -eq 0 ]]; then echo "netcdf is not loaded!"; fi if [[ $(echo $LOADEDMODULES | egrep -c "(^|:)bufr_dump/") -eq 0 ]]; then echo "bufr_dump is not loaded!"; fi if [[ $(echo $LOADEDMODULES | egrep -c "(^|:)intel/") -eq 0 ]]; then echo "intel is not loaded!"; fi if [[ $(echo $LOADEDMODULES | egrep -c "(^|:)craype/") -eq 0 ]]; then echo "craype is not loaded!"; fi if [[ $(echo $LOADEDMODULES | egrep -c "(^|:)cray-mpich/") -eq 0 ]]; then echo "cray-mpich is not loaded!"; fi if [[ $(echo $LOADEDMODULES | egrep -c "(^|:)cray-pals/") -eq 0 ]]; then echo "cray-pals is not loaded!"; fi if [[ $(echo $LOADEDMODULES | egrep -c "(^|:)cfp/") -eq 0 ]]; then echo "cfp is not loaded!"; fi export SENDECF=NO export SENDDBN=NO export SENDSDM=NO export DATAROOT=/lfs/h2/emc/stmp/${USER} if [ -z "$cycM" ]; then export jlogfile=/lfs/h2/emc/stmp/${USER}/${JTYP}.${PDY}.jlogfile else export jlogfile=/lfs/h2/emc/stmp/${USER}/${JTYP}_ru.${PDY}.jlogfile fi export COMOUT_ROOT=/lfs/h3/emc/stmp/${USER}/CRON/${DESC}/com export COMIN_ROOT=/lfs/h3/emc/stmp/${USER}/CRON/${DESC}/com if [ -z "$cycM" ]; then export COMIN=${DATAROOT}/CRON/${DESC}/com/${obsNET}/$obsproc_ver/${JTYP}.${PDY} export COMOUT=${DATAROOT}/CRON/${DESC}/com/${obsNET}/$obsproc_ver/${JTYP}.${PDY} else export COMIN=${DATAROOT}/CRON/${DESC}/com/${obsNET}/$obsproc_ver/${JTYP}_ru.${PDY} export COMOUT=${DATAROOT}/CRON/${DESC}/com/${obsNET}/$obsproc_ver/${JTYP}_ru.${PDY} fi export LOUD=on export DEBUG_LEVEL=3 export KEEPDATA=YES $HOMEobsproc/jobs/JOBSPROC_RTMA_DUMP_POST err=$? # When run from cron, the stdout is written to /u/$USER # mv to stmp pbsjobid=$(echo $PBS_JOBID | cut -d'.' -f1) cronlogfile=/u/$USER/$PBS_JOBNAME.o$pbsjobid outputdir=/lfs/h2/emc/stmp/${USER}/CRON/${DESC}/output if [ -f "$cronlogfile" ]; then mkdir -p $outputdir mv $cronlogfile ${outputdir}/$PBS_JOBNAME.o$pbsjobid fi exit