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

[develop] Add ufs-case-study data options #736

Merged
merged 2 commits into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 11 additions & 0 deletions parm/data_locations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,17 @@ NAM:
fcst:
- nam.t{hh}z.awphys{fcst_hr:02d}.tm00.grib2

UFS-CASE-STUDY:
aws:
protocol: download
url: "https://ufs-case-studies.s3.amazonaws.com/"
file_names: &ufs_file_names
nemsio:
anl:
- "{yyyymmddhh}.gfs.nemsio.tar.gz"
fcst:
- "{yyyymmddhh}_bc.atmf{fcst_hr:03d}.nemsio.tar.gz"

##########################
##########################
### Observation Data ###
Expand Down
1 change: 1 addition & 0 deletions ush/retrieve_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,7 @@ def parse_args(argv):
"RAP_obs",
"HRRRx",
"GSI-FIX",
"UFS-CASE-STUDY"
),
help="External model label. This input is case-sensitive",
required=True,
Expand Down
58 changes: 58 additions & 0 deletions ush/test_retrieve_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,3 +344,61 @@ def test_rap_lbcs_from_aws(self):
path = os.path.join(tmp_dir, "*")
files_on_disk = glob.glob(path)
self.assertEqual(len(files_on_disk), 5)

def test_ufs_ics_from_aws(self):

"""Get UFS-CASE-STUDY ICS from aws"""

with tempfile.TemporaryDirectory(dir=".") as tmp_dir:

# fmt: off
args = [
'--file_set', 'anl',
'--config', self.config,
'--cycle_date', '2020072300',
'--data_stores', 'aws',
'--external_model', 'UFS-CASE-STUDY',
'--fcst_hrs', '0',
'--output_path', tmp_dir,
'--ics_or_lbcs', 'ICS',
'--debug',
'--file_type', 'nemsio',
]
# fmt: on

retrieve_data.main(args)

# Verify files exist in temp dir

path = os.path.join(tmp_dir, "*")
files_on_disk = glob.glob(path)
self.assertEqual(len(files_on_disk), 1)

def test_ufs_lbcs_from_aws(self):

"""Get UFS-CASE-STUDY LBCS from aws for 3 hour boundary conditions"""

with tempfile.TemporaryDirectory(dir=".") as tmp_dir:

# fmt: off
args = [
'--file_set', 'fcst',
'--config', self.config,
'--cycle_date', '2020072300',
'--data_stores', 'aws',
'--external_model', 'UFS-CASE-STUDY',
'--fcst_hrs', '3', '6', '3',
'--output_path', tmp_dir,
'--ics_or_lbcs', 'LBCS',
'--debug',
'--file_type', 'nemsio',
]
# fmt: on

retrieve_data.main(args)

# Verify files exist in temp dir

path = os.path.join(tmp_dir, "*")
files_on_disk = glob.glob(path)
self.assertEqual(len(files_on_disk), 2)