1- from compass .validate import compare_variables
2- from compass .testcase import TestCase
31from compass .landice .tests .humboldt .run_model import RunModel
2+ from compass .testcase import TestCase
3+ from compass .validate import compare_variables
44
55
66class RestartTest (TestCase ):
@@ -25,7 +25,7 @@ class RestartTest(TestCase):
2525 """
2626
2727 def __init__ (self , test_group , velo_solver , calving_law , mesh_type ,
28- damage = None , face_melt = False ):
28+ advection_type , damage = None , face_melt = False ):
2929 """
3030 Create the test case
3131
@@ -43,6 +43,9 @@ def __init__(self, test_group, velo_solver, calving_law, mesh_type,
4343 mesh_type : {'1km', '3km'}
4444 The resolution or type of mesh of the test case
4545
46+ advection_type : {'fo', 'fct'}
47+ The type of advection to use for thickness and tracers
48+
4649 damage : str
4750 The damage method used for the test case
4851
@@ -52,15 +55,17 @@ def __init__(self, test_group, velo_solver, calving_law, mesh_type,
5255 name = 'restart_test'
5356 self .mesh_type = mesh_type
5457 self .velo_solver = velo_solver
58+ self .advection_type = advection_type
5559 assert self .velo_solver in {'sia' , 'FO' , 'none' }, \
5660 "Value of velo_solver must be one of {'sia', 'FO', 'none'}"
5761 self .calving_law = calving_law
5862 self .damage = damage
5963 self .face_melt = face_melt
6064
6165 # build dir name. always include velo solver and calving law
62- subdir = 'mesh-{}_restart_test/velo-{}_calving-{}' .format (
63- mesh_type , velo_solver .lower (), calving_law .lower ())
66+ subdir = 'mesh-{}_restart_test/velo-{}_advec-{}_calving-{}' .format (
67+ mesh_type , velo_solver .lower (), advection_type ,
68+ calving_law .lower ())
6469 # append damage and facemelt if provided
6570 if damage is not None :
6671 subdir += '_damage-{}' .format (damage )
@@ -80,6 +85,11 @@ def __init__(self, test_group, velo_solver, calving_law, mesh_type,
8085 step .add_namelist_file (
8186 'compass.landice.tests.humboldt.restart_test' ,
8287 'namelist.full' , out_name = 'namelist.landice' )
88+ if advection_type == 'fct' :
89+ step .add_namelist_options (
90+ {'config_thickness_advection' : "'fct'" ,
91+ 'config_tracer_advection' : "'fct'" },
92+ out_name = 'namelist.landice' )
8393 step .add_streams_file (
8494 'compass.landice.tests.humboldt.restart_test' ,
8595 'streams.full' , out_name = 'streams.landice' )
@@ -98,13 +108,23 @@ def __init__(self, test_group, velo_solver, calving_law, mesh_type,
98108 step .add_namelist_file (
99109 'compass.landice.tests.humboldt.restart_test' ,
100110 'namelist.restart' , out_name = 'namelist.landice' )
111+ if advection_type == 'fct' :
112+ step .add_namelist_options (
113+ {'config_thickness_advection' : "'fct'" ,
114+ 'config_tracer_advection' : "'fct'" },
115+ out_name = 'namelist.landice' )
101116 step .add_streams_file (
102117 'compass.landice.tests.humboldt.restart_test' ,
103118 'streams.restart' , out_name = 'streams.landice' )
104119
105120 step .add_namelist_file (
106121 'compass.landice.tests.humboldt.restart_test' ,
107122 'namelist.restart.rst' , out_name = 'namelist.landice.rst' )
123+ if advection_type == 'fct' :
124+ step .add_namelist_options (
125+ {'config_thickness_advection' : "'fct'" ,
126+ 'config_tracer_advection' : "'fct'" },
127+ out_name = 'namelist.landice.rst' )
108128 step .add_streams_file (
109129 'compass.landice.tests.humboldt.restart_test' ,
110130 'streams.restart.rst' , out_name = 'streams.landice.rst' )
0 commit comments