Skip to content

Commit

Permalink
modifed 3_year test parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
alicebarthel committed Mar 27, 2024
1 parent a92d61a commit 4145dce
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 18 deletions.
8 changes: 5 additions & 3 deletions compass/ocean/tests/baroclinic_gyre/forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ def __init__(self, test_case, resolution, name='forward', subdir=None,
self.add_namelist_file('compass.ocean.tests.baroclinic_gyre',
'namelist.forward')
if long:
output_interval = "0010_00:00:00"
restart_interval = "0010_00:00:00"
output_interval = "0001-01-01_00:00:00"
restart_interval = "0001-01-01_00:00:00"
else:
output_interval = res_params['run_duration'].replace("'", "")
restart_interval = "0030_00:00:00"
Expand All @@ -82,6 +82,8 @@ def __init__(self, test_case, resolution, name='forward', subdir=None,
options[f'config_{option}'] = res_params[option]
if long:
# run for 3 years instead of 3 time steps
options['config_dt'] = "'00:30:00'"
options['config_btr_dt'] = "'00:03:00'"
options['config_start_time'] = "'0001-01-01_00:00:00'"
options['config_stop_time'] = "'0004-01-01_00:00:00'"
options['config_run_duration'] = "'none'"
Expand All @@ -108,5 +110,5 @@ def run(self):

if self.name == '3_year_test':
replacements = {'config_do_restart': '.true.',
'config_start_time': "'file'"}
'config_start_time': "'Restart_timestamp'"}
self.update_namelist_at_runtime(replacements)
6 changes: 3 additions & 3 deletions compass/ocean/tests/baroclinic_gyre/initial_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ def _write_initial_state(config, dsMesh):
temp_top = section.getfloat('initial_temp_top')
temp_bot = section.getfloat('initial_temp_bot')

print(f'zmid: {ds.zMid.values}')
print(f'zmid: {ds.zMid[0,0,:].values}')
cc = 0.049 # 0.049 value from optimization on 1800m
aa = temp_top / np.log(cc)
bb = (cc ** (temp_bot / temp_top) - cc)
temperature = aa * np.log(bb * -1.0 * ds.zMid / bottom_depth + cc)
print(f'Tinit: {temperature.values}')
print(f'Tinit: {temperature[0,0,:].values}')
val_bot = aa * np.log(bb + cc)
val_top = aa * np.log(cc)
print(f'analytical bottom T: {val_bot} at \
Expand All @@ -84,7 +84,7 @@ def _write_initial_state(config, dsMesh):

# temperature = (-11. * np.log(0.0414 *
# (-1. * ds.zMid + 100.3)) + 48.8)
temperature = temperature.transpose('Time', 'nCells', 'nVertLevels')
# temperature = temperature.transpose('Time', 'nCells', 'nVertLevels')
print(f'bottom layer T: {temperature[0, 0, -1]} and \
surface layer T: {temperature[0, 0, 0]}')
salinity = initial_salinity * xr.ones_like(temperature)
Expand Down
37 changes: 25 additions & 12 deletions compass/ocean/tests/baroclinic_gyre/namelist.forward
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
config_use_mom_del4 = .true.
config_mom_del4_div_factor = 10.0
config_dt = '00:30:00'
config_use_mom_del2 = .true.
config_mom_del2 = 5.0e3
config_use_tracer_del2 = .true.
config_tracer_del2 = 1000.0
config_use_mom_del4 = .false.
config_use_cvmix_convection = .true.
config_cvmix_background_diffusion = 5.0e-6
config_cvmix_background_diffusion = 1.0e-5
config_cvmix_background_viscosity = 1.0e-2
config_use_bulk_wind_stress = .true.
# config_eos_linear_alpha = 0.2
# config_eos_linear_beta = 0.
# config_eos_linear_Tref = 19.0
# config_eos_linear_Sref = 34.0
# config_eos_linear_densityref = 999.8
config_eos_linear_alpha = 0.2
config_eos_linear_beta = 0.8
config_eos_linear_Tref = 5.0
config_eos_linear_Sref = 35.0
config_eos_linear_densityref = 1000.0
# config_bottom_drag_mode = 'explicit'
config_use_implicit_bottom_drag = .false.
config_use_explicit_bottom_drag = .true.
config_disable_vel_explicit_bottom_drag = .true.
config_cvmix_convective_basedOnBVF = .true.
config_use_cvmix_shear = .true.
config_cvmix_shear_mixing_scheme = 'KPP'
config_use_cvmix_kpp = .true.
config_use_bulk_wind_stress = .true.
config_eos_linear_alpha = 0.255
config_eos_linear_Tref = 19.0
config_eos_linear_Sref = 34.0
config_eos_linear_densityref = 1025.0
config_implicit_bottom_drag_coeff = 3.0e-3
config_use_activeTracers_surface_bulk_forcing = .false.
config_use_activeTracers_surface_restoring = .true.
config_use_activeTracers_interior_restoring = .false.
config_use_GM = .true.
config_use_Redi = .true.

0 comments on commit 4145dce

Please sign in to comment.