Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions polaris/ocean/config/coeffs_reconstruct.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
mpas-ocean:
streams:
coeffs_reconstruct:
type: output
filename_template: coeffs_reconstruct.nc
output_interval: 0000_00:00:01
clobber_mode: truncate
contents:
- coeffs_reconstruct
16 changes: 16 additions & 0 deletions polaris/ocean/model/ocean_model_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,22 @@ def dynamic_model_config(self, at_setup: bool) -> None:
super().dynamic_model_config(at_setup)
if self.update_eos:
self.update_namelist_eos()
if self.config.has_option('ocean', 'write_coeffs_reconstruct'):
self.write_coeffs_reconstruct = self.config.get(
'ocean', 'write_coeffs_reconstruct'
)
else:
self.write_coeffs_reconstruct = False
if self.write_coeffs_reconstruct:
model = self.config.get('ocean', 'model')
if not model == 'mpas-ocean':
raise ValueError(
'Coefficients for vector reconstruction can only be '
'written for ocean model MPAS-Ocean'
)
self.add_yaml_file(
'polaris.ocean.config', 'coeffs_reconstruct.yaml'
)

def constrain_resources(self, available_cores: Dict[str, Any]) -> None:
"""
Expand Down
6 changes: 6 additions & 0 deletions polaris/ocean/mpas_ocean.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# This config file has default config options for MPAS-Ocean

[ocean]

# Whether to write coeffs for reconstructing vector quantities during
# the forward run
write_coeffs_reconstruct = True

# The paths section points polaris to external paths
[paths]

Expand Down
Loading