11import time
22
33from polaris .mesh .planar import compute_planar_hex_nx_ny
4- from polaris .ocean .convergence import ConvergenceForward
4+ from polaris .ocean .convergence import get_resolution_for_task
5+ from polaris .ocean .convergence .forward import ConvergenceForward
56
67
78class Forward (ConvergenceForward ):
@@ -14,8 +15,8 @@ class Forward(ConvergenceForward):
1415 resolution : float
1516 The resolution of the test case in km
1617 """
17- def __init__ (self , component , name , resolution , subdir , init ,
18- damping_coeff , coord_type , method ,
18+ def __init__ (self , component , name , refinement_factor , subdir , init ,
19+ damping_coeff , coord_type , method , refinement = 'both' ,
1920 drag_type = 'constant_and_rayleigh' ):
2021 """
2122 Create a new test case
@@ -25,9 +26,6 @@ def __init__(self, component, name, resolution, subdir, init,
2526 component : polaris.Component
2627 The component the step belongs to
2728
28- resolution : km
29- The resolution of the test case in km
30-
3129 subdir : str
3230 The subdirectory that the step belongs to
3331
@@ -67,14 +65,16 @@ def __init__(self, component, name, resolution, subdir, init,
6765 options ['config_tidal_forcing_model' ] = 'monochromatic'
6866 super ().__init__ (component = component ,
6967 name = name , subdir = subdir ,
70- resolution = resolution , mesh = init , init = init ,
68+ refinement_factor = refinement_factor ,
69+ mesh = init , init = init ,
7170 package = 'polaris.ocean.tasks.drying_slope' ,
7271 yaml_filename = 'forward.yaml' ,
73- init_filename = 'initial_state.nc' ,
74- graph_filename = 'culled_graph.info' ,
72+ graph_target = f'{ init .path } /culled_graph.info' ,
7573 output_filename = 'output.nc' ,
7674 forcing = True , options = options ,
7775 validate_vars = ['layerThickness' , 'normalVelocity' ])
76+ self .resolution = get_resolution_for_task (
77+ self .config , self .refinement_factor , refinement = self .refinement )
7878
7979 def compute_cell_count (self ):
8080 """
0 commit comments