#!/bin/bash ############################################ # Set up environment for ensemble products job # initial program, Jun Du, 2001 # change log: # 10/23/2003, Jun Du: use $REGPAIR (for Eta members) # and $RSMPAIR to replace $TOTALPAIR to # deal with different ensemble size in # the two components # 06/16/2005, Jun Du: (1) extend forecast lead time from 63hr # to 87hr; (2) call multiple grids in stead of # 212 one grid only # 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. # 11/15/2011, Jun Du: modified to new 2012 version of SREF (v6.0) # and added hourly output capability # 03/13/2019, Jun Du: Convert to Dell version ############################################ set -xa export OMP_NUM_THREADS=1 export MP_EUIDEVICE=sn_all export MP_EUILIB=us export MP_MPILIB=mpich2 export MP_TASK_AFFINITY=core:1 # # Specify whether the run is production or development # export RUN_ENVIR=${RUN_ENVIR:-nco} ##################################################################################### # Run config file to get input parameters # This config file should define the following variables # DATA_IN: Location of working directory, default to ${DATAROOT} # DEV_SMS: If the job is to be running using ecFflow, 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 ecFflow script then CONFIG_FILE=${CONFIG_FILE:-/lfs/h2/emc/lam/noscrub/${LOGNAME}/sref.v7.cray/parm/sref_para_config_cray} . $CONFIG_FILE export userid=$LOGNAME export DATA_IN=${DATA_IN:-/lfs/h2/emc/ptmp/$userid} fi echo `date` $0 `date -u` begin export PS4='$SECONDS + ' ########################################################### # obtain unique process id (pid) and make temp directories ########################################################### export DATA_IN=${DATA_IN:-${DATAROOT}} export DATA=$DATA_IN/${jobid:?} rm -rf $DATA mkdir -p $DATA cd $DATA #################################### # File To Log Msgs #################################### export jlogfile=${jlogfile:-$DATA/jlogfile.${job}.$$} #################################### # Determine Job Output Name on System #################################### export pgmout="OUTPUT.$$" export cycle=t${cyc}z ############################### # Specify NET and RUN name ############################## export NET=sref export RUN=sref ################################################## # SAVEGES - Copy Files From TMPDIR to $GESdir # SENDECF - Flag Events on ecFflow # SENDCOM - Copy Files From TMPDIR to $COMOUT # SENDDBN - Issue DBNet Client Calls # RERUN - Rerun fcst from beginning (default no) ################################################## export SENDCOM=${SENDCOM:-YES} export SENDECF=${SENDECF:-YES} export SENDDBN=${SENDDBN:-YES} export HOMEsref=${HOMEsref:-${PACKAGEROOT}/${NET}.${sref_ver}} export EXECsref=${EXECsref:-$HOMEsref/exec} export FIXsref=${FIXsref:-$HOMEsref/fix} export PARMsref=${PARMsref:-$HOMEsref/parm} export USHsref=${USHsref:-$HOMEsref/ush} export SPCfix=${SPCfix:-$HOMEsref/fix/spcsref} #export HOMEspc=${HOMEspc:-${PACKAGEROOT}/spcsref.${spcsref_ver}} #export SPCfix=${SPCfix:-$HOMEspc/fix} # Since the grib_util cnvgrib tool at wcoss2 version doesn't work, # it needs this temporary one here: export CNVGRIB=$HOMEsref/util/cnvgrib # Run setpdy and initialize PDY variables setpdy.sh . ./PDY ############################################# # COMIN and COMOUT ############################################# export COM_IN=${COM_IN:-$(compath.py ${NET}/${sref_ver})} export COM_OUT=${COM_OUT:-$(compath.py ${NET}/${sref_ver})} export COMIN=${COMIN:-$COM_IN/${RUN}.${PDY}/${cyc}/pgrb} export COMOUT=${COMoUT:-$COM_OUT/${RUN}.${PDY}/${cyc}/ensprod} mkdir -p -m 775 $COMOUT env ####################################################### # Pass information which is needed to run the Script ####################################################### export ENDHOUR=87 export INCHOUR=3 ######################################################## # Execute the script using POE ######################################################## export DATAHOLD=$DATA rm -f $DATA/poescript # 1. SPC combined probabilities export DATA=$DATAHOLD/212_SPC_1hrly mkdir -p $DATA echo "$HOMEsref/scripts/exsref_enspost4SPC.sh 1hrly 212 $DATA 111 > $DATAHOLD/212_SPC_1hrly.out" >>$DATAHOLD/poescript #export DATA=$DATAHOLD/243_SPC_1hrly #mkdir -p $DATA #echo "$HOMEsref/scripts/exsref_enspost4SPC.sh 1hrly 243 $DATA 111 > $DATAHOLD/243_SPC_1hrly.out" >>$DATAHOLD/poescript #export DATA=$DATAHOLD/216_SPC_1hrly #mkdir -p $DATA #echo "$HOMEsref/scripts/exsref_enspost4SPC.sh 1hrly 216 $DATA 111 > $DATAHOLD/216_SPC_1hrly.out" >>$DATAHOLD/poescript # 2. Regular ensemble products export DATA=$DATAHOLD/212_1hrly mkdir -p $DATA echo "$HOMEsref/scripts/exsref_enspost.sh 1hrly 212 $DATA 111 0 > $DATAHOLD/212_1hrly.out" >>$DATAHOLD/poescript chmod 775 $DATAHOLD/poescript export MP_PGMMODEL=mpmd export MP_CMDFILE=$DATAHOLD/poescript # # Execute the script. mpiexec --cpu-bind core --configfile $DATAHOLD/poescript export err=$?; err_chk wait cd $DATA cat $DATA/212_1hrly.out >>$pgmout cat $DATA/212_SPC_1hrly.out >>$pgmout #cat $DATA/243_SPC_1hrly.out >>$pgmout #cat $DATA/216_SPC_1hrly.out >>$pgmout ######################################################## cat $pgmout msg="JOB COMPLETED NORMALLY" postmsg $jlogfile "$msg" ################################ # Remove the Working Directory ################################ cd $DATA_IN if [ ${KEEPDATA:-NO} != YES ] ; then rm -rf $DATAHOLD ; fi date