Skip to content

New Mesh: NARRM14to30E3r1 #782

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions compass/ocean/suites/narrm14.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ocean/global_ocean/NARRM14/mesh
ocean/global_ocean/NARRM14/WOA23/init
ocean/global_ocean/NARRM14/WOA23/performance_test
ocean/global_ocean/NARRM14/WOA23/dynamic_adjustment
ocean/global_ocean/NARRM14/WOA23/files_for_e3sm
5 changes: 5 additions & 0 deletions compass/ocean/suites/narrmwisc14.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ocean/global_ocean/NARRMwISC14/mesh
ocean/global_ocean/NARRMwISC14/WOA23/init
ocean/global_ocean/NARRMwISC14/WOA23/performance_test
ocean/global_ocean/NARRMwISC14/WOA23/dynamic_adjustment
ocean/global_ocean/NARRMwISC14/WOA23/files_for_e3sm
5 changes: 0 additions & 5 deletions compass/ocean/suites/wc14.txt

This file was deleted.

5 changes: 0 additions & 5 deletions compass/ocean/suites/wcwisc14.txt

This file was deleted.

2 changes: 1 addition & 1 deletion compass/ocean/tests/global_ocean/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(self, mpas_core):

self._add_tests(mesh_names=['SO12to60', 'SOwISC12to60'])

self._add_tests(mesh_names=['WC14', 'WCwISC14'])
self._add_tests(mesh_names=['NARRM14', 'NARRMwISC14'])

# RRS6to18: with and without cavities
self._add_tests(mesh_names=['RRS6to18', 'RRSwISC6to18'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,23 @@ def __init__(self, test_case):
target='ustar_CATS2008_S71W70.nc',
database='tidal_mixing')

self.add_output_file(filename='velocityTidalRMS_CATS2008.nc')
def setup(self):
"""
setup output files based on config options
"""
super().setup()
if self.with_ice_shelf_cavities:
self.add_output_file(filename='velocityTidalRMS_CATS2008.nc')

def run(self):
"""
Run this step of the test case
"""
super().run()

if not self.with_ice_shelf_cavities:
return

logger = self.logger
config = self.config
ntasks = self.ntasks
Expand Down
2 changes: 1 addition & 1 deletion compass/ocean/tests/global_ocean/global_ocean.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ forward_update_pio = True
## metadata related to the mesh
# whether to add metadata to output files
add_metadata = True
# the prefix (e.g. QU, EC, WC, SO)
# the prefix (e.g. QU, EC, NARRM, SO)
prefix = PREFIX
# a description of the mesh
mesh_description = <<<Missing>>>
Expand Down
6 changes: 3 additions & 3 deletions compass/ocean/tests/global_ocean/mesh/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
from compass.ocean.tests.global_ocean.mesh.fris04to60 import FRIS04to60BaseMesh
from compass.ocean.tests.global_ocean.mesh.fris08to60 import FRIS08to60BaseMesh
from compass.ocean.tests.global_ocean.mesh.kuroshio import KuroshioBaseMesh
from compass.ocean.tests.global_ocean.mesh.narrm14 import NARRM14BaseMesh
from compass.ocean.tests.global_ocean.mesh.qu import (
IcosMeshFromConfigStep,
QUMeshFromConfigStep,
)
from compass.ocean.tests.global_ocean.mesh.rrs6to18 import RRS6to18BaseMesh
from compass.ocean.tests.global_ocean.mesh.so12to60 import SO12to60BaseMesh
from compass.ocean.tests.global_ocean.mesh.wc14 import WC14BaseMesh
from compass.ocean.tests.global_ocean.metadata import (
get_author_and_email_from_git,
)
Expand Down Expand Up @@ -110,8 +110,8 @@ def __init__(self, test_group, mesh_name, high_res_topography):
base_mesh_step = FRIS08to60BaseMesh(self, name=name, subdir=subdir)
elif mesh_name.startswith('Kuroshio'):
base_mesh_step = KuroshioBaseMesh(self, name=name, subdir=subdir)
elif mesh_name in ['WC14', 'WCwISC14']:
base_mesh_step = WC14BaseMesh(self, name=name, subdir=subdir)
elif mesh_name in ['NARRM14', 'NARRMwISC14']:
base_mesh_step = NARRM14BaseMesh(self, name=name, subdir=subdir)
else:
raise ValueError(f'Unknown mesh name {mesh_name}')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
from compass.mesh import QuasiUniformSphericalMeshStep


class WC14BaseMesh(QuasiUniformSphericalMeshStep):
class NARRM14BaseMesh(QuasiUniformSphericalMeshStep):
"""
A step for creating WC14 mesh
A step for creating NARRM14 mesh
"""
def setup(self):
"""
Expand Down Expand Up @@ -75,14 +75,10 @@ def build_cell_width_lat_lon(self):
fig.set_size_inches(10.0, 14.0)
register_sci_viz_colormaps()

# Create cell width vs latitude for Atlantic and Pacific basins
EC60to30 = mdt.EC_CellWidthVsLat(lat)
EC60to30Narrow = mdt.EC_CellWidthVsLat(lat, latPosEq=8.0,
latWidthEq=3.0)

# Expand from 1D to 2D
_, cellWidth = np.meshgrid(lon, EC60to30Narrow)
_plot_cartopy(2, 'narrow EC60to30', cellWidth, '3Wbgy5')
# start with a uniform 30 km background resolution
dx_max = 30.
cellWidth = dx_max * np.ones((nlat, nlon))
_plot_cartopy(2, 'Uniform 30 km', cellWidth, '3Wbgy5')
plotFrame = 3

# global settings for regionally refines mesh
Expand Down Expand Up @@ -192,13 +188,6 @@ def build_cell_width_lat_lon(self):
_plot_cartopy(plotFrame + 1, 'cellWidth ', cellWidth, '3Wbgy5')
plotFrame += 2

ax = plt.subplot(6, 2, 1)
ax.plot(lat, EC60to30, label='original EC60to30')
ax.plot(lat, EC60to30Narrow, label='narrow EC60to30')
ax.grid(True)
plt.title('Grid cell size [km] versus latitude')
plt.legend(loc="upper left")

plt.savefig('mesh_construction.png', dpi=300)

return cellWidth, lon, lat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,55 +5,55 @@ dynamic_adjustment:
steps:
damped_adjustment_1:
run_duration: 00_06:00:00
output_interval: 10_00:00:00
output_interval: 00_06:00:00
restart_interval: 00_06:00:00
dt: 00:00:30
btr_dt: 00:00:01.5
Rayleigh_damping_coeff: 1.0e-3

damped_adjustment_2:
run_duration: 00_06:00:00
output_interval: 10_00:00:00
output_interval: 00_06:00:00
restart_interval: 00_06:00:00
dt: 00:01:00
btr_dt: 00:00:03
Rayleigh_damping_coeff: 4.0e-4

damped_adjustment_3:
run_duration: 00_12:00:00
output_interval: 10_00:00:00
output_interval: 00_12:00:00
restart_interval: 00_12:00:00
dt: 00:02:00
btr_dt: 00:00:06
Rayleigh_damping_coeff: 1.0e-4

damped_adjustment_4:
run_duration: 01_00:00:00
output_interval: 10_00:00:00
output_interval: 01_00:00:00
restart_interval: 01_00:00:00
dt: 00:03:00
btr_dt: 00:00:09
Rayleigh_damping_coeff: 4.0e-5

damped_adjustment_5:
run_duration: 01_00:00:00
output_interval: 10_00:00:00
output_interval: 01_00:00:00
restart_interval: 01_00:00:00
dt: 00:05:00
btr_dt: 00:00:12
Rayleigh_damping_coeff: 2.0e-5

damped_adjustment_6:
run_duration: 03_00:00:00
output_interval: 10_00:00:00
output_interval: 03_00:00:00
restart_interval: 03_00:00:00
dt: 00:07:30
btr_dt: 00:00:15
Rayleigh_damping_coeff: None

simulation:
run_duration: 24_00:00:00
output_interval: 10_00:00:00
output_interval: 06_00:00:00
restart_interval: 06_00:00:00
dt: 00:10:00
btr_dt: 00:00:15
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ transition_levels = 28
approx_cell_count = 410000

## metadata related to the mesh
# the prefix (e.g. QU, EC, WC, SO)
prefix = WC
# the prefix (e.g. QU, EC, NARRM, SO)
prefix = NARRM
# a description of the mesh and initial condition
mesh_description = MPAS North America and Arctic Focused Water Cycle mesh for E3SM version
${e3sm_version}, with a focused ${min_res}-km resolution
around North America and <<<levels>>> vertical levels
mesh_description = MPAS North America and Arctic Regionally Refined Mesh for
E3SM version ${e3sm_version}, with ${min_res}-km resolution
in these regions, ${max_res} elsewhere and <<<levels>>>
vertical levels

# E3SM version that the mesh is intended for
e3sm_version = 3
Expand All @@ -43,9 +44,9 @@ mesh_revision = 1
# the minimum (finest) resolution in the mesh
min_res = 14
# the maximum (coarsest) resolution in the mesh, can be the same as min_res
max_res = 60
max_res = 30
# The URL of the pull request documenting the creation of the mesh
pull_request = https://github.com/MPAS-Dev/MPAS-Model/pull/628
pull_request = https://github.com/MPAS-Dev/MPAS-Model/pull/782


# config options related to initial condition and diagnostics support files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@
}
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@
}
}
]
}
}
30 changes: 15 additions & 15 deletions docs/design_docs/cached_outputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Contributors: Xylar Asay-Davis
Each ``compass`` step defines its output files in the ``compass.Step.outputs``
attribute. For selected steps (see :ref:`req_select`), we require a mechanism
to download cached files for each of these outputs and to use these cached
files for the outputs of the step instead of computing them.
files for the outputs of the step instead of computing them.

.. _req_select:

Expand All @@ -48,7 +48,7 @@ Contributors: Xylar Asay-Davis

There needs to be a mechanism for developers and users to select which steps
are run as normal and which use cached outputs. For this mechanism to be
practical, it should not be overly tedious or manual (e.g. manually setting a
practical, it should not be overly tedious or manual (e.g. manually setting a
flag for each step).

.. _req_update:
Expand All @@ -72,11 +72,11 @@ Date last modified: 2021/07/30

Contributors: Xylar Asay-Davis

There should be a mechanism for giving each cached output file a unique
identifier (such as a date stamp). A given version (git hash or release) of
There should be a mechanism for giving each cached output file a unique
identifier (such as a date stamp). A given version (git hash or release) of
``compass`` should know which cached files to download. Older cached files
should be retained so that older versions of ``compass`` can still be used
with these cached files.
with these cached files.

.. note::

Expand Down Expand Up @@ -109,14 +109,14 @@ Date last modified: 2021/07/30

Contributors: Xylar Asay-Davis

``compass`` supports "databases" of input data files on the E3SM
``compass`` supports "databases" of input data files on the E3SM
`LCRC server <https://web.lcrc.anl.gov/public/e3sm/mpas_standalonedata/>`_.
Files will be stored in a new ``compass_cache`` database within each MPAS
Files will be stored in a new ``compass_cache`` database within each MPAS
core's space on that server. If the "cached" version of a step is selected
(see :ref:`des_select`), an appropriate "input" file will be added to the test
(see :ref:`des_select`), an appropriate "input" file will be added to the test
case where the "target" is the file on the LCRC server to be cached locally for
future use and the "filename" is the output file. ``compass`` will know which
files on the server correspond to which output files via a python dictionary,
files on the server correspond to which output files via a python dictionary,
as described in :ref:`des_unique`.

.. _des_select:
Expand Down Expand Up @@ -403,9 +403,9 @@ The implementation leans heavily on the assumption that a given step will
either be run with cached outputs or as normal, so that both versions are not
available in the same work directory or as part of the same test suite.

Nevertheless, if a separate "cached" version of a step were desired, it would
be necessary to make symlinks from the cached files in the location of the
"uncached" version of the step to the location of the "cached" version. For
Nevertheless, if a separate "cached" version of a step were desired, it would
be necessary to make symlinks from the cached files in the location of the
"uncached" version of the step to the location of the "cached" version. For
example, if the "uncached" step is

.. code-block:: none
Expand All @@ -422,7 +422,7 @@ symlinks could be created on the LCRC server, e.g.

.. code-block:: none

/lcrc/group/e3sm/public_html/mpas_standalonedata/mpas-ocean/compass_cache/global_ocean/QU240/cached/mesh/mesh/culled_mesh.210803.nc
/lcrc/group/e3sm/public_html/mpas_standalonedata/mpas-ocean/compass_cache/global_ocean/QU240/cached/mesh/mesh/culled_mesh.210803.nc
-> /lcrc/group/e3sm/public_html/mpas_standalonedata/mpas-ocean/compass_cache/global_ocean/QU240/mesh/mesh/culled_mesh.210803.nc

and the ``cached`` attribute could be set to ``True`` in the constructor of the
Expand Down Expand Up @@ -452,8 +452,8 @@ using test-case runs on Chrysalis.
ocean/global_ocean/QUwISC240/PHC/init/ssh_adjustment/
ocean/global_ocean/EC30to60/mesh/mesh/
ocean/global_ocean/EC30to60/PHC/init/initial_state/
ocean/global_ocean/WC14/mesh/mesh/
ocean/global_ocean/WC14/PHC/init/initial_state/
ocean/global_ocean/NARRM14/mesh/mesh/
ocean/global_ocean/NARRM14/PHC/init/initial_state/
ocean/global_ocean/ECwISC30to60/mesh/mesh/
ocean/global_ocean/ECwISC30to60/PHC/init/initial_state/
ocean/global_ocean/ECwISC30to60/PHC/init/ssh_adjustment/
Expand Down
2 changes: 1 addition & 1 deletion docs/design_docs/compass_package.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1550,7 +1550,7 @@ metadata to include in the output files:
forward_max_disk = 1000

## metadata related to the mesh
# the prefix (e.g. QU, EC, WC, SO)
# the prefix (e.g. QU, EC, NARRM, SO)
prefix = EC
# a description of the mesh and initial condition
mesh_description = MPAS Eddy Closure mesh for E3SM version ${e3sm_version} with
Expand Down
4 changes: 2 additions & 2 deletions docs/developers_guide/ocean/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ test cases and steps
mesh.so12to60.SO12to60BaseMesh
mesh.so12to60.SO12to60BaseMesh.build_cell_width_lat_lon

mesh.wc14.WC14BaseMesh
mesh.wc14.WC14BaseMesh.build_cell_width_lat_lon
mesh.narrm14.NARRM14BaseMesh
mesh.narrm14.NARRM14BaseMesh.build_cell_width_lat_lon

performance_test.PerformanceTest
performance_test.PerformanceTest.configure
Expand Down
Loading