Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add suite of flux-corrected transport tests for landice integration #650

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions compass/landice/suites/fct_integration.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
landice/dome/2000m/fo_fct_decomposition_test
landice/dome/2000m/fo_fct_restart_test
landice/dome/variable_resolution/fo_fct_decomposition_test
landice/dome/variable_resolution/fo_fct_restart_test
landice/greenland/fo_fct_decomposition_test
landice/greenland/fo_fct_restart_test
landice/thwaites/fct_fo_decomposition_test
landice/thwaites/fct_fo_restart_test
landice/humboldt/mesh-3km_restart_test/velo-fo_advec-fct_calving-von_mises_stress_damage-threshold_faceMelting
28 changes: 16 additions & 12 deletions compass/landice/tests/dome/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from compass.testgroup import TestGroup
from compass.landice.tests.dome.smoke_test import SmokeTest
from compass.landice.tests.dome.decomposition_test import DecompositionTest
from compass.landice.tests.dome.restart_test import RestartTest
from compass.landice.tests.dome.smoke_test import SmokeTest
from compass.testgroup import TestGroup


class Dome(TestGroup):
Expand All @@ -17,16 +17,20 @@ def __init__(self, mpas_core):

for mesh_type in ['2000m', 'variable_resolution']:
for velo_solver in ['sia', 'FO']:
for advection_type in ['fo', 'fct']:

self.add_test_case(
SmokeTest(test_group=self, velo_solver=velo_solver,
mesh_type=mesh_type))
self.add_test_case(
SmokeTest(test_group=self, velo_solver=velo_solver,
mesh_type=mesh_type,
advection_type=advection_type))

self.add_test_case(
DecompositionTest(test_group=self,
velo_solver=velo_solver,
mesh_type=mesh_type))
self.add_test_case(
DecompositionTest(test_group=self,
velo_solver=velo_solver,
mesh_type=mesh_type,
advection_type=advection_type))

self.add_test_case(
RestartTest(test_group=self, velo_solver=velo_solver,
mesh_type=mesh_type))
self.add_test_case(
RestartTest(test_group=self, velo_solver=velo_solver,
mesh_type=mesh_type,
advection_type=advection_type))
32 changes: 23 additions & 9 deletions compass/landice/tests/dome/decomposition_test/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from compass.validate import compare_variables
from compass.testcase import TestCase
from compass.landice.tests.dome.setup_mesh import SetupMesh
from compass.landice.tests.dome.run_model import RunModel
from compass.landice.tests.dome.setup_mesh import SetupMesh
from compass.landice.tests.dome.visualize import Visualize
from compass.testcase import TestCase
from compass.validate import compare_variables


class DecompositionTest(TestCase):
Expand All @@ -15,9 +15,12 @@ class DecompositionTest(TestCase):
----------
mesh_type : str
The resolution or type of mesh of the test case

advection_type : {'fo', 'fct'}
The type of advection to use for thickness and tracers
"""

def __init__(self, test_group, velo_solver, mesh_type):
def __init__(self, test_group, velo_solver, mesh_type, advection_type):
"""
Create the test case

Expand All @@ -31,11 +34,16 @@ def __init__(self, test_group, velo_solver, mesh_type):

mesh_type : str
The resolution or type of mesh of the test case

advection_type : {'fo', 'fct'}
The type of advection to use for thickness and tracers
"""
name = 'decomposition_test'
self.mesh_type = mesh_type
self.velo_solver = velo_solver
subdir = '{}/{}_{}'.format(mesh_type, velo_solver.lower(), name)
self.advection_type = advection_type
subdir = '{}/{}_{}_{}'.format(mesh_type, velo_solver.lower(),
advection_type, name)
super().__init__(test_group=test_group, name=name,
subdir=subdir)

Expand All @@ -44,10 +52,16 @@ def __init__(self, test_group, velo_solver, mesh_type):

for procs in [1, 4]:
name = '{}proc_run'.format(procs)
self.add_step(
RunModel(test_case=self, name=name, subdir=name, ntasks=procs,
openmp_threads=1, velo_solver=velo_solver,
mesh_type=mesh_type))
step = RunModel(test_case=self, name=name, subdir=name,
ntasks=procs, openmp_threads=1,
velo_solver=velo_solver, mesh_type=mesh_type)

if advection_type == 'fct':
step.add_namelist_options(
{'config_thickness_advection': "'fct'",
'config_tracer_advection': "'fct'"},
out_name='namelist.landice')
self.add_step(step)

input_dir = name
name = 'visualize_{}'.format(name)
Expand Down
39 changes: 34 additions & 5 deletions compass/landice/tests/dome/restart_test/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from compass.validate import compare_variables
from compass.testcase import TestCase
from compass.landice.tests.dome.setup_mesh import SetupMesh
from compass.landice.tests.dome.run_model import RunModel
from compass.landice.tests.dome.setup_mesh import SetupMesh
from compass.landice.tests.dome.visualize import Visualize
from compass.testcase import TestCase
from compass.validate import compare_variables


class RestartTest(TestCase):
Expand All @@ -15,9 +15,12 @@ class RestartTest(TestCase):
----------
mesh_type : str
The resolution or type of mesh of the test case

advection_type : {'fo', 'fct'}
The type of advection to use for thickness and tracers
"""

def __init__(self, test_group, velo_solver, mesh_type):
def __init__(self, test_group, velo_solver, mesh_type, advection_type):
"""
Create the test case

Expand All @@ -31,11 +34,16 @@ def __init__(self, test_group, velo_solver, mesh_type):

mesh_type : str
The resolution or type of mesh of the test case

advection_type : {'fo', 'fct'}
The type of advection to use for thickness and tracers
"""
name = 'restart_test'
self.mesh_type = mesh_type
self.velo_solver = velo_solver
subdir = '{}/{}_{}'.format(mesh_type, velo_solver.lower(), name)
self.advection_type = advection_type
subdir = '{}/{}_{}_{}'.format(mesh_type, velo_solver.lower(),
advection_type, name)
super().__init__(test_group=test_group, name=name,
subdir=subdir)

Expand All @@ -50,6 +58,13 @@ def __init__(self, test_group, velo_solver, mesh_type):
step.add_namelist_file(
'compass.landice.tests.dome.restart_test',
'namelist.full', out_name='namelist.landice')

if advection_type == 'fct':
step.add_namelist_options(
{'config_thickness_advection': "'fct'",
'config_tracer_advection': "'fct'"},
out_name='namelist.landice')

step.add_streams_file(
'compass.landice.tests.dome.restart_test',
'streams.full', out_name='streams.landice')
Expand All @@ -71,13 +86,27 @@ def __init__(self, test_group, velo_solver, mesh_type):
step.add_namelist_file(
'compass.landice.tests.dome.restart_test',
'namelist.restart', out_name='namelist.landice')

if advection_type == 'fct':
step.add_namelist_options(
{'config_thickness_advection': "'fct'",
'config_tracer_advection': "'fct'"},
out_name='namelist.landice')

step.add_streams_file(
'compass.landice.tests.dome.restart_test',
'streams.restart', out_name='streams.landice')

step.add_namelist_file(
'compass.landice.tests.dome.restart_test',
'namelist.restart.rst', out_name='namelist.landice.rst')

if advection_type == 'fct':
step.add_namelist_options(
{'config_thickness_advection': "'fct'",
'config_tracer_advection': "'fct'"},
out_name='namelist.landice.rst')

step.add_streams_file(
'compass.landice.tests.dome.restart_test',
'streams.restart.rst', out_name='streams.landice.rst')
Expand Down
20 changes: 16 additions & 4 deletions compass/landice/tests/dome/smoke_test/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from compass.testcase import TestCase
from compass.landice.tests.dome.setup_mesh import SetupMesh
from compass.landice.tests.dome.run_model import RunModel
from compass.landice.tests.dome.setup_mesh import SetupMesh
from compass.landice.tests.dome.visualize import Visualize
from compass.testcase import TestCase


class SmokeTest(TestCase):
Expand All @@ -16,9 +16,12 @@ class SmokeTest(TestCase):

velo_solver : {'sia', 'FO'}
The velocity solver to use for the test case

advection_type : {'fo', 'fct'}
The type of advection to use for thickness and tracers
"""

def __init__(self, test_group, velo_solver, mesh_type):
def __init__(self, test_group, velo_solver, mesh_type, advection_type):
"""
Create the test case

Expand All @@ -32,11 +35,16 @@ def __init__(self, test_group, velo_solver, mesh_type):

mesh_type : str
The resolution or type of mesh of the test case

advection_type : {'fo', 'fct'}
The type of advection to use for thickness and tracers
"""
name = 'smoke_test'
self.mesh_type = mesh_type
self.velo_solver = velo_solver
subdir = '{}/{}_{}'.format(mesh_type, velo_solver.lower(), name)
self.advection_type = advection_type
subdir = '{}/{}_{}_{}'.format(mesh_type, velo_solver.lower(),
advection_type, name)
super().__init__(test_group=test_group, name=name,
subdir=subdir)

Expand All @@ -49,6 +57,10 @@ def __init__(self, test_group, velo_solver, mesh_type):
if velo_solver == 'sia':
step.add_namelist_options(
{'config_run_duration': "'0200-00-00_00:00:00'"})
if advection_type == 'fct':
step.add_namelist_options(
{'config_thickness_advection': "'fct'",
'config_tracer_advection': "'fct'"})
self.add_step(step)

step = Visualize(test_case=self, mesh_type=mesh_type)
Expand Down
16 changes: 10 additions & 6 deletions compass/landice/tests/greenland/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,18 @@ def __init__(self, mpas_core):
super().__init__(mpas_core=mpas_core, name='greenland')

for velo_solver in ['sia', 'FO']:
self.add_test_case(
SmokeTest(test_group=self, velo_solver=velo_solver))
for advection_type in ['fo', 'fct']:
self.add_test_case(
SmokeTest(test_group=self, velo_solver=velo_solver,
advection_type=advection_type))

self.add_test_case(
DecompositionTest(test_group=self, velo_solver=velo_solver))
self.add_test_case(
DecompositionTest(test_group=self, velo_solver=velo_solver,
advection_type=advection_type))

self.add_test_case(
RestartTest(test_group=self, velo_solver=velo_solver))
self.add_test_case(
RestartTest(test_group=self, velo_solver=velo_solver,
advection_type=advection_type))

self.add_test_case(
MeshGen(test_group=self))
24 changes: 16 additions & 8 deletions compass/landice/tests/greenland/decomposition_test/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from compass.validate import compare_variables
from compass.testcase import TestCase
from compass.landice.tests.greenland.run_model import RunModel
from compass.testcase import TestCase
from compass.validate import compare_variables


class DecompositionTest(TestCase):
Expand All @@ -10,7 +10,7 @@ class DecompositionTest(TestCase):
results of the two runs are identical.
"""

def __init__(self, test_group, velo_solver):
def __init__(self, test_group, velo_solver, advection_type):
"""
Create the test case

Expand All @@ -21,10 +21,13 @@ def __init__(self, test_group, velo_solver):

velo_solver : {'sia', 'FO'}
The velocity solver to use for the test case

advection_type : {'fo', 'fct'}
The type of advection to use for thickness and tracers
"""
name = 'decomposition_test'
self.velo_solver = velo_solver
subdir = '{}_{}'.format(velo_solver.lower(), name)
subdir = '{}_{}_{}'.format(velo_solver.lower(), advection_type, name)
super().__init__(test_group=test_group, name=name, subdir=subdir)

if velo_solver == 'sia':
Expand All @@ -36,10 +39,15 @@ def __init__(self, test_group, velo_solver):

for procs in self.cores_set:
name = '{}proc_run'.format(procs)
self.add_step(
RunModel(test_case=self, velo_solver=velo_solver, name=name,
subdir=name, ntasks=procs, min_tasks=procs,
openmp_threads=1))
step = RunModel(test_case=self, velo_solver=velo_solver, name=name,
subdir=name, ntasks=procs, min_tasks=procs,
openmp_threads=1)
if advection_type == 'fct':
step.add_namelist_options(
{'config_thickness_advection': "'fct'",
'config_tracer_advection': "'fct'"},
out_name='namelist.landice')
self.add_step(step)

# no configure() method is needed

Expand Down
Loading
Loading