Skip to content

Commit

Permalink
Move nus list to cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
cbegeman committed Jan 30, 2023
1 parent 6d71658 commit 5d379d4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
3 changes: 3 additions & 0 deletions compass/ocean/tests/overflow/overflow.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ width = 40

# The length of the domain in the along-slope dimension (km)
length = 200

# Viscosity values to test for rpe test case
viscosities = 1, 5, 10, 100, 1000
25 changes: 15 additions & 10 deletions compass/ocean/tests/overflow/rpe_test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,27 @@ def __init__(self, test_group, resolution='1km'):
super().__init__(test_group=test_group, name=name,
subdir=subdir)

nus = [1, 5, 10, 100, 1000]

self.resolution = resolution
self.nus = None


def configure(self):
"""
Modify the configuration options for this test case.
"""
config = self.config
resolution = self.resolution

overflow.configure(resolution, config)

nus = config.getlist('overflow', 'viscosities', dtype=float)
self.nus = nus

self.add_step(
InitialState(test_case=self))

for index, nu in enumerate(nus):
name = f'rpe_test_{index + 1}_nu_{nu}'
name = f'rpe_test_{index + 1}_nu_{int(nu)}'
step = Forward(
test_case=self, name=name, subdir=name,
ntasks=64, min_tasks=16, openmp_threads=1,
Expand All @@ -56,11 +68,4 @@ def __init__(self, test_group, resolution='1km'):

self.add_step(
Analysis(test_case=self, resolution=resolution, nus=nus))

def configure(self):
"""
Modify the configuration options for this test case.
"""
overflow.configure(self.resolution, self.config)

# no run() is needed because we're doing the default: running all steps

0 comments on commit 5d379d4

Please sign in to comment.