@@ -219,16 +219,35 @@ tests on {ref}`dev-ocean-spherical-meshes` and planar meshes.
219219The ocean framework includes shared config options and base classes for
220220forward and analysis steps that are expected to be useful across these tests.
221221
222+ The key config options that control the convergence test are ` base_resolution `
223+ and ` refinement_factors ` . The ` base_resolution ` is multipled by the
224+ ` refinement_factors ` to determine which resolutions to test when the
225+ convergence is being tested in space (or space and time together). The
226+ ` base_resolution ` is applied to all steps when convergence in time is tested.
227+ ` base_resolution ` times ` dt_per_km ` determines the base timestep in that case
228+ and is then multiplied by the ` refinement_factors ` to determine which time steps
229+ to test. When spherical meshes are being tested, the values in the
230+ ` convergence ` section are overridden by their values in the
231+ ` spherical_convergence ` section with a prefix indicating the mesh type.
232+
222233The shared config options are:
223234``` cfg
224235# config options for spherical convergence tests
225236[spherical_convergence]
226237
238+ # The base resolution for the icosahedral mesh to which the refinement
239+ # factors are applied
240+ icos_base_resolution = 60.
241+
227242# a list of icosahedral mesh resolutions (km) to test
228- icos_resolutions = 60, 120, 240, 480
243+ icos_refinement_factors = 8., 4., 2., 1.
244+
245+ # The base resolution for the quasi-uniform mesh to which the refinement
246+ # factors are applied
247+ qu_base_resolution = 120.
229248
230249# a list of quasi-uniform mesh resolutions (km) to test
231- qu_resolutions = 60, 90, 120, 150, 180, 210, 240
250+ qu_refinement_factors = 0.5, 0.75, 1., 1.25, 1.5, 1.75, 2.
232251
233252[convergence]
234253
@@ -241,6 +260,15 @@ convergence_thresh = 1.0
241260# Type of error to compute
242261error_type = l2
243262
263+ # the base mesh resolution (km) to which refinement_factors
264+ # are applied if refinement is 'space' or 'both' on a planar mesh
265+ # base resolutions for spherical meshes are given in section spherical_convergence
266+ base_resolution = 120
267+
268+ # refinement factors for a planar mesh applied to either space or time
269+ # refinement factors for a spherical mesh given in section spherical_convergence
270+ refinement_factors = 4., 2., 1., 0.5
271+
244272# config options for convergence forward steps
245273[convergence_forward]
246274
@@ -325,7 +353,8 @@ class Forward(SphericalConvergenceForward):
325353 bell test case
326354 """
327355
328- def __init__ (self , component , name , subdir , resolution , mesh , init ):
356+ def __init__ (self , component , name , subdir , mesh , init ,
357+ refinement_factor , refinement = ' both' ):
329358 """
330359 Create a new step
331360
@@ -348,6 +377,9 @@ class Forward(SphericalConvergenceForward):
348377
349378 init : polaris.Step
350379 The init step
380+
381+ refinement_factor : float
382+ The factor by which to scale space, time or both
351383 """
352384 package = ' polaris.ocean.tasks.cosine_bell'
353385 validate_vars = [' normalVelocity' , ' tracer1' ]
@@ -356,7 +388,10 @@ class Forward(SphericalConvergenceForward):
356388 init = init, package = package,
357389 yaml_filename = ' forward.yaml' ,
358390 output_filename = ' output.nc' ,
359- validate_vars = validate_vars)
391+ validate_vars = validate_vars,
392+ graph_target = f ' { init.path} /graph.info ' ,
393+ refinement_factor = refinement_factor,
394+ refinement = refinement)
360395```
361396Each convergence test must define a YAML file with model config options, called
362397` forward.yaml ` by default. The ` package ` parameter is the location of this
@@ -419,7 +454,7 @@ class Analysis(ConvergenceAnalysis):
419454 """
420455 A step for analyzing the output from the cosine bell test case
421456 """
422- def __init__ (self , component , resolutions , subdir , dependencies ):
457+ def __init__ (self , component , subdir , dependencies , refinement = ' both ' ):
423458 """
424459 Create the step
425460
@@ -436,14 +471,18 @@ class Analysis(ConvergenceAnalysis):
436471
437472 dependencies : dict of dict of polaris.Steps
438473 The dependencies of this step
474+
475+ refinement : str, optional
476+ Whether to refine in space, time or both space and time
439477 """
440478 convergence_vars = [{' name' : ' tracer1' ,
441479 ' title' : ' tracer1' ,
442480 ' zidx' : 0 }]
443481 super ().__init__ (component = component, subdir = subdir,
444482 resolutions = resolutions,
445483 dependencies = dependencies,
446- convergence_vars = convergence_vars)
484+ convergence_vars = convergence_vars,
485+ refinement = refinement)
447486```
448487
449488Many tasks will also need to override the
0 commit comments