Skip to content

Commit e3664f7

Browse files
committed
clean-up input files for omega and mpaso
1 parent 1ea673b commit e3664f7

5 files changed

Lines changed: 66 additions & 28 deletions

File tree

polaris/tasks/ocean/realistic_global/__init__.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,17 @@ def add_realistic_global_tasks(component):
1313
component : polaris.tasks.ocean.Ocean
1414
The ocean component to which the tasks will be added.
1515
"""
16-
subdir = 'spherical/realistic_global'
17-
config_filename = 'analysis_members.cfg'
18-
for mesh in ['oQU240km']:
19-
filepath = f'{subdir}/analysis_members/{config_filename}'
16+
config_filename = 'realistic_global.cfg'
17+
for mesh_name, mesh_id in [('QU240km', 151209), ('EC30to60E2r2', 200908)]:
18+
subdir = f'spherical/realistic_global/{mesh_name}'
19+
filepath = f'{subdir}/{config_filename}'
2020
config = PolarisConfigParser(filepath=filepath)
2121
component.add_task(
2222
AnalysisMembers(
2323
component=component,
2424
subdir=subdir,
25-
mesh_name=mesh,
25+
mesh_name=mesh_name,
26+
mesh_id=mesh_id,
2627
config=config,
2728
config_filename=config_filename,
2829
)

polaris/tasks/ocean/realistic_global/analysis_members/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def __init__(
1919
component,
2020
subdir,
2121
mesh_name,
22+
mesh_id,
2223
config,
2324
config_filename,
2425
):
@@ -56,10 +57,8 @@ def __init__(
5657
component=component,
5758
package=package,
5859
indir=subdir,
59-
name=f'{mesh_name}_forward',
60-
mesh_filename='ocean.QU.240km.151209.omega.teos10eos.nc',
61-
init_filename='ocean.QU.240km.151209.omega.teos10eos.nc',
62-
output_filename='output.nc',
60+
mesh_name=mesh_name,
61+
mesh_id=mesh_id,
6362
replacements=replacements,
6463
resolution_for_cell_count=240,
6564
)

polaris/tasks/ocean/realistic_global/forward.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@ def __init__(
1111
self,
1212
component,
1313
package,
14+
mesh_name,
15+
mesh_id,
1416
name='forward',
1517
indir=None,
1618
subdir=None,
1719
update_eos=False,
1820
yaml_filename='forward.yaml',
19-
mesh_filename='mesh.nc',
20-
init_filename='init.nc',
21-
graph_filename='culled_graph.info',
2221
output_filename='output.nc',
2322
ntasks=None,
2423
min_tasks=None,
@@ -52,18 +51,15 @@ def __init__(
5251
min_tasks=min_tasks,
5352
update_eos=update_eos,
5453
openmp_threads=1,
55-
graph_target=graph_filename,
54+
graph_target='graph.info',
5655
)
57-
self.mesh_filename = mesh_filename
58-
self.init_filename = init_filename
59-
self.graph_filename = graph_filename
56+
self.mesh_filename = f'{mesh_name}.{mesh_id}'
57+
self.graph_filename = f'graph.info.{mesh_id}'
6058
self.resolution = resolution_for_cell_count
59+
6160
# make sure output is double precision
6261
self.add_yaml_file('polaris.ocean.config', 'output.yaml')
6362

64-
# this is set in the yaml file
65-
# self.add_yaml_file('polaris.ocean.eos', 'teos10.yaml')
66-
6763
self.add_yaml_file(
6864
package,
6965
yaml_filename,
@@ -91,16 +87,20 @@ def setup(self):
9187
config = self.config
9288
model = config.get('ocean', 'model')
9389
# TODO: remove as soon as Omega no longer hard-codes this file
90+
input_filename = f'ocean.{self.mesh_filename}'
9491
if model == 'omega':
92+
# TODO eos_type = self.config.get('ocean', 'eos_type')
93+
eos_type = 'teos10'
94+
input_filename = f'{input_filename}.{eos_type}.nc'
9595
self.add_input_file(
96-
target=self.mesh_filename,
96+
target=input_filename,
9797
filename='OmegaMesh.nc',
98-
database='realistic_global',
98+
database=f'realistic_global/{model}',
9999
)
100100
self.add_input_file(
101-
target=self.init_filename,
101+
target=input_filename,
102102
filename='init.nc',
103-
database='realistic_global',
103+
database=f'realistic_global/{model}',
104104
)
105105
# TODO we need to add this file to input database if we want to
106106
# reconstruct zonal, meridional components before Omega has those
@@ -112,9 +112,9 @@ def setup(self):
112112
# )
113113
else:
114114
self.add_input_file(
115-
target='culled_graph.info',
116-
filename=self.graph_filename,
117-
database='realistic_global',
115+
target=self.graph_filename,
116+
filename='graph.info',
117+
database=f'realistic_global/{model}',
118118
)
119119

120120
def compute_cell_count(self):

polaris/tasks/ocean/realistic_global/forward.yaml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,35 @@ ocean:
77
forcing:
88
config_use_bulk_wind_stress: true
99

10+
mpas-ocean:
11+
streams:
12+
mesh:
13+
filename_template: init.nc
14+
input:
15+
filename_template: init.nc
16+
forcing:
17+
filename_template: init.nc
18+
input_interval: initial_only
19+
type: input
20+
contents:
21+
- windStressZonal
22+
- windStressMeridional
23+
restart:
24+
output_interval: {{ run_duration }}
25+
output:
26+
type: output
27+
filename_template: output.nc
28+
output_interval: {{ output_interval }}
29+
clobber_mode: truncate
30+
reference_time: 0001-01-01_00:00:00
31+
contents:
32+
- tracers
33+
- xtime
34+
- normalVelocity
35+
- layerThickness
36+
- kineticEnergyCell
37+
- relativeVorticityCell
38+
1039
Omega:
1140
TimeIntegration:
1241
TimeStepper: RungeKutta4
@@ -22,7 +51,6 @@ Omega:
2251
Contents:
2352
- State
2453
- Tracers
25-
- Tracers
2654
- WindStressZonal
2755
- WindStressMeridional
2856
History:
@@ -34,9 +62,10 @@ Omega:
3462
FileFreq: 9999
3563
FileFreqUnits: years
3664
Contents:
65+
- State
66+
- AuxiliaryState
3767
- Tracers
3868
- PseudoThickness
39-
- NormalVelocity
4069
- SshCell
4170
- KineticEnergyCell
4271
- Eos
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[ocean]
2+
3+
# Equation of state type
4+
eos_type = teos10
5+
6+
[realistic_global]
7+
8+
# Time step duration per kilometer [s]
9+
dt_per_km = 3.0

0 commit comments

Comments
 (0)