From 918287533960fed13ac6e30a6c293eef2639c2b8 Mon Sep 17 00:00:00 2001 From: Alice Barthel Date: Tue, 30 Jul 2024 12:09:32 -0500 Subject: [PATCH] added monthly output --- .../tests/baroclinic_gyre/gyre_test_case.py | 74 ------------------- .../tests/baroclinic_gyre/streams.forward | 49 +++++++++++- 2 files changed, 47 insertions(+), 76 deletions(-) delete mode 100644 compass/ocean/tests/baroclinic_gyre/gyre_test_case.py diff --git a/compass/ocean/tests/baroclinic_gyre/gyre_test_case.py b/compass/ocean/tests/baroclinic_gyre/gyre_test_case.py deleted file mode 100644 index 7c01ccfe9f..0000000000 --- a/compass/ocean/tests/baroclinic_gyre/gyre_test_case.py +++ /dev/null @@ -1,74 +0,0 @@ -from compass.mesh import QuasiUniformSphericalMeshStep -from compass.ocean.tests.baroclinic_gyre.cull_mesh import CullMesh -from compass.ocean.tests.baroclinic_gyre.forward import Forward -from compass.ocean.tests.baroclinic_gyre.initial_state import InitialState -from compass.testcase import TestCase -from compass.validate import compare_variables - - -class GyreTestCase(TestCase): - """ - A class to define the baroclinic gyre test cases - - Attributes - ---------- - resolution : float - The resolution of the test case (m) - """ - - def __init__(self, test_group, resolution, long): - """ - Create the test case - - Parameters - ---------- - test_group : - compass.ocean.tests.baroclinic_gyre.BaroclinicGyre - The test group that this test case belongs to - - resolution : float - The resolution of the test case (m) - - long : bool - Whether to run a long (3-year) simulation to quasi-equilibrium - """ - name = 'performance_test' - self.resolution = resolution - self.long = long - - if long: - name = '3_year_test' - - if resolution >= 1e3: - res_name = f'{int(resolution/1e3)}km' - else: - res_name = f'{int(resolution)}m' - subdir = f'{res_name}/{name}' - super().__init__(test_group=test_group, name=name, - subdir=subdir) - - self.add_step(QuasiUniformSphericalMeshStep( - test_case=self, cell_width=int(resolution / 1e3))) - self.add_step(CullMesh(test_case=self)) - self.add_step( - InitialState(test_case=self, resolution=resolution)) - self.add_step( - Forward(test_case=self, resolution=resolution, - long=long)) - - def configure(self): - """ - Set config options for the test case - """ - config = self.config - config.add_from_package('compass.mesh', 'mesh.cfg') - - def validate(self): - """ - Validate variables against a baseline - """ - compare_variables(test_case=self, - variables=['layerThickness', 'temperature', - 'ssh'], - filename1='forward/output/' - 'output.0001-01-01_00.00.00.nc') diff --git a/compass/ocean/tests/baroclinic_gyre/streams.forward b/compass/ocean/tests/baroclinic_gyre/streams.forward index 72cc69faad..9c82aa8e4e 100644 --- a/compass/ocean/tests/baroclinic_gyre/streams.forward +++ b/compass/ocean/tests/baroclinic_gyre/streams.forward @@ -48,8 +48,9 @@ - + filename_template="forcing.nc" + input_interval="initial_only" + type="input"> @@ -58,4 +59,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +