import os
from compass.testcase import TestCase
from compass.ocean.tests.hurricane.init.initial_state import InitialState
from compass.ocean.tests.hurricane.init.create_pointstats_file \
import CreatePointstatsFile
from compass.ocean.tests.hurricane.init.interpolate_atm_forcing \
import InterpolateAtmForcing
from compass.ocean.tests.hurricane.configure import configure_hurricane
[docs]class Init(TestCase):
"""
A test case for creating initial conditions on a global MPAS-Ocean mesh
Attributes
----------
mesh : compass.ocean.tests.hurricane.mesh.Mesh
The test case that creates the mesh used by this test case
"""
[docs] def __init__(self, test_group, mesh, storm):
"""
Create the test case
Parameters
----------
test_group : compass.ocean.tests.hurricane.Hurricane
The hurricane test group that this test case belongs to
mesh : compass.ocean.tests.hurricane.mesh.Mesh
The test case that creates the mesh used by this test case
storm : str
The name of the storm to be run
"""
name = 'init'
mesh_name = mesh.mesh_name
subdir = os.path.join(mesh_name, name)
super().__init__(test_group=test_group, name=name, subdir=subdir)
self.mesh = mesh
self.add_step(InitialState(test_case=self, mesh=mesh))
self.add_step(InterpolateAtmForcing(test_case=self, mesh=mesh,
storm=storm))
self.add_step(CreatePointstatsFile(test_case=self, mesh=mesh,
storm=storm))
[docs] def run(self):
"""
Run each step of the testcase
"""
# run the steps
super().run()