Skip to content

Commit 48f4913

Browse files
committed
Add thwaites fct tests
1 parent 9b38065 commit 48f4913

File tree

3 files changed

+49
-19
lines changed

3 files changed

+49
-19
lines changed

compass/landice/tests/thwaites/__init__.py

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,23 @@ def __init__(self, mpas_core):
1616
"""
1717
super().__init__(mpas_core=mpas_core, name='thwaites')
1818

19-
self.add_test_case(DecompositionTest(test_group=self,
20-
depth_integrated=False))
21-
self.add_test_case(DecompositionTest(test_group=self,
22-
depth_integrated=True))
19+
for advection_type in ['fo', 'fct']:
20+
self.add_test_case(DecompositionTest(
21+
test_group=self,
22+
advection_type=advection_type,
23+
depth_integrated=False))
24+
self.add_test_case(DecompositionTest(
25+
test_group=self,
26+
advection_type=advection_type,
27+
depth_integrated=True))
2328

24-
self.add_test_case(RestartTest(test_group=self,
25-
depth_integrated=False))
26-
self.add_test_case(RestartTest(test_group=self,
27-
depth_integrated=True))
29+
self.add_test_case(RestartTest(
30+
test_group=self,
31+
advection_type=advection_type,
32+
depth_integrated=False))
33+
self.add_test_case(RestartTest(
34+
test_group=self,
35+
advection_type=advection_type,
36+
depth_integrated=True))
2837

2938
self.add_test_case(MeshGen(test_group=self))

compass/landice/tests/thwaites/decomposition_test/__init__.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class DecompositionTest(TestCase):
1010
results of the two runs are identical.
1111
"""
1212

13-
def __init__(self, test_group, depth_integrated=False):
13+
def __init__(self, test_group, advection_type, depth_integrated=False):
1414
"""
1515
Create the test case
1616
@@ -24,21 +24,26 @@ def __init__(self, test_group, depth_integrated=False):
2424
2525
"""
2626
if depth_integrated is True:
27-
name = 'fo-depthInt_decomposition_test'
27+
name_tmp = 'fo-depthInt_decomposition_test'
2828
else:
29-
name = 'fo_decomposition_test'
29+
name_tmp = 'fo_decomposition_test'
3030

31+
name = f'{advection_type}_{name_tmp}'
3132
super().__init__(test_group=test_group, name=name)
3233

3334
self.cores_set = [16, 32]
3435

3536
for procs in self.cores_set:
3637
name = '{}proc_run'.format(procs)
37-
self.add_step(
38-
RunModel(test_case=self, name=name,
39-
depth_integrated=depth_integrated,
40-
ntasks=procs, min_tasks=procs, openmp_threads=1))
41-
38+
step = RunModel(test_case=self, name=name,
39+
depth_integrated=depth_integrated,
40+
ntasks=procs, min_tasks=procs, openmp_threads=1)
41+
if advection_type == 'fct':
42+
step.add_namelist_options(
43+
{'config_thickness_advection': "'fct'",
44+
'config_tracer_advection': "'fct'"},
45+
out_name='namelist.landice')
46+
self.add_step(step)
4247
# no configure() method is needed
4348

4449
# no run() method is needed

compass/landice/tests/thwaites/restart_test/__init__.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class RestartTest(TestCase):
1010
test case verifies that the results of the two runs are identical.
1111
"""
1212

13-
def __init__(self, test_group, depth_integrated=False):
13+
def __init__(self, test_group, advection_type, depth_integrated=False):
1414
"""
1515
Create the test case
1616
@@ -25,10 +25,11 @@ def __init__(self, test_group, depth_integrated=False):
2525
"""
2626

2727
if depth_integrated is True:
28-
name = 'fo-depthInt_restart_test'
28+
name_tmp = 'fo-depthInt_restart_test'
2929
else:
30-
name = 'fo_restart_test'
30+
name_tmp = 'fo_restart_test'
3131

32+
name = f'{advection_type}_{name_tmp}'
3233
super().__init__(test_group=test_group, name=name)
3334

3435
ntasks = 36
@@ -42,6 +43,11 @@ def __init__(self, test_group, depth_integrated=False):
4243
step.add_namelist_file(
4344
'compass.landice.tests.thwaites.restart_test',
4445
'namelist.full', out_name='namelist.landice')
46+
if advection_type == 'fct':
47+
step.add_namelist_options(
48+
{'config_thickness_advection': "'fct'",
49+
'config_tracer_advection': "'fct'"},
50+
out_name='namelist.landice')
4551
step.add_streams_file(
4652
'compass.landice.tests.thwaites.restart_test',
4753
'streams.full', out_name='streams.landice')
@@ -57,13 +63,23 @@ def __init__(self, test_group, depth_integrated=False):
5763
step.add_namelist_file(
5864
'compass.landice.tests.thwaites.restart_test',
5965
'namelist.restart', out_name='namelist.landice')
66+
if advection_type == 'fct':
67+
step.add_namelist_options(
68+
{'config_thickness_advection': "'fct'",
69+
'config_tracer_advection': "'fct'"},
70+
out_name='namelist.landice')
6071
step.add_streams_file(
6172
'compass.landice.tests.thwaites.restart_test',
6273
'streams.restart', out_name='streams.landice')
6374

6475
step.add_namelist_file(
6576
'compass.landice.tests.thwaites.restart_test',
6677
'namelist.restart.rst', out_name='namelist.landice.rst')
78+
if advection_type == 'fct':
79+
step.add_namelist_options(
80+
{'config_thickness_advection': "'fct'",
81+
'config_tracer_advection': "'fct'"},
82+
out_name='namelist.landice.rst')
6783
# same streams file for both restart stages
6884
step.add_streams_file(
6985
'compass.landice.tests.thwaites.restart_test',

0 commit comments

Comments
 (0)