Skip to content

Commit 0f3ae04

Browse files
committed
Remove: move argument to setup
1 parent ae3d733 commit 0f3ae04

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

polaris/ocean/convergence/forward.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def __init__(self, component, name, subdir, resolution, mesh, init,
5858
A list of variables to validate against a baseline if requested
5959
"""
6060
super().__init__(component=component, name=name, subdir=subdir,
61-
openmp_threads=1, graph_filename=graph_filename)
61+
openmp_threads=1)
6262

6363
self.resolution = resolution
6464
self.package = package
@@ -79,6 +79,9 @@ def __init__(self, component, name, subdir, resolution, mesh, init,
7979
self.add_output_file(filename=output_filename,
8080
validate_vars=validate_vars)
8181

82+
def setup(self, graph_target='graph.info'):
83+
super().setup(graph_target=graph_target)
84+
8285
def compute_cell_count(self):
8386
"""
8487
Compute the approximate number of cells in the mesh, used to constrain

polaris/ocean/model/ocean_model_step.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ class OceanModelStep(ModelStep):
2424
def __init__(self, component, name, subdir=None, indir=None, ntasks=None,
2525
min_tasks=None, openmp_threads=None, max_memory=None,
2626
cached=False, yaml=None, update_pio=True, make_graph=False,
27-
mesh_filename=None, partition_graph=True,
28-
graph_filename='graph.info'):
27+
mesh_filename=None, partition_graph=True):
2928
"""
3029
Make a step for running the model
3130
@@ -95,12 +94,11 @@ def __init__(self, component, name, subdir=None, indir=None, ntasks=None,
9594
mesh_filename=mesh_filename, partition_graph=partition_graph,
9695
graph_filename='graph.info')
9796

98-
self.graph_target = graph_filename
9997
self.dynamic_ntasks = (ntasks is None and min_tasks is None)
10098

10199
self.map: Union[None, List[Dict[str, Dict[str, str]]]] = None
102100

103-
def setup(self):
101+
def setup(self, graph_target='graph.info'):
104102
"""
105103
Determine if we will make yaml files or namelists and streams files,
106104
then, determine the number of MPI tasks to use based on the estimated

polaris/ocean/tasks/inertial_gravity_wave/forward.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@ def __init__(self, component, name, resolution, subdir, init):
3737
resolution=resolution, mesh=init, init=init,
3838
package='polaris.ocean.tasks.inertial_gravity_wave',
3939
yaml_filename='forward.yaml',
40-
graph_filename='culled_graph.info',
4140
output_filename='output.nc',
4241
validate_vars=['layerThickness', 'normalVelocity'])
4342

43+
def setup(self):
44+
super().setup(graph_target='culled_graph.info')
45+
4446
def compute_cell_count(self):
4547
"""
4648
Compute the approximate number of cells in the mesh, used to constrain

polaris/ocean/tasks/manufactured_solution/forward.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,20 @@ def __init__(self, component, name, resolution, subdir, init):
3535
init : polaris.Step
3636
The step which generates the mesh and initial condition
3737
"""
38+
self.init = init
3839
super().__init__(component=component,
3940
name=name, subdir=subdir,
4041
resolution=resolution, mesh=init, init=init,
4142
package='polaris.ocean.tasks.manufactured_solution',
4243
yaml_filename='forward.yaml',
43-
graph_target=f'{init.path}/culled_graph.info',
4444
output_filename='output.nc',
4545
validate_vars=['layerThickness', 'normalVelocity'])
4646

4747
def setup(self):
4848
"""
4949
TEMP: symlink initial condition to name hard-coded in Omega
5050
"""
51-
super().setup()
51+
super().setup(graph_target=f'{self.init.path}/culled_graph.info')
5252
config = self.config
5353
model = config.get('ocean', 'model')
5454
# TODO: remove as soon as Omega supports I/O streams

0 commit comments

Comments
 (0)