@@ -15,12 +15,12 @@ def __init__(self, mpas_core):
1515 """
1616 super ().__init__ (mpas_core = mpas_core , name = 'turbulence_closure' )
1717
18- for resolution in ['10km' ]:
18+ for resolution in [1e4 ]:
1919 self .add_test_case (
2020 DecompTest (test_group = self , resolution = resolution ))
2121 self .add_test_case (
2222 RestartTest (test_group = self , resolution = resolution ))
23- for resolution in ['1m' , '2m' , '10km' ]:
23+ for resolution in [1 , 2 , 1e4 ]:
2424 for forcing in ['cooling' , 'evaporation' ]:
2525 self .add_test_case (
2626 Default (test_group = self , resolution = resolution , forcing = forcing ))
@@ -32,38 +32,41 @@ def configure(resolution, forcing, config):
3232
3333 Parameters
3434 ----------
35- resolution : str
36- The resolution of the test case
35+ resolution : float
36+ The resolution of the test case in meters
3737
3838 config : configparser.ConfigParser
3939 Configuration options for this test case
4040 """
41- res_params = {'10km' : {'nx' : 16 ,
42- 'ny' : 50 ,
43- 'dc' : 10e3 },
44- '2m' : {'nx' : 150 ,
45- 'ny' : 150 ,
46- 'dc' : 2 },
47- '1m' : {'nx' : 128 ,
48- 'ny' : 128 ,
49- 'dc' : 1 }}
50- vert_params = {'10km' : {'vert_levels' : 20 ,
51- 'bottom_depth' : 1e3 },
52- '2m' : {'vert_levels' : 50 ,
53- 'bottom_depth' : 100.0 },
54- '1m' : {'vert_levels' : 128 ,
55- 'bottom_depth' : 128.0 }}
41+ # The resolution parameters are different for different resolutions
42+ # to match existing simulations
43+ if resolution > 1e3 :
44+ nx = 16
45+ ny = 50
46+ vert_levels = 20
47+ bottom_depth = 1e3
48+ elif resolution <= 1e3 and resolution > 5 :
49+ nx = 50
50+ ny = 50
51+ vert_levels = 50
52+ bottom_depth = 100.0
53+ elif resolution <= 5 and resolution > 1 :
54+ nx = 150
55+ ny = 150
56+ vert_levels = 50
57+ bottom_depth = 100.0
58+ elif resolution <= 1 :
59+ nx = 128
60+ ny = 128
61+ vert_levels = 128
62+ bottom_depth = 128.0
5663
57- if resolution not in res_params :
58- raise ValueError (f'Unsupported resolution { resolution } . '
59- f'Supported values are: { list (res_params )} ' )
6064
61- res_params = res_params [resolution ]
62- for param in res_params :
63- config .set ('turbulence_closure' , param , f'{ res_params [param ]} ' )
64- vert_params = vert_params [resolution ]
65- for param in vert_params :
66- config .set ('vertical_grid' , param , f'{ vert_params [param ]} ' )
65+ config .set ('turbulence_closure' , 'nx' , f'{ nx } ' )
66+ config .set ('turbulence_closure' , 'ny' , f'{ ny } ' )
67+ config .set ('turbulence_closure' , 'dc' , f'{ resolution } ' )
68+ config .set ('vertical_grid' , 'vert_levels' , f'{ vert_levels } ' )
69+ config .set ('vertical_grid' , 'bottom_depth' , f'{ bottom_depth } ' )
6770
6871 if forcing == 'cooling' :
6972 config .set ('turbulence_closure' , 'surface_heat_flux' , '-100' )
0 commit comments