1+ import os
2+
13from compass .mesh .spherical import (
24 IcosahedralMeshStep ,
35 QuasiUniformSphericalMeshStep ,
1517 IcosMeshFromConfigStep ,
1618 QUMeshFromConfigStep ,
1719)
20+ from compass .ocean .tests .global_ocean .mesh .remap_mali_topography import (
21+ RemapMaliTopography ,
22+ )
1823from compass .ocean .tests .global_ocean .mesh .rrs6to18 import RRS6to18BaseMesh
1924from compass .ocean .tests .global_ocean .mesh .so12to30 import SO12to30BaseMesh
2025from compass .ocean .tests .global_ocean .mesh .wc14 import WC14BaseMesh
@@ -31,6 +36,13 @@ class Mesh(TestCase):
3136
3237 Attributes
3338 ----------
39+ mesh_name : str
40+ The name of the mesh
41+
42+ mesh_subdir : str
43+ The subdirectory within the test group for all test cases with this
44+ mesh and topography
45+
3446 package : str
3547 The python package for the mesh
3648
@@ -43,8 +55,14 @@ class Mesh(TestCase):
4355 high_res_topography : bool
4456 Whether to remap a high resolution topography data set. A lower
4557 res data set is used for low resolution meshes.
58+
59+ mali_ais_topo : str
60+ Short name for the MALI dataset to use for Antarctic Ice Sheet
61+ topography
4662 """
47- def __init__ (self , test_group , mesh_name , high_res_topography ):
63+
64+ def __init__ (self , test_group , mesh_name , # noqa: C901
65+ high_res_topography , mali_ais_topo = None ):
4866 """
4967 Create test case for creating a global MPAS-Ocean mesh
5068
@@ -59,9 +77,20 @@ def __init__(self, test_group, mesh_name, high_res_topography):
5977 high_res_topography : bool
6078 Whether to remap a high resolution topography data set. A lower
6179 res data set is used for low resolution meshes.
80+
81+ mali_ais_topo : str, optional
82+ Short name for the MALI dataset to use for Antarctic Ice Sheet
83+ topography
6284 """
6385 name = 'mesh'
64- subdir = f'{ mesh_name } /{ name } '
86+ if mali_ais_topo is None :
87+ self .mesh_subdir = mesh_name
88+ else :
89+ self .mesh_subdir = os .path .join (mesh_name ,
90+ f'MALI_topo_{ mali_ais_topo } ' )
91+
92+ subdir = os .path .join (self .mesh_subdir , name )
93+
6594 super ().__init__ (test_group = test_group , name = name , subdir = subdir )
6695
6796 with_ice_shelf_cavities = 'wISC' in mesh_name
@@ -75,6 +104,7 @@ def __init__(self, test_group, mesh_name, high_res_topography):
75104 self .mesh_config_filename = f'{ mesh_lower } .cfg'
76105
77106 self .mesh_name = mesh_name
107+ self .mali_ais_topo = mali_ais_topo
78108 self .with_ice_shelf_cavities = with_ice_shelf_cavities
79109 self .high_res_topography = high_res_topography
80110
@@ -117,9 +147,16 @@ def __init__(self, test_group, mesh_name, high_res_topography):
117147
118148 self .add_step (base_mesh_step )
119149
120- remap_step = RemapTopography (test_case = self ,
121- base_mesh_step = base_mesh_step ,
122- mesh_name = mesh_name )
150+ if mali_ais_topo is None :
151+ remap_step = RemapTopography (test_case = self ,
152+ base_mesh_step = base_mesh_step ,
153+ mesh_name = mesh_name )
154+ else :
155+ remap_step = RemapMaliTopography (
156+ test_case = self , base_mesh_step = base_mesh_step ,
157+ mesh_name = mesh_name , mali_ais_topo = mali_ais_topo ,
158+ ocean_includes_grounded = False )
159+
123160 self .add_step (remap_step )
124161
125162 self .add_step (CullMeshStep (
@@ -146,6 +183,13 @@ def configure(self, config=None):
146183 'low_res_topography.cfg' ,
147184 exception = True )
148185
186+ if self .mali_ais_topo is not None :
187+ package = 'compass.ocean.tests.global_ocean.mesh.' \
188+ 'remap_mali_topography'
189+ config .add_from_package (package ,
190+ f'{ self .mali_ais_topo .lower ()} .cfg' ,
191+ exception = True )
192+
149193 if self .mesh_name .startswith ('Kuroshio' ):
150194 # add the config options for all kuroshio meshes
151195 config .add_from_package (
0 commit comments