Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature 1399 usecase cable #1538

Merged
merged 36 commits into from
Apr 1, 2022
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
44155b3
Adding initial code to read AOML Cable Transport and RTOFS cable tran…
mrinalbiswas Feb 2, 2022
34b00c5
Updating the conf file (no stat analysis yet) and updates to the read…
mrinalbiswas Feb 3, 2022
77bc7a3
Updating the conf file to add STAT_ANALYSIS
mrinalbiswas Feb 3, 2022
444e550
Updates to the code- adding stats
mrinalbiswas Feb 18, 2022
378261c
Updated code--runs now but needs to follow User Script conventions
mrinalbiswas Mar 4, 2022
87f5eae
Changed directory name based on MET conventions
mrinalbiswas Mar 4, 2022
9215770
Updating the read file and adding a conf file
mrinalbiswas Mar 8, 2022
a804fd5
Added logic to count the number of directories in the RTOFS dir
mrinalbiswas Mar 9, 2022
5400819
Updated to run with UserScript conf
mrinalbiswas Mar 9, 2022
9184f55
update version for official release
georgemccabe Mar 14, 2022
5269db4
Merge branch 'dtcenter:main_v4.1' into feature_1399_usecase_cable
mrinalbiswas Mar 17, 2022
b458ca3
Adding a yaml file to specify start_date
mrinalbiswas Mar 17, 2022
e04da46
Added the yaml file and cleaned up the conf file
mrinalbiswas Mar 17, 2022
6f4ede8
Added logic to read the yaml file, cleaned up the script
mrinalbiswas Mar 17, 2022
046b51b
Updating the confile to add output dir, input template and clean up
mrinalbiswas Mar 18, 2022
45d608b
Removing yaml, getting vDate from conf file, adding output file
mrinalbiswas Mar 18, 2022
2e8b765
Adding the doc file for the cable use case
mrinalbiswas Mar 18, 2022
eac885c
Adding image courtesy NOAA
mrinalbiswas Mar 18, 2022
5f57b4b
Adding more documentation
mrinalbiswas Mar 18, 2022
90dcb16
Adding more info
mrinalbiswas Mar 18, 2022
4213c4f
Updated docs
mrinalbiswas Mar 18, 2022
fa8c848
Correcting the python embedding script
mrinalbiswas Mar 18, 2022
3286fb5
Updating to see if the error goes away..no clue
mrinalbiswas Mar 18, 2022
02c69db
Fixing the doc error
mrinalbiswas Mar 22, 2022
be049ad
modifed docs, testing
j-opatz Mar 23, 2022
d37f5ff
updated permissions for script
j-opatz Mar 23, 2022
c47d46f
turned off always testing
j-opatz Mar 24, 2022
6bff4c8
Updated version number
j-opatz Mar 24, 2022
18d5bdb
Update use_case_groups.json
j-opatz Mar 24, 2022
39006ef
Merge branch 'develop' into feature_1399_usecase_cable
j-opatz Mar 24, 2022
e2244d5
Removed erroneous file
j-opatz Apr 1, 2022
b430418
Apply suggestions from code review
georgemccabe Apr 1, 2022
af97428
Update .github/parm/use_case_groups.json
j-opatz Apr 1, 2022
682faf8
Update docs/use_cases/model_applications/marine_and_cryosphere/UserSc…
j-opatz Apr 1, 2022
f066464
Update docs/use_cases/model_applications/marine_and_cryosphere/UserSc…
j-opatz Apr 1, 2022
fb4b718
Update docs/use_cases/model_applications/marine_and_cryosphere/UserSc…
j-opatz Apr 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/parm/use_case_groups.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@
},
{
"category": "marine_and_cryosphere",
"index_list": "3-4",
"index_list": "3-5",
"run": false
},
{
"category": "marine_and_cryosphere",
"index_list": "5",
"run": false
"index_list": "6",
"run": true
j-opatz marked this conversation as resolved.
Show resolved Hide resolved
},
{
"category": "medium_range",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
"""
UserScript: Python Embedding to compute cable transport
j-opatz marked this conversation as resolved.
Show resolved Hide resolved
=======================================================

model_applications/marine_and_cryosphere/UserScript_fcstRTOFS_obsAOML_calcTransport.conf

"""
##############################################################################
# Scientific Objective
# --------------------
# The Florida Current flows northward along the eastern Florida coast and feeds to the Gulf Stream. More info can
# be obtained from: https://www.aoml.noaa.gov/phod/floridacurrent/index.php
#
# This use case utilizes Python embedding to calculate transport (units Sv) variations of the Florida current
j-opatz marked this conversation as resolved.
Show resolved Hide resolved
# using a submarine cable and snapshot estimates made by shipboard instruments. The code compares the transport
# using RTOFS data and compare it with the AOML cable transport data and computes BIAS, RMSE, CORRELATION, and
# Scatter Index. The operational code utilizes 21 days of data and computes 7 day statistics.
# For the use case 3 days of data are utilized. The valid date is passed though an argument. The valid date
# is the last processed day i.e. the code grabs 3 previous days of data.

##############################################################################
# Datasets
# ---------------------
#
# | **Forecast:** RTOFS u(3zuio) amd ,v(3zvio) files via Python Embedding script/file
#
# | **Observations:** AOML Florida Current data via Python Embedding script/file
#
#
# | **Location:** All of the input data required for this use case can be found in the met_test sample data tarball. Click here to the METplus releases page and download sample data for the appropriate release: https://github.com/dtcenter/METplus/releases
# | This tarball should be unpacked into the directory that you will set the value of INPUT_BASE. See `Running METplus`_ section for more information.
#
# | **Data Source:** NOMADS RTOFS Global + Daily mean transport (https://www.aoml.noaa.gov/phod/floridacurrent/data_access.php)+ Eightmilecable (static, provided with the use case)

##############################################################################
# External Dependencies
# ---------------------
#
# You will need to use a version of Python 3.6+ that has the following packages installed:
#
# * scikit-learn
# * pyproj
#
# 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.:
georgemccabe marked this conversation as resolved.
Show resolved Hide resolved
#
# [user_env_vars]
# MET_PYTHON_EXE = /path/to/python/with/required/packages/bin/python

##############################################################################
# METplus Components
# ------------------
#
# This use case utilizes the METplus UserScript wrapper to generate a
# command to run with Python Embedding for the specified valid time.

##############################################################################
# METplus Workflow
# ----------------
#
# This use case uses UserScript. All the gridded data being pulled from the files via Python Embedding.
# All of the desired statistics are in the log file.
# It processes the following run time:
#
# | **Valid:** 2021-10-28
#
# The code grabs the 20211028, 20211027, and 20211026 24 hour RTOFS files.

##############################################################################
# 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
# with the -c option, i.e. -c parm/use_cases/model_applications/marine_and_cryosphere/UserScript_fcstRTOFS_obsAOML_calcTransport.conf
georgemccabe marked this conversation as resolved.
Show resolved Hide resolved
#
# .. highlight:: bash
# .. literalinclude:: ../../../../parm/use_cases/model_applications/marine_and_cryosphere/UserScript_fcstRTOFS_obsAOML_calcTransport.conf

##############################################################################
# MET Configuration
# ---------------------
#
# None. All of the processing is completed in the UserScript
#

##############################################################################
# Python Embedding
j-opatz marked this conversation as resolved.
Show resolved Hide resolved
# ----------------
#
# This use case uses one Python script to read forecast and observation data
# as well as processing the desired statistics.
#
# parm/use_cases/model_applications/marine_and_cryosphere/UserScript_fcstRTOFS_obsAOML_calcTransport/read_aomlcable_rtofs_transport.py
#
# .. highlight:: python
# .. literalinclude:: ../../../../parm/use_cases/model_applications/marine_and_cryosphere/UserScript_fcstRTOFS_obsAOML_calcTransport/read_aomlcable_rtofs_transport.py
#

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

##############################################################################
# Expected Output
# ---------------
#
# A successful run will output the following both to the screen and to the logfile::
#
# INFO: METplus has successfully finished running.
#
# Refer to the value set for **OUTPUT_BASE** to find where the output data was generated.
# Output for use case will be found in calc_transport (relative to **OUTPUT_BASE**)
# and will contain the following files:
#
# * calc_transport.log

##############################################################################
# Keywords
# --------
#
# .. note::
#
# * UserScriptUseCase
# * PythonEmbeddingFileUseCase
# * MarineAndCryosphereAppUseCase
#
# Navigate to the :ref:`quick-search` page to discover other similar use cases.
#
#
#
# sphinx_gallery_thumbnail_path = '_static/marine_and_cryosphere-UserScript_fcstRTOFS_obsAOML_calcTransport.png'

1 change: 1 addition & 0 deletions internal_tests/use_cases/all_use_cases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ Category: marine_and_cryosphere
3::GridStat_fcstRTOFS_obsSMOS_climWOA_sss::model_applications/marine_and_cryosphere/GridStat_fcstRTOFS_obsSMOS_climWOA_sss.conf:: icecover_env, py_embed
4::GridStat_fcstRTOFS_obsSMAP_climWOA_sss::model_applications/marine_and_cryosphere/GridStat_fcstRTOFS_obsSMAP_climWOA_sss.conf:: icecover_env, py_embed
5::GridStat_fcstRTOFS_obsAVISO_climHYCOM_ssh::model_applications/marine_and_cryosphere/GridStat_fcstRTOFS_obsAVISO_climHYCOM_ssh.conf:: icecover_env, py_embed
6::UserScript_fcstRTOFS_obsAOML_calcTransport::model_applications/marine_and_cryosphere/UserScript_fcstRTOFS_obsAOML_calcTransport.conf:: icecover_env, py_embed
#X::GridStat_fcstRTOFS_obsGHRSST_climWOA_sst::model_applications/marine_and_cryosphere/GridStat_fcstRTOFS_obsGHRSST_climWOA_sst.conf, model_applications/marine_and_cryosphere/GridStat_fcstRTOFS_obsGHRSST_climWOA_sst/ci_overrides.conf:: icecover_env, py_embed


Expand Down
2 changes: 1 addition & 1 deletion metplus/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.0-beta1-dev
5.0.0-beta1-dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
[config]

# List of applications to run
PROCESS_LIST = UserScript

# 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 INIT_BEG and INIT_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

# Start time for METplus run - must match VALID_TIME_FMT
VALID_BEG = 20211028

# Increment between METplus runs (in seconds if no units are specified)
# Must be >= 60 seconds
VALID_INCREMENT = 24H

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

# 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

USER_SCRIPT_RUNTIME_FREQ = RUN_ONCE

USER_SCRIPT_OUTPUT_DIR = {OUTPUT_BASE}/model_applications/marine_and_cryosphere/calc_transport

USER_SCRIPT_INPUT_TEMPLATE = {VALID_BEG}

# The valid date increments backwards
USER_SCRIPT_COMMAND = {PARM_BASE}/use_cases/model_applications/marine_and_cryosphere/UserScript_fcstRTOFS_obsAOML_calcTransport/read_aomlcable_rtofs_transport.py {USER_SCRIPT_INPUT_TEMPLATE}


[user_env_vars]

# Calc Transport specific variables

CALC_TRANSPORT_RTOFS_DIRNAME = {INPUT_BASE}/model_applications/marine_and_cryosphere/UserScript_fcstRTOFS_obsAOML_calcTransport/RTOFS

CALC_TRANSPORT_CABLE_FILENAME = {INPUT_BASE}/model_applications/marine_and_cryosphere/UserScript_fcstRTOFS_obsAOML_calcTransport/FC_cable_transport_2021.dat

CALC_TRANSPORT_EIGHTMILE_FILENAME = {INPUT_BASE}/model_applications/marine_and_cryosphere/UserScript_fcstRTOFS_obsAOML_calcTransport/eightmilecable.dat

CALC_TRANSPORT_LEAD_TIME = 24

# Calculate stats for number of days. The operational website uses 21 days
# of data and then calculates 7 day stats. For the use case both of them are 3 days each.
# The code calculates the number of subdirectories
# under RTOFS directory, however, CALC_TRANSPORT_STATS_DAY is the number of days the statistics
# will be calculated.
CALC_TRANSPORT_STATS_DAY = 3

CALC_TRANSPORT_LOG_FILE = calc_transport.log

OUTPUT_DIR = {OUTPUT_BASE}/model_applications/marine_and_cryosphere/calc_transport
Loading