diff --git a/.github/parm/use_case_groups.json b/.github/parm/use_case_groups.json index 4cb2de818b..6c5f13f407 100644 --- a/.github/parm/use_case_groups.json +++ b/.github/parm/use_case_groups.json @@ -136,7 +136,7 @@ }, { "category": "s2s", - "index_list": "8-9", + "index_list": "7-9", "run": false }, { @@ -144,6 +144,11 @@ "index_list": "10", "run": false }, + { + "category": "s2s", + "index_list": "11", + "run": false + }, { "category": "space_weather", "index_list": "0-1", diff --git a/docs/_static/s2s-OMI_GFS_phase_diagram.png b/docs/_static/s2s-OMI_GFS_phase_diagram.png new file mode 100644 index 0000000000..5ec1b3adb6 Binary files /dev/null and b/docs/_static/s2s-OMI_GFS_phase_diagram.png differ diff --git a/docs/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_OMI.py b/docs/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_OMI.py index 103d0b34d3..201e41d96e 100644 --- a/docs/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_OMI.py +++ b/docs/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_OMI.py @@ -12,7 +12,7 @@ # Scientific Objective # -------------------- # -# To use Outgoing Longwave Radiation (OLR) to compute the OLR based MJO Index (OMI). Specifically, OMI is computed using OLR data between 20N and 20S. Anomalies of OLR are then created. The OLR anomalies are then projected onto Empirical Orthogonal Function (EOF) data that is computed for each day of the year, latitude, and longitude. The OLR is then filtered for 20 - 96 days, and regressed onto the daily EOFs. Finally, it's normalized and these normalized components are plotted on a phase diagram. +# To use Outgoing Longwave Radiation (OLR) to compute the OLR based MJO Index (OMI). Specifically, OMI is computed using OLR data between 20N and 20S. The OLR data are then projected onto Empirical Orthogonal Function (EOF) data that is computed for each day of the year, latitude, and longitude. The OLR is then filtered for 20 - 96 days, and regressed onto the daily EOFs. Finally, it's normalized and these normalized components are plotted on a phase diagram. Separate phase diagrams are created for the model and observations. # ############################################################################## @@ -48,14 +48,14 @@ # METplus Components # ------------------ # -# This use case runs the OMI driver which computes OMI and creates a phase diagram. Inputs to the OMI driver include netCDF files that are in MET's netCDF version. In addition, a txt file containing the listing of these input netCDF files is required, as well as text file listings of the EOF1 and EOF2 files. These text files can be generated using the USER_SCRIPT_INPUT_TEMPLATES in the [create_eof_filelist] and [script_omi] sections. Some optional pre-processing steps include using regrid_data_plane to either regrid your data or cut the domain t0 20N - 20S. +# This use case runs the OMI driver which computes OMI and creates a phase diagram. Inputs to the OMI driver include netCDF files that are in MET's netCDF version. In addition, a txt file containing the listing of these input netCDF files is required, as well as text file listings of the EOF1 and EOF2 files. These text files can be generated using the USER_SCRIPT_INPUT_TEMPLATES in the [create_eof_filelist] and [script_omi] sections. Some optional pre-processing steps include using regrid_data_plane to either regrid your data or cut the domain to 20N - 20S. # ############################################################################## # METplus Workflow # ---------------- # -# The OMI driver script python code is run for each lead time on the forecast and observations data. This example loops by valid time for the model pre-processing, and valid time for the other steps. This version is set to only process the OMI calculation and creating a text file listing of the EOF files, omitting the regridding, and anomaly caluclation pre-processing steps. However, the configurations for pre-processing are available for user reference. +# The OMI driver script python code is run for each lead time on the forecast and observations data. This example loops by valid time for the model pre-processing, and valid time for the other steps. This version is set to only process the OMI calculation and creating a text file listing of the EOF files, omitting the creation of daily means for the model and the regridding pre-processing steps. However, the configurations for pre-processing are available for user reference. ############################################################################## # METplus Configuration @@ -129,9 +129,13 @@ # Keywords # -------- # -# sphinx_gallery_thumbnail_path = '_static/s2s-OMI_phase_diagram.png' +# .. note:: +# +# * S2SAppUseCase +# * RegridDataPlaneUseCase +# * PCPCombineUseCase +# +# Navigate to :ref:`quick-search` to discover other similar use cases. +# +# sphinx_gallery_thumbnail_path = '_static/s2s-OMI_GFS_phase_diagram.png' # -# .. note:: `S2SAppUseCase `_, -# `RegridDataPlaneUseCase `_, -# `PCPCombineUseCase `_ - diff --git a/docs/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_RMM.py b/docs/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_RMM.py deleted file mode 100644 index b6b618c66b..0000000000 --- a/docs/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_RMM.py +++ /dev/null @@ -1,263 +0,0 @@ -""" -UserScript: Make RMM plots from calculated MJO indices -=========================================================================== - -model_applications/ -s2s/ -UserScript_fcstGFS_obsERA_RMM.py - -""" - -############################################################################## -# Scientific Objective -# -------------------- -# -# To compute the Real-time Multivariate MJO Index (RMM) using Outgoing Longwave Radiation (OLR), 850 hPa wind (U850), and 200 hPa wind (U200). Specifically, RMM is computed using OLR, U850, andU200 data between 15N and 15S. Anomalies of OLR, U850, and U200 are then created, 120 day day mean removed, and the data are normalized by normalization factors (generally the square root of the average variance) The anomalies are projected onto Empirical Orthogonal Function (EOF) data. The OLR is then filtered for 20 - 96 days, and regressed onto the daily EOFs. Finally, it's normalized and these normalized components are plotted on a phase diagram and timeseries plot. -# - -############################################################################## -# Datasets -# -------- -# -# * Forecast dataset: GFS Model Outgoing Longwave Radiation -# * Observation dataset: ERA Reanlaysis Outgoing Longwave Radiation. - -############################################################################## -# External Dependencies -# --------------------- -# -# You will need to use a version of Python 3.6+ that has the following packages installed:: -# -# * numpy -# * netCDF4 -# * datetime -# * xarray -# * matplotlib -# * scipy -# * pandas -# -# If the version of Python used to compile MET did not have these libraries at the time of compilation, you will need to add these packages or create a new Python environment with these packages. -# -# If this is the case, you will need to set the MET_PYTHON_EXE environment variable to the path of the version of Python you want to use. If you want this version of Python to only apply to this use case, set it in the [user_env_vars] section of a METplus configuration file.: -# -# [user_env_vars] -# MET_PYTHON_EXE = /path/to/python/with/required/packages/bin/python -# - -############################################################################## -# METplus Components -# ------------------ -# -# This use case runs the OMI driver which computes OMI and creates a phase diagram. Inputs to the OMI driver include netCDF files that are in MET's netCDF version. In addition, a txt file containing the listing of these input netCDF files is required, as well as text file listings of the EOF1 and EOF2 files. Some optional pre-processing steps include using regrid_data_plane to either regrid your data or cut the domain t0 20N - 20S. -# - -############################################################################## -# METplus Workflow -# ---------------- -# -# The OMI driver script python code is run for each lead time on the forecast and observations data. This example loops by valid time for the model pre-processing, and valid time for the other steps. This version is set to only process the OMI calculation and creating a text file listing of the EOF files, omitting the regridding, and anomaly caluclation pre-processing steps. However, the configurations for pre-processing are available for user reference. - -############################################################################## -# 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/UserScript_fcstGFS_obsERA_OMI.conf. -# The file OMI_driver.py runs the python program and -# UserScript_fcstGFS_obsERA_OMI/UserScript_fcstGFS_obsERA_OMI.conf sets the -# variables for all steps of the OMI use case. -# -# .. highlight:: bash -# .. literalinclude:: ../../../../parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_OMI.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. -# -# - -############################################################################## -# Python Scripts -# ---------------- -# -# The OMI driver script orchestrates the calculation of the MJO indices and -# the generation of a phase diagram OMI plot: -# parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_OMI/OMI_driver.py: -# -# .. highlight:: python -# .. literalinclude:: ../../../../parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_OMI/OMI_driver.py -# - -############################################################################## -# Running METplus -# --------------- -# -# This use case is run in the following ways: -# -# 1) Passing in UserScript_fcstGFS_obsERA_OMI.conf then a user-specific system configuration file:: -# -# run_metplus.py -c /path/to/METplus/parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_OMI.conf -c /path/to/user_system.conf -# -# 2) Modifying the configurations in parm/metplus_config, then passing in UserScript_fcstGFS_obsERA_OMI.py:: -# -# run_metplus.py -c /path/to/METplus/parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_OMI.conf -# -# 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 -# - -############################################################################## -# Expected Output -# --------------- -# -# 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 model_applications/s2s/UserScript_fcstGFS_obsERA_OMI. This may include the regridded data and daily averaged files. In addition, the phase diagram plots will be generated and the output location can be specified as OMI_PLOT_OUTPUT_DIR. If it is not specified, plots will be sent to model_applications/s2s/UserScript_fcstGFS_obsERA_OMI/plots (relative to **OUTPUT_BASE**). - -############################################################################## -# Keywords -# -------- -# -# sphinx_gallery_thumbnail_path = '_static/s2s-OMI_phase_diagram.png' -# -# .. note:: `XXXX`, `S2SAppUseCase `_ -# `RegridDataPlaneUseCase `_, -# `PCPCombineUseCase `_ - - -# -# - -############################################################################## -# Datasets -# -------- -# -# * Forecast dataset: GFS Model Outgoing Longwave Radiation, 850 hPa wind and 200 hPa wind -# * Observation dataset: ERA Reanlaysis Outgoing Longwave Radiation, 850 hPa wind and 200 hPa wind - -############################################################################## -# External Dependencies -# --------------------- -# -# You will need to use a version of Python 3.6+ that has the following packages installed:: -# -# * numpy -# * netCDF4 -# * datetime -# * xarray -# * matplotlib -# * scipy -# * pandas -# -# If the version of Python used to compile MET did not have these libraries at the time of compilation, you will need to add these packages or create a new Python environment with these packages. -# -# If this is the case, you will need to set the MET_PYTHON_EXE environment variable to the path of the version of Python you want to use. If you want this version of Python to only apply to this use case, set it in the [user_env_vars] section of a METplus configuration file.: -# -# [user_env_vars] -# MET_PYTHON_EXE = /path/to/python/with/required/packages/bin/python -# - -############################################################################## -# METplus Components -# ------------------ -# -# This use case runs the RMM driver which computes RMM and creates a phase diagram, time series, and EOF plot. Inputs to the RMM driver include netCDF files that are in MET's netCDF version. In addition, a text file containing the listing of these input netCDF files for OLR, u850 and u200 is required. Some optional pre-processing steps include using regrid_data_plane to either regrid your data or cut the domain t0 20N - 20S. -# - -############################################################################## -# METplus Workflow -# ---------------- -# The RMM driver script python code is run for each lead time on the forecast and observations data. This example loops by valid time for the model pre-processing, and valid time for the other steps. This version is set to only process the RMM calculation, omitting the regridding, and anomaly caluclation, and creation of the text file listing for OLR, u850, and u200 pre-processing steps. However, the configurations for pre-processing are available for user reference. -# - -############################################################################## -# 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/UserScript_fcstGFS_obsERA_RMM.conf. -# The file UserScript_fcstGFS_obsERA_RMM/RMM_driver.py runs the python program and -# UserScript_fcstGFS_obsERA_RMM.conf sets the variables for all steps of the RMM use case. -# -# .. highlight:: bash -# .. literalinclude:: ../../../../parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_RMM.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. -# -# - -############################################################################## -# Python Scripts -# ---------------- -# -# The RMM driver script orchestrates the calculation of the MJO indices and -# the generation of three RMM plots: -# parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_RMM/RMM_driver.py: -# -# .. highlight:: python -# .. literalinclude:: ../../../../parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_RMM/RMM_driver.py -# - -############################################################################## -# Running METplus -# --------------- -# -# This use case is run in the following ways: -# -# 1) Passing in UserScript_fcstGFS_obsERA_RMM.conf then a user-specific system configuration file:: -# -# run_metplus.py -c /path/to/METplus/parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_RMM.conf -c /path/to/user_system.conf -# -# 2) Modifying the configurations in parm/metplus_config, then passing in UserScript_fcstGFS_obsERA_RMM.py:: -# -# run_metplus.py -c /path/to/METplus/parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_RMM.conf -# -# 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 -# - -############################################################################## -# Expected Output -# --------------- -# -# 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 model_applications/s2s/UserScript_fcstGFS_obsERA_RMM. This may include the regridded data and daily averaged files. In addition, three plots will be generated, a phase diagram, time series, and EOF plot, and the output location can be specified as RMM_PLOT_OUTPUT_DIR. If it is not specified, plots will be sent to model_applications/s2s/UserScript_fcstGFS_obsERA_RMM/plots (relative to **OUTPUT_BASE**). -# - -############################################################################## -# Keywords -# -------- -# -# sphinx_gallery_thumbnail_path = '_static/s2s-RMM_time_series.png' -# -# .. note:: `XXXX`, `S2SAppUseCase `_, -# `NetCDFFileUseCase ` -# `RegridDataPlaneUseCase `_, -# `PCPCombineUseCase `__ diff --git a/docs/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_OMI.py b/docs/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_OMI.py new file mode 100644 index 0000000000..90450b8134 --- /dev/null +++ b/docs/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_OMI.py @@ -0,0 +1,141 @@ +""" +UserScript: Make OMI plot from calculated MJO indices +=========================================================================== + +model_applications/ +s2s/ +UserScript_obsERA_obsOnly_OMI.py + +""" + +############################################################################## +# Scientific Objective +# -------------------- +# +# To use Outgoing Longwave Radiation (OLR) to compute the OLR based MJO Index (OMI). Specifically, OMI is computed using OLR data between 20N and 20S. The OLR data are then projected onto Empirical Orthogonal Function (EOF) data that is computed for each day of the year, latitude, and longitude. The OLR is then filtered for 20 - 96 days, and regressed onto the daily EOFs. Finally, it's normalized and these normalized components are plotted on a phase diagram. +# + +############################################################################## +# Datasets +# -------- +# +# * Forecast dataset: None +# * Observation dataset: ERA Reanlaysis Outgoing Longwave Radiation. + +############################################################################## +# External Dependencies +# --------------------- +# +# You will need to use a version of Python 3.6+ that has the following packages installed:: +# +# * numpy +# * netCDF4 +# * datetime +# * xarray +# * matplotlib +# * scipy +# * pandas +# +# If the version of Python used to compile MET did not have these libraries at the time of compilation, you will need to add these packages or create a new Python environment with these packages. +# +# If this is the case, you will need to set the MET_PYTHON_EXE environment variable to the path of the version of Python you want to use. If you want this version of Python to only apply to this use case, set it in the [user_env_vars] section of a METplus configuration file.: +# +# [user_env_vars] +# MET_PYTHON_EXE = /path/to/python/with/required/packages/bin/python +# + +############################################################################## +# METplus Components +# ------------------ +# +# This use case runs the OMI driver which computes OMI and creates a phase diagram. Inputs to the OMI driver include netCDF files that are in MET's netCDF version. In addition, a txt file containing the listing of these input netCDF files is required, as well as text file listings of the EOF1 and EOF2 files. These text files can be generated using the USER_SCRIPT_INPUT_TEMPLATES in the [create_eof_filelist] and [script_omi] sections. Some optional pre-processing steps include using regrid_data_plane to either regrid your data or cut the domain to 20N - 20S. +# + +############################################################################## +# METplus Workflow +# ---------------- +# +# The OMI driver script python code is run for each lead time on the forecast and observations data. This example loops by valid time for the model pre-processing, and valid time for the other steps. This version is set to only process the OMI calculation and creating a text file listing of the EOF files, omitting the creation of daily means for the model and the regridding pre-processing steps. However, the configurations for pre-processing are available for user reference. + +############################################################################## +# 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/UserScript_obsERA_obsOnly_OMI.conf. +# The file UserScript_obsERA_obsOnly_OMI/OMI_driver.py runs the python program and +# UserScript_fcstGFS_obsERA_OMI.conf sets the variables for all steps of the OMI use case. +# +# .. highlight:: bash +# .. literalinclude:: ../../../../parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_OMI.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. +# +# + +############################################################################## +# Python Scripts +# ---------------- +# +# The OMI driver script orchestrates the calculation of the MJO indices and +# the generation of a phase diagram OMI plot: +# parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_OMI/OMI_driver.py: +# +# .. highlight:: python +# .. literalinclude:: ../../../../parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_OMI/OMI_driver.py +# + +############################################################################## +# Running METplus +# --------------- +# +# This use case is run in the following ways: +# +# 1) Passing in UserScript_obsERA_obsOnly_OMI.conf then a user-specific system configuration file:: +# +# run_metplus.py -c /path/to/METplus/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_OMI.conf -c /path/to/user_system.conf +# +# 2) Modifying the configurations in parm/metplus_config, then passing in UserScript_obsERA_obsOnly_OMI.py:: +# +# run_metplus.py -c /path/to/METplus/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_OMI.conf +# +# 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 +# + +############################################################################## +# Expected Output +# --------------- +# +# 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 model_applications/s2s/UserScript_obsERA_obsOnly_OMI. This may include the regridded data and daily averaged files. In addition, the phase diagram plots will be generated and the output location can be specified as OMI_PLOT_OUTPUT_DIR. If it is not specified, plots will be sent to model_applications/s2s/UserScript_obsERA_obsOnly_OMI/plots (relative to **OUTPUT_BASE**). + +############################################################################## +# Keywords +# -------- +# +# .. note:: +# +# * S2SAppUseCase +# * RegridDataPlaneUseCase +# * PCPCombineUseCase +# +# Navigate to :ref:`quick-search` to discover other similar use cases. +# +# sphinx_gallery_thumbnail_path = '_static/s2s-OMI_phase_diagram.png' +# \ No newline at end of file diff --git a/docs/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_PhaseDiagram.py b/docs/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_PhaseDiagram.py similarity index 82% rename from docs/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_PhaseDiagram.py rename to docs/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_PhaseDiagram.py index 9a9e2996e3..3266d628dd 100644 --- a/docs/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_PhaseDiagram.py +++ b/docs/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_PhaseDiagram.py @@ -4,7 +4,7 @@ model_applications/ s2s/ -UserScript_fcstGFS_obsERA_PhaseDiagram.py +UserScript_obsERA_obsOnly_PhaseDiagram.py """ @@ -63,13 +63,13 @@ # # 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/UserScript_fcstGFS_obsERA_OMI.conf. -# The file UserScript_fcstGFS_obsERA_PhaseDiagram/PhaseDiagram_driver.py runs the python -# program and UserScript_fcstGFS_obsERA_PhaseDiagram.conf sets the variables for all steps +# i.e. parm/use_cases/model_applications/s2s/UserScript_obsERA_obsERA_OMI.conf. +# The file UserScript_obsERA_obsOnly_PhaseDiagram/PhaseDiagram_driver.py runs the python +# program and UserScript_obsERA_obsOnly_PhaseDiagram.conf sets the variables for all steps # of the use case. # # .. highlight:: bash -# .. literalinclude:: ../../../../parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_PhaseDiagram.conf +# .. literalinclude:: ../../../../parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_PhaseDiagram.conf ############################################################################## # MET Configuration @@ -84,11 +84,11 @@ # ---------------- # # The phase diagram driver script orchestrates the generation of a phase diagram plot: -# parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_OMI/PhaseDiagram_driver.py: +# parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_OMI/PhaseDiagram_driver.py: # # .. highlight:: python -# .. literalinclude:: ../../../../parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_PhaseDiagram/PhaseDiagram_driver.py -# .. literalinclude:: ../../../../parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_PhaseDiagram/save_input_files_txt.py +# .. literalinclude:: ../../../../parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_PhaseDiagram/PhaseDiagram_driver.py +# .. literalinclude:: ../../../../parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_PhaseDiagram/save_input_files_txt.py # ############################################################################## @@ -97,13 +97,13 @@ # # This use case is run in the following ways: # -# 1) Passing in UserScript_fcstGFS_obsERA_OMI.conf then a user-specific system configuration file:: +# 1) Passing in UserScript_obsERA_obsOnly_PhaseDiagram.conf then a user-specific system configuration file:: # -# run_metplus.py -c /path/to/METplus/parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_PhaseDiagram.conf -c /path/to/user_system.conf +# run_metplus.py -c /path/to/METplus/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_PhaseDiagram.conf -c /path/to/user_system.conf # -# 2) Modifying the configurations in parm/metplus_config, then passing in UserScript_fcstGFS_obsERA_PhaseDiagram.py:: +# 2) Modifying the configurations in parm/metplus_config, then passing in UserScript_obsERA_obsOnly_PhaseDiagram.py:: # -# run_metplus.py -c /path/to/METplus/parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_PhaseDiagram.conf +# run_metplus.py -c /path/to/METplus/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_PhaseDiagram.conf # # The following variables must be set correctly: # @@ -123,12 +123,18 @@ # Expected Output # --------------- # -# 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 model_applications/s2s/UserScript_fcstGFS_obsERA_PhaseDiagram. This may include the regridded data and daily averaged files. In addition, the phase diagram plots will be generated and the output location can be specified as OMI_PLOT_OUTPUT_DIR. If it is not specified, plots will be sent to model_applications/s2s/UserScript_fcstGFS_obsERA_OMI/plots (relative to **OUTPUT_BASE**). +# 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 model_applications/s2s/UserScript_obsERA_obsOnly_PhaseDiagram. This may include the regridded data and daily averaged files. In addition, the phase diagram plots will be generated and the output location can be specified as PHASE_DIAGRAM_PLOT_OUTPUT_DIR. If it is not specified, plots will be sent to model_applications/s2s/UserScript_obsERA_obsOnly_PhaseDiagram/plots (relative to **OUTPUT_BASE**). ############################################################################## # Keywords # -------- # -# sphinx_gallery_thumbnail_path = '_static/s2s-PhaseDiagram.png' # -# .. note:: `XXXX`, `S2SAppUseCase `_ +# .. note:: +# +# * S2SAppUseCase +# +# Navigate to :ref:`quick-search` to discover other similar use cases. +# +# sphinx_gallery_thumbnail_path = '_static/s2s-PhaseDiagram.png' +# \ No newline at end of file diff --git a/docs/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_RMM.py b/docs/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_RMM.py new file mode 100644 index 0000000000..6c4f3e5c6c --- /dev/null +++ b/docs/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_RMM.py @@ -0,0 +1,147 @@ +""" +UserScript: Make RMM plots from calculated MJO indices +=========================================================================== + +model_applications/ +s2s/ +UserScript_obsERA_obsOnly_RMM.py + +""" + +############################################################################## +# Scientific Objective +# -------------------- +# +# To compute the Real-time Multivariate MJO Index (RMM) using Outgoing Longwave Radiation (OLR), 850 hPa wind (U850), and 200 hPa wind (U200). Specifically, RMM is computed using OLR, U850, and U200 data between 15N and 15S. Anomalies of OLR, U850, and U200 are created using a harmonic analysis, 120 day day mean removed, and the data are normalized by normalization factors (generally the square root of the average variance) The anomalies are projected onto Empirical Orthogonal Function (EOF) data. The OLR is then filtered for 20 - 96 days, and regressed onto the daily EOFs. Finally, it's normalized and these normalized components are plotted on a phase diagram and timeseries plot. +# + +############################################################################## +# Datasets +# -------- +# +# * Forecast dataset: None +# * Observation dataset: ERA Reanlaysis Outgoing Longwave Radiation, 850 hPa wind and 200 hPa wind + +############################################################################## +# External Dependencies +# --------------------- +# +# You will need to use a version of Python 3.6+ that has the following packages installed:: +# +# * numpy +# * netCDF4 +# * datetime +# * xarray +# * matplotlib +# * scipy +# * pandas +# +# If the version of Python used to compile MET did not have these libraries at the time of compilation, you will need to add these packages or create a new Python environment with these packages. +# +# If this is the case, you will need to set the MET_PYTHON_EXE environment variable to the path of the version of Python you want to use. If you want this version of Python to only apply to this use case, set it in the [user_env_vars] section of a METplus configuration file.: +# +# [user_env_vars] +# MET_PYTHON_EXE = /path/to/python/with/required/packages/bin/python +# + +############################################################################## +# METplus Components +# ------------------ +# +# This use case runs the RMM driver which computes first computes anomalies of outgoing longwave raidation, 850 hPa wind and 200 hPa wind. Then, it regrids the data to 15S to 15N. Next, RMM is computed and a phase diagram, time series, and EOF plot are created. Inputs to the RMM driver include netCDF files that are in MET's netCDF version. In addition, a text file containing the listing of these input netCDF files for OLR, u850 and u200 is required. Some optional pre-processing steps include using pcp_combine to compute daily means and the mean daily annual cycle for the data. +# + +############################################################################## +# METplus Workflow +# ---------------- +# The RMM driver script python code is run for each lead time on the forecast and observations data. This example loops by valid time for the model pre-processing, and valid time for the other steps. This version is set to only process the creation of anomalies, regridding, and RMM calculation, omitting the caluclation of daily means and the mean daily annucal cycle pre-processing steps. However, the configurations for pre-processing are available for user reference. +# + +############################################################################## +# 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/UserScript_obsERA_obsOnly_RMM.conf. +# The file UserScript_obsERA_obsOnly_RMM/RMM_driver.py runs the python program and +# UserScript_obsERA_obsOnly_RMM.conf sets the variables for all steps of the RMM use case. +# +# .. highlight:: bash +# .. literalinclude:: ../../../../parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_RMM.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. +# +# + +############################################################################## +# Python Scripts +# ---------------- +# +# The RMM driver script orchestrates the calculation of the MJO indices and +# the generation of three RMM plots: +# parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_RMM/RMM_driver.py: +# The harmonic anomalies script creates anomalies of input data using a harmonic analysis: +# parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_RMM/compute_harmonic_anomalies.py +# +# .. highlight:: python +# .. literalinclude:: ../../../../parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_RMM/RMM_driver.py +# .. literalinclude:: ../../../../parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_RMM/compute_harmonic_anomalies.py +# + +############################################################################## +# Running METplus +# --------------- +# +# This use case is run in the following ways: +# +# 1) Passing in UserScript_obsERA_obsOnly_RMM.conf then a user-specific system configuration file:: +# +# run_metplus.py -c /path/to/METplus/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_RMM.conf -c /path/to/user_system.conf +# +# 2) Modifying the configurations in parm/metplus_config, then passing in UserScript_obsERA_obsOnly_RMM.py:: +# +# run_metplus.py -c /path/to/METplus/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_RMM.conf +# +# 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 +# + +############################################################################## +# Expected Output +# --------------- +# +# 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 model_applications/s2s/UserScript_obsERA_obsOnly_RMM. This may include the regridded data and daily averaged files. In addition, three plots will be generated, a phase diagram, time series, and EOF plot, and the output location can be specified as RMM_PLOT_OUTPUT_DIR. If it is not specified, plots will be sent to model_applications/s2s/UserScript_obsERA_obsOnly_RMM/plots (relative to **OUTPUT_BASE**). +# + +############################################################################## +# Keywords +# -------- +# +# +# .. note:: +# +# * S2SAppUseCase +# * NetCDFFileUseCase +# * RegridDataPlaneUseCase +# * PCPCombineUseCase +# +# Navigate to :ref:`quick-search` to discover other similar use cases. +# +# sphinx_gallery_thumbnail_path = '_static/s2s-RMM_time_series.png' +# \ No newline at end of file diff --git a/internal_tests/use_cases/all_use_cases.txt b/internal_tests/use_cases/all_use_cases.txt index 2d196b9b67..b6cd0a3af5 100644 --- a/internal_tests/use_cases/all_use_cases.txt +++ b/internal_tests/use_cases/all_use_cases.txt @@ -123,10 +123,11 @@ Category: s2s 4::TCGen_fcstGFSO_obsBDECKS_GDF_TDF:: model_applications/s2s/TCGen_fcstGFSO_obsBDECKS_GDF_TDF.conf:: metplotpy_env,cartopy,metplus 5::UserScript_obsPrecip_obsOnly_Hovmoeller:: model_applications/s2s/UserScript_obsPrecip_obsOnly_Hovmoeller.conf:: metplotpy_env,cartopy 6:: UserScript_obsPrecip_obsOnly_CrossSpectraPlot:: model_applications/s2s/UserScript_obsPrecip_obsOnly_CrossSpectraPlot.conf:: spacetime_env -7:: UserScript_fcstGFS_obsERA_PhaseDiagram:: model_applications/s2s/UserScript_fcstGFS_obsERA_PhaseDiagram.conf:: spacetime_env +7:: UserScript_obsERA_obsOnly_PhaseDiagram:: model_applications/s2s/UserScript_obsERA_obsOnly_PhaseDiagram.conf:: spacetime_env 8:: UserScript_fcstGFS_obsERA_OMI:: model_applications/s2s/UserScript_fcstGFS_obsERA_OMI.conf:: spacetime_env, metdatadb -9:: UserScript_fcstGFS_obsERA_RMM:: model_applications/s2s/UserScript_fcstGFS_obsERA_RMM.conf:: spacetime_env, metdatadb -10::UserScript_fcstGFS_obsERA_WeatherRegime:: model_applications/s2s/UserScript_fcstGFS_obsERA_WeatherRegime.conf:: weatherregime_env,cartopy,metplus +9:: UserScript_obsERA_obsOnly_OMI:: model_applications/s2s/UserScript_obsERA_obsOnly_OMI.conf:: spacetime_env, metdatadb +10:: UserScript_obsERA_obsOnly_RMM:: model_applications/s2s/UserScript_obsERA_obsOnly_RMM.conf:: spacetime_env, metdatadb +11:: UserScript_fcstGFS_obsERA_WeatherRegime:: model_applications/s2s/UserScript_fcstGFS_obsERA_WeatherRegime.conf:: weatherregime_env,cartopy,metplus Category: space_weather 0::GridStat_fcstGloTEC_obsGloTEC_vx7:: model_applications/space_weather/GridStat_fcstGloTEC_obsGloTEC_vx7.conf diff --git a/parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_OMI.conf b/parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_OMI.conf index 628ff33271..8ca46eba79 100644 --- a/parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_OMI.conf +++ b/parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_OMI.conf @@ -1,7 +1,7 @@ # OMI UserScript wrapper [config] # All steps, including pre-processing: -#PROCESS_LIST = RegridDataPlane(regrid_obs_olr), UserScript(create_eof_filelist), UserScript(script_omi) +#PROCESS_LIST = PcpCombine(daily_mean_fcst), RegridDataPlane(regrid_obs_olr), RegridDataPlane(regrid_fcst_olr), UserScript(create_eof_filelist), UserScript(script_omi) # Finding EOF files and OMI Analysis script for the observations PROCESS_LIST = UserScript(create_eof_filelist), UserScript(script_omi) @@ -19,10 +19,10 @@ LOOP_BY = VALID VALID_TIME_FMT = %Y%m%d%H # Start time for METplus run -VALID_BEG = 1979010100 +VALID_BEG = 2017010100 # End time for METplus run -VALID_END = 2012123000 +VALID_END = 2018123100 # Increment between METplus runs in seconds. Must be >= 60 VALID_INCREMENT = 86400 @@ -47,7 +47,7 @@ CONFIG_DIR={PARM_BASE}/use_cases/model_applications/s2s # Run the obs for these cases OBS_RUN = True -FCST_RUN = False +FCST_RUN = True # Mask to use for regridding REGRID_DATA_PLANE_VERIF_GRID = latlon 144 17 -20 0 2.5 2.5 @@ -59,12 +59,36 @@ REGRID_DATA_PLANE_METHOD = NEAREST REGRID_DATA_PLANE_WIDTH = 1 # Input and Output Directories for the OBS OLR Files and output text file containing the file list -OBS_OLR_INPUT_DIR = {INPUT_BASE}/model_applications/s2s/UserScript_fcstGFS_obsERA_OMI/ERA +OBS_OLR_INPUT_DIR = {INPUT_BASE}/model_applications/s2s/UserScript_fcstGFS_obsERA_OMI/ERA/Regrid OBS_OLR_INPUT_TEMPLATE = OLR_{valid?fmt=%Y%m%d}.nc +# Input and Output Directories for the OBS OLR Files and output text file containing the file list +FCST_OLR_INPUT_DIR = {INPUT_BASE}/model_applications/s2s/UserScript_fcstGFS_obsERA_OMI/GFS/Regrid +FCST_OLR_INPUT_TEMPLATE = OLR_{valid?fmt=%Y%m%d}.nc + + +# Configurations for pcp_combine: Create daily means for the GFS +[daily_mean_fcst] +# run pcp_combine on obs data +FCST_PCP_COMBINE_RUN = {FCST_RUN} + +# method to run pcp_combine on forecast data +# Options are ADD, SUM, SUBTRACT, DERIVE, and USER_DEFINED +FCST_PCP_COMBINE_METHOD = USER_DEFINED + +FCST_PCP_COMBINE_COMMAND = -derive mean {FCST_PCP_COMBINE_INPUT_DIR}/{valid?fmt=%Y}/{valid?fmt=%Y%m%d}/gfs.0p25.{valid?fmt=%Y%m%d%H}.f{lead?fmt=%HHH?shift=86400}.grib2 {FCST_PCP_COMBINE_INPUT_DIR}/{valid?fmt=%Y}/{valid?fmt=%Y%m%d}/gfs.0p25.{valid?fmt=%Y%m%d%H}.f{lead?fmt=%HHH?shift=75600}.grib2 {FCST_PCP_COMBINE_INPUT_DIR}/{valid?fmt=%Y}/{valid?fmt=%Y%m%d}/gfs.0p25.{valid?fmt=%Y%m%d%H}.f{lead?fmt=%HHH?shift=64800}.grib2 {FCST_PCP_COMBINE_INPUT_DIR}/{init?fmt=%Y}/{init?fmt=%Y%m%d}/gfs.0p25.{init?fmt=%Y%m%d%H}.f{lead?fmt=%HHH?shift=54000}.grib2 {FCST_PCP_COMBINE_INPUT_DIR}/{init?fmt=%Y}/{init?fmt=%Y%m%d}/gfs.0p25.{init?fmt=%Y%m%d%H}.f{lead?fmt=%HHH?shift=43200}.grib2 {FCST_PCP_COMBINE_INPUT_DIR}/{init?fmt=%Y}/{init?fmt=%Y%m%d}/gfs.0p25.{init?fmt=%Y%m%d%H}.f{lead?fmt=%HHH?shift=32400}.grib2 {FCST_PCP_COMBINE_INPUT_DIR}/{init?fmt=%Y}/{init?fmt=%Y%m%d}/gfs.0p25.{init?fmt=%Y%m%d%H}.f{lead?fmt=%HHH?shift=21600}.grib2 {FCST_PCP_COMBINE_INPUT_DIR}/{init?fmt=%Y}/{init?fmt=%Y%m%d}/gfs.0p25.{init?fmt=%Y%m%d%H}.f{lead?fmt=%HHH?shift=10800}.grib2 -field 'name="ULWRF"; level="L0"; set_attr_valid = "{valid?fmt=%Y%m%d_%H%M%S}"; GRIB2_ipdtmpl_index = 9; GRIB2_ipdtmpl_val = 8;' + +FCST_PCP_COMBINE_INPUT_DIR = /gpfs/fs1/collections/rda/data/ds084.1 +FCST_PCP_COMBINE_INPUT_TEMPLATE = {valid?fmt=%Y%m}/gfs.0p25.{init?fmt=%y%m%d%H}.f{lead?fmt=%HHH}.grib2 + +FCST_PCP_COMBINE_OUTPUT_DIR = {OUTPUT_BASE}/s2s/UserScript_fcstGFS_obsERA_OMI/GFS/daily_mean +FCST_PCP_COMBINE_OUTPUT_TEMPLATE = GFS_mean_{valid?fmt=%Y%m%d}.nc -# Configurations for regrid_data_plane: Regrid OLR to -20 to 20 latitude + +# Configurations for regrid_data_plane: Regrid ERA OLR to -20 to 20 latitude [regrid_obs_olr] +LEAD_SEQ = 0 + # Run regrid_data_plane on forecast data OBS_REGRID_DATA_PLANE_RUN = {OBS_RUN} @@ -84,7 +108,7 @@ OBS_REGRID_DATA_PLANE_VAR1_OPTIONS = file_type=NETCDF_NCCF; censor_thresh=eq-999 OBS_REGRID_DATA_PLANE_VAR1_OUTPUT_FIELD_NAME = olr # input and output data directories for each application in PROCESS_LIST -OBS_REGRID_DATA_PLANE_INPUT_DIR = {INPUT_BASE}/model_applications/s2s/UserScript_fcstGFS_obsERA_OMI +OBS_REGRID_DATA_PLANE_INPUT_DIR = {INPUT_BASE}/model_applications/s2s/UserScript_fcstGFS_obsERA_OMI/ERA/daily_mean OBS_REGRID_DATA_PLANE_OUTPUT_DIR = {OBS_OLR_INPUT_DIR} # format of filenames @@ -93,6 +117,34 @@ OBS_REGRID_DATA_PLANE_INPUT_TEMPLATE = olr.1x.7920.nc OBS_REGRID_DATA_PLANE_OUTPUT_TEMPLATE = {OBS_OLR_INPUT_TEMPLATE} +# Configurations for regrid_data_plane: Regrid GFS OLR to -20 to 20 latitude +[regrid_fcst_olr] +# Run regrid_data_plane on forecast data +FCST_REGRID_DATA_PLANE_RUN = {FCST_RUN} + +# 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_NAME = ULWRF_L0_mean + +# Level of input field to process +FCST_REGRID_DATA_PLANE_VAR1_LEVELS = "(*,*)" + +# Name of output field to create +FCST_REGRID_DATA_PLANE_VAR1_OUTPUT_FIELD_NAME = olr + +# input and output data directories for each application in PROCESS_LIST +FCST_REGRID_DATA_PLANE_INPUT_DIR = {INPUT_BASE}/model_applications/s2s/UserScript_fcstGFS_obsERA_OMI/GFS/daily_mean +FCST_REGRID_DATA_PLANE_OUTPUT_DIR = {FCST_OLR_INPUT_DIR} + +# format of filenames +# Input ERA Interim +FCST_REGRID_DATA_PLANE_INPUT_TEMPLATE = GFS_mean_{valid?fmt=%Y%m%d}.nc +FCST_REGRID_DATA_PLANE_OUTPUT_TEMPLATE = {FCST_OLR_INPUT_TEMPLATE} + + # Create the EOF filelists [create_eof_filelist] # Find the files for each time to create the time list @@ -133,11 +185,13 @@ OBS_PER_DAY = 1 OMI_PLOT_OUTPUT_DIR = {OUTPUT_BASE}/s2s/UserScript_fcstGFS_obsERA_OMI/plots # Phase Plot start date, end date, output name, and format -PHASE_PLOT_TIME_BEG = 2012010100 -PHASE_PLOT_TIME_END = 2012033000 +PHASE_PLOT_TIME_BEG = 2017010100 +PHASE_PLOT_TIME_END = 2017033100 PHASE_PLOT_TIME_FMT = {VALID_TIME_FMT} OBS_PHASE_PLOT_OUTPUT_NAME = obs_OMI_comp_phase -OBS_PHASE_PLOT_OUTPUT_FORMAT = png +OBS_PHASE_PLOT_OUTPUT_FORMAT = png +FCST_PHASE_PLOT_OUTPUT_NAME = fcst_OMI_comp_phase +FCST_PHASE_PLOT_OUTPUT_FORMAT = png # Configurations for UserScript: Run the RMM Analysis driver @@ -146,12 +200,12 @@ OBS_PHASE_PLOT_OUTPUT_FORMAT = png USER_SCRIPT_RUNTIME_FREQ = RUN_ONCE_PER_LEAD ## Template of OLR filenames to input to the user-script -USER_SCRIPT_INPUT_TEMPLATE = {OBS_OLR_INPUT_DIR}/{OBS_OLR_INPUT_TEMPLATE} +USER_SCRIPT_INPUT_TEMPLATE = {OBS_OLR_INPUT_DIR}/{OBS_OLR_INPUT_TEMPLATE},{FCST_OLR_INPUT_DIR}/{FCST_OLR_INPUT_TEMPLATE} ## Name of the file containing the listing of OLR input files ## The options are OBS_OLR_INPUT and FCST_OLR_INPUT ## *** Make sure the order is the same as the order of templates listed in USER_SCRIPT_INPUT_TEMPLATE -USER_SCRIPT_INPUT_TEMPLATE_LABELS = OBS_OLR_INPUT +USER_SCRIPT_INPUT_TEMPLATE_LABELS = OBS_OLR_INPUT,FCST_OLR_INPUT # Command to run the user script with input configuration file USER_SCRIPT_COMMAND = {METPLUS_BASE}/parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_OMI/OMI_driver.py diff --git a/parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_OMI/OMI_driver.py b/parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_OMI/OMI_driver.py index 1c63b88104..9e1ab61d05 100755 --- a/parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_OMI/OMI_driver.py +++ b/parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_OMI/OMI_driver.py @@ -84,6 +84,7 @@ def run_omi_steps(inlabel, olr_filetxt, spd, EOF1, EOF2, oplot_dir): # Get the output name and format for the PC plase diagram phase_plot_name = os.path.join(oplot_dir,os.environ.get(inlabel+'_PHASE_PLOT_OUTPUT_NAME',inlabel+'_OMI_comp_phase')) + print(phase_plot_name) phase_plot_format = os.environ.get(inlabel+'_PHASE_PLOT_OUTPUT_FORMAT','png') # plot the PC phase diagram @@ -128,7 +129,7 @@ def main(): # Determine if doing forecast or obs run_obs_omi = os.environ.get('RUN_OBS','False').lower() - run_fcst_omi = os.environ.get('FCST_RUN_FCST', 'False').lower() + run_fcst_omi = os.environ.get('RUN_FCST', 'False').lower() # Run the steps to compute OMM # Observations diff --git a/parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_RMM.conf b/parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_RMM.conf deleted file mode 100644 index 2eb51d1608..0000000000 --- a/parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_RMM.conf +++ /dev/null @@ -1,214 +0,0 @@ -# RMM UserScript wrapper -[config] -# All steps, including pre-processing: -#PROCESS_LIST = RegridDataPlane(regrid_obs_olr), RegridDataPlane(regrid_obs_u850), RegridDataPlane(regrid_obs_u200), UserScript(script_rmm) -# Only RMM Analysis script for the observations -PROCESS_LIST = UserScript(script_rmm) - -# time looping - 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 -LOOP_BY = VALID - -# Format of VALID_BEG and VALID_END using % items -# %Y = 4 digit year, %m = 2 digit month, %d = 2 digit day, etc. -# see www.strftime.org for more information -# %Y%m%d%H expands to YYYYMMDDHH -VALID_TIME_FMT = %Y%m%d%H - -# Start time for METplus run -VALID_BEG = 2000010100 - -# End time for METplus run -VALID_END = 2002123000 - -# Increment between METplus runs in seconds. Must be >= 60 -VALID_INCREMENT = 86400 - -# List of forecast leads to process for each run time (init or valid) -# In hours if units are not specified -# If unset, defaults to 0 (don't loop through forecast leads) -LEAD_SEQ = 0 - -# Order of loops to process data - Options are times, processes -# Not relevant if only one item is in the PROCESS_LIST -# times = run all wrappers in the PROCESS_LIST for a single run time, then -# increment the run time and run all wrappers again until all times have -# been evaluated. -# processes = run the first wrapper in the PROCESS_LIST for all times -# specified, then repeat for the next item in the PROCESS_LIST until all -# wrappers have been run -LOOP_ORDER = processes - -# location of configuration files used by MET applications -CONFIG_DIR={PARM_BASE}/use_cases/model_applications/s2s - -# Run the obs for these cases -OBS_RUN = True -FCST_RUN = False - -# Mask to use for regridding -REGRID_DATA_PLANE_VERIF_GRID = latlon 144 13 -15 0 2.5 2.5 - -# Method to run regrid_data_plane, not setting this will default to NEAREST -REGRID_DATA_PLANE_METHOD = NEAREST - -# Regridding width used in regrid_data_plane, not setting this will default to 1 -REGRID_DATA_PLANE_WIDTH = 1 - - -# Configurations for regrid_data_plane: Regrid OLR to -15 to 15 latitude -[regrid_obs_olr] -# Run regrid_data_plane on forecast data -OBS_REGRID_DATA_PLANE_RUN = {OBS_RUN} - -# If true, process each field individually and write a file for each -# If false, run once per run time passing in all fields specified -OBS_DATA_PLANE_ONCE_PER_FIELD = False - -# Name of input field to process -OBS_REGRID_DATA_PLANE_VAR1_NAME = olr - -# Level of input field to process -OBS_REGRID_DATA_PLANE_VAR1_LEVELS = "({valid?fmt=%Y%m%d_%H%M%S},*,*)" - -OBS_REGRID_DATA_PLANE_VAR1_OPTIONS = file_type=NETCDF_NCCF; censor_thresh=eq-999.0; censor_val=-9999.0; - -# Name of output field to create -OBS_REGRID_DATA_PLANE_VAR1_OUTPUT_FIELD_NAME = olr - -# input and output data directories for each application in PROCESS_LIST -OBS_REGRID_DATA_PLANE_INPUT_DIR = {INPUT_BASE}/model_applications/s2s/UserScript_fcstGFS_obsERA_RMM -OBS_REGRID_DATA_PLANE_OUTPUT_DIR = {OUTPUT_BASE}/s2s/UserScript_fcstGFS_obsERA_RMM/ERA - -# format of filenames -# Input ERA Interim -OBS_REGRID_DATA_PLANE_INPUT_TEMPLATE = olr.1x.7920.anom7901.nc -OBS_REGRID_DATA_PLANE_OUTPUT_TEMPLATE = OLR_{valid?fmt=%Y%m%d}.nc - - -# Configurations for regrid_data_plane: Regrid u850 to -15 to 15 latitude -[regrid_obs_u850] -# Run regrid_data_plane on forecast data -OBS_REGRID_DATA_PLANE_RUN = {OBS_RUN} - -# If true, process each field individually and write a file for each -# If false, run once per run time passing in all fields specified -OBS_DATA_PLANE_ONCE_PER_FIELD = False - -# Name of input field to process -OBS_REGRID_DATA_PLANE_VAR1_NAME = uwnd - -# Level of input field to process -OBS_REGRID_DATA_PLANE_VAR1_LEVELS = "({valid?fmt=%Y%m%d_%H%M%S},*,*)" - -OBS_REGRID_DATA_PLANE_VAR1_OPTIONS = file_type=NETCDF_NCCF; censor_thresh=eq-999.0; censor_val=-9999.0; - -# Name of output field to create -OBS_REGRID_DATA_PLANE_VAR1_OUTPUT_FIELD_NAME = uwnd850 - -# input and output data directories for each application in PROCESS_LIST -OBS_REGRID_DATA_PLANE_INPUT_DIR = {INPUT_BASE}/model_applications/s2s/UserScript_fcstGFS_obsERA_RMM -OBS_REGRID_DATA_PLANE_OUTPUT_DIR = {OUTPUT_BASE}/s2s/UserScript_fcstGFS_obsERA_RMM/ERA - -# format of filenames -# Input ERA Interim -OBS_REGRID_DATA_PLANE_INPUT_TEMPLATE = uwnd.erai.an.2p5.850.daily.anom7901.nc -OBS_REGRID_DATA_PLANE_OUTPUT_TEMPLATE = u850_{valid?fmt=%Y%m%d}.nc - - -# Configurations for regrid_data_plane: Regrid u200 to -15 to 15 latitude -[regrid_obs_u200] -# Run regrid_data_plane on forecast data -OBS_REGRID_DATA_PLANE_RUN = {OBS_RUN} - -# If true, process each field individually and write a file for each -# If false, run once per run time passing in all fields specified -OBS_DATA_PLANE_ONCE_PER_FIELD = False - -# Name of input field to process -OBS_REGRID_DATA_PLANE_VAR1_NAME = uwnd - -# Level of input field to process -OBS_REGRID_DATA_PLANE_VAR1_LEVELS = "({valid?fmt=%Y%m%d_%H%M%S},*,*)" - -OBS_REGRID_DATA_PLANE_VAR1_OPTIONS = file_type=NETCDF_NCCF; censor_thresh=eq-999.0; censor_val=-9999.0; - -# Name of output field to create -OBS_REGRID_DATA_PLANE_VAR1_OUTPUT_FIELD_NAME = uwnd200 - -# input and output data directories for each application in PROCESS_LIST -OBS_REGRID_DATA_PLANE_INPUT_DIR = {INPUT_BASE}/model_applications/s2s/UserScript_fcstGFS_obsERA_RMM -OBS_REGRID_DATA_PLANE_OUTPUT_DIR = {OUTPUT_BASE}/s2s/UserScript_fcstGFS_obsERA_RMM/ERA - -# format of filenames -# Input ERA Interim -OBS_REGRID_DATA_PLANE_INPUT_TEMPLATE = uwnd.erai.an.2p5.200.daily.anom7901.nc -OBS_REGRID_DATA_PLANE_OUTPUT_TEMPLATE = u200_{valid?fmt=%Y%m%d}.nc - - -# Configurations for the RMM analysis script -[user_env_vars] -# Whether to Run the model or obs -RUN_OBS = {OBS_RUN} -RUN_FCST = {FCST_RUN} - -# Make OUTPUT_BASE Available to the script -SCRIPT_OUTPUT_BASE = {OUTPUT_BASE} - -# Number of obs per day -OBS_PER_DAY = 1 - -# EOF Filename -OLR_EOF_INPUT_TEXTFILE = {INPUT_BASE}/model_applications/s2s/UserScript_fcstGFS_obsERA_RMM/EOF/rmm_olr_eofs.txt -U850_EOF_INPUT_TEXTFILE = {INPUT_BASE}/model_applications/s2s/UserScript_fcstGFS_obsERA_RMM/EOF/rmm_u850_eofs.txt -U200_EOF_INPUT_TEXTFILE = {INPUT_BASE}/model_applications/s2s/UserScript_fcstGFS_obsERA_RMM/EOF/rmm_u200_eofs.txt - -# Normalization factors for RMM -RMM_OLR_NORM = 15.11623 -RMM_U850_NORM = 1.81355 -RMM_U200_NORM = 4.80978 -PC1_NORM = 8.618352504159244 -PC2_NORM = 8.40736449709697 - -# Output Directory for the plots -# If not set, it this will default to {OUTPUT_BASE}/plots -RMM_PLOT_OUTPUT_DIR = {OUTPUT_BASE}/s2s/UserScript_fcstGFS_obsERA_RMM/plots - -# EOF plot information -EOF_PLOT_OUTPUT_NAME = RMM_EOFs -EOF_PLOT_OUTPUT_FORMAT = png - -# Phase Plot start date, end date, output name, and format -PHASE_PLOT_TIME_BEG = 2002010100 -PHASE_PLOT_TIME_END = 2002123000 -PHASE_PLOT_TIME_FMT = {VALID_TIME_FMT} -OBS_PHASE_PLOT_OUTPUT_NAME = obs_RMM_comp_phase -OBS_PHASE_PLOT_OUTPUT_FORMAT = png - -# Time Series Plot start date, end date, output name, and format -TIMESERIES_PLOT_TIME_BEG = 2002010100 -TIMESERIES_PLOT_TIME_END = 2002123000 -TIMESERIES_PLOT_TIME_FMT = {VALID_TIME_FMT} -OBS_TIMESERIES_PLOT_OUTPUT_NAME = obs_RMM_time_series -OBS_TIMESERIES_PLOT_OUTPUT_FORMAT = png - - -# Configurations for UserScript: Run the RMM Analysis driver -[script_rmm] -# list of strings to loop over for each run time. -# Run the user script once per lead -USER_SCRIPT_RUNTIME_FREQ = RUN_ONCE_PER_LEAD - -# Template of filenames to input to the user-script -USER_SCRIPT_INPUT_TEMPLATE = {INPUT_BASE}/model_applications/s2s/UserScript_fcstGFS_obsERA_RMM/ERA/OLR_{valid?fmt=%Y%m%d}.nc,{INPUT_BASE}/model_applications/s2s/UserScript_fcstGFS_obsERA_RMM/ERA/u850_{valid?fmt=%Y%m%d}.nc,{INPUT_BASE}/model_applications/s2s/UserScript_fcstGFS_obsERA_RMM/ERA/u200_{valid?fmt=%Y%m%d}.nc - -# Name of the file containing the listing of input files -# The options are OBS_OLR_INPUT, OBS_U850_INPUT, OBS_U200_INPUT, FCST_OLR_INPUT, FCST_U850_INPUT, and FCST_U200_INPUT -# *** Make sure the order is the same as the order of templates listed in USER_SCRIPT_INPUT_TEMPLATE -USER_SCRIPT_INPUT_TEMPLATE_LABELS = OBS_OLR_INPUT,OBS_U850_INPUT, OBS_U200_INPUT - -# Command to run the user script with input configuration file -USER_SCRIPT_COMMAND = {METPLUS_BASE}/parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_RMM/RMM_driver.py diff --git a/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_OMI.conf b/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_OMI.conf new file mode 100644 index 0000000000..fff56cde25 --- /dev/null +++ b/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_OMI.conf @@ -0,0 +1,157 @@ +# OMI UserScript wrapper +[config] +# All steps, including pre-processing: +#PROCESS_LIST = RegridDataPlane(regrid_obs_olr), UserScript(create_eof_filelist), UserScript(script_omi) +# Finding EOF files and OMI Analysis script for the observations +PROCESS_LIST = UserScript(create_eof_filelist), UserScript(script_omi) + +# time looping - 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 +LOOP_BY = VALID + +# Format of VALID_BEG and VALID_END using % items +# %Y = 4 digit year, %m = 2 digit month, %d = 2 digit day, etc. +# see www.strftime.org for more information +# %Y%m%d%H expands to YYYYMMDDHH +VALID_TIME_FMT = %Y%m%d%H + +# Start time for METplus run +VALID_BEG = 1979010100 + +# End time for METplus run +VALID_END = 2012123000 + +# Increment between METplus runs in seconds. Must be >= 60 +VALID_INCREMENT = 86400 + +# List of forecast leads to process for each run time (init or valid) +# In hours if units are not specified +# If unset, defaults to 0 (don't loop through forecast leads) +LEAD_SEQ = 0 + +# Order of loops to process data - Options are times, processes +# Not relevant if only one item is in the PROCESS_LIST +# times = run all wrappers in the PROCESS_LIST for a single run time, then +# increment the run time and run all wrappers again until all times have +# been evaluated. +# processes = run the first wrapper in the PROCESS_LIST for all times +# specified, then repeat for the next item in the PROCESS_LIST until all +# wrappers have been run +LOOP_ORDER = processes + +# location of configuration files used by MET applications +CONFIG_DIR={PARM_BASE}/use_cases/model_applications/s2s + +# Run the obs for these cases +OBS_RUN = True +FCST_RUN = False + +# Mask to use for regridding +REGRID_DATA_PLANE_VERIF_GRID = latlon 144 17 -20 0 2.5 2.5 + +# Method to run regrid_data_plane, not setting this will default to NEAREST +REGRID_DATA_PLANE_METHOD = NEAREST + +# Regridding width used in regrid_data_plane, not setting this will default to 1 +REGRID_DATA_PLANE_WIDTH = 1 + +# Input and Output Directories for the OBS OLR Files and output text file containing the file list +OBS_OLR_INPUT_DIR = {INPUT_BASE}/model_applications/s2s/UserScript_obsERA_obsOnly_OMI/ERA +OBS_OLR_INPUT_TEMPLATE = OLR_{valid?fmt=%Y%m%d}.nc + + +# Configurations for regrid_data_plane: Regrid OLR to -20 to 20 latitude +[regrid_obs_olr] +# Run regrid_data_plane on forecast data +OBS_REGRID_DATA_PLANE_RUN = {OBS_RUN} + +# If true, process each field individually and write a file for each +# If false, run once per run time passing in all fields specified +OBS_DATA_PLANE_ONCE_PER_FIELD = False + +# Name of input field to process +OBS_REGRID_DATA_PLANE_VAR1_NAME = olr + +# Level of input field to process +OBS_REGRID_DATA_PLANE_VAR1_LEVELS = "({valid?fmt=%Y%m%d_%H%M%S},*,*)" + +OBS_REGRID_DATA_PLANE_VAR1_OPTIONS = file_type=NETCDF_NCCF; censor_thresh=eq-999.0; censor_val=-9999.0; + +# Name of output field to create +OBS_REGRID_DATA_PLANE_VAR1_OUTPUT_FIELD_NAME = olr + +# input and output data directories for each application in PROCESS_LIST +OBS_REGRID_DATA_PLANE_INPUT_DIR = {INPUT_BASE}/model_applications/s2s/UserScript_obsERA_obsOnly_OMI +OBS_REGRID_DATA_PLANE_OUTPUT_DIR = {OBS_OLR_INPUT_DIR} + +# format of filenames +# Input ERA Interim +OBS_REGRID_DATA_PLANE_INPUT_TEMPLATE = olr.1x.7920.nc +OBS_REGRID_DATA_PLANE_OUTPUT_TEMPLATE = {OBS_OLR_INPUT_TEMPLATE} + + +# Create the EOF filelists +[create_eof_filelist] +# Find the files for each time to create the time list +USER_SCRIPT_RUNTIME_FREQ = RUN_ONCE + +# Valid Begin and End Times for the EOF files +VALID_BEG = 2012010100 +VALID_END = 2012123100 + +# Find the EOF files for each time +# Filename templates for EOF1 and EOF2 +USER_SCRIPT_INPUT_TEMPLATE = {INPUT_BASE}/model_applications/s2s/UserScript_obsERA_obsOnly_OMI/EOF/eof1/eof{valid?fmt=%j}.txt,{INPUT_BASE}/model_applications/s2s/UserScript_obsERA_obsOnly_OMI/EOF/eof2/eof{valid?fmt=%j}.txt + +# Name of the file containing the listing of input files +# The options are EOF1_INPUT and EOF2_INPUT +# *** Make sure the order is the same as the order of templates listed in USER_SCRIPT_INPUT_TEMPLATE +USER_SCRIPT_INPUT_TEMPLATE_LABELS = EOF1_INPUT, EOF2_INPUT + +# Placeholder command just to build the file list +# This just states that it's building the file list +USER_SCRIPT_COMMAND = echo Populated file list for EOF1 and EOF2 Input + + +# Configurations for the OMI analysis script +[user_env_vars] +# Whether to Run the model or obs +RUN_OBS = {OBS_RUN} +RUN_FCST = {FCST_RUN} + +# Make OUTPUT_BASE Available to the script +SCRIPT_OUTPUT_BASE = {OUTPUT_BASE} + +# Number of obs per day +OBS_PER_DAY = 1 + +# Output Directory for the plots +# If not set, it this will default to {OUTPUT_BASE}/plots +OMI_PLOT_OUTPUT_DIR = {OUTPUT_BASE}/s2s/UserScript_obsERA_obsOnly_OMI/plots + +# Phase Plot start date, end date, output name, and format +PHASE_PLOT_TIME_BEG = 2012010100 +PHASE_PLOT_TIME_END = 2012033000 +PHASE_PLOT_TIME_FMT = {VALID_TIME_FMT} +OBS_PHASE_PLOT_OUTPUT_NAME = obs_OMI_comp_phase +OBS_PHASE_PLOT_OUTPUT_FORMAT = png + + +# Configurations for UserScript: Run the RMM Analysis driver +[script_omi] +# Run the script once per lead time +USER_SCRIPT_RUNTIME_FREQ = RUN_ONCE_PER_LEAD + +## Template of OLR filenames to input to the user-script +USER_SCRIPT_INPUT_TEMPLATE = {OBS_OLR_INPUT_DIR}/{OBS_OLR_INPUT_TEMPLATE} + +## Name of the file containing the listing of OLR input files +## The options are OBS_OLR_INPUT and FCST_OLR_INPUT +## *** Make sure the order is the same as the order of templates listed in USER_SCRIPT_INPUT_TEMPLATE +USER_SCRIPT_INPUT_TEMPLATE_LABELS = OBS_OLR_INPUT + +# Command to run the user script with input configuration file +USER_SCRIPT_COMMAND = {METPLUS_BASE}/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_OMI/OMI_driver.py diff --git a/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_OMI/OMI_driver.py b/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_OMI/OMI_driver.py new file mode 120000 index 0000000000..ff871c910e --- /dev/null +++ b/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_OMI/OMI_driver.py @@ -0,0 +1 @@ +../UserScript_fcstGFS_obsERA_OMI/OMI_driver.py \ No newline at end of file diff --git a/parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_PhaseDiagram.conf b/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_PhaseDiagram.conf similarity index 92% rename from parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_PhaseDiagram.conf rename to parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_PhaseDiagram.conf index 9326a96e2b..7f435f4034 100644 --- a/parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_PhaseDiagram.conf +++ b/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_PhaseDiagram.conf @@ -50,7 +50,7 @@ FCST_RUN = False # Input and Output Directories for the OBS OLR Files and output text file containing the file list OBS_PDTIME_FMT = %Y%m%d-%H%M%S OBS_PDTIME_INPUT_TEMPLATE = {valid?fmt=%Y%m%d-%H%M%S} -OBS_PDTIME_OUTPUT_DIR = {INPUT_BASE}/model_applications/s2s/UserScript_fcstGFS_obsERA_PhaseDiagram/ +OBS_PDTIME_OUTPUT_DIR = {INPUT_BASE}/model_applications/s2s/UserScript_obsERA_obsOnly_PhaseDiagram/ OBS_PDTIME_OUTPUT_TEMPLATE = time_list_lead{lead?fmt=%HHH}.txt @@ -59,7 +59,7 @@ OBS_PDTIME_OUTPUT_TEMPLATE = time_list_lead{lead?fmt=%HHH}.txt # Find the files for each time USER_SCRIPT_RUNTIME_FREQ = RUN_ONCE_FOR_EACH -USER_SCRIPT_COMMAND = {METPLUS_BASE}/parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_PhaseDiagram/save_input_files_txt.py {OBS_PDTIME_INPUT_TEMPLATE} {OBS_PDTIME_OUTPUT_DIR}/{OBS_PDTIME_OUTPUT_TEMPLATE} +USER_SCRIPT_COMMAND = {METPLUS_BASE}/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_PhaseDiagram/save_input_files_txt.py {OBS_PDTIME_INPUT_TEMPLATE} {OBS_PDTIME_OUTPUT_DIR}/{OBS_PDTIME_OUTPUT_TEMPLATE} # Configurations for the Phase Diagram Plotting Script @@ -86,7 +86,7 @@ OBS_PHASE_DIAGRAM_INPUT_TIMELIST_TEXTFILE = {OBS_PDTIME_OUTPUT_DIR}/{OBS_PDTIME_ OBS_PHASE_DIAGRAM_INPUT_TIME_FMT = {OBS_PDTIME_FMT} # Plot Output Directory -PHASE_DIAGRAM_PLOT_OUTPUT_DIR = {OUTPUT_BASE}/s2s/UserScript_fcstGFS_obsERA_PhaseDiagram/plots +PHASE_DIAGRAM_PLOT_OUTPUT_DIR = {OUTPUT_BASE}/s2s/UserScript_obsERA_obsOnly_PhaseDiagram/plots # Plot Ouptut Name OBS_PHASE_PLOT_OUTPUT_NAME = RMM_phase_diagram @@ -99,4 +99,4 @@ OBS_PHASE_PLOT_OUTPUT_NAME = RMM_phase_diagram USER_SCRIPT_RUNTIME_FREQ = RUN_ONCE_PER_LEAD # Command to run the user script with input configuration file -USER_SCRIPT_COMMAND = {METPLUS_BASE}/parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_PhaseDiagram/PhaseDiagram_driver.py +USER_SCRIPT_COMMAND = {METPLUS_BASE}/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_PhaseDiagram/PhaseDiagram_driver.py diff --git a/parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_PhaseDiagram/PhaseDiagram_driver.py b/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_PhaseDiagram/PhaseDiagram_driver.py similarity index 100% rename from parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_PhaseDiagram/PhaseDiagram_driver.py rename to parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_PhaseDiagram/PhaseDiagram_driver.py diff --git a/parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_PhaseDiagram/save_input_files_txt.py b/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_PhaseDiagram/save_input_files_txt.py similarity index 100% rename from parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_PhaseDiagram/save_input_files_txt.py rename to parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_PhaseDiagram/save_input_files_txt.py diff --git a/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_RMM.conf b/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_RMM.conf new file mode 100644 index 0000000000..495a124b2f --- /dev/null +++ b/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_RMM.conf @@ -0,0 +1,436 @@ +# RMM UserScript wrapper +[config] +# All steps, including creating daily means and mean daily annual cycle +#PROCESS_LIST = PcpCombine(mean_daily_annual_cycle_obs_wind), PcpCombine(mean_daily_annual_cycle_obs_olr), PcpCombine(daily_mean_obs_wind), PcpCombine(daily_mean_obs_olr), UserScript(create_mda_filelist), UserScript(harmonic_anomalies_olr), UserScript(harmonic_anomalies_u850), UserScript(harmonic_anomalies_u200), RegridDataPlane(regrid_obs_olr), RegridDataPlane(regrid_obs_u850), RegridDataPlane(regrid_obs_u200), UserScript(script_rmm) +# Computing anomalies, regridding, and RMM Analysis script +PROCESS_LIST = UserScript(create_mda_filelist), UserScript(harmonic_anomalies_olr), UserScript(harmonic_anomalies_u850), UserScript(harmonic_anomalies_u200), RegridDataPlane(regrid_obs_olr), RegridDataPlane(regrid_obs_u850), RegridDataPlane(regrid_obs_u200), UserScript(script_rmm) + +# time looping - 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 +LOOP_BY = VALID + +# Format of VALID_BEG and VALID_END using % items +# %Y = 4 digit year, %m = 2 digit month, %d = 2 digit day, etc. +# see www.strftime.org for more information +# %Y%m%d%H expands to YYYYMMDDHH +VALID_TIME_FMT = %Y%m%d%H + +# Start time for METplus run +VALID_BEG = 2000010100 + +# End time for METplus run +VALID_END = 2002123000 + +# Increment between METplus runs in seconds. Must be >= 60 +VALID_INCREMENT = 86400 + +# List of forecast leads to process for each run time (init or valid) +# In hours if units are not specified +# If unset, defaults to 0 (don't loop through forecast leads) +LEAD_SEQ = 0 + +# Order of loops to process data - Options are times, processes +# Not relevant if only one item is in the PROCESS_LIST +# times = run all wrappers in the PROCESS_LIST for a single run time, then +# increment the run time and run all wrappers again until all times have +# been evaluated. +# processes = run the first wrapper in the PROCESS_LIST for all times +# specified, then repeat for the next item in the PROCESS_LIST until all +# wrappers have been run +LOOP_ORDER = processes + +# location of configuration files used by MET applications +CONFIG_DIR={PARM_BASE}/use_cases/model_applications/s2s + +# Run the obs for these cases +OBS_RUN = True +FCST_RUN = False + +# Mask to use for regridding +REGRID_DATA_PLANE_VERIF_GRID = latlon 144 13 -15 0 2.5 2.5 + +# Method to run regrid_data_plane, not setting this will default to NEAREST +REGRID_DATA_PLANE_METHOD = NEAREST + +# Regridding width used in regrid_data_plane, not setting this will default to 1 +REGRID_DATA_PLANE_WIDTH = 1 + + +# Configurations for creating U200 and U850 mean daily annual cycle obs +# Mean daily annual cycle anomalies are computed for 1979 - 2001 +[mean_daily_annual_cycle_obs_wind] +LOOP_BY = VALID + +# Format of VALID_BEG and VALID_END using % items +# %Y = 4 digit year, %m = 2 digit month, %d = 2 digit day, etc. +# see www.strftime.org for more information +# %Y%m%d%H expands to YYYYMMDDHH +VALID_TIME_FMT = %Y%m%d%H + +# Start time for METplus run +# Set to one year, since we want a mean daily across all years +# Using 2012 because leap day will be included +VALID_BEG = 2012010100 + +# End time for METplus run +VALID_END = 2012123100 + +# Increment between METplus runs in seconds. Must be >= 60 +VALID_INCREMENT = 86400 + +# run pcp_combine on obs data +OBS_PCP_COMBINE_RUN = {OBS_RUN} + +# method to run pcp_combine on forecast data +# Options are ADD, SUM, SUBTRACT, DERIVE, and USER_DEFINED +OBS_PCP_COMBINE_METHOD = USER_DEFINED + +OBS_PCP_COMBINE_COMMAND = -derive mean {OBS_PCP_COMBINE_INPUT_DIR}/{OBS_PCP_COMBINE_INPUT_TEMPLATE} -field 'name="U_P850_mean"; level="(*,*)"; set_attr_valid = "{valid?fmt=%Y%m%d_%H%M%S}";' -field 'name="U_P200_mean"; level="(*,*)"; set_attr_valid = "{valid?fmt=%Y%m%d_%H%M%S}";' -name U_P850_mean,U_P200_mean + +OBS_PCP_COMBINE_INPUT_DIR = {INPUT_BASE}/model_applications/s2s/UserScript_obsERA_obsOnly_RMM/ERA/daily_mean +OBS_PCP_COMBINE_INPUT_TEMPLATE = ERA_wind_daily_mean_*{valid?fmt=%m%d}.nc + +OBS_PCP_COMBINE_OUTPUT_DIR = {OUTPUT_BASE}/s2s/UserScript_obsERA_obsOnly_RMM/ERA/mean_daily_annual_cycle +OBS_PCP_COMBINE_OUTPUT_TEMPLATE = ERA_wind_daily_annual_{valid?fmt=%m%d}.nc + + +# Configurations for creating OLR mean daily annual cycle obs +# Mean daily annual cycle anomalies are computed for 1979 - 2001 +[mean_daily_annual_cycle_obs_olr] +LOOP_BY = VALID + +# Format of VALID_BEG and VALID_END using % items +# %Y = 4 digit year, %m = 2 digit month, %d = 2 digit day, etc. +# see www.strftime.org for more information +# %Y%m%d%H expands to YYYYMMDDHH +VALID_TIME_FMT = %Y%m%d%H + +# Start time for METplus run +# Set to one year, since we want a mean daily across all years +# Using 2012 because leap day will be included +VALID_BEG = 2012010100 + +# End time for METplus run +VALID_END = 2012123100 + +# Increment between METplus runs in seconds. Must be >= 60 +VALID_INCREMENT = 86400 + +# run pcp_combine on obs data +OBS_PCP_COMBINE_RUN = {OBS_RUN} + +# method to run pcp_combine on forecast data +# Options are ADD, SUM, SUBTRACT, DERIVE, and USER_DEFINED +OBS_PCP_COMBINE_METHOD = USER_DEFINED + +OBS_PCP_COMBINE_COMMAND = -derive mean {OBS_PCP_COMBINE_INPUT_DIR}/{OBS_PCP_COMBINE_INPUT_TEMPLATE} -field 'name="olr"; level="(*,*)";' + +OBS_PCP_COMBINE_INPUT_DIR = {INPUT_BASE}/model_applications/s2s/UserScript_obsERA_obsOnly_RMM/ERA/daily_mean +OBS_PCP_COMBINE_INPUT_TEMPLATE = ERA_OLR_daily_mean_*{valid?fmt=%m%d}.nc + +OBS_PCP_COMBINE_OUTPUT_DIR = {OUTPUT_BASE}/s2s/UserScript_obsERA_obsOnly_RMM/ERA/mean_daily_annual_cycle +OBS_PCP_COMBINE_OUTPUT_TEMPLATE = ERA_OLR_daily_annual_{valid?fmt=%m%d}.nc + + +# Configurations for creating U200 and U850 daily mean obs +[daily_mean_obs_wind] +LOOP_BY = VALID + +# Format of VALID_BEG and VALID_END using % items +# %Y = 4 digit year, %m = 2 digit month, %d = 2 digit day, etc. +# see www.strftime.org for more information +# %Y%m%d%H expands to YYYYMMDDHH +VALID_TIME_FMT = %Y%m%d%H + +# Start time for METplus run +VALID_BEG = 1979010100 + +# End time for METplus run +VALID_END = 2002123100 + +# Increment between METplus runs in seconds. Must be >= 60 +VALID_INCREMENT = 86400 + +# run pcp_combine on obs data +OBS_PCP_COMBINE_RUN = {OBS_RUN} + +# method to run pcp_combine on forecast data +# Options are ADD, SUM, SUBTRACT, DERIVE, and USER_DEFINED +OBS_PCP_COMBINE_METHOD = USER_DEFINED + +OBS_PCP_COMBINE_COMMAND = -derive mean {OBS_PCP_COMBINE_INPUT_DIR}/{OBS_PCP_COMBINE_INPUT_TEMPLATE} -field 'name="U"; level="P850"; set_attr_valid = "{valid?fmt=%Y%m%d_%H%M%S}";' -field 'name="U"; level="P200"; set_attr_valid = "{valid?fmt=%Y%m%d_%H%M%S}";' + +OBS_PCP_COMBINE_INPUT_DIR = /gpfs/fs1/collections/rda/data/ds627.0/ei.oper.an.pl +OBS_PCP_COMBINE_INPUT_TEMPLATE = {valid?fmt=%Y%m}/ei.oper.an.pl.regn128uv.{valid?fmt=%Y%m%d}* + +OBS_PCP_COMBINE_OUTPUT_DIR = {OUTPUT_BASE}/s2s/UserScript_obsERA_obsOnly_RMM/ERA/daily_mean +OBS_PCP_COMBINE_OUTPUT_TEMPLATE = ERA_wind_daily_mean_{valid?fmt=%Y%m%d}.nc + + +# Configurations for creating mean daily annual cycle obs OLR +[daily_mean_obs_olr] +LOOP_BY = VALID + +# Format of VALID_BEG and VALID_END using % items +# %Y = 4 digit year, %m = 2 digit month, %d = 2 digit day, etc. +# see www.strftime.org for more information +# %Y%m%d%H expands to YYYYMMDDHH +VALID_TIME_FMT = %Y%m%d%H + +# Start time for METplus run +VALID_BEG = 1979010100 + +# End time for METplus run +VALID_END = 2002123100 + +# Increment between METplus runs in seconds. Must be >= 60 +VALID_INCREMENT = 86400 + +# run pcp_combine on obs data +OBS_PCP_COMBINE_RUN = {OBS_RUN} + +# method to run pcp_combine on forecast data +# Options are ADD, SUM, SUBTRACT, DERIVE, and USER_DEFINED +OBS_PCP_COMBINE_METHOD = USER_DEFINED + +OBS_PCP_COMBINE_COMMAND = -add {OBS_PCP_COMBINE_INPUT_DIR}/{OBS_PCP_COMBINE_INPUT_TEMPLATE} -field 'name="olr"; level="({valid?fmt=%Y%m%d_%H%M%S},*,*)"; file_type=NETCDF_NCCF;' + +OBS_PCP_COMBINE_INPUT_DIR = /glade/u/home/kalb/MJO +OBS_PCP_COMBINE_INPUT_TEMPLATE = olr.1x.7920.nc + +OBS_PCP_COMBINE_OUTPUT_DIR = {OUTPUT_BASE}/s2s/UserScript_obsERA_obsOnly_RMM/ERA/daily_mean +OBS_PCP_COMBINE_OUTPUT_TEMPLATE = ERA_OLR_daily_mean_{valid?fmt=%Y%m%d}.nc + + +# Creating a file list of the mean daily annual cycle files +# This is run separately since it has different start/end times +[create_mda_filelist] +# Find the files for each lead time +USER_SCRIPT_RUNTIME_FREQ = RUN_ONCE_PER_LEAD + +# Valid Begin and End Times for the CBL File Climatology +VALID_BEG = 2012010100 +VALID_END = 2012123100 +VALID_INCREMENT = 86400 +LEAD_SEQ = 0 + +# Template of filenames to input to the user-script +USER_SCRIPT_INPUT_TEMPLATE = {INPUT_BASE}/model_applications/s2s/UserScript_obsERA_obsOnly_RMM/ERA/mean_daily_annual_cycle/ERA_OLR_daily_annual_{valid?fmt=%m%d}.nc,{INPUT_BASE}/model_applications/s2s/UserScript_obsERA_obsOnly_RMM/ERA/mean_daily_annual_cycle/ERA_wind_daily_annual_{valid?fmt=%m%d}.nc + +# Name of the file containing the listing of input files +USER_SCRIPT_INPUT_TEMPLATE_LABELS = input_mean_daily_annual_infiles_olr,input_mean_daily_annual_infiles_wind + +# Placeholder command just to build the file list +# This just states that it's building the file list +USER_SCRIPT_COMMAND = echo Populated file list for Mean daily annual cycle Input + + +# Configurations to create anomalies for OLR +[harmonic_anomalies_olr] +# list of strings to loop over for each run time. +# Run the user script once per lead +USER_SCRIPT_RUNTIME_FREQ = RUN_ONCE_PER_LEAD + +# Template of filenames to input to the user-script +USER_SCRIPT_INPUT_TEMPLATE = {INPUT_BASE}/model_applications/s2s/UserScript_obsERA_obsOnly_RMM/ERA/daily_mean/ERA_OLR_daily_mean_{valid?fmt=%Y%m%d}.nc + +# Name of the file containing the listing of input files +# The options are OBS_OLR_INPUT, OBS_U850_INPUT, OBS_U200_INPUT, FCST_OLR_INPUT, FCST_U850_INPUT, and FCST_U200_INPUT +# *** Make sure the order is the same as the order of templates listed in USER_SCRIPT_INPUT_TEMPLATE +USER_SCRIPT_INPUT_TEMPLATE_LABELS = input_daily_mean_infiles + +# Command to run the user script with input configuration file +USER_SCRIPT_COMMAND = {METPLUS_BASE}/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_RMM/compute_harmonic_anomalies.py 'METPLUS_FILELIST_INPUT_MEAN_DAILY_ANNUAL_INFILES_OLR' 'olr' 'olr_NA_mean' '{OUTPUT_BASE}/s2s/UserScript_obsERA_obsOnly_RMM/ERA/Anomaly' 'ERA_OLR_anom' + + +# Configurations to create anomalies for U850 +[harmonic_anomalies_u850] +# list of strings to loop over for each run time. +# Run the user script once per lead +USER_SCRIPT_RUNTIME_FREQ = RUN_ONCE_PER_LEAD + +# Template of filenames to input to the user-script +USER_SCRIPT_INPUT_TEMPLATE = {INPUT_BASE}/model_applications/s2s/UserScript_obsERA_obsOnly_RMM/ERA/daily_mean/ERA_wind_daily_mean_{valid?fmt=%Y%m%d}.nc + +# Name of the file containing the listing of input files +# The options are OBS_OLR_INPUT, OBS_U850_INPUT, OBS_U200_INPUT, FCST_OLR_INPUT, FCST_U850_INPUT, and FCST_U200_INPUT +# *** Make sure the order is the same as the order of templates listed in USER_SCRIPT_INPUT_TEMPLATE +USER_SCRIPT_INPUT_TEMPLATE_LABELS = input_daily_mean_infiles + +# Command to run the user script with input configuration file +USER_SCRIPT_COMMAND = {METPLUS_BASE}/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_RMM/compute_harmonic_anomalies.py 'METPLUS_FILELIST_INPUT_MEAN_DAILY_ANNUAL_INFILES_WIND' 'U_P850_mean' 'U_P850_mean' '{OUTPUT_BASE}/s2s/UserScript_obsERA_obsOnly_RMM/ERA/Anomaly' 'ERA_U850_anom' + + +# Configurations to create anomalies for U200 +[harmonic_anomalies_u200] +# list of strings to loop over for each run time. +# Run the user script once per lead +USER_SCRIPT_RUNTIME_FREQ = RUN_ONCE_PER_LEAD + +# Template of filenames to input to the user-script +USER_SCRIPT_INPUT_TEMPLATE = {INPUT_BASE}/model_applications/s2s/UserScript_obsERA_obsOnly_RMM/ERA/daily_mean/ERA_wind_daily_mean_{valid?fmt=%Y%m%d}.nc + +# Name of the file containing the listing of input files +# The options are OBS_OLR_INPUT, OBS_U850_INPUT, OBS_U200_INPUT, FCST_OLR_INPUT, FCST_U850_INPUT, and FCST_U200_INPUT +# *** Make sure the order is the same as the order of templates listed in USER_SCRIPT_INPUT_TEMPLATE +USER_SCRIPT_INPUT_TEMPLATE_LABELS = input_daily_mean_infiles + +# Command to run the user script with input configuration file +USER_SCRIPT_COMMAND = {METPLUS_BASE}/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_RMM/compute_harmonic_anomalies.py 'METPLUS_FILELIST_INPUT_MEAN_DAILY_ANNUAL_INFILES_WIND' 'U_P200_mean' 'U_P200_mean' '{OUTPUT_BASE}/s2s/UserScript_obsERA_obsOnly_RMM/ERA/Anomaly' 'ERA_U200_anom' + + +# Configurations for regrid_data_plane: Regrid OLR to -15 to 15 latitude +[regrid_obs_olr] +# Run regrid_data_plane on forecast data +OBS_REGRID_DATA_PLANE_RUN = {OBS_RUN} + +# 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 +OBS_REGRID_DATA_PLANE_VAR1_NAME = olr_anom + +# Level of input field to process +OBS_REGRID_DATA_PLANE_VAR1_LEVELS = "(*,*)" + +# Name of output field to create +OBS_REGRID_DATA_PLANE_VAR1_OUTPUT_FIELD_NAME = OLR_anom + +# input and output data directories for each application in PROCESS_LIST +OBS_REGRID_DATA_PLANE_INPUT_DIR = {OUTPUT_BASE}/s2s/UserScript_obsERA_obsOnly_RMM/ERA/Anomaly +OBS_REGRID_DATA_PLANE_OUTPUT_DIR = {OUTPUT_BASE}/s2s/UserScript_obsERA_obsOnly_RMM/ERA/Regrid + +# format of filenames +# Input ERA Interim +OBS_REGRID_DATA_PLANE_INPUT_TEMPLATE = ERA_OLR_anom_{lead?fmt=%H%M%S}L_{valid?fmt=%Y%m%d}_{valid?fmt=%H%M%S}V.nc +OBS_REGRID_DATA_PLANE_OUTPUT_TEMPLATE = ERA_OLR_{valid?fmt=%Y%m%d}.nc + + +# Configurations for regrid_data_plane: Regrid u850 to -15 to 15 latitude +[regrid_obs_u850] +# Run regrid_data_plane on forecast data +OBS_REGRID_DATA_PLANE_RUN = {OBS_RUN} + +# 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 +OBS_REGRID_DATA_PLANE_VAR1_NAME = U_P850_mean_anom + +# Level of input field to process +OBS_REGRID_DATA_PLANE_VAR1_LEVELS = "(*,*)" + +# Name of output field to create +OBS_REGRID_DATA_PLANE_VAR1_OUTPUT_FIELD_NAME = U_P850_anom + +# input and output data directories for each application in PROCESS_LIST +OBS_REGRID_DATA_PLANE_INPUT_DIR = {OUTPUT_BASE}/s2s/UserScript_obsERA_obsOnly_RMM/ERA/Anomaly +OBS_REGRID_DATA_PLANE_OUTPUT_DIR = {OUTPUT_BASE}/s2s/UserScript_obsERA_obsOnly_RMM/ERA/Regrid + +# format of filenames +# Input ERA Interim +OBS_REGRID_DATA_PLANE_INPUT_TEMPLATE = ERA_U850_anom_{lead?fmt=%H%M%S}L_{valid?fmt=%Y%m%d}_{valid?fmt=%H%M%S}V.nc +OBS_REGRID_DATA_PLANE_OUTPUT_TEMPLATE = ERA_U850_{valid?fmt=%Y%m%d}.nc + + +# Configurations for regrid_data_plane: Regrid u200 to -15 to 15 latitude +[regrid_obs_u200] +# Run regrid_data_plane on forecast data +OBS_REGRID_DATA_PLANE_RUN = {OBS_RUN} + +# 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 +OBS_REGRID_DATA_PLANE_VAR1_NAME = U_P200_mean_anom + +# Level of input field to process +OBS_REGRID_DATA_PLANE_VAR1_LEVELS = "(*,*)" + +# Name of output field to create +OBS_REGRID_DATA_PLANE_VAR1_OUTPUT_FIELD_NAME = U_P200_anom + +# input and output data directories for each application in PROCESS_LIST +OBS_REGRID_DATA_PLANE_INPUT_DIR = {OUTPUT_BASE}/s2s/UserScript_obsERA_obsOnly_RMM/ERA/Anomaly +OBS_REGRID_DATA_PLANE_OUTPUT_DIR = {OUTPUT_BASE}/s2s/UserScript_obsERA_obsOnly_RMM/ERA/Regrid + +# format of filenames +# Input ERA Interim +OBS_REGRID_DATA_PLANE_INPUT_TEMPLATE = ERA_U200_anom_{lead?fmt=%H%M%S}L_{valid?fmt=%Y%m%d}_{valid?fmt=%H%M%S}V.nc +OBS_REGRID_DATA_PLANE_OUTPUT_TEMPLATE = ERA_U200_{valid?fmt=%Y%m%d}.nc + + +# Configurations for the RMM analysis script +[user_env_vars] +# Whether to Run the model or obs +RUN_OBS = {OBS_RUN} +RUN_FCST = {FCST_RUN} + +# Make OUTPUT_BASE Available to the script +SCRIPT_OUTPUT_BASE = {OUTPUT_BASE} + +# Number of obs per day +OBS_PER_DAY = 1 + +# Variable names for OLR, U850, U200 +OBS_OLR_VAR_NAME = OLR_anom +OBS_U850_VAR_NAME = U_P850_anom +OBS_U200_VAR_NAME = U_P200_anom + +# EOF Filename +OLR_EOF_INPUT_TEXTFILE = {INPUT_BASE}/model_applications/s2s/UserScript_obsERA_obsOnly_RMM/EOF/rmm_olr_eofs.txt +U850_EOF_INPUT_TEXTFILE = {INPUT_BASE}/model_applications/s2s/UserScript_obsERA_obsOnly_RMM/EOF/rmm_u850_eofs.txt +U200_EOF_INPUT_TEXTFILE = {INPUT_BASE}/model_applications/s2s/UserScript_obsERA_obsOnly_RMM/EOF/rmm_u200_eofs.txt + +# Normalization factors for RMM +RMM_OLR_NORM = 15.11623 +RMM_U850_NORM = 1.81355 +RMM_U200_NORM = 4.80978 +PC1_NORM = 8.618352504159244 +PC2_NORM = 8.40736449709697 + +# Output Directory for the plots +# If not set, it this will default to {OUTPUT_BASE}/plots +RMM_PLOT_OUTPUT_DIR = {OUTPUT_BASE}/s2s/UserScript_obsERA_obsOnly_RMM/plots + +# EOF plot information +EOF_PLOT_OUTPUT_NAME = RMM_EOFs +EOF_PLOT_OUTPUT_FORMAT = png + +# Phase Plot start date, end date, output name, and format +PHASE_PLOT_TIME_BEG = 2002010100 +PHASE_PLOT_TIME_END = 2002123000 +PHASE_PLOT_TIME_FMT = {VALID_TIME_FMT} +OBS_PHASE_PLOT_OUTPUT_NAME = obs_RMM_comp_phase +OBS_PHASE_PLOT_OUTPUT_FORMAT = png + +# Time Series Plot start date, end date, output name, and format +TIMESERIES_PLOT_TIME_BEG = 2002010100 +TIMESERIES_PLOT_TIME_END = 2002123000 +TIMESERIES_PLOT_TIME_FMT = {VALID_TIME_FMT} +OBS_TIMESERIES_PLOT_OUTPUT_NAME = obs_RMM_time_series +OBS_TIMESERIES_PLOT_OUTPUT_FORMAT = png + + +# Configurations for UserScript: Run the RMM Analysis driver +[script_rmm] +# list of strings to loop over for each run time. +# Run the user script once per lead +USER_SCRIPT_RUNTIME_FREQ = RUN_ONCE_PER_LEAD + +# Template of filenames to input to the user-script +USER_SCRIPT_INPUT_TEMPLATE = {OUTPUT_BASE}/s2s/UserScript_obsERA_obsOnly_RMM/ERA/Regrid/ERA_OLR_{valid?fmt=%Y%m%d}.nc,{OUTPUT_BASE}/s2s/UserScript_obsERA_obsOnly_RMM/ERA/Regrid/ERA_U850_{valid?fmt=%Y%m%d}.nc,{OUTPUT_BASE}/s2s/UserScript_obsERA_obsOnly_RMM/ERA/Regrid/ERA_U200_{valid?fmt=%Y%m%d}.nc + +# Name of the file containing the listing of input files +# The options are OBS_OLR_INPUT, OBS_U850_INPUT, OBS_U200_INPUT, FCST_OLR_INPUT, FCST_U850_INPUT, and FCST_U200_INPUT +# *** Make sure the order is the same as the order of templates listed in USER_SCRIPT_INPUT_TEMPLATE +USER_SCRIPT_INPUT_TEMPLATE_LABELS = OBS_OLR_INPUT,OBS_U850_INPUT, OBS_U200_INPUT + +# Command to run the user script with input configuration file +USER_SCRIPT_COMMAND = {METPLUS_BASE}/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_RMM/RMM_driver.py diff --git a/parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_RMM/RMM_driver.py b/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_RMM/RMM_driver.py similarity index 88% rename from parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_RMM/RMM_driver.py rename to parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_RMM/RMM_driver.py index d33906c9d8..3e3f5b741f 100755 --- a/parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_RMM/RMM_driver.py +++ b/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_RMM/RMM_driver.py @@ -48,11 +48,15 @@ def read_rmm_eofs(olrfile, u850file, u200file): def run_rmm_steps(inlabel, spd, EOF1, EOF2, oplot_dir): - # Get OLR, U850, U200 file listings + # Get OLR, U850, U200 file listings and variable names olr_filetxt = os.environ['METPLUS_FILELIST_'+inlabel+'_OLR_INPUT'] u850_filetxt = os.environ['METPLUS_FILELIST_'+inlabel+'_U850_INPUT'] u200_filetxt = os.environ['METPLUS_FILELIST_'+inlabel+'_U200_INPUT'] + olr_var = os.environ[inlabel+'_OLR_VAR_NAME'] + u850_var = os.environ[inlabel+'_U850_VAR_NAME'] + u200_var = os.environ[inlabel+'_U200_VAR_NAME'] + # Read the listing of OLR, U850, U200 files with open(olr_filetxt) as ol: olr_input_files = ol.read().splitlines() @@ -67,6 +71,18 @@ def run_rmm_steps(inlabel, spd, EOF1, EOF2, oplot_dir): if (u200_input_files[0] == 'file_list'): u200_input_files = u200_input_files[1:] + # Check the input data to make sure it's not all missing + olr_allmissing = all(elem == 'missing' for elem in olr_input_files) + if olr_allmissing: + raise IOError ('No input OLR files were found, check file paths') + u850_allmissing = all(elem == 'missing' for elem in u850_input_files) + if u850_allmissing: + raise IOError('No input U850 files were found, check file paths') + u200_allmissing = all(elem == 'missing' for elem in u200_input_files) + if u200_allmissing: + raise IOError('No input U200 files were found, check file paths') + + # Read OLR, U850, U200 data from file netcdf_reader_olr = read_netcdf.ReadNetCDF() ds_olr = netcdf_reader_olr.read_into_xarray(olr_input_files) @@ -81,7 +97,7 @@ def run_rmm_steps(inlabel, spd, EOF1, EOF2, oplot_dir): time = [] for din in range(len(ds_olr)): colr = ds_olr[din] - ctime = datetime.datetime.strptime(colr['olr'].valid_time,'%Y%m%d_%H%M%S') + ctime = datetime.datetime.strptime(colr[olr_var].valid_time,'%Y%m%d_%H%M%S') time.append(ctime.strftime('%Y-%m-%d')) colr = colr.assign_coords(time=ctime) ds_olr[din] = colr.expand_dims("time") @@ -97,17 +113,17 @@ def run_rmm_steps(inlabel, spd, EOF1, EOF2, oplot_dir): time = np.array(time,dtype='datetime64[D]') everything_olr = xr.concat(ds_olr,"time") - olr = everything_olr['olr'] + olr = everything_olr[olr_var] olr = olr.mean('lat') print(olr.min(), olr.max()) everything_u850 = xr.concat(ds_u850,"time") - u850 = everything_u850['uwnd850'] + u850 = everything_u850[u850_var] u850 = u850.mean('lat') print(u850.min(), u850.max()) everything_u200 = xr.concat(ds_u200,"time") - u200 = everything_u200['uwnd200'] + u200 = everything_u200[u200_var] u200 = u200.mean('lat') print(u200.min(), u200.max()) @@ -186,7 +202,7 @@ def main(): # Determine if doing forecast or obs run_obs_rmm = os.environ.get('RUN_OBS', 'False').lower() - run_fcst_rmm = os.environ.get('FCST_RUN_FCST', 'False').lower() + run_fcst_rmm = os.environ.get('RUN_FCST', 'False').lower() if (run_obs_rmm == 'true'): run_rmm_steps('OBS', spd, EOF1, EOF2, oplot_dir) diff --git a/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_RMM/compute_harmonic_anomalies.py b/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_RMM/compute_harmonic_anomalies.py new file mode 100755 index 0000000000..6c6fe9dad7 --- /dev/null +++ b/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_RMM/compute_harmonic_anomalies.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python3 +import numpy as np +import xarray as xr +import glob +import os +import sys +import datetime +import METreadnc.util.read_netcdf as read_netcdf + +input_mean_daily_annual_infiles_list = os.environ[sys.argv[1]] +dm_var = sys.argv[2] +mda_var = sys.argv[3] +anom_output_dir = sys.argv[4] +anom_output_base = sys.argv[5] +input_daily_mean_infiles_list = os.environ['METPLUS_FILELIST_INPUT_DAILY_MEAN_INFILES'] + +# Environment variables for script +nobs = int(os.environ.get('OBS_PER_DAY',1)) +out_var = dm_var+'_anom' + +# Read the listing of files +with open(input_daily_mean_infiles_list) as idm: + input_daily_mean_infiles = idm.read().splitlines() +if (input_daily_mean_infiles[0] == 'file_list'): + input_daily_mean_infiles = input_daily_mean_infiles[1:] + +with open(input_mean_daily_annual_infiles_list) as imda: + input_mean_daily_annual_infiles = imda.read().splitlines() +if (input_mean_daily_annual_infiles[0] == 'file_list'): + input_mean_daily_annual_infiles = input_mean_daily_annual_infiles[1:] + + +# Read in the data +netcdf_reader = read_netcdf.ReadNetCDF() +dm_orig = netcdf_reader.read_into_xarray(input_daily_mean_infiles) +# Add some needed attributes +dm_list = [] +time_dm = [] +yr_dm = [] +doy_dm = [] +for din in dm_orig: + ctime = datetime.datetime.strptime(din[dm_var].valid_time,'%Y%m%d_%H%M%S') + time_dm.append(ctime.strftime('%Y-%m-%d')) + yr_dm.append(int(ctime.strftime('%Y'))) + doy_dm.append(int(ctime.strftime('%j'))) + din = din.assign_coords(time=ctime) + din = din.expand_dims("time") + dm_list.append(din) +time_dm = np.array(time_dm,dtype='datetime64[D]') +yr_dm = np.array(yr_dm) +doy_dm = np.array(doy_dm) +everything = xr.concat(dm_list,"time") +dm_data = np.array(everything[dm_var]) + +netcdf_reader2 = read_netcdf.ReadNetCDF() +mda_orig = netcdf_reader2.read_into_xarray(input_mean_daily_annual_infiles) +# Add some needed attributes +mda_list = [] +time_mda = [] +for din in mda_orig: + ctime = datetime.datetime.strptime(din[mda_var].valid_time,'%Y%m%d_%H%M%S') + time_mda.append(ctime.strftime('%Y-%m-%d')) + din = din.assign_coords(time=ctime) + din = din.expand_dims("time") + mda_list.append(din) +time_mda = np.array(time_mda,dtype='datetime64[D]') +everything2 = xr.concat(mda_list,"time") +mda_data = np.array(everything2[mda_var]) + +# Harmonic Analysis, first step is Forward Fast Fourier Transform +clmfft = np.fft.rfft(mda_data,axis=0) + +smthfft = np.zeros(clmfft.shape,dtype=complex) +for f in np.arange(0,3): + smthfft[f,:,:] = clmfft[f,:,:] + +clmout = np.fft.irfft(smthfft,axis=0) + +# Subtract the clmout from the data to create anomalies, each year at a time +yrstrt = yr_dm[0] +yrend = yr_dm[-1] +anom = np.zeros(dm_data.shape) + +for y in np.arange(yrstrt,yrend+1,1): + curyr = np.where(yr_dm == y) + dd = doy_dm[curyr] - 1 + ndd = len(curyr[0]) + clmshp = [np.arange(dd[0]*nobs,dd[0]*nobs+ndd,1)] + anom[curyr,:,:] = dm_data[curyr,:,:] - clmout[clmshp,:,:] + +# Assign to an xarray and write output +if not os.path.exists(anom_output_dir): + os.makedirs(anom_output_dir) +for o in np.arange(0,len(dm_orig)): + dm_orig_cur = dm_orig[o] + dout = xr.Dataset({out_var: (("lat", "lon"),anom[o,:,:])}, + coords={"lat": dm_orig_cur.coords['lat'], "lon": dm_orig_cur.coords['lon']}, + attrs=dm_orig_cur.attrs) + dout[out_var].attrs = dm_orig_cur[dm_var].attrs + dout[out_var].attrs['long_name'] = dm_orig_cur[dm_var].attrs['long_name']+' Anomalies' + dout[out_var].attrs['name'] = out_var + + # write to a file + cvtime = datetime.datetime.strptime(dm_orig_cur[dm_var].valid_time,'%Y%m%d_%H%M%S') + citime = datetime.datetime.strptime(dm_orig_cur[dm_var].init_time,'%Y%m%d_%H%M%S') + cltime = (cvtime - citime) + leadmin,leadsec = divmod(cltime.total_seconds(), 60) + leadhr,leadmin = divmod(leadmin,60) + lead_str = str(int(leadhr)).zfill(2)+str(int(leadmin)).zfill(2)+str(int(leadsec)).zfill(2) + dout.to_netcdf(os.path.join(anom_output_dir,anom_output_base+'_'+lead_str+'L_'+cvtime.strftime('%Y%m%d')+'_'+cvtime.strftime('%H%M%S')+'V.nc'))