#!/bin/sh set -xa ############################################################# # NARRE getrap # 10/17/2011 Binbin Zhou, modified from Jun Du's SREF job # 12/15/2011 Xiaoxue Wang, modified to NCO/EMC template # 12/10/2012 Binbin Zhou, moved to WCOSS ############################################################# ###################################################### # The following two variable could be defined in the # loadleveler submission script (the sms 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:-narre} export RUN=${RUN:-narre} ############################################################### if [ "$RUN_ENVIR" != nco ]; then typeset -Z2 cyc export cyc=$1 export envir=dev export DATA=/lfs/h2/emc/ptmp/Binbin.Zhou/narre/tmpnwprd1/narre_${cyc}_${envir} export DATA_IN=/lfs/h2/emc/ptmp/Binbin.Zhou/narre/tmpnwprd1/narre_${cyc}_${envir}/misc export COMOUT=/lfs/h2/emc/ptmp/Binbin.Zhou/narre/com/${NET}/${envir}/${RUN}.${PDY}/ensprod fi # ################################### # SET SHELL PROCESSING VARIABLES # ################################### export PS4='$SECONDS + ' date export DATA=${DATA:-$DATAROOT/narre_${cyc}_${envir}} export DATA_IN=${DATA_IN:-$DATAROOT/narre_${cyc}_${envir}/misc} mkdir -p -m 775 $DATA/getrap cd $DATA/getrap export cycle=t${cyc}z export MP_HOLDTIME=1000 export MP_LABELIO=YES 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:-NO} #################################### # Specify Execution Areas #################################### export HOMEnarre=${HOMEnarre:-${PACKAGEROOT}/${RUN}.${narre_ver}} export EXECnarre=${EXECnarre:-${HOMEnarre}/exec} export FIXnarre=${FIXnarre:-$HOMEnarre/fix} export PARMnarre=${PARMnarre:-$HOMEnarre/parm} export USHnarre=${USHnarre:-$HOMEnarre/ush} export SCRIPTSnarre=${SCRIPTSnarre:-$HOMEnarre/scripts} msg="JOB $job HAS BEGUN" postmsg "$msg" # # Run setpdy and initialize PDY variables # setpdy.sh . ./PDY ############################################## # Define COM directories ############################################## export COMINrap=${COMINrap:-$(compath.py $envir/rap/${rap_ver})} ################################## ####################################################### # Pass information which is needed to run the Script ####################################################### export VERBOSE=YES env ################################################### # Execute the Scripts # get RAP data rm -f poescript echo "#!/bin/sh" > poescript echo "$SCRIPTSnarre/exnarre_getrap.sh 130 >$DATA/getrap130.out 2>&1" >> poescript echo "$SCRIPTSnarre/exnarre_getrap.sh 242 >$DATA/getrap242.out 2>&1" >> poescript chmod 775 poescript # # Execute the script. mpiexec --cpu-bind core --configfile ./poescript export err=$?; err_chk set +x echo "######################################" echo " GETRAP130.OUT " echo "######################################" set -x cat $DATA/getrap130.out set +x echo "######################################" echo " GETRAP242.OUT " echo "######################################" set -x cat $DATA/getrap242.out msg="JOB $job HAS COMPLETED NORMALLY." postmsg "$jlogfile" "$msg" echo "Keep $DATA for narre_ensprod jobs..." date