Skip to content

Commit

Permalink
Feature 413 surrogate severe calculation round 2 (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgemccabe authored May 15, 2020
1 parent 7fb6fe9 commit ab41e29
Show file tree
Hide file tree
Showing 6 changed files with 161 additions and 713 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
"""
Surrogate Severe Calculation: PCPCombine, EnsembleStat, and RegridDataPlane
===================================================================================================
EnsembleStat_fcstHRRR_fcstOnly_SurrogateSevere.conf
"""
###################################################################################################
# Scientific Objective
# --------------------
#
# Run PCPCombine, EnsembleStat, and RegridDataPlane tools to create surrogate severe probability
# forecasts (SSPFs) for a given date. SSPFs are a severe weather forecasting tool and is a techniqu
# used by the Storm Prediction Center (SPC) as well as others. SSPFs are based on updraft helicity
# (UH; UH = ∫z0 to zt (ω * ζ) dz) since certain thresholds of UH have been shown as good proxies for# severe weather. SSPFs can be thought of as the perfect model forecast. They are derived as follows:
# 1. Regrid the maximum UH value over the 2-5km layer at each grid point to the NCEP 211 grid (dx = ~80km).
# 2. Create a binary mask of points that meet a given threshold of UH)
# 3. Convert the binary mask into a probability field by applying a Gaussian filter.
#
# For more information, please reference Sobash et al. 2011 (https://journals.ametsoc.org/doi/full/10.1175/WAF-D-10-05046.1).

###################################################################################################
# Datasets
# --------
#
# There are two dates that can be used as input data for this use case 20190518 or 20200205.
#
# * Input Data: HRRR data
# - There should 24 grib2 files.
# - Variable of interest: MXUPHL; the maximum updraft helicity
# - Level: Z2000-5000; from 2 - 5km
# - Format: grib2
# - Projection: Lambert Conformal
#
# * Location: kiowa:/d1/projects/METplus/METplus_Data/model_applications/convection_allowing_models/surrogate_severe_calc/
#
# * Data Source: Originally received from Burkely Gallo at the Storm Prediction Center.

###################################################################################################
# METplus Components
# ------------------
#
# This use case runs the PCPCombine, EnsembleStat, and RegridDataPlane MET tools.

###################################################################################################
# METplus Workflow
# ----------------
#
# This workflow loops over the data by process, meaning that each MET tool will run over all times
# before moving onto the tool. PCPCombine is called first, followed by EnsembleStat,
# and then, finally, RegridDataPlane.

###################################################################################################
# METplus Configuration
# ---------------------
#
# METplus first loads all of the configuration files found in parm/metplus_config. Then, it loads
# any configuration files passed to METplus by the command line with the -c option.
#
# .. highlight:: bash
# .. literalinclude:: ../../../../parm/use_cases/model_applications/convection_allowing_models/EnsembleStat_fcstHRRR_fcstOnly_SurrogateSevere.conf

###################################################################################################
# MET Configuration
# -----------------
#
# METplus sets environment variables based on the values in the METplus configuration file.
# These variables are referenced in the MET configuration file. **YOU SHOULD NOT SET ANY OF THESE ENVIRONMENT VARIABLES YOURSELF! THEY WILL BE OVERWRITTEN BY METPLUS WHEN IT CALLS THE MET TOOLS!** If there is a setting in the MET configuration file that is not controlled by an environment variable, you can add additional environment variables to be set only within the METplus environment using the [user_env_vars] section of the METplus configuration files. See the 'User Defined Config' section on the 'System Configuration' page of the METplus User's Guide for more information.
#
# **EnsembleStatConfig_Surrogate_severe**
#
# .. highlight:: bash
# .. literalinclude:: ../../../../parm/use_cases/model_applications/convection_allowing_models/EnsembleStatConfig_Surrogate_severe
#
# See the following file for more information about the environment variables set in this configuration file:
# parm/use_cases/met_tool_wrapper/EnsembleStat/EnsembleStat.py

###################################################################################################
# Running METplus
# ---------------
#
# The command to run this use case is::
#
# master_metplus.py -c /path/to/METplus/parm/use_cases/model_applications/convection_allowing_models/EnsembleStat_fcstHRRR_fcstOnly_SurrogateSevere.conf

###################################################################################################
# Expected Output
# ---------------

# A successful run of this use case will output the following to the screen and logfile::
#
# INFO: METplus has successfully finished runing.
#
# A successful run will have the following output files in the location defined by {OUTPUT_BASE}, which
# is located in the metplus_system.conf configuration file located in /path/to/METplus/parm/metplus_config.
# This list of files should be found for every time run through METplus. Using the output for 20190518 as an example.
#
# **PCPCombine output**:
#
# * 20190518/hrrr_ncep_2019051800f036.nc
#
# **EnsembleStat output**:
#
# * ensemble_stat_20190519_120000V_ens.nc
#
# **RegridDataPlane output**:
#
# * surrogate_severe_20190518_036V_regrid.nc
#

###################################################################################################
# Keywords
# --------
#
# sphinx_gallery_thumbnail_path =
#
# .. note:: PCPCombineUseCase, EnsembleStatUseCase, RegridDataPlaneUseCase
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ LOOP_BY = INIT
INIT_TIME_FMT = %Y%m%d%H

# Start time for METplus run
INIT_BEG=2019051800
INIT_BEG=2020020500

# End time for METplus run
INIT_END=2019051800
INIT_END=2020020500

# Increment between METplus runs in seconds. Must be >= 60
INIT_INCREMENT=86400
Expand All @@ -27,10 +27,9 @@ LEAD_SEQ = 36
LOOP_ORDER = processes

# List of applications to run
PROCESS_LIST = PcpCombine, EnsembleStat
PROCESS_LIST = PcpCombine, EnsembleStat, RegridDataPlane


# PCP_COMBINE
# PCP_COMBINE (Step 1)
# run pcp_combine on forecast data
FCST_PCP_COMBINE_RUN = True

Expand All @@ -48,8 +47,7 @@ FCST_PCP_COMBINE_OUTPUT_ACCUM = 24
FCST_PCP_COMBINE_DERIVE_LOOKBACK = 24
FCST_PCP_COMBINE_INPUT_DATATYPE = GRIB


#ENSEMBLE_STAT
#ENSEMBLE_STAT (Steps 2 and 3)
# number of expected members for ensemble. Should correspond with the
# number of items in the list for FCST_ENSEMBLE_STAT_INPUT_TEMPLATE
ENSEMBLE_STAT_N_MEMBERS = 1
Expand All @@ -69,32 +67,57 @@ ENS_VAR1_THRESH = >=14.2, >=19.0, >=26.0, >=38.0, >=61.0


# REGRID_DATA_PLANE (Step 4)
# run regrid_data_plane on observation data
# Run regrid_data_plane on forecast data
FCST_REGRID_DATA_PLANE_RUN = True

# method to run regrid_data_plane, not setting this will default to NEAREST
# If true, process each field individually and write a file for each
# If false, run once per run time passing in all fields specified
REGRID_DATA_PLANE_ONCE_PER_FIELD = False

# Name of input field to process
FCST_REGRID_DATA_PLANE_VAR1_INPUT_FIELD_NAME = MXUPHL_24_A1_ENS_FREQ_ge14.2
FCST_REGRID_DATA_PLANE_VAR2_INPUT_FIELD_NAME = MXUPHL_24_A1_ENS_FREQ_ge19.0
FCST_REGRID_DATA_PLANE_VAR3_INPUT_FIELD_NAME = MXUPHL_24_A1_ENS_FREQ_ge26.0
FCST_REGRID_DATA_PLANE_VAR4_INPUT_FIELD_NAME = MXUPHL_24_A1_ENS_FREQ_ge38.0
FCST_REGRID_DATA_PLANE_VAR5_INPUT_FIELD_NAME = MXUPHL_24_A1_ENS_FREQ_ge61.0

# Level of input field to process
FCST_REGRID_DATA_PLANE_VAR1_INPUT_LEVEL = "(*,*)"
FCST_REGRID_DATA_PLANE_VAR2_INPUT_LEVEL = "(*,*)"
FCST_REGRID_DATA_PLANE_VAR3_INPUT_LEVEL = "(*,*)"
FCST_REGRID_DATA_PLANE_VAR4_INPUT_LEVEL = "(*,*)"
FCST_REGRID_DATA_PLANE_VAR5_INPUT_LEVEL = "(*,*)"

# Name of output field to create
FCST_REGRID_DATA_PLANE_VAR1_OUTPUT_FIELD_NAME = MXUPHL_prob_75
FCST_REGRID_DATA_PLANE_VAR2_OUTPUT_FIELD_NAME = MXUPHL_prob_80
FCST_REGRID_DATA_PLANE_VAR3_OUTPUT_FIELD_NAME = MXUPHL_prob_85
FCST_REGRID_DATA_PLANE_VAR4_OUTPUT_FIELD_NAME = MXUPHL_prob_90
FCST_REGRID_DATA_PLANE_VAR5_OUTPUT_FIELD_NAME = MXUPHL_prob_95

# Mask to use for regridding
REGRID_DATA_PLANE_VERIF_GRID = G211

# Method to run regrid_data_plane, not setting this will default to NEAREST
REGRID_DATA_PLANE_METHOD = MAXGAUSS

# regridding width used in regrid_data_plane, not setting this will default to 1
# Regridding width used in regrid_data_plane, not setting this will default to 1
REGRID_DATA_PLANE_WIDTH = 1

# mask to use for regridding
REGRID_DATA_PLANE_VERIF_GRID=G211

FCST_REGRID_DATA_PLANE_VAR1_FIELD_NAME = MXUPHL_24_A1_ENS_FREQ_ge14.2
# Set Gaussian dx value to add as command line argument - not added if unset or blank
REGRID_DATA_PLANE_GAUSSIAN_DX = 81.271

# Set Gaussian filter radius value to add as command line argument - not added if unset or blank
REGRID_DATA_PLANE_GAUSSIAN_RADIUS = 120

[dir]
INPUT_BASE = /d3/projects/MET/METplus_Data
OUTPUT_BASE = /d3/personal/kalb/METplus_Data
PARM_BASE = /home/kalb/surrogate_severe/METplus/parm

# location of configuration files used by MET applications
CONFIG_DIR={PARM_BASE}/use_cases/model_applications/convection_allowing_models

# input and output data directories for each application in PROCESS_LIST
FCST_PCP_COMBINE_INPUT_DIR = {INPUT_BASE}/model_applications/convection_allowing_models/surrogate_severe_calc
FCST_PCP_COMBINE_OUTPUT_DIR = {OUTPUT_BASE}/model_applications/convection_allowing_models/surrogate_severe_calc
FCST_PCP_COMBINE_OUTPUT_DIR = {OUTPUT_BASE}/convection_allowing_models/surrogate_severe_calc

FCST_ENSEMBLE_STAT_INPUT_DIR = {FCST_PCP_COMBINE_OUTPUT_DIR}
ENSEMBLE_STAT_OUTPUT_DIR = {FCST_PCP_COMBINE_OUTPUT_DIR}
Expand All @@ -110,3 +133,7 @@ FCST_PCP_COMBINE_OUTPUT_TEMPLATE = {init?fmt=%Y%m%d}/hrrr_ncep_{init?fmt=%Y%m%d%

# To enemble_stat
FCST_ENSEMBLE_STAT_INPUT_TEMPLATE = {FCST_PCP_COMBINE_OUTPUT_TEMPLATE}

# To regrid_data_plane
FCST_REGRID_DATA_PLANE_INPUT_TEMPLATE = ensemble_stat_{valid?fmt=%Y%m%d}_120000V_ens.nc
FCST_REGRID_DATA_PLANE_OUTPUT_TEMPLATE = surrogate_severe_{init?fmt=%Y%m%d}_{lead?fmt=%HHH}V_regrid.nc
Loading

0 comments on commit ab41e29

Please sign in to comment.