Skip to content

Commit

Permalink
Merge pull request #610 from xylar/add-woa23-init
Browse files Browse the repository at this point in the history
Add WOA23 initial condition
  • Loading branch information
xylar authored Apr 22, 2023
2 parents 360bbe8 + cb933bd commit b708541
Show file tree
Hide file tree
Showing 27 changed files with 327 additions and 194 deletions.
8 changes: 4 additions & 4 deletions compass/ocean/suites/ec30to60.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ocean/global_ocean/EC30to60/mesh
ocean/global_ocean/EC30to60/PHC/init
ocean/global_ocean/EC30to60/PHC/performance_test
ocean/global_ocean/EC30to60/PHC/dynamic_adjustment
ocean/global_ocean/EC30to60/PHC/files_for_e3sm
ocean/global_ocean/EC30to60/WOA23/init
ocean/global_ocean/EC30to60/WOA23/performance_test
ocean/global_ocean/EC30to60/WOA23/dynamic_adjustment
ocean/global_ocean/EC30to60/WOA23/files_for_e3sm
8 changes: 4 additions & 4 deletions compass/ocean/suites/ecwisc30to60.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ocean/global_ocean/ECwISC30to60/mesh
ocean/global_ocean/ECwISC30to60/PHC/init
ocean/global_ocean/ECwISC30to60/PHC/performance_test
ocean/global_ocean/ECwISC30to60/PHC/dynamic_adjustment
ocean/global_ocean/ECwISC30to60/PHC/files_for_e3sm
ocean/global_ocean/ECwISC30to60/WOA23/init
ocean/global_ocean/ECwISC30to60/WOA23/performance_test
ocean/global_ocean/ECwISC30to60/WOA23/dynamic_adjustment
ocean/global_ocean/ECwISC30to60/WOA23/files_for_e3sm
8 changes: 4 additions & 4 deletions compass/ocean/suites/kuroshio12to60.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ocean/global_ocean/Kuroshio12to60/mesh
ocean/global_ocean/Kuroshio12to60/PHC/init
ocean/global_ocean/Kuroshio12to60/PHC/performance_test
ocean/global_ocean/Kuroshio12to60/PHC/dynamic_adjustment
ocean/global_ocean/Kuroshio12to60/PHC/files_for_e3sm
ocean/global_ocean/Kuroshio12to60/WOA23/init
ocean/global_ocean/Kuroshio12to60/WOA23/performance_test
ocean/global_ocean/Kuroshio12to60/WOA23/dynamic_adjustment
ocean/global_ocean/Kuroshio12to60/WOA23/files_for_e3sm
8 changes: 4 additions & 4 deletions compass/ocean/suites/kuroshio8to60.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ocean/global_ocean/Kuroshio8to60/mesh
ocean/global_ocean/Kuroshio8to60/PHC/init
ocean/global_ocean/Kuroshio8to60/PHC/performance_test
ocean/global_ocean/Kuroshio8to60/PHC/dynamic_adjustment
ocean/global_ocean/Kuroshio8to60/PHC/files_for_e3sm
ocean/global_ocean/Kuroshio8to60/WOA23/init
ocean/global_ocean/Kuroshio8to60/WOA23/performance_test
ocean/global_ocean/Kuroshio8to60/WOA23/dynamic_adjustment
ocean/global_ocean/Kuroshio8to60/WOA23/files_for_e3sm
24 changes: 12 additions & 12 deletions compass/ocean/suites/nightly.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ ocean/baroclinic_channel/10km/decomp_test
ocean/baroclinic_channel/10km/restart_test

ocean/global_ocean/QU240/mesh
ocean/global_ocean/QU240/PHC/init
ocean/global_ocean/QU240/PHC/performance_test
ocean/global_ocean/QU240/PHC/restart_test
ocean/global_ocean/QU240/PHC/decomp_test
ocean/global_ocean/QU240/PHC/threads_test
ocean/global_ocean/QU240/PHC/analysis_test
ocean/global_ocean/QU240/WOA23/init
ocean/global_ocean/QU240/WOA23/performance_test
ocean/global_ocean/QU240/WOA23/restart_test
ocean/global_ocean/QU240/WOA23/decomp_test
ocean/global_ocean/QU240/WOA23/threads_test
ocean/global_ocean/QU240/WOA23/analysis_test

ocean/global_ocean/QU240/PHC/RK4/performance_test
ocean/global_ocean/QU240/PHC/RK4/restart_test
ocean/global_ocean/QU240/PHC/RK4/decomp_test
ocean/global_ocean/QU240/PHC/RK4/threads_test
ocean/global_ocean/QU240/WOA23/RK4/performance_test
ocean/global_ocean/QU240/WOA23/RK4/restart_test
ocean/global_ocean/QU240/WOA23/RK4/decomp_test
ocean/global_ocean/QU240/WOA23/RK4/threads_test

ocean/global_ocean/QUwISC240/mesh
cached
ocean/global_ocean/QUwISC240/PHC/init
ocean/global_ocean/QUwISC240/WOA23/init
cached
ocean/global_ocean/QUwISC240/PHC/performance_test
ocean/global_ocean/QUwISC240/WOA23/performance_test

ocean/ice_shelf_2d/5km/z-star/restart_test
ocean/ice_shelf_2d/5km/z-level/restart_test
Expand Down
25 changes: 25 additions & 0 deletions compass/ocean/suites/phc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
ocean/global_ocean/QU240/mesh
ocean/global_ocean/QU240/PHC/init
ocean/global_ocean/QU240/PHC/performance_test
ocean/global_ocean/QU240/PHC/restart_test
ocean/global_ocean/QU240/PHC/decomp_test
ocean/global_ocean/QU240/PHC/threads_test
ocean/global_ocean/QU240/PHC/analysis_test
ocean/global_ocean/QU240/PHC/dynamic_adjustment

ocean/global_ocean/QU240/PHC/RK4/performance_test
ocean/global_ocean/QU240/PHC/RK4/restart_test
ocean/global_ocean/QU240/PHC/RK4/decomp_test
ocean/global_ocean/QU240/PHC/RK4/threads_test

ocean/global_ocean/QUwISC240/mesh
ocean/global_ocean/QUwISC240/PHC/init
ocean/global_ocean/QUwISC240/PHC/performance_test

ocean/global_ocean/EC30to60/mesh
ocean/global_ocean/EC30to60/PHC/init
ocean/global_ocean/EC30to60/PHC/performance_test

ocean/global_ocean/ECwISC30to60/mesh
ocean/global_ocean/ECwISC30to60/PHC/init
ocean/global_ocean/ECwISC30to60/PHC/performance_test
36 changes: 18 additions & 18 deletions compass/ocean/suites/pr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,36 @@ ocean/global_convergence/qu/cosine_bell
cached: QU240_mesh QU240_init

ocean/global_ocean/QU240/mesh
ocean/global_ocean/QU240/PHC/init
ocean/global_ocean/QU240/PHC/performance_test
ocean/global_ocean/QU240/PHC/restart_test
ocean/global_ocean/QU240/PHC/decomp_test
ocean/global_ocean/QU240/PHC/threads_test
ocean/global_ocean/QU240/PHC/analysis_test
ocean/global_ocean/QU240/PHC/dynamic_adjustment

ocean/global_ocean/QU240/PHC/RK4/performance_test
ocean/global_ocean/QU240/PHC/RK4/restart_test
ocean/global_ocean/QU240/PHC/RK4/decomp_test
ocean/global_ocean/QU240/PHC/RK4/threads_test
ocean/global_ocean/QU240/WOA23/init
ocean/global_ocean/QU240/WOA23/performance_test
ocean/global_ocean/QU240/WOA23/restart_test
ocean/global_ocean/QU240/WOA23/decomp_test
ocean/global_ocean/QU240/WOA23/threads_test
ocean/global_ocean/QU240/WOA23/analysis_test
ocean/global_ocean/QU240/WOA23/dynamic_adjustment

ocean/global_ocean/QU240/WOA23/RK4/performance_test
ocean/global_ocean/QU240/WOA23/RK4/restart_test
ocean/global_ocean/QU240/WOA23/RK4/decomp_test
ocean/global_ocean/QU240/WOA23/RK4/threads_test

ocean/global_ocean/QUwISC240/mesh
cached
ocean/global_ocean/QUwISC240/PHC/init
ocean/global_ocean/QUwISC240/WOA23/init
cached
ocean/global_ocean/QUwISC240/PHC/performance_test
ocean/global_ocean/QUwISC240/WOA23/performance_test

ocean/global_ocean/EC30to60/mesh
cached
ocean/global_ocean/EC30to60/PHC/init
ocean/global_ocean/EC30to60/WOA23/init
cached
ocean/global_ocean/EC30to60/PHC/performance_test
ocean/global_ocean/EC30to60/WOA23/performance_test

ocean/global_ocean/ECwISC30to60/mesh
cached
ocean/global_ocean/ECwISC30to60/PHC/init
ocean/global_ocean/ECwISC30to60/WOA23/init
cached
ocean/global_ocean/ECwISC30to60/PHC/performance_test
ocean/global_ocean/ECwISC30to60/WOA23/performance_test

ocean/ice_shelf_2d/5km/z-star/restart_test
ocean/ice_shelf_2d/5km/z-level/restart_test
Expand Down
6 changes: 3 additions & 3 deletions compass/ocean/suites/qu240_for_e3sm.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ocean/global_ocean/QU240/mesh
ocean/global_ocean/QU240/PHC/init
ocean/global_ocean/QU240/PHC/dynamic_adjustment
ocean/global_ocean/QU240/PHC/files_for_e3sm
ocean/global_ocean/QU240/WOA23/init
ocean/global_ocean/QU240/WOA23/dynamic_adjustment
ocean/global_ocean/QU240/WOA23/files_for_e3sm
24 changes: 12 additions & 12 deletions compass/ocean/suites/quwisc240.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
ocean/global_ocean/QUwISC240/mesh
ocean/global_ocean/QUwISC240/PHC/init
ocean/global_ocean/QUwISC240/PHC/performance_test
ocean/global_ocean/QUwISC240/PHC/restart_test
ocean/global_ocean/QUwISC240/PHC/decomp_test
ocean/global_ocean/QUwISC240/PHC/threads_test
ocean/global_ocean/QUwISC240/PHC/analysis_test
ocean/global_ocean/QUwISC240/PHC/RK4/performance_test
ocean/global_ocean/QUwISC240/PHC/RK4/restart_test
ocean/global_ocean/QUwISC240/PHC/RK4/decomp_test
ocean/global_ocean/QUwISC240/PHC/RK4/threads_test
ocean/global_ocean/QUwISC240/WOA23/init
ocean/global_ocean/QUwISC240/WOA23/performance_test
ocean/global_ocean/QUwISC240/WOA23/restart_test
ocean/global_ocean/QUwISC240/WOA23/decomp_test
ocean/global_ocean/QUwISC240/WOA23/threads_test
ocean/global_ocean/QUwISC240/WOA23/analysis_test
ocean/global_ocean/QUwISC240/WOA23/RK4/performance_test
ocean/global_ocean/QUwISC240/WOA23/RK4/restart_test
ocean/global_ocean/QUwISC240/WOA23/RK4/decomp_test
ocean/global_ocean/QUwISC240/WOA23/RK4/threads_test
ocean/global_ocean/QUwISC240/EN4_1900/init
ocean/global_ocean/QUwISC240/EN4_1900/performance_test
ocean/global_ocean/QUwISC240/PHC_BGC/init
ocean/global_ocean/QUwISC240/PHC_BGC/performance_test
ocean/global_ocean/QUwISC240/WOA23_BGC/init
ocean/global_ocean/QUwISC240/WOA23_BGC/performance_test
6 changes: 3 additions & 3 deletions compass/ocean/suites/quwisc240_for_e3sm.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ocean/global_ocean/QUwISC240/mesh
ocean/global_ocean/QUwISC240/PHC/init
ocean/global_ocean/QUwISC240/PHC/dynamic_adjustment
ocean/global_ocean/QUwISC240/PHC/files_for_e3sm
ocean/global_ocean/QUwISC240/WOA23/init
ocean/global_ocean/QUwISC240/WOA23/dynamic_adjustment
ocean/global_ocean/QUwISC240/WOA23/files_for_e3sm
8 changes: 4 additions & 4 deletions compass/ocean/suites/so12to60.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ocean/global_ocean/SO12to60/mesh
ocean/global_ocean/SO12to60/PHC/init
ocean/global_ocean/SO12to60/PHC/performance_test
ocean/global_ocean/SO12to60/PHC/dynamic_adjustment
ocean/global_ocean/SO12to60/PHC/files_for_e3sm
ocean/global_ocean/SO12to60/WOA23/init
ocean/global_ocean/SO12to60/WOA23/performance_test
ocean/global_ocean/SO12to60/WOA23/dynamic_adjustment
ocean/global_ocean/SO12to60/WOA23/files_for_e3sm
8 changes: 4 additions & 4 deletions compass/ocean/suites/sowisc12to60.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ocean/global_ocean/SOwISC12to60/mesh
ocean/global_ocean/SOwISC12to60/PHC/init
ocean/global_ocean/SOwISC12to60/PHC/performance_test
ocean/global_ocean/SOwISC12to60/PHC/dynamic_adjustment
ocean/global_ocean/SOwISC12to60/PHC/files_for_e3sm
ocean/global_ocean/SOwISC12to60/WOA23/init
ocean/global_ocean/SOwISC12to60/WOA23/performance_test
ocean/global_ocean/SOwISC12to60/WOA23/dynamic_adjustment
ocean/global_ocean/SOwISC12to60/WOA23/files_for_e3sm
8 changes: 4 additions & 4 deletions compass/ocean/suites/wc14.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ocean/global_ocean/WC14/mesh
ocean/global_ocean/WC14/PHC/init
ocean/global_ocean/WC14/PHC/performance_test
ocean/global_ocean/WC14/PHC/dynamic_adjustment
ocean/global_ocean/WC14/PHC/files_for_e3sm
ocean/global_ocean/WC14/WOA23/init
ocean/global_ocean/WC14/WOA23/performance_test
ocean/global_ocean/WC14/WOA23/dynamic_adjustment
ocean/global_ocean/WC14/WOA23/files_for_e3sm
8 changes: 4 additions & 4 deletions compass/ocean/suites/wcwisc14.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ocean/global_ocean/WCwISC14/mesh
ocean/global_ocean/WCwISC14/PHC/init
ocean/global_ocean/WCwISC14/PHC/performance_test
ocean/global_ocean/WCwISC14/PHC/dynamic_adjustment
ocean/global_ocean/WCwISC14/PHC/files_for_e3sm
ocean/global_ocean/WCwISC14/WOA23/init
ocean/global_ocean/WCwISC14/WOA23/performance_test
ocean/global_ocean/WCwISC14/WOA23/dynamic_adjustment
ocean/global_ocean/WCwISC14/WOA23/files_for_e3sm
25 changes: 18 additions & 7 deletions compass/ocean/tests/global_ocean/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def __init__(self, mpas_core):
remap_topography=False,
include_rk4=True,
include_regression=True,
include_phc=True,
include_en4_1900=True,
include_bgc=True)

Expand Down Expand Up @@ -77,20 +78,24 @@ def __init__(self, mpas_core):

def _add_tests(self, mesh_names, DynamicAdjustment, remap_topography=True,
include_rk4=False, include_regression=False,
include_en4_1900=False, include_bgc=False):
include_phc=False, include_en4_1900=False,
include_bgc=False):
""" Add test cases for the given mesh(es) """

default_ic = 'WOA23'
default_time_int = 'split_explicit'

for mesh_name in mesh_names:
mesh_test = Mesh(test_group=self, mesh_name=mesh_name,
remap_topography=remap_topography)
self.add_test_case(mesh_test)

init_test = Init(test_group=self, mesh=mesh_test,
initial_condition='PHC',
initial_condition=default_ic,
with_bgc=False)
self.add_test_case(init_test)

time_integrator = 'split_explicit'
time_integrator = default_time_int
self.add_test_case(
PerformanceTest(
test_group=self, mesh=mesh_test, init=init_test,
Expand Down Expand Up @@ -150,11 +155,17 @@ def _add_tests(self, mesh_names, DynamicAdjustment, remap_topography=True,
test_group=self, mesh=mesh_test, init=init_test,
time_integrator=time_integrator))

initial_conditions = []
if include_phc:
initial_conditions.append('PHC')
if include_en4_1900:
# EN4_1900 tests
time_integrator = 'split_explicit'
initial_conditions.append('EN4_1900')

for initial_condition in initial_conditions:
# additional initial conditions (if any)
time_integrator = default_time_int
init_test = Init(test_group=self, mesh=mesh_test,
initial_condition='EN4_1900',
initial_condition=initial_condition,
with_bgc=False)
self.add_test_case(init_test)

Expand All @@ -176,7 +187,7 @@ def _add_tests(self, mesh_names, DynamicAdjustment, remap_topography=True,
if include_bgc:
# BGC tests
init_test = Init(test_group=self, mesh=mesh_test,
initial_condition='PHC',
initial_condition=default_ic,
with_bgc=True)
self.add_test_case(init_test)

Expand Down
12 changes: 7 additions & 5 deletions compass/ocean/tests/global_ocean/init/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Init(TestCase):
mesh : compass.ocean.tests.global_ocean.mesh.Mesh
The test case that creates the mesh used by this test case
initial_condition : {'PHC', 'EN4_1900'}
initial_condition : {'WOA23', 'PHC', 'EN4_1900'}
The initial condition dataset to use
with_bgc : bool
Expand All @@ -37,7 +37,7 @@ def __init__(self, test_group, mesh, initial_condition, with_bgc):
mesh : compass.ocean.tests.global_ocean.mesh.Mesh
The test case that creates the mesh used by this test case
initial_condition : {'PHC', 'EN4_1900'}
initial_condition : {'WOA23', 'PHC', 'EN4_1900'}
The initial condition dataset to use
with_bgc : bool
Expand Down Expand Up @@ -80,10 +80,12 @@ def configure(self, config=None):
self.mesh.configure(config=config)

initial_condition = self.initial_condition
descriptions = {'PHC': 'Polar science center Hydrographic '
descriptions = {'WOA23': 'World Ocean Atlas 2023 climatology '
'1991-2020',
'PHC': 'Polar science center Hydrographic '
'Climatology (PHC)',
'EN4_1900':
"Met Office Hadley Centre's EN4 dataset from 1900"}
'EN4_1900': "Met Office Hadley Centre's EN4 dataset "
"from 1900"}
config.set('global_ocean', 'init_description',
descriptions[initial_condition])

Expand Down
13 changes: 9 additions & 4 deletions compass/ocean/tests/global_ocean/init/initial_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class InitialState(Step):
mesh : compass.ocean.tests.global_ocean.mesh.mesh.MeshStep
The step for creating the mesh
initial_condition : {'PHC', 'EN4_1900'}
initial_condition : {'WOA23', 'PHC', 'EN4_1900'}
The initial condition dataset to use
with_bgc : bool
Expand All @@ -38,13 +38,13 @@ def __init__(self, test_case, mesh, initial_condition, with_bgc):
mesh : compass.ocean.tests.global_ocean.mesh.Mesh
The test case that creates the mesh used by this test case
initial_condition : {'PHC', 'EN4_1900'}
initial_condition : {'WOA23', 'PHC', 'EN4_1900'}
The initial condition dataset to use
with_bgc : bool
Whether to include biogeochemistry (BGC) in the initial condition
"""
if initial_condition not in ['PHC', 'EN4_1900']:
if initial_condition not in ['WOA23', 'PHC', 'EN4_1900']:
raise ValueError(f'Unknown initial_condition {initial_condition}')

super().__init__(test_case=test_case, name='initial_state')
Expand Down Expand Up @@ -110,7 +110,12 @@ def __init__(self, test_case, mesh, initial_condition, with_bgc):
target='chlorophyllA_monthly_averages_1deg.151201.nc',
database='initial_condition_database')

if initial_condition == 'PHC':
if initial_condition == 'WOA23':
self.add_input_file(
filename='woa23.nc',
target='woa23_decav_0.25_extrap.20230416.nc',
database='initial_condition_database')
elif initial_condition == 'PHC':
self.add_input_file(
filename='temperature.nc',
target='PotentialTemperature.01.filled.60levels.PHC.151106.nc',
Expand Down
12 changes: 12 additions & 0 deletions compass/ocean/tests/global_ocean/init/namelist.woa23
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
config_global_ocean_temperature_file = 'woa23.nc'
config_global_ocean_salinity_file = 'woa23.nc'
config_global_ocean_tracer_nlat_dimname = 'lat'
config_global_ocean_tracer_nlon_dimname = 'lon'
config_global_ocean_tracer_ndepth_dimname = 'depth'
config_global_ocean_tracer_depth_conversion_factor = 1.0
config_global_ocean_temperature_varname = 'pt_an'
config_global_ocean_salinity_varname = 's_an'
config_global_ocean_tracer_latlon_degrees = .true.
config_global_ocean_tracer_lat_varname = 'lat'
config_global_ocean_tracer_lon_varname = 'lon'
config_global_ocean_tracer_depth_varname = 'depth'
Loading

0 comments on commit b708541

Please sign in to comment.