From 3bc11251ea67dd37e310718742d9e7fc64c4751f Mon Sep 17 00:00:00 2001 From: "Michael Kavulich, Jr" Date: Fri, 4 Aug 2023 16:48:59 +0000 Subject: [PATCH] Address Gerard's comments --- jobs/JREGIONAL_GET_VERIF_OBS | 2 +- scripts/exregional_get_verif_obs.sh | 22 +++++++++++----------- ush/config_defaults.yaml | 16 ++++++++-------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/jobs/JREGIONAL_GET_VERIF_OBS b/jobs/JREGIONAL_GET_VERIF_OBS index 3aea9e0765..3820a739db 100755 --- a/jobs/JREGIONAL_GET_VERIF_OBS +++ b/jobs/JREGIONAL_GET_VERIF_OBS @@ -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. # #----------------------------------------------------------------------- # diff --git a/scripts/exregional_get_verif_obs.sh b/scripts/exregional_get_verif_obs.sh index 8788f87c53..f2202ac813 100755 --- a/scripts/exregional_get_verif_obs.sh +++ b/scripts/exregional_get_verif_obs.sh @@ -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})) @@ -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} diff --git a/ush/config_defaults.yaml b/ush/config_defaults.yaml index 78e1b7c0fb..894afeb2a4 100644 --- a/ush/config_defaults.yaml +++ b/ush/config_defaults.yaml @@ -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: @@ -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: @@ -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: @@ -279,7 +279,7 @@ 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 # #----------------------------------------------------------------------- @@ -287,10 +287,10 @@ platform: 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" # #----------------------------------------------------------------------- #