Skip to content

Commit 333e3ff

Browse files
committed
Add Omega IOStreams to convergence and manufactured_solution
1 parent 40e859d commit 333e3ff

File tree

3 files changed

+36
-21
lines changed

3 files changed

+36
-21
lines changed

polaris/ocean/convergence/forward.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,16 @@ def dynamic_model_config(self, at_setup):
139139
output_interval_str = get_time_interval_string(
140140
seconds=output_interval * s_per_hour)
141141

142+
# For Omega, we want the output interval as a number of seconds
143+
output_freq = int(output_interval * s_per_hour)
144+
142145
replacements = dict(
143146
time_integrator=time_integrator,
144147
dt=dt_str,
145148
btr_dt=btr_dt_str,
146149
run_duration=run_duration_str,
147150
output_interval=output_interval_str,
151+
output_freq=f'{output_freq}'
148152
)
149153

150154
self.add_yaml_file(self.package, self.yaml_filename,

polaris/ocean/tasks/manufactured_solution/forward.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,6 @@ def __init__(self, component, name, resolution, subdir, init):
4444
output_filename='output.nc',
4545
validate_vars=['layerThickness', 'normalVelocity'])
4646

47-
def setup(self):
48-
"""
49-
TEMP: symlink initial condition to name hard-coded in Omega
50-
"""
51-
super().setup()
52-
config = self.config
53-
model = config.get('ocean', 'model')
54-
# TODO: remove as soon as Omega supports I/O streams
55-
if model == 'omega':
56-
self.add_input_file(filename='OmegaMesh.nc', target='init.nc')
57-
5847
def compute_cell_count(self):
5948
"""
6049
Compute the approximate number of cells in the mesh, used to constrain

polaris/ocean/tasks/manufactured_solution/forward.yaml

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ ocean:
55
time_integration:
66
config_dt: {{ dt }}
77
config_time_integrator: {{ time_integrator }}
8+
9+
mpas-ocean:
10+
bottom_drag:
11+
config_bottom_drag_mode: implicit
12+
config_implicit_bottom_drag_type: constant
13+
config_implicit_constant_bottom_drag_coeff: 0.0
14+
manufactured_solution:
15+
config_use_manufactured_solution: true
16+
debug:
17+
config_disable_vel_hmix: true
818
streams:
919
mesh:
1020
filename_template: init.nc
@@ -22,19 +32,31 @@ ocean:
2232
- layerThickness
2333
- ssh
2434

25-
mpas-ocean:
26-
bottom_drag:
27-
config_bottom_drag_mode: implicit
28-
config_implicit_bottom_drag_type: constant
29-
config_implicit_constant_bottom_drag_coeff: 0.0
30-
manufactured_solution:
31-
config_use_manufactured_solution: true
32-
debug:
33-
config_disable_vel_hmix: true
34-
3535
Omega:
3636
Tendencies:
3737
VelDiffTendencyEnable: false
3838
VelHyperDiffTendencyEnable: false
3939
Dimension:
4040
NVertLevels: 1
41+
IOStreams:
42+
InitialState:
43+
UsePointerFile: false
44+
Filename: init.nc
45+
Mode: read
46+
Precision: double
47+
Freq: 1
48+
FreqUnits: OnStartup
49+
UseStartEnd: false
50+
Contents:
51+
- Restart
52+
History:
53+
UsePointerFile: false
54+
Filename: output.nc
55+
Mode: write
56+
IfExists: replace
57+
Precision: double
58+
Freq: {{ output_freq }}
59+
FreqUnits: Seconds
60+
UseStartEnd: false
61+
Contents:
62+
- Tracers

0 commit comments

Comments
 (0)