Skip to content

Commit

Permalink
Add validation with cropped output: performance_test
Browse files Browse the repository at this point in the history
  • Loading branch information
cbegeman committed Jul 21, 2021
1 parent cd17c03 commit d2fdfe3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions compass/ocean/tests/global_ocean/performance_test/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from compass.validate import compare_variables, compare_timers
from compass.ocean.tests.global_ocean.forward import ForwardTestCase, \
ForwardStep
from compass.ocean.inactive_top_cells import remove_inactive_top_cells_output


class PerformanceTest(ForwardTestCase):
Expand Down Expand Up @@ -61,6 +62,18 @@ def validate(self):
compare_variables(test_case=self, variables=variables,
filename1='forward/output.nc')

if self.config.has_option('vertical_grid', 'inactive_top_cells'):
offset = self.config.getint('vertical_grid', 'inactive_top_cells')
if offset > 0:
remove_inactive_top_cells_output('forward/output.nc',
inactive_top_cells=offset)
variables = [
'temperature', 'salinity', 'layerThickness', 'normalVelocity']
compare_variables(test_case=self, variables=variables,
filename1='forward/output_crop.nc',
filename2='forward/output_comp.nc',
quiet=False, check_outputs=False)

if self.mesh.with_ice_shelf_cavities:
variables = [
'ssh', 'landIcePressure', 'landIceDraft', 'landIceFraction',
Expand Down

0 comments on commit d2fdfe3

Please sign in to comment.