#!/bin/bash ######################################## # Preliminary data setup step for exsref_wrf_gfsprep.sh # change log: # 08/14/2007, Jun Du: Initial Implementation # 05/20/2008, Jun Du: run it separately by disconnecting to $model and $member # for generality # 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. # 9/27/2011, Jun Du: To speed it up, this step is now submitted sinutaneously # for all members (ctl, c00, p01, p02, p03, p04, p05, p06) # separately for each cycle (cyc) # 4/15/2015, SPA SH: SREF V7.0 upgrade on WCOSS Phase 2 system # 11/18/2021, Jun Du: SREF V7.0 upgraded to V7.1 on WCOSS2 system # ######################################## set -xa echo `date` $0 `date -u` begin export PS4='$SECONDS + ' export OMP_NUM_THREADS=1 export MP_EUIDEVICE=sn_all export MP_EUILIB=us export MP_MPILIB=mpich2 # # Specify whether the run is production or development # export RUN_ENVIR=${RUN_ENVIR:-nco} export SENDECF=${SENDECF:-YES} ##################################################################################### # 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 ########################################################### # obtain unique process id (pid) and make temp directories # Note: ctl member needs to be run only once and can be used # for both NMM and ARW cores! ########################################################### export DATA_IN=${DATA_IN:-${DATAROOT}} export DATA=$DATA_IN/sref_gfsprep_${cyc}_${envir}/$MEMBER # Remove old directory if it exists 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 pgmerr=errfile export cycle=t${cyc}z ############################### # Specify NET and RUN name ############################## export NET=sref export RUN=sref # The grib_util module should be loaded prior to running this J-job #module load grib_util ################################################## # 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 VERBOSE=${VERBOSE:-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} # used for those global scripts #export HOMEglobal=${HOMEglobal:-${PACKAGEROOTp1}} #export EXECglobal=${EXECglobal:-$HOMEglobal/exec} #export FIXglobal=${FIXglobal:-$HOMEglobal/fix} #export PARMglobal=${PARMglobal:-$HOMEglobal/parm} #export USHglobal=${USHglobal:-$HOMEglobal/ush} ##XXW for global_postgp export POSTGPSH=$HOMEsref/ush/global_postgp.sh export POSTGPEXEC=$HOMEsref/exec/global_postgs # Run setpdy and initialize PDY variables setpdy.sh . ./PDY ############################################# # COMIN and COMOUT ############################################# export COM_OUT=${COM_OUT:-$(compath.py -o ${NET}/${sref_ver})} export COMOUT=$COM_OUT/${RUN}.${PDY} export GFSOUT=$COMOUT/global_pgrb export COMINgfs=${COMINgfs:-$(compath.py gfs/${gfs_ver})} export COMINgens=${COMINgens:-$(compath.py gefs/${gefs_ver})} mkdir -p -m 775 $COMOUT $GFSOUT export cyc MEMBER export CYC=${cyc} export START=00 export LENGTH=186 export DATE=$PDY env ######################################################## # Execute the script. $HOMEsref/scripts/exsref_wrf_gfsprep.sh ######################################################## cat $pgmout msg="JOB COMPLETED NORMALLY" postmsg $jlogfile "$msg" ################################ # Remove the Working Directory ################################ cd $DATA_IN if [ ${KEEPDATA:-NO} != YES ]; then rm -rf $DATA; fi date