Skip to content

Commit

Permalink
Adding updated soil moisture use case
Browse files Browse the repository at this point in the history
  • Loading branch information
CPKalb committed Dec 28, 2024
1 parent 2915a37 commit dc3c29e
Show file tree
Hide file tree
Showing 3 changed files with 318 additions and 60 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
"""
PCP-Combine: Compute 1m Soil Moisture and 30 year Climatology
=============================================================
model_applications/s2s/PcpCombine_obsERA5_obsOnly_soilMoisturePreProcessing.conf
"""
##############################################################################
# .. contents::
# :depth: 1
# :local:
# :backlinks: none

##############################################################################
# Scientific Objective
# --------------------
# [UPDATE_SECTION_CONTENT]
#
# To provide statistical information on the forecast hail size compared to
# the observed hail size from MRMS MESH data. Using objects to verify hail size
# avoids the “unfair penalty” issue, where a CAM must first generate convection
# to have any chance of accurately predicting the hail size. In addition, studies
# have shown that MRMS MESH observed hail sizes do not correlate one-to-one with
# observed sizes but can only be used to group storms into general categories.
# Running MODE allows a user to do this.

##############################################################################
# Version Added
# -------------
#
# METplus version 6.1

##############################################################################
# Datasets
# --------
#
# **Forecast:** None
#
# **Observation:** ERA-5 Land Soil Moisture top 3 layers
#
# **Climatology:** None
#
# **Location:** The input data required for PCP-Combine in this use case can be
# found in a sample data tarball. Each use case category will have
# one or more sample data tarballs. It is only necessary to download
# the tarball with the use case’s dataset and not the entire collection
# of sample data. Click here to access the METplus releases page and download sample data
# for the appropriate release: https://github.com/dtcenter/METplus/releases
# This tarball should be unpacked into the directory that you will
# set the value of INPUT_BASE. See :ref:`running-metplus` section for more information.
#
# Data for the Regrid-Data-Plane runsis not contained in the sample data tar files due
# to its size. Rather, it is stored as additional data in a separate tar file, named
# additional_data_PcpCombine_obsERA5_obsOnly_soilMoisturePreProcessing.tar.gz and can be
# downloaded at https://dtcenter.ucar.edu/dfiles/code/METplus/METplus_Data/v6.1/.

##############################################################################
# METplus Components
# ------------------
#
# This use case calls PCP-Combine twice. There is an additional call to
# Regrid-Data-Plane that is commented out but may be turned back on by the user.

##############################################################################
# METplus Workflow
# ----------------
#
# **Beginning time (VALID_BEG):** 1991-01-01
#
# **End time (VALID_END):** 2020-12-01
#
# **Increment between beginning and end times (VALID_INCREMENT):** 1 month
#
# **Sequence of forecast leads to process (LEAD_SEQ):** 0
#
# The first PCP-Combine run computes the sum of soil moisture of the top three layers
# multiplied by the thickness of each layer. It loops over valid time, running once for
# each valid time which is monthly data for 1991 through 2020. This is a total of 360
# PCP-Combine runs. The second call to PCP-Combine computes a 30 year mean and standard
# deviation. It runs once for each month, for a total of 12 runs
#
# When turned on, Regrid-Data-Plane regrids the data to a 1 degree latitude/longitude grid.
# Like the first PCP-Combine run, it loops over valid time, running once for each month
# between 1991 and 2020, for a total of 360 runs. Regrid-Data-Plane can be turned back on
# by using the PROCESS_LIST that is commented out:
#
# PROCESS_LIST = RegridDataPlane, PcpCombine(create_1m), PcpCombine(obs_mean_stdev)
#
# Settings for the Regrid-Data-Plane run are provided in the configuration file. Data is
# not included in the tarball, but can be downloaded from the link provided in the Datasets
# section above.

##############################################################################
# METplus Configuration
# ---------------------
#
# METplus first loads all of the configuration files found in parm/metplus_config,
# then it loads any configuration files passed to METplus via the command line,
# i.e. parm/use_cases/model_applications/s2s/PcpCombine_obsERA5_obsOnly_soilMoisturePreProcessing.conf
#
# .. highlight:: bash
# .. literalinclude:: ../../../../parm/use_cases/model_applications/s2s/PcpCombine_obsERA5_obsOnly_soilMoisturePreProcessing.conf

##############################################################################
# MET Configuration
# -----------------
#
# There are no MET configuration files in this use case.

##############################################################################
# Python Embedding
# ----------------
#
# This use case does not use Python embedding.

##############################################################################
# User Scripting
# --------------
#
# There are no user scripts in this use case.

##############################################################################
# Running METplus
# ---------------
#
# Pass the use case configuration file to the run_metplus.py script along
# with any user-specific system configuration files if desired::
#
# run_metplus.py /path/to/METplus/parm/use_cases/model_applications/s2s/PcpCombine_obsERA5_obsOnly_soilMoisturePreProcessing.conf /path/to/user_system.conf
#
# See :ref:`running-metplus` for more information.

##############################################################################
# Expected Output
# ---------------
#
# A successful run will output the following both to the screen and to the logfile::
#
# INFO: METplus has successfully finished running.
#
# Refer to the value set for **OUTPUT_BASE** to find where the output data was generated.
# Output for this use case will be found in
# {OUTPUT_BASE}/model_applications/s2s/PcpCombine_obsERA5_obsOnly_soilMoisturePreProcessing.
# Output from the first netCDF run will be in the ERA5_land_soilm1m subdirectory and will
# contain 360 files, one for each month, with the format shown below (for January and
# February 1991)::
#
# * ERA5_soilm1m_1x1_mon_199101.nc
# * ERA5_soilm1m_1x1_mon_199102.nc
#
# Output from the second call to PCP-Combine will be in the ERA5_land_clim subdirectory
# and will contain 12 files::
#
# * ERA5_soilm1m_1x1_30year_1991_2020_01_mean_stdev.nc
# * ERA5_soilm1m_1x1_30year_1991_2020_02_mean_stdev.nc
# * ERA5_soilm1m_1x1_30year_1991_2020_03_mean_stdev.nc
# * ERA5_soilm1m_1x1_30year_1991_2020_04_mean_stdev.nc
# * ERA5_soilm1m_1x1_30year_1991_2020_05_mean_stdev.nc
# * ERA5_soilm1m_1x1_30year_1991_2020_06_mean_stdev.nc
# * ERA5_soilm1m_1x1_30year_1991_2020_07_mean_stdev.nc
# * ERA5_soilm1m_1x1_30year_1991_2020_08_mean_stdev.nc
# * ERA5_soilm1m_1x1_30year_1991_2020_09_mean_stdev.nc
# * ERA5_soilm1m_1x1_30year_1991_2020_10_mean_stdev.nc
# * ERA5_soilm1m_1x1_30year_1991_2020_11_mean_stdev.nc
# * ERA5_soilm1m_1x1_30year_1991_2020_12_mean_stdev.nc
#
# The netCDF output files for the first PCP-Combine run contains one variable (not
# including the lat/lon fields)::
#
# * soilm1m(lat, lon)
#
# The netCDF output files for the second PCP-Combine run contains two variables (not
# including the lat/lon fields)::
#
# * soilm1m_mean(lat, lon)
# * soilm1m_stdev(lat, lon)
#
# If the Regrid-Data-Plane step is turned on 360 regridded files will be output to
# the ERA5_land_regrid subdirectory.

##############################################################################
# Keywords
# --------
#
# .. note::
#
# * PCPCombineToolUseCase
# * RegridDataPlaneToolUseCase
# * S2SAppUseCase
# * NetCDFFileUseCase
#
# Navigate to the :ref:`quick-search` page to discover other similar use cases.
#
#
#
# sphinx_gallery_thumbnail_path = ‘_static/s2s-PcpCombine_obsERA5_obsOnly_soilMoisturePreProcessing.png’

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
[config]

# Documentation for this use case can be found at
# https://metplus.readthedocs.io/en/latest/generated/model_applications/s2s_mid_lat/UserScript_fcstGFS_obsERA_Blocking.html

# For additional information, please see the METplus Users Guide.
# https://metplus.readthedocs.io/en/latest/Users_Guide

###
# Processes to run
# https://metplus.readthedocs.io/en/latest/Users_Guide/systemconfiguration.html#process-list
###

#PROCESS_LIST = RegridDataPlane, PcpCombine(create_1m), PcpCombine(obs_mean_stdev)
PROCESS_LIST = PcpCombine(create_1m), PcpCombine(obs_mean_stdev)

###
# Time Info
# LOOP_BY options are INIT, VALID, RETRO, and REALTIME
# If set to INIT or RETRO:
# INIT_TIME_FMT, INIT_BEG, INIT_END, and INIT_INCREMENT must also be set
# If set to VALID or REALTIME:
# VALID_TIME_FMT, VALID_BEG, VALID_END, and VALID_INCREMENT must also be set
# LEAD_SEQ is the list of forecast leads to process
# https://metplus.readthedocs.io/en/latest/Users_Guide/systemconfiguration.html#timing-control
###

LOG_LEVEL = DEBUG

LOOP_BY = VALID
VALID_TIME_FMT = %Y%m%d%H
VALID_BEG = 1991010100
VALID_END = 2020120100
VALID_INCREMENT = 1m
LEAD_SEQ = 0


###
# File I/O for Regruid-Data-Plane
# https://metplus.readthedocs.io/en/latest/Users_Guide/systemconfiguration.html#directory-and-filename-template-info
###
OBS_REGRID_DATA_PLANE_RUN = True

OBS_REGRID_DATA_PLANE_INPUT_DIR = {INPUT_BASE}/model_applications/PcpCombine_obsERA5_obsOnly_soilMoisturePreProcessing/ERA5_land
OBS_REGRID_DATA_PLANE_OUTPUT_DIR = {OUTPUT_BASE}/PcpCombine_obsERA5_obsOnly_soilMoisturePreProcessing/ERA5_land_regrid

OBS_REGRID_DATA_PLANE_INPUT_TEMPLATE = ERA5_soilm_layers_mon_{valid?fmt=%Y}01_{valid?fmt=%Y}12.nc
OBS_REGRID_DATA_PLANE_OUTPUT_TEMPLATE = ERA5_soilm_1x1_layers_mon_{valid?fmt=%Y%m}.nc

###
# Field Info
# https://metplus.readthedocs.io/en/latest/Users_Guide/systemconfiguration.html#field-info
###

OBS_REGRID_DATA_PLANE_VAR1_INPUT_FIELD_NAME = swvl1
OBS_REGRID_DATA_PLANE_VAR1_INPUT_LEVEL = "({valid?fmt=%Y%m%d_%H%M%S},*,*)"

OBS_REGRID_DATA_PLANE_VAR2_INPUT_FIELD_NAME = swvl2
OBS_REGRID_DATA_PLANE_VAR2_INPUT_LEVEL = "({valid?fmt=%Y%m%d_%H%M%S},*,*)"

OBS_REGRID_DATA_PLANE_VAR3_INPUT_FIELD_NAME = swvl3
OBS_REGRID_DATA_PLANE_VAR3_INPUT_LEVEL = "({valid?fmt=%Y%m%d_%H%M%S},*,*)"

###
# RegridDataPlane Settings
# https://metplus.readthedocs.io/en/latest/Users_Guide/wrappers.html#regriddataplane
###

REGRID_DATA_PLANE_ONCE_PER_FIELD = False

REGRID_DATA_PLANE_VERIF_GRID = latlon 360 181 90 0 -1.0 1.0

REGRID_DATA_PLANE_METHOD = NEAREST

REGRID_DATA_PLANE_WIDTH = 1


[create_1m]
###
# PCPCombine(create_1m) Settings
# https://metplus.readthedocs.io/en/latest/Users_Guide/wrappers.html#pcpcombine
###

OBS_PCP_COMBINE_RUN = True

OBS_PCP_COMBINE_METHOD = USER_DEFINED
OBS_PCP_COMBINE_COMMAND = -add {OBS_PCP_COMBINE_INPUT_DIR}/{OBS_PCP_COMBINE_INPUT_TEMPLATE} 'name="swvl1"; level="(*,*)"; convert(x)= x*70; set_attr_units = "mm";' {OBS_PCP_COMBINE_INPUT_DIR}/{OBS_PCP_COMBINE_INPUT_TEMPLATE} 'name="swvl2"; level="(*,*)"; convert(x) = x*210;' {OBS_PCP_COMBINE_INPUT_DIR}/{OBS_PCP_COMBINE_INPUT_TEMPLATE} 'name="swvl3"; level="(*,*)"; convert(x)= x*720;'

OBS_PCP_COMBINE_OUTPUT_NAME = soilm1m

OBS_PCP_COMBINE_INPUT_DIR = {OBS_REGRID_DATA_PLANE_OUTPUT_DIR}
OBS_PCP_COMBINE_OUTPUT_DIR = {OUTPUT_BASE}/PcpCombine_obsERA5_obsOnly_soilMoisturePreProcessing/ERA5_land_soilm1m

OBS_PCP_COMBINE_INPUT_TEMPLATE = {OBS_REGRID_DATA_PLANE_OUTPUT_TEMPLATE}
OBS_PCP_COMBINE_OUTPUT_TEMPLATE = ERA5_soilm1m_1x1_mon_{valid?fmt=%Y%m}.nc


[obs_mean_stdev]
###
# PCPCombine(obs_mean_stdev) Settings
# https://metplus.readthedocs.io/en/latest/Users_Guide/wrappers.html#pcpcombine
###

VALID_BEG = 2020010100

OBS_PCP_COMBINE_RUN = True

OBS_PCP_COMBINE_METHOD = DERIVE
OBS_PCP_COMBINE_STAT_LIST = mean,stdev

OBS_PCP_COMBINE_INPUT_ACCUMS = 1Y

OBS_PCP_COMBINE_INPUT_NAMES = soilm1m
OBS_PCP_COMBINE_INPUT_LEVELS = "(*,*)"

OBS_PCP_COMBINE_DERIVE_LOOKBACK = 30Y

OBS_PCP_COMBINE_INPUT_DIR = {OUTPUT_BASE}/PcpCombine_obsERA5_obsOnly_soilMoisturePreProcessing/ERA5_land_soilm1m
OBS_PCP_COMBINE_OUTPUT_DIR = {OUTPUT_BASE}/PcpCombine_obsERA5_obsOnly_soilMoisturePreProcessing/ERA5_land_clim

OBS_PCP_COMBINE_INPUT_TEMPLATE = ERA5_soilm1m_1x1_mon_{valid?fmt=%Y%m}.nc
OBS_PCP_COMBINE_OUTPUT_TEMPLATE = ERA5_soilm1m_1x1_30year_1991_2020_{valid?fmt=%m}_mean_stdev.nc

0 comments on commit dc3c29e

Please sign in to comment.