#!/bin/sh set -xa ######################################### # NARRE ensprod # 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 # 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} ############################################################### # This block can be modified for different Production test # environment. This is used for operational testings ############################################################### 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 export PS4='$SECONDS + ' date ######################################### # obtain unique process id (pid) and make temp directories ######################################### export DATA=${DATA:-$DATAROOT/narre_${cyc}_${envir}} export DATA_IN=${DATA_IN:-$DATAROOT/narre_${cyc}_${envir}/misc} mkdir -p $DATA/ensprod $DATA_IN cd $DATA/ensprod 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:-YES} #################################### # 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 COMOUT=${COMOUT:-$(compath.py -o ${NET}/${narre_ver})/${RUN}.${PDY}/ensprod} ######################################################## mkdir -p $COMOUT ####################################################### # Pass information which is needed to run the Script ####################################################### export VERBOSE=YES env ################################################### # Execute the Scripts # Run product generator ################################################### mkdir -m 775 $DATA/ensprod/130 mkdir -m 775 $DATA/ensprod/242 rm -f poescript echo "#!/bin/sh" > poescript echo "$SCRIPTSnarre/exnarre_ensprod.sh 130 > $DATA/ensprod/130.out 2>&1" >> poescript echo "$SCRIPTSnarre/exnarre_ensprod.sh 242 > $DATA/ensprod/242.out 2>&1" >> poescript chmod 775 poescript mpiexec --cpu-bind core --configfile ./poescript export err=$?; err_chk set +x echo "######################################" echo " ENS130.OUT " echo "######################################" set -x cat $DATA/ensprod/130.out set +x echo "######################################" echo " ENS242.OUT " echo "######################################" set -x cat $DATA/ensprod/242.out msg="JOB $job HAS COMPLETED NORMALLY." postmsg "$msg" cd $DATAROOT if [ "$KEEPDATA" != "YES" ]; then rm -rf $DATA fi date