Skip to content

Commit

Permalink
Add config option for number of inactive layers
Browse files Browse the repository at this point in the history
  • Loading branch information
cbegeman committed Jun 23, 2021
1 parent e82e304 commit 9d8a44f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions compass/ocean/tests/global_ocean/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def configure_global_ocean(test_case, mesh, init=None):
config.get('global_ocean', 'prefix')))

if init is not None and init.with_inactive_top_cells:
config.set('vertical_grid', 'inactive_top_cells', '1')
config.set('vertical_grid', 'vert_levels', '{}'.format(
config.getint('vertical_grid', 'vert_levels')+1))

Expand Down
1 change: 1 addition & 0 deletions compass/ocean/tests/global_ocean/mesh/qu240/qu240.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ min_layer_thickness = 3.0
# The maximum layer thickness
max_layer_thickness = 500.0

inactive_top_cells = 0

# options for global ocean testcases
[global_ocean]
Expand Down
4 changes: 4 additions & 0 deletions compass/ocean/vertical/grid_1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ def generate_1d_grid(config):
bottom_depth = section.getfloat('bottom_depth')
# renormalize to the requested range
interfaces = (bottom_depth/interfaces[-1]) * interfaces
if config.has_option('vertical_grid', 'inactive_top_cells'):
offset = config.getint('vertical_grid', 'inactive_top_cells')
if offset > 0:
interfaces[offset:] = interfaces[:0-offset]

return interfaces

Expand Down

0 comments on commit 9d8a44f

Please sign in to comment.