Skip to content

Commit

Permalink
Use remapped topography in global_ocean init
Browse files Browse the repository at this point in the history
  • Loading branch information
xylar committed Mar 23, 2023
1 parent 7a4c334 commit fb0be0a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
24 changes: 20 additions & 4 deletions compass/ocean/tests/global_ocean/init/initial_state.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from importlib.resources import contents

from compass.model import run_model
Expand Down Expand Up @@ -79,10 +80,25 @@ def __init__(self, test_case, mesh, initial_condition, with_bgc):
if mesh_streams in mesh_package_contents:
self.add_streams_file(mesh_package, mesh_streams, mode='init')

self.add_input_file(
filename='topography.nc',
target='BedMachineAntarctica_v2_and_GEBCO_2022_0.05_degree_20220729.nc', # noqa: E501
database='bathymetry_database')
if 'remap_topography' in self.mesh.steps:
options = {
'config_global_ocean_topography_source': "'mpas_variable'",
'config_global_ocean_land_ice_topo_source': "'mpas_variable'"
}
self.add_namelist_options(options, mode='init')
self.add_streams_file(package, 'streams.topo', mode='init')

cull_step = self.mesh.steps['cull_mesh']
target = os.path.join(cull_step.path, 'topography_culled.nc')
self.add_input_file(filename='topography.nc',
work_dir_target=target)

else:
target = 'BedMachineAntarctica_v2_and_GEBCO_2022_0.05_degree_20220729.nc' # noqa: E501
self.add_input_file(
filename='topography.nc',
target=target,
database='bathymetry_database')

self.add_input_file(
filename='wind_stress.nc',
Expand Down
15 changes: 15 additions & 0 deletions compass/ocean/tests/global_ocean/init/streams.topo
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<streams>
<stream name="topography"
type="input"
filename_template="topography.nc"
input_interval="initial_only" >

<var name="bed_elevation"/>
<var name="landIceDraftObserved"/>
<var name="landIceThkObserved"/>
<var name="landIceFracObserved"/>
<var name="landIceGroundedFracObserved"/>
<var name="oceanFracObserved"/>
</stream>

</streams>

0 comments on commit fb0be0a

Please sign in to comment.