Skip to content

Commit

Permalink
Feature 2557 stratosphere qbo (#2621)
Browse files Browse the repository at this point in the history
* Initial commit for QBO driver

* Adding initial documentation for Stratosphere

* Updating documentation typo

* Updates to Polar plot

* Updates to Stratosphere use cases and documentation

* Updates to polar use case

* Updating documentation

* Updates to Polar and QBO

* Updated documentation for use cases that cannot be run in actions

* Removed some unnecessary imports

* Fixed staging dir settings

* documentation update

* More documentation edits

* More updates

* Fixed link in documentation

* Updating documentation

* Updated bullet list

* More updates

* Added some additional comments to the .conf file

* Fixed typo in output file name in documentation

* Updated output section of documentation

* Updated documentation

* Fixed list that was not working

* Updated broken link

* Fixed broken link again

* Fixed another typo

* Trying to fix documentation error

* Trying to fix indent error

* fixed capital typo

* Added clarification
  • Loading branch information
CPKalb authored Jun 28, 2024
1 parent b67331d commit 6b0a930
Show file tree
Hide file tree
Showing 12 changed files with 686 additions and 41 deletions.
4 changes: 2 additions & 2 deletions .github/parm/use_case_groups.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,12 @@
{
"category": "s2s_mid_lat",
"index_list": "0-2",
"run": false
"run": true
},
{
"category": "s2s_mid_lat",
"index_list": "3",
"run": false
"run": true
},
{
"category": "s2s_mjo",
Expand Down
3 changes: 2 additions & 1 deletion docs/Contributors_Guide/add_use_case.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ Use Cases that Exceed GitHub Actions Memory Limit

Use Cases that Exceed GitHub Actions Disk Space
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- *model_applications/s2s/UserScript_fcstGFS_obsERA_StratospherePolar*
- *model_applications/s2s_stratosphere/UserScript_fcstGFS_obsERA_StratospherePolar*
- *model_applications/s2s_stratosphere/UserScript_fcstGFS_obsERA_StratosphereQBO*

.. _use_case_documentation:

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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
"""
QBO Phase plots and QBO Index: UserScript, Stat-Analysis
================================================================================
model_applications/
s2s_stratosphere/
UserScript_fcstGFS_obsERA_StratosphereQBO.py
"""

##############################################################################
# Scientific Objective
# --------------------
#
# Many common modes of variability in the troposphere have stratospheric teloconnection
# pathways. This use case performs evaluation of the Quasi-biennial Oscillation (QBO),
# one of the key players of stratosphereic varability, using several different calculations
# and plots. Specifically, phase diagrams can be used to compare the QBO plhase progression
# between the model and observations. Additionally, timeseries of U at 30 and 50mb are also
# plotted to compare the speed of propagation of QBO in the model versus observations.
# Continuous statistics (ME, RMSE, etc.) are calculated for U at 30 and 50mb, and are also
# computed separately to evaluate QBO in the easterly phase versus the westerly phase.
#

##############################################################################
# Datasets
# --------
#
# * GFS: 0-24 hour forecasts for 10/2017 - 2/2018
# * ERA: 30 year climatology for EOFs and 10/2017 - 2/2018
#
# Data for this use case is 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_UserScript_fcstGFS_obsERA_StratosphereQBO.tar.gz at
# https://dtcenter.ucar.edu/dfiles/code/METplus/METplus_Data/v6.0/.
#

##############################################################################
# METplus Components
# ------------------
#
# This use case calls UserScript and StatAnalysis. The UserScript accesses calculation
# in METcalcpy, METplotpy, and METdataio. For it to run, the following versions of those
# repositories are needed, METcalcpy 3.0.0, METplotpy 3.0.0, and METdataio 2.1.
#

##############################################################################
# METplus Workflow
# ----------------
#
# This use case does not loop but UserScript and StatAnalysis are each run once.
# The UserScript call runs the driver script stratosphere_qbo_driver.py which first
# computes zonal and meridional means using directional_means.py in METcalcpy on U from
# -10 S to 10N latitude. Then, an EOF analysis is performed on this zonal and meridional
# mean data, and two phase diagrams of QBO are created using the plot_qbo_phase_circuits and
# plot_qbo_phase_space functions from stratosphere_plots.py in METplotpy. Additionally the
# zonal and meridional mean at 30 and 50mb are output as time series to matched pair (MPR)
# files using write_mpr.py in METcalcpy and are also plotted as timeseries using the
# plot_u_timeseries function from stratosphere_plots.py in METplotpy. Finally StatAnalysis is
# run on the 30 and 50mb U mpr files to compute the bias (ME).
#

##############################################################################
# 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_stratosphere/UserScript_fcstGFS_obsERA_StratosphereQBO.conf
#
# .. highlight:: bash
# .. literalinclude:: ../../../../parm/use_cases/model_applications/s2s_stratosphere/UserScript_fcstGFS_obsERA_StratosphereQBO.conf
#

#############################################################################
# MET Configuration
# ---------------------
#
# 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.
#
# **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 currently not supported by METplus you'd like to control, please refer to:
# :ref:`Overriding Unsupported MET config file settings<met-config-overrides>`
#
# **StatAnalysisConfig_wrapped**
#
# .. note:: See the :ref:`Stat-Analysis MET Configuration<series-analysis-met-conf>` section of the User's Guide for more information on the environment variables used in the file below:
#
# .. highlight:: bash
# .. literalinclude:: ../../../../parm/met_config/STATAnalysisConfig_wrapped
#

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

##############################################################################
# Python Scripting
# ----------------
#
# This use case runs the stratospher_qbo_driver.py python script. The processing
# performed by the script are detailed in the METplus Workflow section above.
#

##############################################################################
# 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_stratosphere/UserScript_fcstGFS_obsERA_StratosphereQBO.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.
#
# There should be 4 graphics output to the plot directory in the location set as OUTPUT_DIR
# in the [user_env_vars] section of the configuration file:
#
# * ERA_GFS_QBO_circuits.png
# * ERA5_QBO_PhaseSpace.png
# * ERA_GFS_timeseries_30mb_u_201710_201802.png
# * ERA_GFS_timeseries_50mb_u_201710_201802.png
#
# The name of the output graphics can be changed using PLOT_PHASE_CIRCUITS_OUTPUT_NAME,
# PLOT_PHASE_SPACE_OUTPUT_NAME, PLOT_TIME_SERIES_OUTPUT_NAME_30, and PLOT_TIME_SERIES_OUTPUT_NAME_50
# also in the [user_env_vars] section. Additionally many matched pair .stat files will be output to
# OUTPUT_DIR/mpr, and tow computed continuous statistics will be output to OUTPUT_DIR/StatAnalysis:
#
# * GFS_ERA_20171001_20180228_210000L_zonal_wind_byphase_CNT.stat
# * GFS_ERA_20171001_20180228_210000L_zonal_wind_CNT.stat
#

##############################################################################
# Keywords
# --------
#
# .. note::
#
# * UserScriptUseCase
# * S2SAppUseCase
# * S2SStratosphereAppUseCase
# * StatAnalysisUseCase
# * METcalcpyUseCase
# * METplotpyUseCase
#
# Navigate to the :ref:`quick-search` page to discover other similar use cases.
#
#
#
# sphinx_gallery_thumbnail_path = '_static/s2s_stratosphere-UserScript_fcstGFS_obsERA_StratosphereQBO.png'
1 change: 1 addition & 0 deletions internal/tests/use_cases/all_use_cases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ Category: s2s_mjo
Category: s2s_stratosphere
0:: UserScript_fcstGFS_obsERA_StratosphereBias:: model_applications/s2s_stratosphere/UserScript_fcstGFS_obsERA_StratosphereBias.conf:: weatherregime_env,cartopy,metdataio
#X::UserScript_fcstGFS_obsERA_StratospherePolar:: model_applications/s2s_stratosphere/UserScript_fcstGFS_obsERA_StratospherePolar.conf:: weatherregime_env,cartopy,metdataio
#X::UserScript_fcstGFS_obsERA_StratosphereQBO:: model_applications/s2s_stratosphere/UserScript_fcstGFS_obsERA_StratosphereQBO.conf:: weatherregime_env,cartopy,metdataio


Category: short_range
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
###

PROCESS_LIST = UserScript(means), StatAnalysis(sanal_cnt), UserScript(plots_t), UserScript(plots_u)
#PROCESS_LIST = UserScript(means)


SCRUB_STAGING_DIR = False
Expand All @@ -33,7 +34,9 @@ VALID_TIME_FMT = %Y%m%d
VALID_BEG = 20180201
VALID_END = 20180228
VALID_INCREMENT = 30d
LEAD_SEQ = begin_end_incr(0,240,3),begin_end_incr(252,384,12)
#LEAD_SEQ = begin_end_incr(0,240,3),begin_end_incr(252,384,12)
LEAD_SEQ = begin_end_incr(0,384,24)
#LEAD_SEQ = 0

LOOP_ORDER = processes

Expand All @@ -54,28 +57,41 @@ USER_SCRIPT_INPUT_TEMPLATE = {INPUT_BASE}/model_applications/s2s_stratosphere/Us
# observation_template, forecast_template
USER_SCRIPT_INPUT_TEMPLATE_LABELS = OBS_INPUT, FCST_INPUT

USER_SCRIPT_COMMAND = {PARM_BASE}/use_cases/model_applications/s2s_stratosphere/UserScript_fcstGFS_obsERA_StratospherePolar/polar_t_u_driver.py time {lead?fmt=%HHH}
USER_SCRIPT_COMMAND = {PARM_BASE}/use_cases/model_applications/s2s_stratosphere/UserScript_fcstGFS_obsERA_StratospherePolar/polar_t_u_driver.py {lead?fmt=%HHH}



[user_env_vars]
MODEL_NAME = GFS

FCST_T_VAR = T
FCST_U_VAR = u
FCST_TIME_VAR = time
FCST_LAT_DIM = lat
FCST_LON_DIM = lon
FCST_PRES_DIM = pres

OBS_T_VAR = T
OBS_U_VAR = u
OBS_TIME_VAR = time
OBS_LAT_DIM = lat
OBS_LON_DIM = lon
OBS_PRES_DIM = pres

OUTPUT_DIR = {OUTPUT_BASE}/s2s_stratosphere/UserScript_fcstGFS_obsERA_StratospherePolar

PLOT_OUTPUT_DIR = {OUTPUT_DIR}/plots

PLOT_INPUT_FILE = {OUTPUT_BASE}/s2s_stratosphere/UserScript_fcstGFS_obsERA_StratospherePolar/SeriesAnalysis/zonal_mean_stats_2018_02.nc
PLOT_T_BIAS_LEVELS = -6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6
PLOT_T_BIAS_LEVELS = -7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9
PLOT_T_BIAS_TITLE = GFS vs ERA Polar Cap Temperature Bias (ME) 02/2018
PLOT_T_RMSE_LEVELS = 0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6
PLOT_T_RMSE_LEVELS = 0,1,2,3,4,5,6,7,8,9,10
PLOT_T_RMSE_TITLE = GFS vs ERA Polar Cap Temperature RMSE 02/2018
PLOT_T_BIAS_OUTPUT_FILE = ME_2018_02_polar_cap_T.png
PLOT_T_RMSE_OUTPUT_FILE = RMSE_2018_02_polar_cap_T.png

PLOT_U_BIAS_LEVELS = -6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6
PLOT_U_BIAS_LEVELS = -4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12
PLOT_U_BIAS_TITLE = GFS vs ERA Polar Vortex U Bias (ME) 02/2018
PLOT_U_RMSE_LEVELS = 0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5
PLOT_U_RMSE_LEVELS = 0,2,4,6,8,10,12,14,16,18,20,22,24
PLOT_U_RMSE_TITLE = GFS vs ERA Polar Vortex U RMSE 02/2018
PLOT_U_BIAS_OUTPUT_FILE = ME_2018_02_polar_vortex_U.png
PLOT_U_RMSE_OUTPUT_FILE = RMSE_2018_02_polar_vortex_U.png
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ def main():
"""
Create plots
"""
print(plot_bias_levels)
print(plot_rmse_levels)
plot_polar_bias(pleads,plevels,pme,plot_bias_output_file,plot_bias_title,plot_bias_levels)
plot_polar_rmse(pleads,plevels,prmse,plot_rmse_output_file,plot_rmse_title,plot_rmse_levels)

Expand Down
Loading

0 comments on commit 6b0a930

Please sign in to comment.