File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
polaris/ocean/tasks/barotropic_gyre Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 11import time
2- from math import ceil
2+ from math import ceil , floor
33
44from polaris .mesh .planar import compute_planar_hex_nx_ny
55from polaris .ocean .model import OceanModelStep , get_time_interval_string
@@ -124,7 +124,7 @@ def dynamic_model_config(self, at_setup):
124124 rho_0 = config .getfloat ("barotropic_gyre" , "rho_0" )
125125
126126 dt_max = compute_max_time_step (config )
127- dt = dt_max / 3.
127+ dt = floor ( dt_max / 3. )
128128 dt_str = get_time_interval_string (seconds = dt )
129129
130130 options = {'config_dt' : dt_str ,
Original file line number Diff line number Diff line change @@ -50,12 +50,12 @@ def setup(self):
5050 nu_2 = config .getfloat ("barotropic_gyre" , "nu_2" )
5151
5252 # calculate the boundary layer thickness for specified parameters
53- M = (np .pi * 2 ) / np .sqrt (3 ) * (nu_2 / beta )** (1. / 3. )
53+ m = (np .pi * 2 ) / np .sqrt (3 ) * (nu_2 / beta )** (1. / 3. )
5454 # ensure the boundary layer is at least 3 gridcells wide
55- if M >= 3. * resolution * 1.e3 :
55+ if m >= 3. * resolution * 1.e3 :
5656 raise ValueError (f"Resolution { resolution } km is too coarse to "
5757 "properly resolve the lateral boundary layer "
58- f"with anticipated width of { (M * 1e-3 ):03g} km" )
58+ f"with anticipated width of { (m * 1e-3 ):03g} km" )
5959
6060 # check whether viscosity suitable for stability
6161 stability_parameter_max = 0.6
You can’t perform that action at this time.
0 commit comments