Skip to content

Commit

Permalink
Move thin film thickness to cfg option
Browse files Browse the repository at this point in the history
  • Loading branch information
cbegeman committed Sep 27, 2023
1 parent 16eee6b commit c0257ed
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
3 changes: 3 additions & 0 deletions compass/ocean/tests/drying_slope/drying_slope.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
# Number of vertical levels
vert_levels = 10

# Thickness of each layer in the thin film region
thin_film_thickness = 1.0e-3

# config options for drying slope test cases
[drying_slope]

Expand Down
6 changes: 5 additions & 1 deletion compass/ocean/tests/drying_slope/forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ def run(self):
Run this step of the test case
"""
dt = self.get_dt()
self.update_namelist_at_runtime(options={'config_dt': f"'{dt}'"},
section = self.config['vertical_grid']
thin_film_thickness = section.getfloat('thin_film_thickness')
options = {'config_dt': f"'{dt}'",
'config_drying_min_cell_height': f'{thin_film_thickness}'}
self.update_namelist_at_runtime(options=options,
out_name='namelist.ocean')

run_model(self)
Expand Down
12 changes: 8 additions & 4 deletions compass/ocean/tests/drying_slope/initial_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,20 @@ def run(self):
config = self.config
logger = self.logger

config = self.config
section = config['vertical_grid']
coord_type = self.coord_type
thin_film_thickness = section.getfloat('thin_film_thickness') + 1.0e-9
if coord_type == 'single_layer':
options = {'config_tidal_boundary_vert_levels': '1'}
options = {'config_tidal_boundary_vert_levels': '1',
'config_drying_min_cell_height':
f'{thin_film_thickness}'}
self.update_namelist_at_runtime(options)
else:
vert_levels = section.get('vert_levels')
vert_levels = section.getint('vert_levels')
options = {'config_tidal_boundary_vert_levels': f'{vert_levels}',
'config_tidal_boundary_layer_type': f"'{coord_type}'"}
'config_tidal_boundary_layer_type': f"'{coord_type}'",
'config_drying_min_cell_height':
f'{thin_film_thickness}'}
self.update_namelist_at_runtime(options)

# Determine mesh parameters
Expand Down
1 change: 0 additions & 1 deletion compass/ocean/tests/drying_slope/namelist.forward
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ config_vert_coord_movement='impermeable_interfaces'
config_ALE_thickness_proportionality='weights_only'
config_use_wetting_drying=.true.
config_prevent_drying=.true.
config_drying_min_cell_height=1.0e-3
config_zero_drying_velocity_ramp_hmax = 1e-1
config_zero_drying_velocity=.true.
config_verify_not_dry=.true.
Expand Down
1 change: 0 additions & 1 deletion compass/ocean/tests/drying_slope/namelist.init
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ config_tidal_boundary_left_bottom_depth=0.0
config_tidal_boundary_use_distances=.true.
config_tidal_forcing_monochromatic_baseline=10.0
config_use_wetting_drying=.true.
config_drying_min_cell_height=1.000001e-3
config_use_tidal_forcing=.true.
config_write_cull_cell_mask=.false.

0 comments on commit c0257ed

Please sign in to comment.