Skip to content

Commit

Permalink
Feature 1852 use case physics tendency (#1881)
Browse files Browse the repository at this point in the history
* Issue #1852 initial work for the Planview plot

* Issue #1852 planview plot for physics tendency

* issue #1852 cleared away unused/unneccessary code

* Issue #1852 update script command

* Issue #1852 first draft, doesn't have correct content

* Issue #1852 updated name of output plot to include short_range in name

* Issue #1852 renamed to include fcstOnly label

* Issue #1852 initial commit

* Issue #1852

* Issue #1852

* Issue #1852 initial commit

* issue #1852 vertical cross section

* Issue 1852 clean up unused lines

* Issue #1852 initial commit

* Issue #1852

* Issue #1852 updates

* Issue #1852 fixed documentation warnings, but some problems remain

* fixing line length for chapter and section headers and one letter capitalization

* cleaning up line spacing and trying to fix a critical error.

* trying to fix critical error again

* Issue #1852 more description for data and dependency on METplotpy with additional instructions

* Issue #1852 update location of input data to single directory

* Removing duplicate files with a misformatted name that are not needed

* Per #1852, making changes to formatting to eliminate errors

* Issue #1852 remove redundant yaml config file

* Issue #1852 update PYTHONPATH information

* Issue #1852 fixed conflicts

* Issue #1852 update path to shapefile

* Issue #1852 fixed copy and paste error

* Issue #1852 add three use case entries: Planview, VerticalProfile, and VerticalCrossSection for the short range Physics tendency use case

* Issue #1852 add latest short range tests to top, move down list when everything passes

* Update use_case_groups.json

move short_range use cases #10-12 to below the short range test for #9

* Issue #1852 clean up conf files by providing variables for the input netCDF files and for the planview plot, allow user to indicate pressure levels

* Issue #1852 Indicate external Python packages

* Issue #1852 added external dependency section

* removed env vars that don't need to be set -- METPLOTPY_BASE is set by the automated test conf (.github/parm/test_settings.conf) and PYTHONPATH doesn't need to be set because METplotpy is installed in Python environment for use case tests

* Update UserScript_fcstFV3_fcstOnly_PhysicsTendency_Planview.py

Fixed one typo

* Update UserScript_fcstFV3_fcstOnly_PhysicsTendency_VerticalCrossSection.py

Fixed a typo

* Update UserScript_fcstFV3_fcstOnly_PhysicsTendency_VerticalProfile.py

Same typo, same fix

* Issue #1852 remove extraneous entry for USER_SCRIPT_COMMAND, a hold-over from the original implementation which doesn't allow the user to easily specify the FV3 history file and grid spec netCDF file

* Update UserScript_fcstFV3_fcstOnly_PhysicsTendency_VerticalProfile.conf

Removed the incorrect USER_SCRIPT_COMMAND in previous commit.  Reinstated the correct version and removed the incorrect command.

* update html file from Planview to VerticalProfile

Co-authored-by: Lisa Goodrich <[email protected]>
Co-authored-by: Julie Prestopnik <[email protected]>
Co-authored-by: George McCabe <[email protected]>
Co-authored-by: Hank Fisher <[email protected]>
  • Loading branch information
5 people authored Oct 25, 2022
1 parent d512507 commit d8708ac
Show file tree
Hide file tree
Showing 17 changed files with 946 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/parm/use_case_groups.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[
{
{
"category": "met_tool_wrapper",
"index_list": "0-29,59-61",
"run": false
Expand Down Expand Up @@ -49,6 +49,11 @@
"index_list": "9",
"run": false
},
{
"category": "short_range",
"index_list": "10-12",
"run": false
},
{
"category": "data_assimilation",
"index_list": "0",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
"""
UserScript: Physics Tendency Planview Plot
==========================================
model_applications/
short_range/
UserScript_fcstFV3_fcstOnly_PhysicsTendency_Planview.conf
"""

##############################################################################
# Scientific Objective
# --------------------
#
# To plot tendencies of temperature, moisture, and wind components averaged over
# a time window and spatial domain. Tendencies are partitioned into physics
# parameterizations and dynamics. Physics parameterizations include schemes like
# deep convection, convective gravity wave drag, short wave radiation, plantetary
# boundary layer, microphysics, and others. Non-physics tendencies (or dynamics)
# are due to horizontal and vertical motion. The residual (which should be zero)
# is the difference between the actual change in the state variable over the
# requested time window and the expected change due to physics parameterizations
# and dynamics tendencies. One can plot a single tendency component at multiple
# pressure levels or plot all tendency components at a single pressure level.
# This use case illustrates how to generate plan views (horizontal cross
# sections). The METplotpy source code is needed to generate the plot.
# Clone the METplotpy repository (https://github.com/dtcenter/METplotpy) under the same base
# directory as the METPLUS_BASE directory so that the METplus and
# METplotpy directories are under the same base directory (i.e. if the METPLUS_BASE directory is
# /home/username/working/METplus, then clone the METplotpy source
# code into the /home/username/working directory).

##############################################################################
# Datasets
# --------
#
# * Forecast dataset: FV3 3-D history file with physics and dynamics tendencies
# * Grid specification: FV3 2-D grid specification file with latitude and longitude of each grid point
#
# **Location:** All of the input data required for this use case can be
# found in the met_test sample data tarball. Click here to the METplus
# releases page and download sample data for the appropriate release:
# https://github.com/dtcenter/METplus/releases
# The tarball should be unpacked into the directory that you will set
# the value of INPUT_BASE. See the "Running METplus" section below for more
# information.


##############################################################################
# External Dependencies
# ---------------------
# You will need to use a versio of Python 3.86 that has the following packages
# installed:
#
# * cartopy (0.20.3 only)
# * matplotlib
# * metpy
# * numpy
# * pandas
# * shapely
# * xarray
#



##############################################################################
# METplus Components
# ------------------
#
# This use case runs the METplotpy planview_fv3.py script to generate the
# plan views.

##############################################################################
# METplus Workflow
# ----------------
#
# This use case does not loop but plots physics tendency data that has been
# subsetted to one date: 2019-05-04.

###################################################################################################
# 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/short_range/UserScript_fcstFV3_fcstOnly_PhysicsTendency_Planview.conf
#
# .. highlight:: bash
# .. literalinclude:: ../../../../parm/use_cases/model_applications/short_range/UserScript_fcstFV3_fcstOnly_PhysicsTendency_Planview.conf

##############################################################################
# MET Configuration
# -----------------
#
# No MET tools are used in this use case.
#
# METplus sets environment variables based on user settings in the METplus
# configuration file.
# See :ref:`How METplus controls MET config file settings<metplus-control-met>`
# for more details.


##############################################################################
# Running METplus
# ---------------
#
# This use case can be run in the following way:
#
# 1) Passing in UserScript_fcstFV3_fcstOnly_PhysicsTendency_Planview.conf
# then a user-specific system configuration file::
#
# run_metplus.py /path/to/METplus/parm/use_cases/model_applications/short_range/UserScript_fcstFV3_fcstOnly_PhysicsTendency_Planview.conf /path/to/user_system.conf
#
# 2) Modifying the configurations in parm/metplus_config, then passing in
# UserScript_fcstFV3_fcstOnly_PhysicsTendency_Planview.conf::
#
# run_metplus.py /path/to/METplus/parm/use_cases/model_applications/short_range/UserScript_fcstFV3_fcstOnly_PhysicsTendency_Planview.conf
#
# The former method is recommended. Whether you add them to a user-specific
# configuration file or modify the metplus_config files, the following
# variables must be set correctly:
#
# * **INPUT_BASE** - Path to directory where sample data tarballs are
# unpacked (See Datasets section to obtain tarballs). This is not required
# to run METplus, but it is required to run the examples in parm/use_cases
# * **OUTPUT_BASE** - Path where METplus output will be written. This must
# be in a location where you have write permissions
# * **MET_INSTALL_DIR** - Path to location where MET is installed locally
#
# Example User Configuration File::
#
# [dir]
# INPUT_BASE = /path/to/sample/input/data
# OUTPUT_BASE = /path/to/output/dir
# MET_INSTALL_DIR = /path/to/met-X.Y
#
# **NOTE:** All of these items must be found under the [dir] section.

##############################################################################
# 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.
# The following file will be created:
#
# physics_tendency_planview.png

##############################################################################
# Keywords
# --------
#
#
# .. note::
#
# * MediumRangeAppUseCase
# * PhysicsTendency
# * ValidationUseCase
# * ShortRangeAppUseCase
#
# Navigate to the :ref:`quick-search` page to discover other similar
# use cases.
#
#
#
# sphinx_gallery_thumbnail_path = '_static/short_range-UserScript_fcstFV3_fcstOnly_PhysicsTendency_Planview.png'
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
"""
UserScript: Physics Tendency Vertical Cross Section plot
=========================================================================
model_applications/short_range/UserScript_fcstFV3_fcstOnly_PhysicsTendency_VerticalCrossSection.conf
"""

##############################################################################
# Scientific Objective
# --------------------
#
# To plot tendencies of temperature, moisture, and wind components averaged over
# a time window and spatial domain. Tendencies are partitioned into physics
# parameterizations and dynamics. Physics parameterizations include schemes like
# deep convection, convective gravity wave drag, short wave radiation, plantetary
# boundary layer, microphysics, and others. Non-physics tendencies (or dynamics)
# are due to horizontal and vertical motion. The residual (which should be zero)
# is the difference between the actual change in the state variable over the requested
# time window and the expected change due to physics parameterizations and dynamics
# tendencies. One can plot a single tendency component at multiple pressure levels or
# plot all tendency components at a single pressure level. This use case illustrates
# how to generate the vertical cross section plot. The METplotpy source code is needed to generate the plot.
# Clone the METplotpy repository (https://github.com/dtcenter/METplotpy) under the same base
# directory as the METPLUS_BASE directory so that the METplus and
# METplotpy directories are under the same base directory (i.e. if the METPLUS_BASE directory is
# /home/username/working/METplus, then clone the METplotpy source
# code into the /home/username/working directory).


##############################################################################
# Datasets
# --------
#
# | Forecast dataset: FV3 3-D history file with physics and dynamics tendencies
# | Grid specification: FV3 2-D grid specification file with latitude and longitude of each grid point
#
# | **Location:** All of the input data required for this use case can be found in the met_test sample data tarball. Click here to the METplus releases page and download sample data for the appropriate release: https://github.com/dtcenter/METplus/releases
# | The tarball should be unpacked into the directory that you will set the value of INPUT_BASE. See `Running METplus`_ section for more information.
#



##############################################################################
# External Dependencies
# ---------------------
# You will need to use a versio of Python 3.86 that has the following packages
# installed:
#
# * cartopy (0.20.3 only)
# * matplotlib
# * metpy
# * numpy
# * pandas
# * shapely
# * xarray
#



##############################################################################
# METplus Components
# ------------------
#
# This use case runs the METplotpy cross_section_vert.py script to generate the plan views.
#

##############################################################################
# METplus Workflow
# ----------------
#
# This use case does not loop but plots physics tendency data that has been
# subsetted to one date: 2019-05-04.
#


##############################################################################
# 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/short_range/UserScript_fcstFV3_fcstOnly_PhysicsTendency_VerticalCrossSection.conf
#
# .. highlight:: bash
# .. literalinclude:: ../../../../parm/use_cases/model_applications/short_range/UserScript_fcstFV3_fcstOnly_PhysicsTendency_VerticalCrossSection.conf
#

##############################################################################
# MET Configuration
# ---------------------
#
# No MET tools are used in this use case.
#
# METplus sets environment variables based on user settings in the METplus configuration file.
# See :ref:`How METplus controls MET config file settings<metplus-control-met>` for more details.
#
# .. note:: See the :ref:`MODE MET Configuration<mode-met-conf>` section of the User's Guide for more information on the environment variables used in the file below:
#

##############################################################################
# Running METplus
# ---------------
#
# This use case can be run in the following way:
#
# 1) Passing in UserScript_fcstFV3_fcstOnly_PhysicsTendency_VerticalCrossSection.conf then a user-specific system configuration file::
#
# run_metplus.py /path/to/METplus/parm/use_cases/model_applications/short_range/UserScript_fcstFV3_fcstOnly_PhysicsTendency_VerticalCrossSection.conf /path/to/user_system.conf
#
# 2) Modifying the configurations in parm/metplus_config, then passing in UserScript_fcstFV3_fcstOnly_PhysicsTendency_VerticalCrossSection.conf::
#
# run_metplus.py /path/to/METplus/parm/use_cases/model_applications/short_range/UserScript_fcstFV3_fcstOnly_PhysicsTendency_VerticalCrossSection.conf
#
# The former method is recommended. Whether you add them to a user-specific configuration file or modify the metplus_config files, the following variables must be set correctly:
#
# * **INPUT_BASE** - Path to directory where sample data tarballs are unpacked (See Datasets section to obtain tarballs). This is not required to run METplus, but it is required to run the examples in parm/use_cases
# * **OUTPUT_BASE** - Path where METplus output will be written. This must be in a location where you have write permissions
# * **MET_INSTALL_DIR** - Path to location where MET is installed locally
#
# Example User Configuration File::
#
# [dir]
# INPUT_BASE = /path/to/sample/input/data
# OUTPUT_BASE = /path/to/output/dir
# MET_INSTALL_DIR = /path/to/met-X.Y
#
# **NOTE:** All of these items must be found under the [dir] section.
#

##############################################################################
# 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.
# The following file will be created:
#
# short_range-physics_tendency_vertical_cross_section.png
#
#


##############################################################################
# Keywords
# --------
#
#
# .. note::
#
# * MediumRangeAppUseCase
# * PhysicsTendency
# * ValidationUseCase
# * ShortRangeAppUseCase
#
# Navigate to the :ref:`quick-search` page to discover other similar use cases.
#
#
#
# sphinx_gallery_thumbnail_path = '_static/short_range-UserScript_fcstFV3_fcstOnly_PhysicsTendency_VerticalCrossSection.png'
#
Loading

0 comments on commit d8708ac

Please sign in to comment.