Skip to content

Commit 9d8a44f

Browse files
committed
Add config option for number of inactive layers
1 parent e82e304 commit 9d8a44f

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

compass/ocean/tests/global_ocean/configure.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def configure_global_ocean(test_case, mesh, init=None):
2626
config.get('global_ocean', 'prefix')))
2727

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

compass/ocean/tests/global_ocean/mesh/qu240/qu240.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ min_layer_thickness = 3.0
1616
# The maximum layer thickness
1717
max_layer_thickness = 500.0
1818

19+
inactive_top_cells = 0
1920

2021
# options for global ocean testcases
2122
[global_ocean]

compass/ocean/vertical/grid_1d.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ def generate_1d_grid(config):
4646
bottom_depth = section.getfloat('bottom_depth')
4747
# renormalize to the requested range
4848
interfaces = (bottom_depth/interfaces[-1]) * interfaces
49+
if config.has_option('vertical_grid', 'inactive_top_cells'):
50+
offset = config.getint('vertical_grid', 'inactive_top_cells')
51+
if offset > 0:
52+
interfaces[offset:] = interfaces[:0-offset]
4953

5054
return interfaces
5155

0 commit comments

Comments
 (0)