Skip to content

Commit

Permalink
Print the max. temperature during dynamic adjustment
Browse files Browse the repository at this point in the history
We want to do this as a sanity check even if it is below the threshold
that will raise an error.
  • Loading branch information
xylar committed Apr 29, 2023
1 parent 3fff215 commit dfdf7c4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions compass/ocean/tests/global_ocean/dynamic_adjustment.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import glob
import os

import xarray
import glob

from compass.validate import compare_variables
from compass.ocean.tests.global_ocean.forward import ForwardTestCase
from compass.validate import compare_variables


class DynamicAdjustment(ForwardTestCase):
Expand Down Expand Up @@ -57,6 +58,7 @@ def validate(self):
and timers
"""
config = self.config
logger = self.logger
variables = ['temperature', 'salinity', 'layerThickness',
'normalVelocity']

Expand All @@ -68,7 +70,7 @@ def validate(self):

for step_name in self.steps_to_run:
step = self.steps[step_name]
step_path = os.path.join(self.work_dir, step.subdir)
step_path = os.path.join(self.work_dir, step.subdir)
global_stats_path = os.path.join(step_path, 'analysis_members',
'globalStats.*.nc')
global_stats_path = glob.glob(global_stats_path)
Expand All @@ -81,3 +83,6 @@ def validate(self):
f'Max of {var} > allowed threshold: '
f'{max_in_global_stats} > {max_value} '
f'in {filename}')
logger.info(f'As desired, max of {var}: '
f'{max_in_global_stats} <= {max_value} in\n'
f' {filename}')

0 comments on commit dfdf7c4

Please sign in to comment.