#!/bin/ksh set -xa export MP_IOAGENT_CNT=all export MP_IO_BUFFER_SIZE=8M ######################################## # HRRR Preliminary data setup step ######################################## ###################################################### # 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} ################################### # 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}${PACKAGEROOT}/parm/${package_name}_para_config export userid=${userid:-$LOGNAME} fi export PS4='$SECONDS + ' date #################################### # obtain unique process id (pid) and make temp directory #################################### export DATA=${DATAROOT}/hrrr_${dom}_makeguess_${envir}_${cyc} mkdir -p $DATA cd $DATA export cycle=t${cyc}z export cycm1=`expr $cyc - 1` export cycm2=`expr $cyc - 2` export cycm3=`expr $cyc - 3` export cycm4=`expr $cyc - 4` cycm1=$(printf "%02d" $cycm1) if [ "$cyc" = 00 ]; then cycm1=23 cycm2=22 cycm3=21 cycm4=20 elif [ "$cyc" = 01 ]; then cycm1=$(printf "%02d" $cycm1) cycm2=23 cycm3=22 cycm4=21 elif [ "$cyc" = 02 ]; then cycm1=$(printf "%02d" $cycm1) cycm2=$(printf "%02d" $cycm2) cycm3=23 cycm4=22 elif [ "$cyc" = 03 ]; then cycm1=$(printf "%02d" $cycm1) cycm2=$(printf "%02d" $cycm2) cycm3=$(printf "%02d" $cycm3) cycm4=23 else cycm1=$(printf "%02d" $cycm1) cycm2=$(printf "%02d" $cycm2) cycm3=$(printf "%02d" $cycm3) cycm4=$(printf "%02d" $cycm4) fi echo $cyc echo $cycm1 echo $cycm2 echo $cycm3 echo $cycm4 export tmmark=tm00 export pgmout="OUTPUT.$$" #################################### # SENDECF - Flag Events on ECF # SENDCOM - Copy files to /com directory #################################### export SENDECF=${SENDECF:-YES} export SENDCOM=${SENDCOM:-YES} export SENDDBN=${SENDDBN:-YES} #################################### # Specify Execution Areas #################################### export HOMEhrrr=${HOMEhrrr:-${PACKAGEROOT}/${NET}.${hrrr_ver}} export EXEChrrr=${EXEChrrr:-${HOMEhrrr}/exec} export FIXhrrr=${FIXhrrr:-${HOMEhrrr}/fix/${dom}} export PARMhrrr=${PARMhrrr:-${HOMEhrrr}/parm/${dom}} export USHhrrr=${USHhrrr:-${HOMEhrrr}/ush/${dom}} ########################################### # Run setpdy and initialize PDY variables ########################################### setpdy.sh . PDY ############################################## # Define COM directories ############################################## # for testing with canned data #export COMROOT=${COMROOT:-/lfs/h2/emc/ptmp/Benjamin.Blake/com} #export COM=${COM:-${COMROOT}/${NET}/${hrrr_ver}/${RUN}.${PDY}} #export COMIN=${COMIN:-${COMROOT}/${NET}/${hrrr_ver}/${RUN}.${PDY}/${dom}} #export COMOUT=${COMOUT:-${COMROOT}/${NET}/${hrrr_ver}/${RUN}.${PDY}/${dom}} #export GESROOT=${GESROOT:-${COMROOT}/${NET}/${hrrr_ver}/nwges} # for WCOSS2 ops export COM=${COM:-$(compath.py ${envir}/${NET}/${hrrr_ver})/${RUN}.${PDY}} export COMIN=${COMIN:-$(compath.py ${envir}/${NET}/${hrrr_ver})/${RUN}.${PDY}/${dom}} export COMOUT=${COMOUT:-$(compath.py ${envir}/${NET}/${hrrr_ver})/${RUN}.${PDY}/${dom}} export GESROOT=${GESROOT:-$(compath.py ${envir}/${NET}/${hrrr_ver})/nwges} export COMRAP=${COMRAP:-$(compath.py $envir/rap/$rap_ver)} export HRRRDASENSP=${HRRRDASENSP:-$GESROOT/hrrrdasensp} export HRRRGESSFC=${HRRRGESSFC:-$GESROOT/hrrrges_sfc/${dom}} mkdir -m 775 -p $COM $COMOUT $HRRRGESSFC $HRRRDASENSP env ######################################################## # Execute the script. ${HRRR_MAKEGUESSSH:-$HOMEhrrr/scripts/${dom}/exhrrr_makeguess.sh} ######################################################## cat $pgmout msg="ENDED NORMALLY." postmsg "$jlogfile" "$msg" ############################## # Remove the Temporary working directory ############################## cd $DATA if [ ${KEEPDATA} = NO ] ; then rm -rf $DATA ; fi date