Skip to content

Commit 2e577a9

Browse files
committed
Add humboldt fct tests
Add 3km fct full physics tests for humboldt. Note that the decomposition tests do not pass validation, but testing shows that they also fail using fo advection.
1 parent 48f4913 commit 2e577a9

File tree

3 files changed

+85
-45
lines changed

3 files changed

+85
-45
lines changed

compass/landice/tests/humboldt/__init__.py

Lines changed: 46 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -25,50 +25,58 @@ def __init__(self, mpas_core):
2525
DecompositionTest(test_group=self,
2626
velo_solver=velo_solver,
2727
calving_law='none',
28-
mesh_type=mesh_type))
28+
mesh_type=mesh_type,
29+
advection_type='fo'))
2930
self.add_test_case(
3031
RestartTest(test_group=self,
3132
velo_solver=velo_solver,
3233
calving_law='none',
33-
mesh_type=mesh_type))
34+
mesh_type=mesh_type,
35+
advection_type='fo'))
3436

3537
# Set up 'full physics' tests using the 3km mesh
3638
mesh_type = '3km'
3739
for velo_solver in ['FO', 'none']:
38-
self.add_test_case(
39-
DecompositionTest(test_group=self,
40-
velo_solver=velo_solver,
41-
calving_law='von_Mises_stress',
42-
mesh_type=mesh_type,
43-
damage='threshold',
44-
face_melt=True))
40+
for advection_type in ['fo', 'fct']:
41+
self.add_test_case(
42+
DecompositionTest(test_group=self,
43+
velo_solver=velo_solver,
44+
calving_law='von_Mises_stress',
45+
mesh_type=mesh_type,
46+
advection_type=advection_type,
47+
damage='threshold',
48+
face_melt=True))
4549

46-
self.add_test_case(
47-
RestartTest(test_group=self,
48-
velo_solver=velo_solver,
49-
calving_law='von_Mises_stress',
50-
mesh_type=mesh_type,
51-
damage='threshold',
52-
face_melt=True))
50+
self.add_test_case(
51+
RestartTest(test_group=self,
52+
velo_solver=velo_solver,
53+
calving_law='von_Mises_stress',
54+
mesh_type=mesh_type,
55+
advection_type=advection_type,
56+
damage='threshold',
57+
face_melt=True))
5358

5459
for velo_solver in ['FO']:
55-
self.add_test_case(
56-
DecompositionTest(test_group=self,
57-
velo_solver=velo_solver,
58-
calving_law='von_Mises_stress',
59-
mesh_type=mesh_type,
60-
damage='threshold',
61-
face_melt=True,
62-
depth_integrated=True))
60+
for advection_type in ['fo', 'fct']:
61+
self.add_test_case(
62+
DecompositionTest(test_group=self,
63+
velo_solver=velo_solver,
64+
calving_law='von_Mises_stress',
65+
mesh_type=mesh_type,
66+
advection_type=advection_type,
67+
damage='threshold',
68+
face_melt=True,
69+
depth_integrated=True))
6370

64-
self.add_test_case(
65-
RestartTest(test_group=self,
66-
velo_solver=velo_solver,
67-
calving_law='von_Mises_stress',
68-
mesh_type=mesh_type,
69-
damage='threshold',
70-
face_melt=True,
71-
depth_integrated=True))
71+
self.add_test_case(
72+
RestartTest(test_group=self,
73+
velo_solver=velo_solver,
74+
calving_law='von_Mises_stress',
75+
mesh_type=mesh_type,
76+
advection_type=advection_type,
77+
damage='threshold',
78+
face_melt=True,
79+
depth_integrated=True))
7280

7381
# Create decomp and restart tests for all calving laws.
7482
# Note that FO velo solver is NOT BFB across decompositions
@@ -86,13 +94,15 @@ def __init__(self, mpas_core):
8694
DecompositionTest(test_group=self,
8795
velo_solver=velo_solver,
8896
calving_law=calving_law,
89-
mesh_type=mesh_type))
97+
mesh_type=mesh_type,
98+
advection_type='fo'))
9099

91100
self.add_test_case(
92101
RestartTest(test_group=self,
93102
velo_solver=velo_solver,
94103
calving_law=calving_law,
95-
mesh_type=mesh_type))
104+
mesh_type=mesh_type,
105+
advection_type='fo'))
96106

97107
# Add hydro tests
98108
mesh_type = '3km'
@@ -101,6 +111,7 @@ def __init__(self, mpas_core):
101111
velo_solver='none',
102112
calving_law='none',
103113
mesh_type=mesh_type,
114+
advection_type='fo',
104115
damage=None,
105116
face_melt=False,
106117
hydro=True))
@@ -110,6 +121,7 @@ def __init__(self, mpas_core):
110121
velo_solver='none',
111122
calving_law='none',
112123
mesh_type=mesh_type,
124+
advection_type='fo',
113125
damage=None,
114126
face_melt=False,
115127
hydro=True))

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

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ class DecompositionTest(TestCase):
3939
"""
4040

4141
def __init__(self, test_group, velo_solver, calving_law, mesh_type,
42-
damage=None, face_melt=False, depth_integrated=False,
43-
hydro=False):
42+
advection_type, damage=None, face_melt=False,
43+
depth_integrated=False, hydro=False):
4444
"""
4545
Create the test case
4646
@@ -58,6 +58,9 @@ def __init__(self, test_group, velo_solver, calving_law, mesh_type,
5858
mesh_type : {'1km', '3km'}
5959
The resolution or type of mesh of the test case
6060
61+
advection_type : {'fo', 'fct'}
62+
The type of advection to use for thickness and tracers
63+
6164
damage : str
6265
The damage method used for the test case
6366
@@ -73,6 +76,7 @@ def __init__(self, test_group, velo_solver, calving_law, mesh_type,
7376
name = 'decomposition_test'
7477
self.mesh_type = mesh_type
7578
self.velo_solver = velo_solver
79+
self.advection_type = advection_type
7680
assert self.velo_solver in {'sia', 'FO', 'none'}, \
7781
"Value of velo_solver must be one of {'sia', 'FO', 'none'}"
7882
self.calving_law = calving_law
@@ -84,8 +88,8 @@ def __init__(self, test_group, velo_solver, calving_law, mesh_type,
8488
self.hydro = False
8589

8690
# build dir name. always include velo solver and calving law
87-
subdir = 'mesh-{}_decomposition_test/velo-{}'.format(
88-
mesh_type, velo_solver.lower())
91+
subdir = 'mesh-{}_decomposition_test/velo-{}_advec-{}'.format(
92+
mesh_type, velo_solver.lower(), advection_type)
8993
if velo_solver == 'FO' and depth_integrated is True:
9094
subdir += '-depthInt'
9195
subdir += '_calving-{}'.format(calving_law.lower())
@@ -105,15 +109,20 @@ def __init__(self, test_group, velo_solver, calving_law, mesh_type,
105109
self.proc_list = [1, 32]
106110
for procs in self.proc_list:
107111
name = '{}proc_run'.format(procs)
108-
self.add_step(
109-
RunModel(test_case=self, name=name, subdir=name, ntasks=procs,
112+
step = RunModel(test_case=self, name=name, subdir=name, ntasks=procs,
110113
openmp_threads=1, velo_solver=self.velo_solver,
111114
calving_law=self.calving_law,
112115
damage=self.damage,
113116
face_melt=self.face_melt,
114117
depth_integrated=depth_integrated,
115118
hydro=self.hydro,
116-
mesh_type=mesh_type))
119+
mesh_type=mesh_type)
120+
if advection_type == 'fct':
121+
step.add_namelist_options(
122+
{'config_thickness_advection': "'fct'",
123+
'config_tracer_advection': "'fct'"},
124+
out_name='namelist.landice')
125+
self.add_step(step)
117126

118127
# no configure() method is needed
119128

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

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ class RestartTest(TestCase):
3131
"""
3232

3333
def __init__(self, test_group, velo_solver, calving_law, mesh_type,
34-
damage=None, face_melt=False, depth_integrated=False,
35-
hydro=False):
34+
advection_type, damage=None, face_melt=False,
35+
depth_integrated=False, hydro=False):
3636
"""
3737
Create the test case
3838
@@ -50,6 +50,9 @@ def __init__(self, test_group, velo_solver, calving_law, mesh_type,
5050
mesh_type : {'1km', '3km'}
5151
The resolution or type of mesh of the test case
5252
53+
advection_type : {'fo', 'fct'}
54+
The type of advection to use for thickness and tracers
55+
5356
damage : str
5457
The damage method used for the test case
5558
@@ -65,6 +68,7 @@ def __init__(self, test_group, velo_solver, calving_law, mesh_type,
6568
name = 'restart_test'
6669
self.mesh_type = mesh_type
6770
self.velo_solver = velo_solver
71+
self.advection_type = advection_type
6872
assert self.velo_solver in {'sia', 'FO', 'none'}, \
6973
"Value of velo_solver must be one of {'sia', 'FO', 'none'}"
7074
self.calving_law = calving_law
@@ -76,8 +80,8 @@ def __init__(self, test_group, velo_solver, calving_law, mesh_type,
7680
self.hydro = False
7781

7882
# build dir name. always include velo solver and calving law
79-
subdir = 'mesh-{}_restart_test/velo-{}'.format(
80-
mesh_type, velo_solver.lower())
83+
subdir = 'mesh-{}_restart_test/velo-{}_advec-{}'.format(
84+
mesh_type, velo_solver.lower(), advection_type)
8185
if velo_solver == 'FO' and depth_integrated is True:
8286
subdir += '-depthInt'
8387
subdir += '_calving-{}'.format(calving_law.lower())
@@ -111,6 +115,11 @@ def __init__(self, test_group, velo_solver, calving_law, mesh_type,
111115
step.add_namelist_file(
112116
'compass.landice.tests.humboldt.restart_test',
113117
nl1, out_name='namelist.landice')
118+
if advection_type == 'fct':
119+
step.add_namelist_options(
120+
{'config_thickness_advection': "'fct'",
121+
'config_tracer_advection': "'fct'"},
122+
out_name='namelist.landice')
114123
step.add_streams_file(
115124
'compass.landice.tests.humboldt.restart_test',
116125
'streams.full', out_name='streams.landice')
@@ -140,13 +149,23 @@ def __init__(self, test_group, velo_solver, calving_law, mesh_type,
140149
step.add_namelist_file(
141150
'compass.landice.tests.humboldt.restart_test',
142151
nl1, out_name='namelist.landice')
152+
if advection_type == 'fct':
153+
step.add_namelist_options(
154+
{'config_thickness_advection': "'fct'",
155+
'config_tracer_advection': "'fct'"},
156+
out_name='namelist.landice')
143157
step.add_streams_file(
144158
'compass.landice.tests.humboldt.restart_test',
145159
'streams.restart', out_name='streams.landice')
146160

147161
step.add_namelist_file(
148162
'compass.landice.tests.humboldt.restart_test',
149163
nl2, out_name='namelist.landice.rst')
164+
if advection_type == 'fct':
165+
step.add_namelist_options(
166+
{'config_thickness_advection': "'fct'",
167+
'config_tracer_advection': "'fct'"},
168+
out_name='namelist.landice.rst')
150169
step.add_streams_file(
151170
'compass.landice.tests.humboldt.restart_test',
152171
'streams.restart.rst', out_name='streams.landice.rst')

0 commit comments

Comments
 (0)