#!/bin/ksh ##################################################################### # 9/20/2009, Julia Zhu Scripts are modified to be sharable # between EMC and NCO # Please note that variable "RUN_ENVIR" is set and used # in the development enviroment only. ###################################################################### na=`basename $0` export PS4=' + $SECONDS $na $LINENO: ' export RUN_ENVIR=${RUN_ENVIR:-prod} echo `date` $0 `date -u` begin set -xa ########################################### # Run gefs_config to get input parameters ########################################### if [ "$RUN_ENVIR" = dev ] ### For Developers then # RLW 20141008 modify to obtain and use version for vertical structure . $basesource/nw$envir/*/versions/gefs_legacy.ver . $basesource/nw$envir/gefs_legacy.${gefs_legacy_ver}/parm/gefs_config fi #################################### # obtain unique process id (pid) and make temp directory #################################### export pid=$$ if [ "$RUN_ENVIR" = dev ] ### For Developers then export DATA_IN=${DATA_IN:-$basetmp/tmpnwprd1} else ### For Operations export DATA_IN=$DATAROOT fi #export DATA=$DATA_IN/${job}.${pid} export DATA=${DATA:-$DATA_IN/${job}.${pid}} mkdir -p $DATA cd $DATA export cycle=t${cyc}z #################################### # Specify NET and RUN Name and model #################################### export NET=gens #################################### # File To Log Msgs #################################### if [ "$RUN_ENVIR" = dev ] ### For Developers then export jlogfile=${jlogfile:-$baselog/com/logs/jlogfile} fi export jlogfile=${jlogfile:-${DATA}/jlogfile} #################################### # Determine Job Output Name on System #################################### export outid="LL$job" export jobid="${outid}.o${pid}" export pgmout="OUTPUT.${pid}" export pgmerr=errfile #################################### # SENDECF - Flag Events on ECF # SENDCOM - Copy Files From TMPDIR to $COMOUT # SENDDBN - Issue DBNet Client Calls #################################### if [ "$RUN_ENVIR" = dev ] ### For Developers then export SENDCOM=${SENDCOM:-YES} export SENDDBN=${SENDDBN:-NO} export SENDECF=${SENDECF:-YES} # Specify Execution Areas export HOMEGLOBAL=${HOMEGLOBAL:-/nw${envir}} export EXECGLOBAL=${EXECGLOBAL:-$HOMEGLOBAL/exec} export USHGLOBAL=${USHGLOBAL:-$HOMEGLOBAL/ush} export FIXGLOBAL=${FIXGLOBAL:-$HOMEGLOBAL/fix} export PARMGLOBAL=${PARMGLOBAL:-$HOMEGLOBAL/parm} # RLW 20141008 modify to obtain and use version for vertical structure export HOMEgefs=${HOMEgefs_legacy:-/gpfs/dell1/nco/ops/nw${envir}/gefs_legacy.${gefs_legacy_ver}} export EXECgefs=${EXECgefs:-$HOMEgefs/exec} export USHgefs=${USHgefs:-$HOMEgefs/ush} export FIXgefs=${FIXgefs:-$HOMEgefs/fix} export PARMgefs=${PARMgefs:-$HOMEgefs/parm} else ### For Operations export SENDCOM=YES export SENDDBN=NO export SENDECF=YES # RLW 20141008 modify to obtain and use version for vertical structure export HOMEgefs=${HOMEgefs_legacy:-/nw${envir}/gefs_legacy.${gefs_legacy_ver}} export EXECgefs=$HOMEgefs/exec export USHgefs=$HOMEgefs/ush export FIXgefs=$HOMEgefs/fix export PARMgefs=$HOMEgefs/parm # Specify Execution Areas export HOMEGLOBAL=${HOMEGLOBAL:-${HOMEgefs}} export EXECGLOBAL=$HOMEGLOBAL/exec export USHGLOBAL=$HOMEGLOBAL/ush export FIXGLOBAL=$HOMEGLOBAL/fix export PARMGLOBAL=$HOMEGLOBAL/parm fi #################################### # Specify Execution Areas #################################### # JY -remove the following 02/07 ? #export GRBINDEX=/nwprod/util/exec/grbindex #export HOMEUTIL=/nwprod/util #export EXECUTIL=$HOMEUTIL/exec #export FIXUTIL=$HOMEUTIL/fix ############################## # Set up the UTILITIES ############################## #export utilscript=/nwprod/util/ush ############################## # Run setup to initialize working directory and utility scripts ############################## #ksh $utilscript/setup.sh ############################## # Run setpdy and initialize PDY variables ############################## #sh $utilscript/setpdy.sh sh setpdy.sh . PDY ############################################## # Define COM directories ############################################## if [ "$RUN_ENVIR" = dev ] ### For Developers then export COM_IN=${COM_IN:-/global/noscrub/$LOGBAME/com/${NET}/${envir}} export COM_OUT=${COM_OUT:-/global/noscrub/$LOGBAME/com/${NET}/${envir}} export COMIN=$COM_IN/gefs_legacy.${PDY} export COMOUT=$COM_OUT/gefs_legacy.${PDY} else ### For Operations export COMIN=$COMROOT/${NET}/${envir}/gefs_legacy.${PDY} export COMOUT=$COMROOT/${NET}/${envir}/gefs_legacy.${PDY} fi ############################################## echo set parameters using gefs.parm ############################################## . $PARMgefs/gefs.parm case $cyc in 00) export fhmax=$fhmax00;; 06) export fhmax=$fhmax06;; 12) export fhmax=$fhmax12;; 18) export fhmax=$fhmax18;; esac #################################### # Create member list #################################### if [[ $RUN_CONCURRENT = yes ]]; then memberlist="" (( imem = 0 )) while (( imem < npair * 2 )) do (( imem = imem + 1 )) if (( imem < 10 )); then imem=0$imem fi memberlist="$memberlist p$imem" done if (( cyc == cyc_fcst )); then memberlist="$memberlist c00" fi else memberlist=`echo $RUN | cut -c3-5` fi echo memberlist=$memberlist export memberlist ################################################################# # Set Limits for Restart files # # Set fhrmirrorlist to select the forecast hours at which restart # files should be renamed and moved to restartb . # # Select only as many hours as can be mirrored to the other # computer # To avoid copying incomplete sets of files, do not include # consecutive times; the interval between hours in the list # should be at least 36 . # To avoid interference with model restarts, do not include hours # at which the model is restarted (currently 126 and 180) or # the previous hours at which restart files are written # (currently 108 and 162) ################################################################# if [[ $FORECAST_SEGMENT = hr ]]; then if (( cyc == cyc_fcst )); then export fhrmirrorlist="36 72 108 144" export fhrmirrorlist="42 84 126 168" export fhrini=0 export fhrlim=$fhmaxh else export fhrmirrorlist="210 252 294 336 378" export fhrini=$(( fhmaxh - HOUTSPS )) export fhrlim=$fhmax fi else export fhrmirrorlist="18 54 90 144 198 234 270 306 342 378" export fhrmirrorlist="36 72 108 144 216 252 288 324 360" export fhrmirrorlist="42 84 126 168 210 252 294 336 378" export fhrini=0 export fhrlim=$fhmax fi export fhrint=$fhrestart if (( fhrint > fhrestart3 )); then fhrint=fhrestart3 fi fhrfirst=$fhmax fhrlast=0 echo fhrini=$fhrini fhrlim=$fhrlim before modification echo fhrmirrorlist=$fhrmirrorlist for fhr in $fhrmirrorlist do if (( fhrfirst > fhr )); then fhrfirst=$fhr fi if (( fhrlast < fhr )); then fhrlast=$fhr fi done echo fhrfirst=$fhrfirst fhrlast=$fhrlast if (( fhrini < fhrfirst )); then fhrini=$fhrfirst fi if (( fhrlim > fhrlast )); then fhrlim=$fhrlast fi echo fhrini=$fhrini fhrlim=$fhrlim after modification echo env | sort echo ########################################################### # copy restart files ########################################################### echo `date` $HOMEgefs/scripts/exgefs_restart_copy.sh.ecf before $HOMEgefs/scripts/exgefs_restart_copy.sh.ecf echo `date` $HOMEgefs/scripts/exgefs_restart_copy.sh.ecf after ######################################################## export PS4=' + $SECONDS $na $LINENO: ' ############################## # Remove the Temporary working directory ############################## cd $DATA_IN rm -rf $DATA echo `date` $0 `date -u` end