Skip to content

Commit 03e90aa

Browse files
committed
Update baroclinic config
1 parent 42adc36 commit 03e90aa

File tree

3 files changed

+22
-13
lines changed

3 files changed

+22
-13
lines changed

polaris/ocean/tasks/drying_slope/drying_slope.cfg

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ btr_dt_per_km = 1.5
4040
# Coriolis parameter
4141
coriolis_parameter = 0.0
4242

43+
# Background temperature
44+
background_temperature = 20.0
45+
4346
# config options for barotropic drying slope test cases
4447
[drying_slope_barotropic]
4548

@@ -67,9 +70,6 @@ plug_width_frac = 0.0
6770
# Plug temperature
6871
plug_temperature = 20.0
6972

70-
# Background temperature
71-
background_temperature = 20.0
72-
7373
# Background salinity
7474
background_salinity = 35.0
7575

@@ -89,7 +89,7 @@ ly = 55.
8989
ly_analysis = 50.
9090

9191
# Bottom depth at the right side of the domain in m
92-
right_bottom_depth = 2.5
92+
right_bottom_depth = -2.5
9393

9494
# Bottom depth at the left side of the domain in m
9595
left_bottom_depth = 0.

polaris/ocean/tasks/drying_slope/forward.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,14 @@ def dynamic_model_config(self, at_setup):
214214
'%H:%M:%S', time.gmtime(dt * self.run_time_steps))
215215

216216
if self.baroclinic:
217+
section = self.config['vertical_grid']
218+
vert_levels = section.getint('vert_levels')
217219
section = self.config['drying_slope_baroclinic']
220+
thin_film_thickness = section.getfloat('min_column_thickness') / \
221+
vert_levels
218222
else:
219223
section = self.config['drying_slope_barotropic']
220-
thin_film_thickness = section.getfloat('thin_film_thickness')
224+
thin_film_thickness = section.getfloat('thin_film_thickness')
221225
options['config_drying_min_cell_height'] = thin_film_thickness
222226
options['config_zero_drying_velocity_ramp_hmin'] = \
223227
thin_film_thickness

polaris/ocean/tasks/drying_slope/init.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,31 +77,33 @@ def run(self):
7777

7878
section = config['drying_slope']
7979
coriolis_parameter = section.getfloat('coriolis_parameter')
80+
background_temperature = section.getfloat('background_temperature')
81+
vert_levels = config.getint('vertical_grid', 'vert_levels')
8082

8183
if self.baroclinic:
8284
section = config['drying_slope_baroclinic']
8385
right_salinity = section.getfloat('right_salinity')
8486
left_salinity = section.getfloat('left_salinity')
8587
manning_coefficient = section.getfloat('manning_coefficient')
88+
thin_film_thickness = section.getfloat('min_column_thickness') / \
89+
vert_levels + 1.e-8
8690
else:
8791
section = config['drying_slope_barotropic']
8892
plug_width_frac = section.getfloat('plug_width_frac')
8993
plug_temperature = section.getfloat('plug_temperature')
90-
background_temperature = section.getfloat('background_temperature')
9194
background_salinity = section.getfloat('background_salinity')
95+
thin_film_thickness = section.getfloat('thin_film_thickness') + \
96+
1.e-8
9297

9398
# config options used in both configurations but which have different
9499
# values in each
95-
thin_film_thickness = section.getfloat('thin_film_thickness') + 1.e-8
96100
drying_length = section.getfloat('ly_analysis') * 1e3
97101
lx = section.getfloat('lx')
98102
ly = section.getfloat('ly')
99103
right_bottom_depth = section.getfloat('right_bottom_depth')
100104
left_bottom_depth = section.getfloat('left_bottom_depth')
101105
right_tidal_height = section.getfloat('right_tidal_height')
102106

103-
vert_levels = config.getint('vertical_grid', 'vert_levels')
104-
105107
domain_length = ly * 1e3
106108
# Check config options
107109
if domain_length < drying_length:
@@ -145,10 +147,13 @@ def run(self):
145147

146148
init_vertical_coord(config, ds)
147149

148-
plug_width = domain_length * plug_width_frac
149-
y_plug_boundary = y_min + plug_width
150-
temperature = xr.where(y_cell < y_plug_boundary,
151-
plug_temperature, background_temperature)
150+
if self.baroclinic:
151+
temperature = background_temperature * xr.ones_like(y_cell)
152+
else:
153+
plug_width = domain_length * plug_width_frac
154+
y_plug_boundary = y_min + plug_width
155+
temperature = xr.where(y_cell < y_plug_boundary,
156+
plug_temperature, background_temperature)
152157
temperature, _ = xr.broadcast(temperature, ds.refBottomDepth)
153158
ds['temperature'] = temperature.expand_dims(dim='Time', axis=0)
154159
if self.baroclinic:

0 commit comments

Comments
 (0)