#!/bin/ksh set -xa ######################################## # HRRR Clean-up Jon ######################################## ###################################################### # The following two variable could be defined in the # loadleveler submission script (the ecf script), if # not they will take the default values which is set # for the NCO running enviroment ####################################################### export RUN_ENVIR=${RUN_ENVIR:-nco} export SENDECF=${SENDECF:-YES} ################################### # Specify NET and RUN Name and model #################################### export NET=${NET:-hrrr} export RUN=${RUN:-hrrr} export model=${model:-hrrr} ##################################################################################### # This block is for Developer's test run: # Run config file to get input parameters # This config file should define the following variables # DATA_IN: Location of working directory, default to ${DATAROOT} # SENDECF: If the job is to be running using ECF, default to YES # SENDDBN: Set to NO for developers, default to YES # COM_IN: Directory for input files, default to ${COMROOT}/$NET/${envir} # COM_OUT: Directory for output file, default to ${COMROOT}/$NET/${envir} # gespath: Directory for the guess or restart files, default to ${GESROOT}/${envir} ##################################################################################### if [ "$RUN_ENVIR" != nco ] ### For Developers, "group_name" is passed from the ECF script then group_name=${group_name:-meso} package_name=${package_name:-hrrr} . /${group_name}/save/${LOGNAME}/${package_name}${PACKAGEROOTprod}/parm/${package_name}_para_config export userid=${userid:-$LOGNAME} export DATA_IN=${DATA_IN:-/ptmp/$userid} fi export PS4='$SECONDS + ' date #################################### # obtain unique process id (pid) and make temp directory #################################### export DATA_IN=${DATA_IN:-${DATAROOT}} export DATA=$DATA_IN/${jobid} mkdir -p $DATA cd $DATA export cycle=t${cyc}z export tmmark=tm00 export pgmout="OUTPUT.$$" fhr=00 if [ $cyc -eq 00 -o $cyc -eq 06 -o $cyc -eq 12 -o $cyc -eq 18 ]; then endfhr=48 else endfhr=18 fi shh=$cyc FCSTDIR=$DATA_IN/hrrr_${dom}_fcst_${envir}_${cyc} while [ $fhr -le $endfhr ] do fhr=`printf %02d $fhr` if [ -s $FCSTDIR/fcstdone${fhr}??.${shh} ] then echo "found $fhr" fi let fhr=fhr+1 done cat $pgmout msg="ENDED NORMALLY." postmsg "$jlogfile" "$msg" ############################## # Remove the Temporary working directory ############################## cd $DATA_IN if [ ${KEEPDATA} = NO ] ; then rm -rf $DATA_IN/hrrr_${dom}_prep_radar_${envir}_${cyc} rm -rf $DATA_IN/hrrr_${dom}_prep_smoke_${envir}_${cyc} rm -rf $DATA_IN/hrrr_${dom}_ref2tten_${envir}_${cyc} rm -rf $DATA_IN/hrrr_${dom}_anl_${envir}_${cyc} rm -rf $DATA_IN/hrrr_${dom}_fcst_${envir}_${cyc} rm -rf $DATA_IN/hrrr_${dom}_postmgr_subh_${envir}_${cyc} fhr=00 while [ $fhr -le $endfhr ] do fhr=`printf %02d $fhr` rm -rf hrrr_${dom}_post_${envir}_${cyc}_f${fhr}?? rm -rf $DATA_IN/hrrr_${dom}_wrfbufr_${envir}_${cyc}_f${fhr} let fhr=fhr+1 done rm -rf $DATA fi date