Skip to content

Commit

Permalink
Address Gerard's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mkavulich committed Aug 4, 2023
1 parent c34d65a commit 3bc1125
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion jobs/JREGIONAL_GET_VERIF_OBS
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
#-----------------------------------------------------------------------
#
# This script checks, pulls. and stages observation data for model verification.
# This script checks, pulls, and stages observation data for model verification.
#
#-----------------------------------------------------------------------
#
Expand Down
22 changes: 11 additions & 11 deletions scripts/exregional_get_verif_obs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,31 +118,31 @@ cd ${OBS_DIR}
logfile=retrieve_data.log

# PDY and cyc are defined in rocoto XML...they are the yyyymmdd and hh for initial forecast hour respectively
iyyyy=`echo ${PDY} | cut -c1-4`
imm=`echo ${PDY} | cut -c5-6`
idd=`echo ${PDY} | cut -c7-8`
iyyyy=$(echo ${PDY} | cut -c1-4)
imm=$(echo ${PDY} | cut -c5-6)
idd=$(echo ${PDY} | cut -c7-8)
ihh=${cyc}

# Unix date utility needs dates in yyyy-mm-dd hh:mm:ss format
unix_init_DATE="${iyyyy}-${imm}-${idd} ${ihh}:00:00"

# This awk expression gets the last item of the list $FHR
fcst_length=`echo ${FHR} | awk '{ print $NF }'`
fcst_length=$(echo ${FHR} | awk '{ print $NF }')

current_fcst=01
while [[ ${current_fcst} -le ${fcst_length} ]]; do
#remove leading zero from current_fcst because bash treats numbers with leading zeros as octal *sigh*
current_fcst=$((10#${current_fcst}))
# Calculate valid date info using date utility
vdate=`$DATE_UTIL -d "${unix_init_DATE} ${current_fcst} hours" +%Y%m%d%H`
unix_vdate=`$DATE_UTIL -d "${unix_init_DATE} ${current_fcst} hours" "+%Y-%m-%d %H:00:00"`
vyyyymmdd=`echo ${vdate} | cut -c1-8`
vhh=`echo ${vdate} | cut -c9-10`
vdate=$($DATE_UTIL -d "${unix_init_DATE} ${current_fcst} hours" +%Y%m%d%H)
unix_vdate=$($DATE_UTIL -d "${unix_init_DATE} ${current_fcst} hours" "+%Y-%m-%d %H:00:00")
vyyyymmdd=$(echo ${vdate} | cut -c1-8)
vhh=$(echo ${vdate} | cut -c9-10)

# Calculate valid date + 1 day; this is needed because (for some ungodly reason) CCPA files for 19-23z
# are stored in the *next* day's 00h directory
vdate_p1=`$DATE_UTIL -d "${unix_init_DATE} ${current_fcst} hours 1 day" +%Y%m%d%H`
vyyyymmdd_p1=`echo ${vdate_p1} | cut -c1-8`
vdate_p1=$($DATE_UTIL -d "${unix_init_DATE} ${current_fcst} hours 1 day" +%Y%m%d%H)
vyyyymmdd_p1=$(echo ${vdate_p1} | cut -c1-8)

#remove leading zero again, this time keep original
vhh_noZero=$((10#${vhh}))
Expand Down Expand Up @@ -362,7 +362,7 @@ while [[ ${current_fcst} -le ${fcst_length} ]]; do

# copy files from the previous 6 hours
for tm in $(seq 0 5); do
vyyyymmddhh_tm=`$DATE_UTIL -d "${unix_vdate} ${tm} hours ago" +%Y%m%d%H`
vyyyymmddhh_tm=$($DATE_UTIL -d "${unix_vdate} ${tm} hours ago" +%Y%m%d%H)
tm2=$(echo $tm | awk '{printf "%02d\n", $0;}')

cp $ndas_raw/${vyyyymmdd}${vhh}/nam.t${vhh}z.prepbufr.tm${tm2}.nr $ndas_proc/prepbufr.ndas.${vyyyymmddhh_tm}
Expand Down
16 changes: 8 additions & 8 deletions ush/config_defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ platform:
# in file scripts/exregional_get_verif_obs.sh for more details about
# files and directory structure, as well as important caveats about
# errors in the metadata and file names.
# NOTE: This should not be set equal to other *OBS_DIR variables,
# NOTE: Do not set this to the same path as other *_OBS_DIR variables,
# otherwise unexpected results and data loss may occur
#
# MRMS_OBS_DIR:
Expand All @@ -261,7 +261,7 @@ platform:
# retrieved by the workflow, where they will be placed). See comments
# in the scripts/exregional_get_verif_obs.sh for more details about
# files and directory structure.
# NOTE: This should not be set equal to other *OBS_DIR variables,
# NOTE: Do not set this to the same path as other *_OBS_DIR variables,
# otherwise unexpected results and data loss may occur
#
# NDAS_OBS_DIR:
Expand All @@ -270,7 +270,7 @@ platform:
# where they will be placed). See comments in file
# scripts/exregional_get_verif_obs.sh for more details about files
# and directory structure.
# NOTE: This should not be set equal to other *OBS_DIR variables,
# NOTE: Do not set this to the same path as other *_OBS_DIR variables,
# otherwise unexpected results and data loss may occur
#
# NOHRSC_OBS_DIR:
Expand All @@ -279,18 +279,18 @@ platform:
# if retrieved by the workflow, where they will be placed). See comments
# in file scripts/exregional_get_verif_obs.sh for more details about
# files and directory structure
# NOTE: This should not be set equal to other *OBS_DIR variables,
# NOTE: Do not set this to the same path as other *_OBS_DIR variables,
# otherwise unexpected results and data loss may occur
#
#-----------------------------------------------------------------------
#
MET_INSTALL_DIR: ""
MET_BIN_EXEC: ""
METPLUS_PATH: ""
CCPA_OBS_DIR: ""
NOHRSC_OBS_DIR: ""
MRMS_OBS_DIR: ""
NDAS_OBS_DIR: ""
CCPA_OBS_DIR: "{{ workflow.EXPTDIR }}/obs_data/ccpa/proc"
NOHRSC_OBS_DIR: "{{ workflow.EXPTDIR }}/obs_data/nohrsc/proc"
MRMS_OBS_DIR: "{{ workflow.EXPTDIR }}/obs_data/mrms/proc"
NDAS_OBS_DIR: "{{ workflow.EXPTDIR }}/obs_data/ndas/proc"
#
#-----------------------------------------------------------------------
#
Expand Down

0 comments on commit 3bc1125

Please sign in to comment.