#!/bin/ksh #PBS -N paraUmxmit #PBS -o /lfs/h2/emc/ptmp/manuel.pondeca/airportproj/para_urma2p5_2dvar/logs/urma_mintmaxt_prep.out #PBS -e /lfs/h2/emc/ptmp/manuel.pondeca/airportproj/para_urma2p5_2dvar/logs/urma_mintmaxt_prep.out #PBS -l select=1:ncpus=1:mem=4000MB #PBS -l walltime=00:30:00 #PBS -q "dev" #PBS -A RTMA-DEV set -ax echo "Master Host: $PBS_O_HOST" echo "Nodes:"; cat $PBS_NODEFILE echo "PBS_O_WORKDIR= $PBS_O_WORKDIR" export ntasks=1 export ppn=1 export threads=1 export configfile=/lfs/h2/emc/ptmp/$USER/airportproj/config/urma/para/urma2p5/urma2p5_envir.sh source $configfile MYCOMROOT=$COMROOT #Add this to preserve $COMROOT value which is unset iI believe in purge / 2 Nov2021 iflg0=+1 if (((${cyc} == ${cyc_mitm_m1}) && (${minmaxt_prep_flg} == ${iflg0}))) ; then echo "test" if [[ $thismachine == 'IBM' ]] ; then . /usrx/local/Modules/3.2.9/init/ksh module purge module load ics/14.0.2 module load prod_util module load grib_util/v1.0.5 elif [[ $thismachine == 'DELL' ]] ; then . /usrx/local/prod/lmod/lmod/init/ksh module purge module load ips/18.0.1.163 module load prod_util/1.1.0 module load grib_util/1.0.6 elif [[ $thismachine == 'CRAY' ]] ; then echo "test" . /usr/share/lmod/lmod/init/ksh module purge moduledir=$HOMEurma/emc/modulefiles/URMA module use ${moduledir} source $HOMEurma/versions/run.ver module load v${vernum}_for_${thismachine}.minmax module list echo $PATH sleep 1 fi echo "test" export PREP_MINMAXT_COMOUT=${PREP_MINMAXT_DIR} export COM_IN=${MYCOMROOT}/${NET}/${envir} export R_COM_IN=$MINMAXT_R_COM_IN export COM_IN_ALT=$MINMAXT_COM_IN_ALT export R_COM_IN_ALT=$MINMAXT_R_COM_IN_ALT export DATA=${DATA_MINT_PREP} mkdir -p $DATA cd $DATA export job=MINT_PREP export jlogfile=$jlogfile_mint_prep export pgmout=stdout_mint_prep if [[ $thismachine == 'IBM' ]] ; then sh $utilscript/setup.sh elif [[ $thismachine == 'DELL' ]] ; then cp $UTILROOT/ush/err_chk .; chmod +x err_chk cp $UTILROOT/ush/err_exit .; chmod +x err_exit cp $UTILROOT/ush/prep_step .; chmod +x prep_step cp $UTILROOT/ush/postmsg .; chmod +x postmsg cp $UTILROOT/ush/setpdy.sh .; chmod +x setpdy.sh elif [[ $thismachine == 'CRAY' ]] ; then sh $utilscript/setup.sh fi $lscripts_emc/ex${NET}_getminmaxt_input.sh "${minmaxt_grids}" export err=$?; err_chk ic=0 while [ $ic -le 10 ] ; do if [ -s $COMOUT/done_getminmaxt_input.txt ] ; then sleep 10 break else echo "run_mint_prep_ph2.ll: sleeping for 30 seconds" sleep 30 fi done export FIX${NET}=$FIXdir2 # export COMINobsproc_urma=$COMINobsproc_urma #just a reminder export COMOUT=$COMINobsproc_urma #location to write out mintobs file mkdir -p $COMOUT $lscripts_minmaxt/ex${NET}_mintobs.sh "${minmaxt_grids}" export err=$? #; err_chk #if obs job fails, go ahead and run other jobs. Analysis can run without obs if [[ $err -ne 0 ]] ; then msg="WARNING: URMA minT obs job failure for cycle ${PDY} (20Z URMA run). MinT analysis will run, but without obs" echo "$msg" | mail.py fi export FIX${NET}=$FIXdir2 export COM_IN=$PREP_MINMAXT_DIR export COMOUT2p5=${MYCOMROOT}/${NET}/${envir}/urma2p5.${PDY} ; mkdir -p $COMOUT2p5 #location to write out minT bckg and maxRH for conus export COMOUTak=${MYCOMROOT}/${NET}/${envir}/akurma.${PDY} ; mkdir -p $COMOUTak #location to write out minT bckg and maxRH for alaska export COMOUThi=${MYCOMROOT}/${NET}/${envir}/hiurma.${PDY} ; mkdir -p $COMOUThi #location to write out minT bckg and maxRH for hawaii export COMOUTpr=${MYCOMROOT}/${NET}/${envir}/prurma.${PDY} ; mkdir -p $COMOUTpr #location to write out minT bckg and maxRH for prico $lscripts_minmaxt/ex${NET}_mintbg.sh "${minmaxt_grids}" export err=$?; err_chk $lscripts_minmaxt/ex${NET}_maxrh.sh "${minmaxt_grids}" export err=$?; err_chk fi if (((${cyc} == ${cyc_mxtm_m1}) && (${minmaxt_prep_flg} == ${iflg0}))) ; then if [[ $thismachine == 'IBM' ]] ; then . /usrx/local/Modules/3.2.9/init/ksh module purge module load ics/14.0.2 module load prod_util module load grib_util/v1.0.5 elif [[ $thismachine == 'DELL' ]] ; then . /usrx/local/prod/lmod/lmod/init/ksh module purge module load ips/18.0.1.163 module load prod_util/1.1.0 module load grib_util/1.0.6 elif [[ $thismachine == 'CRAY' ]] ; then . /usr/share/lmod/lmod/init/ksh module purge moduledir=$HOMEurma/emc/modulefiles/URMA module use ${moduledir} source $HOMEurma/versions/run.ver module load v${vernum}_for_${thismachine}.minmax module list echo $PATH sleep 1 fi export PREP_MINMAXT_COMOUT=$PREP_MINMAXT_DIR export COM_IN=${MYCOMROOT}/${NET}/${envir} export R_COM_IN=$MINMAXT_R_COM_IN export COM_IN_ALT=$MINMAXT_COM_IN_ALT export R_COM_IN_ALT=$MINMAXT_R_COM_IN_ALT export DATA=${DATA_MAXT_PREP} mkdir -p $DATA cd $DATA export job=MAXT_PREP export jlogfile=$jlogfile_maxt_prep export pgmout=stdout_maxt_prep if [[ $thismachine == 'IBM' ]] ; then sh $utilscript/setup.sh elif [[ $thismachine == 'DELL' ]] ; then cp $UTILROOT/ush/err_chk .; chmod +x err_chk cp $UTILROOT/ush/err_exit .; chmod +x err_exit cp $UTILROOT/ush/prep_step .; chmod +x prep_step cp $UTILROOT/ush/postmsg .; chmod +x postmsg cp $UTILROOT/ush/setpdy.sh .; chmod +x setpdy.sh elif [[ $thismachine == 'CRAY' ]] ; then sh $utilscript/setup.sh fi $lscripts_emc/ex${NET}_getminmaxt_input.sh "${minmaxt_grids}" export err=$?; err_chk ic=0 while [ $ic -le 10 ] ; do if [ -s $COMOUT/done_getminmaxt_input.txt ] ; then sleep 10 break else echo "run_maxt_prep_ph2.ll: sleeping for 30 seconds" sleep 30 fi done export FIX${NET}=$FIXdir2 # export COMINobsproc_urma=$COMINobsproc_urma #just a reminder export COMOUT=$COMINobsproc_urma_m1 #location to write out maxtobs file mkdir -p $COMOUT $lscripts_minmaxt/ex${NET}_maxtobs.sh "${minmaxt_grids}" export err=$? #; err_chk #if obs job fails, go ahead and run other jobs. Analysis can run without obs if [[ $err -ne 0 ]] ; then msg="WARNING: URMA maxT obs job failure for cycle ${PDY} (08Z URMA run). MaxT analysis will run, but without obs" echo "$msg" | mail.py fi export FIX${NET}=$FIXdir2 export COM_IN=$PREP_MINMAXT_DIR export COMOUT2p5=${MYCOMROOT}/${NET}/${envir}/urma2p5.${PDYm1} ; mkdir -p $COMOUT2p5 #location to write out maxT bckg and minRH for conus export COMOUTak=${MYCOMROOT}/${NET}/${envir}/akurma.${PDYm1} ; mkdir -p $COMOUTak #location to write out maxT bckg and minRH for alaska export COMOUThi=${MYCOMROOT}/${NET}/${envir}/hiurma.${PDYm1} ; mkdir -p $COMOUThi #location to write out maxT bckg and minRH for hawaii export COMOUTpr=${MYCOMROOT}/${NET}/${envir}/prurma.${PDYm1} ; mkdir -p $COMOUTpr #location to write out maxT bckg and minRH for prico $lscripts_minmaxt/ex${NET}_maxtbg.sh "${minmaxt_grids}" export err=$?; err_chk $lscripts_minmaxt/ex${NET}_minrh.sh "${minmaxt_grids}" export err=$?; err_chk fi