-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add a tides test case for the VR45to5 mesh #802
Open
sbrus89
wants to merge
9
commits into
MPAS-Dev:main
Choose a base branch
from
sbrus89:vr45to5_tides
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
670bf77
Add VR45to5 tides case
sbrus89 e2661a4
Updates to VR tides case
sbrus89 61688af
Fix analysis plot titles and flake8 issues
sbrus89 a509b68
Remove log file output and add docstrings to init
sbrus89 ac22669
Use bed derivatives from pixel file in calculate_wave_drag.py
sbrus89 6a7907a
Inherit from QuasiUniformSphericalMeshStep for VRTidesMesh class
sbrus89 3f7d98a
Update documentation
sbrus89 db6fda2
Add remap topography step to tides mesh step
sbrus89 bd62b1c
Improve tides analysis step
sbrus89 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import os | ||
|
||
import compass.ocean.tests.tides.dem.dem_pixel as dem_pixel | ||
from compass.step import Step | ||
|
||
|
||
class CreatePixelFile(Step): | ||
""" | ||
A step for creating a pixel file for creating MPAS meshes | ||
|
||
Attributes | ||
---------- | ||
""" | ||
|
||
def __init__(self, test_case): | ||
""" | ||
Create the step | ||
|
||
Parameters | ||
---------- | ||
test_case : compass.ocean.tests.tides.init.Init | ||
The test case this step belongs to | ||
""" | ||
super().__init__(test_case=test_case, name='pixel', | ||
ntasks=1, min_tasks=1, openmp_threads=1) | ||
|
||
self.add_input_file( | ||
filename='GEBCO_2023_sub_ice_topo.nc', | ||
target='GEBCO_2023_sub_ice_topo.nc', | ||
database='bathymetry_database') | ||
|
||
self.add_input_file( | ||
filename='RTopo-2.0.4_30sec_bedrock_topography.nc', | ||
target='RTopo-2.0.4_30sec_bedrock_topography.nc', | ||
database='bathymetry_database') | ||
|
||
self.add_input_file( | ||
filename='RTopo-2.0.4_30sec_surface_elevation.nc', | ||
target='RTopo-2.0.4_30sec_surface_elevation.nc', | ||
database='bathymetry_database') | ||
|
||
self.add_input_file( | ||
filename='RTopo-2.0.4_30sec_ice_base_topography.nc', | ||
target='RTopo-2.0.4_30sec_ice_base_topography.nc', | ||
database='bathymetry_database') | ||
|
||
def run(self): | ||
""" | ||
Run this step of the test case | ||
""" | ||
|
||
self.init_path = './' | ||
|
||
if not os.path.exists('RTopo_2_0_4_30sec_pixel.nc'): | ||
dem_pixel.rtopo_30sec(self.init_path, self.init_path) | ||
if not os.path.exists('GEBCO_v2023_30sec_pixel.nc'): | ||
dem_pixel.gebco_30sec(self.init_path, self.init_path) | ||
if not os.path.exists('RTopo_2_0_4_GEBCO_v2023_30sec_pixel.nc'): | ||
dem_pixel.rtopo_gebco_30sec(self.init_path, self.init_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
# -- long_name strings for NetCDF variables | ||
|
||
class base: | ||
pass | ||
|
||
|
||
names = base() | ||
names.bed_elevation = "elevation of bed" | ||
names.ocn_thickness = "thickness of ocn" | ||
names.ice_thickness = "thickness of ice" | ||
names.ocn_cover = "fractional cover of ocn, 0-1" | ||
names.ice_cover = "fractional cover of ice, 0-1" | ||
names.bed_slope = "RMS magnitude of bed slopes" | ||
names.bed_slope_deg = "arc-tangent of RMS bed slopes" | ||
names.bed_dz_dx = "derivative of bed elevation along lon.-axis" | ||
names.bed_dz_dy = "derivative of bed elevation along lat.-axis" | ||
names.bed_elevation_profile = "sub-grid percentiles of bed elevation" | ||
names.bed_slope_profile = "sub-grid percentiles of RMS bed slope" | ||
names.ocn_thickness_profile = "sub-grid percentiles of ocn thickness" | ||
names.ice_thickness_profile = "sub-grid percentiles of ice thickness" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Building these DEM datasets could be done once and cached somewhere, as it's pretty expensive and is typically only redone when GEBCO release a new bathymetry (once per year).