From e285b253b064f9f85b6d23a04988c3029dc23192 Mon Sep 17 00:00:00 2001 From: Carolyn Begeman Date: Thu, 24 Oct 2024 11:11:24 -0500 Subject: [PATCH] Only visualize init for thin film cases --- compass/ocean/tests/isomip_plus/initial_state.py | 6 ++++-- compass/ocean/tests/isomip_plus/isomip_plus_test.py | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/compass/ocean/tests/isomip_plus/initial_state.py b/compass/ocean/tests/isomip_plus/initial_state.py index c5db827434..09eb2921a2 100644 --- a/compass/ocean/tests/isomip_plus/initial_state.py +++ b/compass/ocean/tests/isomip_plus/initial_state.py @@ -40,7 +40,7 @@ class InitialState(Step): Whether the run includes a thin film below grounded ice """ def __init__(self, test_case, resolution, experiment, vertical_coordinate, - time_varying_forcing, thin_film_present): + time_varying_forcing, thin_film_present, include_viz=False): """ Create the step @@ -65,6 +65,7 @@ def __init__(self, test_case, resolution, experiment, vertical_coordinate, Whether the run includes a thin film below grounded ice """ super().__init__(test_case=test_case, name='initial_state') + self.include_viz = include_viz self.resolution = resolution self.experiment = experiment self.vertical_coordinate = vertical_coordinate @@ -88,7 +89,8 @@ def run(self): """ ds, frac = self._compute_initial_condition() self._compute_restoring(ds, frac) - self._plot(ds) + if self.include_viz: + self._plot(ds) def _compute_initial_condition(self): config = self.config diff --git a/compass/ocean/tests/isomip_plus/isomip_plus_test.py b/compass/ocean/tests/isomip_plus/isomip_plus_test.py index cf17731a01..b701816661 100644 --- a/compass/ocean/tests/isomip_plus/isomip_plus_test.py +++ b/compass/ocean/tests/isomip_plus/isomip_plus_test.py @@ -140,7 +140,8 @@ def __init__(self, test_group, resolution, experiment, experiment=experiment, vertical_coordinate=vertical_coordinate, time_varying_forcing=time_varying_forcing, - thin_film_present=thin_film_present)) + thin_film_present=thin_film_present, + include_viz=thin_film_present)) self.add_step( SshAdjustment(test_case=self, resolution=resolution, vertical_coordinate=vertical_coordinate,