Skip to content

Commit 9e52c0d

Browse files
committed
Add Omega IOStreams to convergence and manufactured_solution
1 parent ed88038 commit 9e52c0d

File tree

3 files changed

+26
-13
lines changed

3 files changed

+26
-13
lines changed

polaris/ocean/convergence/forward.py

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

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

149153
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: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,25 @@ Omega:
3636
Tendencies:
3737
VelDiffTendencyEnable: false
3838
VelHyperDiffTendencyEnable: false
39-
Dimension:
40-
NVertLevels: 1
39+
IOStreams:
40+
InitialState:
41+
UsePointerFile: false
42+
Filename: init.nc
43+
Mode: read
44+
Precision: double
45+
Freq: 1
46+
FreqUnits: OnStartup
47+
UseStartEnd: false
48+
Contents:
49+
- Restart
50+
History:
51+
UsePointerFile: false
52+
Filename: output.nc
53+
Mode: write
54+
IfExists: replace
55+
Precision: double
56+
Freq: {{ output_freq }}
57+
FreqUnits: Seconds
58+
UseStartEnd: false
59+
Contents:
60+
- Tracers

0 commit comments

Comments
 (0)