Skip to content

Commit d2fdfe3

Browse files
committed
Add validation with cropped output: performance_test
1 parent cd17c03 commit d2fdfe3

File tree

1 file changed

+13
-0
lines changed
  • compass/ocean/tests/global_ocean/performance_test

1 file changed

+13
-0
lines changed

compass/ocean/tests/global_ocean/performance_test/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from compass.validate import compare_variables, compare_timers
22
from compass.ocean.tests.global_ocean.forward import ForwardTestCase, \
33
ForwardStep
4+
from compass.ocean.inactive_top_cells import remove_inactive_top_cells_output
45

56

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

65+
if self.config.has_option('vertical_grid', 'inactive_top_cells'):
66+
offset = self.config.getint('vertical_grid', 'inactive_top_cells')
67+
if offset > 0:
68+
remove_inactive_top_cells_output('forward/output.nc',
69+
inactive_top_cells=offset)
70+
variables = [
71+
'temperature', 'salinity', 'layerThickness', 'normalVelocity']
72+
compare_variables(test_case=self, variables=variables,
73+
filename1='forward/output_crop.nc',
74+
filename2='forward/output_comp.nc',
75+
quiet=False, check_outputs=False)
76+
6477
if self.mesh.with_ice_shelf_cavities:
6578
variables = [
6679
'ssh', 'landIcePressure', 'landIceDraft', 'landIceFraction',

0 commit comments

Comments
 (0)