Skip to content

Commit

Permalink
Merge pull request #864 from xylar/add-low-res-topo-cfg
Browse files Browse the repository at this point in the history
Put low res topography options in a config file
  • Loading branch information
xylar authored Oct 9, 2024
2 parents 1279a40 + a0d8ab8 commit 0e79f61
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
16 changes: 16 additions & 0 deletions compass/ocean/mesh/low_res_topography.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# config options related to remapping topography to an MPAS-Ocean mesh
[remap_topography]

# the name of the topography file in the bathymetry database
topo_filename = BedMachineAntarctica_v2_and_GEBCO_2022_0.05_degree_20220729.nc

# variable names in topo_filename
bathy_frac_var = ocean_mask

# the description to include in metadata
description = Bathymetry is from GEBCO 2022, combined with BedMachine
Antarctica v2 around Antarctica.

# the target and minimum number of MPI tasks to use in remapping
ntasks = 64
min_tasks = 4
14 changes: 4 additions & 10 deletions compass/ocean/tests/global_ocean/mesh/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,20 +137,14 @@ def configure(self, config=None):
if config is None:
config = self.config
config.add_from_package('compass.mesh', 'mesh.cfg', exception=True)
# a description of the bathymetry
if 'remap_topography' in self.steps:
config.add_from_package('compass.ocean.mesh',
'remap_topography.cfg', exception=True)

if not self.high_res_topography:
filename = 'BedMachineAntarctica_v2_and_GEBCO_2022_0.05_degree_20220729.nc' # noqa: E501
description = 'Bathymetry is from GEBCO 2022, combined with ' \
'BedMachine Antarctica v2 around Antarctica.'
config.set('remap_topography', 'topo_filename', filename)
config.set('remap_topography', 'bathy_frac_var', 'ocean_mask')
config.set('remap_topography', 'description', description)
config.set('remap_topography', 'ntasks', '64')
config.set('remap_topography', 'min_tasks', '4')
if not self.high_res_topography:
config.add_from_package('compass.ocean.mesh',
'low_res_topography.cfg',
exception=True)

if self.mesh_name.startswith('Kuroshio'):
# add the config options for all kuroshio meshes
Expand Down

0 comments on commit 0e79f61

Please sign in to comment.