Skip to content

Commit

Permalink
Roll new snowfall/NOHRSC verification into new data retrieval system
Browse files Browse the repository at this point in the history
 - Remove stand-alone j-jobs and exscripts for NOHRSC
 - Add NOHRSC_obs stanza to parm/data_locations.yml
 - Update documentation and comments to include NOHRSC obs
 - Add "ASNOW" (accumulated snow) verification to
   custom_ESGgrid_Great_Lakes_snow_8km
 -
  • Loading branch information
mkavulich committed Jul 25, 2023
1 parent 21b5b19 commit e41abf2
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 253 deletions.
91 changes: 0 additions & 91 deletions jobs/JREGIONAL_GET_OBS_NOHRSC

This file was deleted.

16 changes: 16 additions & 0 deletions parm/data_locations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,22 @@ NDAS_obs:
obs:
- "./nam.t{hh}z.prepbufr.tm*.nr"

NOHRSC_obs:
hpss:
protocol: htar
archive_format: tar
archive_path:
- /NCEPPROD/hpssprod/runhistory/rh{yyyy}/{yyyy}{mm}/{yyyy}{mm}{dd}
- /NCEPPROD/hpssprod/runhistory/rh{yyyy}/{yyyy}{mm}/{yyyy}{mm}{dd}
archive_file_names:
- "dcom_prod_{yyyy}{mm}{dd}.tar"
- "dcom_{yyyy}{mm}{dd}.tar"
file_names:
obs:
- "sfav2_CONUS_*h_{yyyy}{mm}{dd}{hh}_grid184.grb2"
archive_internal_dir:
- ./wgrbbul/nohrsc_snowfall/

###########################
###########################
####### Fix Files #########
Expand Down
3 changes: 2 additions & 1 deletion parm/wflow/verify_pre.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ task_get_obs_ccpa:

task_get_obs_nohrsc:
<<: *default_task_verify_pre
command: '&LOAD_MODULES_RUN_TASK_FP; "get_obs" "&JOBSdir;/JREGIONAL_GET_OBS_NOHRSC"'
command: '&LOAD_MODULES_RUN_TASK_FP; "get_obs" "&JOBSdir;/JREGIONAL_GET_VERIF_OBS"'
envars:
<<: *default_vars
OBS_DIR: '&NOHRSC_OBS_DIR;'
OBTYPE: 'NOHRSC'
FHR: '{% for h in range(0, workflow.FCST_LEN_HRS+1) %}{{ " %02d" % h }}{% endfor %}'
partition: '{% if platform.get("PARTITION_HPSS") %}&PARTITION_HPSS;{% else %}None{% endif %}'
queue: "&QUEUE_HPSS;"
Expand Down
133 changes: 0 additions & 133 deletions scripts/exregional_get_obs_nohrsc.sh

This file was deleted.

79 changes: 74 additions & 5 deletions scripts/exregional_get_verif_obs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ set -x
#
# This script performs several important tasks for preparing data for
# verification tasks. Depending on the value of the environment variable
# OBTYPE=(CCPA|MRMS|NDAS), the script will prepare that particular data
# OBTYPE=(CCPA|MRMS|NDAS|NOHRSC), the script will prepare that particular data
# set.
#
# If data is not available on disk (in the location specified by
# CCPA_OBS_DIR, MRMS_OBS_DIR, or NDAS_OBS_DIR respectively), the script
# attempts to retrieve the data from HPSS using the retrieve_data.py
# CCPA_OBS_DIR, MRMS_OBS_DIR, NDAS_OBS_DIR, or NOHRSC_OBS_DIR respectively),
# the script attempts to retrieve the data from HPSS using the retrieve_data.py
# script. Depending on the data set, there are a few strange quirks and/or
# bugs in the way data is organized; see in-line comments for details.
#
Expand Down Expand Up @@ -91,6 +91,23 @@ set -x
#
# If data is retrieved from HPSS, it will automatically staged by this
# this script.
#
#
# NOHRSC
# ----------
# If data is available on disk, it must be in the following
# directory structure and file name conventions expected by verification
# tasks:
#
# {NOHRSC_OBS_DIR}/{YYYYMMDD}/sfav2_CONUS_{AA}h_{YYYYMMDD}{HH}_grid184.grb2
#
# where AA is the 2-digit accumulation duration in hours: 06 or 24
#
# METplus is configured to verify snowfall using 06- and 24-h accumulated
# snowfall from 6- and 12-hourly NOHRSC files, respectively.
#
# If data is retrieved from HPSS, it will automatically staged by this
# this script.

#-----------------------------------------------------------------------
# Create and enter top-level obs directory (so temporary data from HPSS won't collide with other tasks)
Expand Down Expand Up @@ -356,15 +373,67 @@ while [[ ${current_fcst} -le ${fcst_length} ]]; do
fi
fi

# Retrieve NOHRSC observations
elif [[ ${OBTYPE} == "NOHRSC" ]]; then

# Reorganized NOHRSC location (no need for raw data dir)
nohrsc_proc=${OBS_DIR}

nohrsc06h_file="$nohrsc_proc/${vyyyymmdd}/sfav2_CONUS_06h_${vyyyymmdd}${vhh}_grid184.grb2"
nohrsc24h_file="$nohrsc_proc/${vyyyymmdd}/sfav2_CONUS_24h_${vyyyymmdd}${vhh}_grid184.grb2"
retrieve=0
# If 24-hour files should be available (at 00z and 12z) then look for both files
# Otherwise just look for 6hr file
if (( ${current_fcst} % 12 == 0 )) && (( ${current_fcst} >= 24 )) ; then
if [ ! -f "${nohrsc06h_file}" ] || [ ! -f "${nohrsc24h_file}" ] ; then
retrieve=1
else
echo "NOHRSC 6h accumulation file exists: ${nohrsc06h_file}"
echo "NOHRSC 24h accumulation file exists: ${nohrsc24h_file}"
fi
elif (( ${current_fcst} % 6 == 0 )) ; then
if [ ! -f "${nohrsc06h_file}" ]; then
retrieve=1
else
echo "NOHRSC 6h accumulation file exists: ${nohrsc06h_file}"
fi
fi
if [ $retrieve == 1 ]; then
if [[ ! -d "$nohrsc_proc/${vyyyymmdd}" ]]; then
mkdir -p $nohrsc_proc/${vyyyymmdd}
fi

# Pull NOHRSC data from HPSS; script will retrieve all files so only call once
cmd="
python3 -u ${USHdir}/retrieve_data.py \
--debug \
--file_set obs \
--config ${PARMdir}/data_locations.yml \
--cycle_date ${vyyyymmdd}${vhh} \
--data_stores hpss \
--data_type NOHRSC_obs \
--output_path $nohrsc_proc/${vyyyymmdd} \
--summary_file ${logfile}"

echo "CALLING: ${cmd}"

$cmd || print_err_msg_exit "\
Could not retrieve NOHRSC data from HPSS
The following command exited with a non-zero exit status:
${cmd}
"
# 6-hour forecast needs to be renamed
mv $nohrsc_proc/${vyyyymmdd}/sfav2_CONUS_6h_${vyyyymmdd}${vhh}_grid184.grb2 ${nohrsc06h_file}
else
echo "Will not retrieve from HPSS"
fi

else
print_err_msg_exit "\
Invalid OBTYPE specified for script; valid options are CCPA, MRMS, and NDAS
Invalid OBTYPE specified for script; valid options are CCPA, MRMS, NDAS, and NOHRSC
"
fi
fi # Increment to next forecast hour
# Increment to next forecast hour
echo "Finished fcst hr=${current_fcst}"
current_fcst=$((${current_fcst} + 1))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ task_run_post:
POST_OUTPUT_DOMAIN_NAME: custom_ESGgrid_Michigan_Ontario
verification:
VX_FCST_MODEL_NAME: Michigan_Ontario_snow_8km
VX_FIELDS: [ "APCP", "REFC", "RETOP", "SFC", "UPA", "ASNOW" ]
platform:
CCPA_OBS_DIR: '{{ workflow.EXPTDIR }}/CCPA_obs'
MRMS_OBS_DIR: '{{ workflow.EXPTDIR }}/MRMS_obs'
NDAS_OBS_DIR: '{{ workflow.EXPTDIR }}/NDAS_obs'
NOHRSC_OBS_DIR: '{{ workflow.EXPTDIR }}/NOHRSC_obs'
Loading

0 comments on commit e41abf2

Please sign in to comment.