Skip to content

Commit 0bcab9a

Browse files
xylarcbegeman
authored andcommitted
Update performance test
Move cropping of inactive top cells to ForwardStep so it is explicitly included as an output of that step. Give `init.nc` as the mesh file for cropping. For validation, point to the output file from the version of the performance test without inactive top cells for `filename2`.
1 parent ba3b04a commit 0bcab9a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

compass/ocean/tests/global_ocean/forward.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from importlib.resources import contents
44

55
from compass.model import run_model
6+
from compass.ocean.inactive_top_cells import remove_inactive_top_cells_output
67
from compass.ocean.tests.global_ocean.metadata import (
78
add_mesh_and_init_metadata,
89
)
@@ -155,6 +156,9 @@ def __init__(self, test_case, mesh, time_integrator, init=None,
155156
filename='graph.info',
156157
work_dir_target=f'{init.path}/initial_state/graph.info')
157158

159+
if init.with_inactive_top_cells:
160+
self.add_output_file(filename='output_crop.nc')
161+
158162
self.add_model_as_input()
159163

160164
def setup(self):
@@ -214,6 +218,12 @@ def run(self):
214218
update_pio = self.config.getboolean('global_ocean',
215219
'forward_update_pio')
216220
run_model(self, update_pio=update_pio)
221+
222+
if self.init.with_inactive_top_cells:
223+
remove_inactive_top_cells_output(in_filename='output.nc',
224+
out_filename='output_crop.nc',
225+
mesh_filename='init.nc')
226+
217227
add_mesh_and_init_metadata(self.outputs, self.config,
218228
init_filename='init.nc')
219229

0 commit comments

Comments
 (0)