#!/bin/bash set -xa ############################################################# # NARRE getnam # 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} ############################################################### # 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 # ################################### # 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} if [ -d $DATA ]; then rm -rf $DATA; fi mkdir -p -m 775 $DATA/getnam mkdir -m 775 $DATA_IN # #set flag here to avoid three narre jobs making the working diretory at the same time # ecflow_client --event release_getrap cd $DATA/getnam 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} # Run setpdy and initialize PDY variables setpdy.sh . ./PDY ############################################## # Define NAM COMIN directories ############################################## export COMINnam=${COMINnam:-$(compath.py $envir/nam/${nam_ver})} ################################## ####################################################### # Pass information which is needed to run the Script ####################################################### export VERBOSE=YES #env ################################################### # Execute the Scripts # get NAM data rm -f poescript echo "#!/bin/sh" > poescript cat poescript echo "$SCRIPTSnarre/exnarre_getnam.sh 130 >$DATA/getnam130.out 2>&1" >> poescript echo "$SCRIPTSnarre/exnarre_getnam.sh 242 >$DATA/getnam242.out 2>&1" >> poescript chmod 775 poescript # # Execute the script. mpiexec --cpu-bind core --configfile ./poescript export err=$?; err_chk set +x echo "######################################" echo " GETNAM130.OUT " echo "######################################" set -x cat $DATA/getnam130.out set +x echo "######################################" echo " GETNAM242.OUT " echo "######################################" set -x cat $DATA/getnam242.out msg="JOB $job HAS COMPLETED NORMALLY." postmsg "$msg" echo "keep $DATA for narre_ensprod jobs" date