Skip to content

Commit b2a3794

Browse files
committed
Make inactive top cells false by default and add inactive top cells performance test
1 parent fcddc43 commit b2a3794

File tree

2 files changed

+23
-21
lines changed

2 files changed

+23
-21
lines changed

compass/ocean/tests/global_ocean/__init__.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,8 @@ def __init__(self, mpas_core):
4040

4141
init = Init(test_group=self, mesh=mesh,
4242
initial_condition='PHC',
43-
with_bgc=False,
44-
with_inactive_top_cells=False)
43+
with_bgc=False)
4544
self.add_test_case(init)
46-
init_inactive_top_cells = Init(test_group=self, mesh=mesh,
47-
initial_condition='PHC',
48-
with_bgc=False,
49-
with_inactive_top_cells=True)
50-
self.add_test_case(init_inactive_top_cells)
5145

5246
time_integrator = 'split_explicit'
5347
self.add_test_case(
@@ -106,8 +100,7 @@ def __init__(self, mpas_core):
106100
time_integrator = 'split_explicit'
107101
init = Init(test_group=self, mesh=mesh,
108102
initial_condition='EN4_1900',
109-
with_bgc=False,
110-
with_inactive_top_cells=False)
103+
with_bgc=False)
111104
self.add_test_case(init)
112105
self.add_test_case(
113106
PerformanceTest(
@@ -125,8 +118,18 @@ def __init__(self, mpas_core):
125118
# BGC tests
126119
init = Init(test_group=self, mesh=mesh,
127120
initial_condition='PHC',
128-
with_bgc=True,
129-
with_inactive_top_cells=False)
121+
with_bgc=True)
122+
self.add_test_case(init)
123+
self.add_test_case(
124+
PerformanceTest(
125+
test_group=self, mesh=mesh, init=init,
126+
time_integrator=time_integrator))
127+
128+
# Inactive top cells tests
129+
init = Init(test_group=self, mesh=mesh,
130+
initial_condition='PHC',
131+
with_bgc=False,
132+
with_inactive_top_cells=True)
130133
self.add_test_case(init)
131134
self.add_test_case(
132135
PerformanceTest(
@@ -140,8 +143,7 @@ def __init__(self, mpas_core):
140143

141144
init = Init(test_group=self, mesh=mesh,
142145
initial_condition='PHC',
143-
with_bgc=False,
144-
with_inactive_top_cells=False)
146+
with_bgc=False)
145147
self.add_test_case(init)
146148

147149
time_integrator = 'split_explicit'
@@ -165,8 +167,7 @@ def __init__(self, mpas_core):
165167

166168
init = Init(test_group=self, mesh=mesh,
167169
initial_condition='PHC',
168-
with_bgc=False,
169-
with_inactive_top_cells=False)
170+
with_bgc=False)
170171
self.add_test_case(init)
171172
time_integrator = 'split_explicit'
172173
self.add_test_case(
@@ -189,8 +190,7 @@ def __init__(self, mpas_core):
189190

190191
init = Init(test_group=self, mesh=mesh,
191192
initial_condition='PHC',
192-
with_bgc=False,
193-
with_inactive_top_cells=False)
193+
with_bgc=False)
194194
self.add_test_case(init)
195195
time_integrator = 'split_explicit'
196196
self.add_test_case(

compass/ocean/tests/global_ocean/init/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Init(TestCase):
2626
The subdirectory within the test group for all test cases with this
2727
initial condition
2828
"""
29-
def __init__(self, test_group, mesh, initial_condition, with_bgc, with_inactive_top_cells):
29+
def __init__(self, test_group, mesh, initial_condition, with_bgc, with_inactive_top_cells=False):
3030
"""
3131
Create the test case
3232
@@ -46,17 +46,19 @@ def __init__(self, test_group, mesh, initial_condition, with_bgc, with_inactive_
4646
"""
4747
name = 'init'
4848
mesh_name = mesh.mesh_name
49+
ic_dir = initial_condition
4950
if with_bgc:
50-
ic_dir = '{}_BGC'.format(initial_condition)
51-
else:
52-
ic_dir = initial_condition
51+
ic_dir = '{}_BGC'.format(ic_dir)
52+
if with_inactive_top_cells:
53+
ic_dir = '{}_inactive_top'.format(ic_dir)
5354
self.init_subdir = os.path.join(mesh_name, ic_dir)
5455
subdir = os.path.join(self.init_subdir, name)
5556
super().__init__(test_group=test_group, name=name, subdir=subdir)
5657

5758
self.mesh = mesh
5859
self.initial_condition = initial_condition
5960
self.with_bgc = with_bgc
61+
self.with_inactive_top_cells = with_inactive_top_cells
6062

6163
self.add_step(
6264
InitialState(

0 commit comments

Comments
 (0)