#!/bin/bash set -xa ######################################## # NOS_OFS_OBS # To prepare for the observation input file for data assimilation ######################################## export HOMEnos=${HOMEnos:-${PACKAGEROOT}/nosofs.${nosofs_ver:?}} ###################################################### # 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} ################################### # Specify NET and RUN Name and model #################################### #export OFS=${OFS:-wcofs } export NET=${NET:-nosofs} export RUN=${RUN:-$OFS} export PREFIXNOS=${PREFIXNOS:-$OFS} # hardcoded SENDDBN = NO for wcofs_da and wcofs_free export SENDDBN=${SENDDBN:-NO} if [ "${OFS,,}" == "wcofs_da" -o "${OFS,,}" == "wcofs_free" ]; then export SENDDBN='NO' fi ############################################################### # This block can be modified for different Production test # environment. This is used for operational testings # Commented by SK 20201209 ############################################################### export PS4='$SECONDS + ' date #################################### # obtain unique process id (pid) and make temp directory #################################### export pid=$$ ##export DATAROOT=${DATAROOT:-/lfs/h1/ops/prod/tmp} ##export DATA=${DATA:-$DATAROOT/${job}.${pid}} #export DATA=${DATA:-${DATAROOT:?}/nos_${OFS}_obs_${cyc}_$envir} export DATA=${DATA:-${DATAROOT:?}/${jobid:?}} if [ ! -d $DATA ] then mkdir -p $DATA cd $DATA else cd $DATA rm -fr $DATA/* fi export cycle=t${cyc}z ############################################ # Determine Job Output Name on System ############################################ # JY - 08/19/22 turned off the following two lines as the jobid is got in upstream setting # export outid="LL$job" # export jobid="${outid}.o${pid}" #################################### # Specify Execution Areas #################################### export EXECnos=${EXECnos:-${HOMEnos}/exec} export FIXnos=${FIXnos:-${HOMEnos}/fix/shared} export FIXofs=${FIXofs:-${HOMEnos}/fix/${OFS}} export PARMnos=${PARMnos:-${HOMEnos}/parm} export USHnos=${USHnos:-${HOMEnos}/ush} export SCRIPTSnos=${SCRIPTSnos:-${HOMEnos}/scripts} export PYnos=${PYnos:-${HOMEnos}/ush/pysh} export COMINrtofs_2d=${COMINrtofs_2d:-$(compath.py prod/rtofs/${rtofs_ver})} export COMINrtofs_3d=${COMINrtofs_3d:-$(compath.py prod/rtofs/${rtofs_ver})} ########################################### # Run setpdy and initialize PDY variables ########################################### sh setpdy.sh . ./PDY #PDY=20240119 ############################################## # Define COM directories ############################################## export COMROOT=${COMROOT:-/lfs/h1/ops/${envir}/com} export DCOMROOT=${DCOMROOT:-/lfs/h1/ops/${envir}/dcom} export COMIN=${COMIN:-$(compath.py ${NET}/${nosofs_ver})/${RUN}.${PDY}} export COMOUTroot=${COMOUTroot:-$(compath.py -o ${NET}/${nosofs_ver})} export COMOUT=${COMOUT:-$(compath.py -o ${NET}/${nosofs_ver})/${RUN}.${PDY}} mkdir -m 775 -p $COMOUT ############################################## ### Set up input data path #export DCOMROOTdev=${DCOMROOTdev:-/lfs/h1/ops/canned/dcom} export DCOMROOT=${DCOMROOT:-/lfs/h1/ops/prod/dcom} export DCOMINsst=${DCOMROOT} export DCOMINhf=${DCOMROOT} export DCOMINssh=${DCOMROOT} export DCOMINsst=${DCOMINsst:-${DCOMROOT}} export DCOMINhf=${DCOMINhf:-${DCOMROOT}} export DCOMINssh=${DCOMINssh:-${DCOMROOT}} ############################################## #### Log File To Sys Report export nosjlogfile=${nosjlogfile:-${COMOUT}/${PREFIXNOS}.${cycle}.${PDY}.jlogfile.log} export cormslogfile=${cormslogfile:-${COMOUT}/${PREFIXNOS}.${cycle}.${PDY}.corms.log} #env ######################################################## # Execute the script. ######################################################## # echo "push model data to CO-OPS ftp server of tidepool" $SCRIPTSnos/exnos_ofs_obs.sh ######################################################## postmsg "$nosjlogfile" "$0 completed normally" ############################## # Remove the Temporary working directory ############################## if [ "${KEEPDATA^^}" != YES ]; then rm -rf $DATA fi if [ $envir == 'dev' ]; then RPTDIR=/lfs/h1/nos/ptmp/$LOGNAME/rpt/${nosofs_ver} cp -p ${RPTDIR}/${OFS}_obs_${cyc}.out ${RPTDIR}/${OFS}_obs_${cyc}.out.${pbsid} cp -p ${RPTDIR}/${OFS}_obs_${cyc}.err ${RPTDIR}/${OFS}_obs_${cyc}.err.${pbsid} fi date