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

[config]

# Documentation for this use case can be found at
# https://metplus.readthedocs.io/en/latest/generated/model_applications/short_range/UserScript_fcstFV3_fcstOnly_PhysicsTendency_Planview.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 = UserScript


###
# 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
###

LOOP_BY = REALTIME
VALID_TIME_FMT = %Y
VALID_BEG = 2019

USER_SCRIPT_RUNTIME_FREQ = RUN_ONCE 


###
# UserScript Settings
# https://metplus.readthedocs.io/en/latest/Users_Guide/wrappers.html#userscript
###

FV3_HISTORY_FILE = {INPUT_BASE}/model_applications/short_range/UserScript_fcstFV3_fcstOnly_PhysicsTendency/fv3_history.nc
GRID_SPEC_FILE = {INPUT_BASE}/model_applications/short_range/UserScript_fcstFV3_fcstOnly_PhysicsTendency/grid_spec.nc
PRESSURE_LEVEL = 500
USER_SCRIPT_COMMAND = {PARM_BASE}/use_cases/model_applications/short_range/UserScript_fcstFV3_fcstOnly_PhysicsTendency_Planview/planview_plot.py {PARM_BASE}/use_cases/model_applications/short_range/UserScript_fcstFV3_fcstOnly_PhysicsTendency_Planview/physics_tendency_planview.yaml {FV3_HISTORY_FILE} {GRID_SPEC_FILE} tmp pbl -p {PRESSURE_LEVEL} -t 1 -v 20190504T14 -o {OUTPUT_BASE}/plots/short_range-physics_tendency_planview.png --nofineprint

[user_env_vars]

# Planview plot specific variables

LOG_FILE = "planview.log"

LOG_LEVEL = "DEBUG"

YAML_CONFIG_NAME = {PARM_BASE}/use_cases/model_applications/short_range/UserScript_fcstFV3_fcstOnly_PhysicsTendency_Planview/physics_tendency_planview.yaml

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 How METplus controls MET config file settings 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

  • S2SAppUseCase

  • METplotpyUseCase

Navigate to the METplus Quick Search for Use Cases page to discover other similar use cases.

sphinx_gallery_thumbnail_path = ‘_static/short_range-UserScript_fcstFV3_fcstOnly_PhysicsTendency_Planview.png’

Total running time of the script: (0 minutes 0.000 seconds)

Gallery generated by Sphinx-Gallery