@@ -22,17 +22,22 @@ def generate_1d_grid(config):
2222 interfaces : numpy.ndarray
2323 A 1D array of positive depths for layer interfaces in meters
2424 """
25+ offset = 0
26+ if config .has_option ('vertical_grid' , 'inactive_top_cells' ):
27+ offset = config .getint ('vertical_grid' , 'inactive_top_cells' )
28+
2529 section = config ['vertical_grid' ]
2630 grid_type = section .get ('grid_type' )
2731 if grid_type == 'uniform' :
2832 vert_levels = section .getint ('vert_levels' )
29- interfaces = _generate_uniform (vert_levels )
33+ interfaces = _generate_uniform (vert_levels - offset )
3034 elif grid_type == 'tanh_dz' :
3135 vert_levels = section .getint ('vert_levels' )
3236 min_layer_thickness = section .getfloat ('min_layer_thickness' )
3337 max_layer_thickness = section .getfloat ('max_layer_thickness' )
3438 bottom_depth = section .getfloat ('bottom_depth' )
35- interfaces = _create_tanh_dz_grid (vert_levels , bottom_depth ,
39+ interfaces = _create_tanh_dz_grid (vert_levels - offset ,
40+ bottom_depth ,
3641 min_layer_thickness ,
3742 max_layer_thickness )
3843
@@ -47,6 +52,9 @@ def generate_1d_grid(config):
4752 # renormalize to the requested range
4853 interfaces = (bottom_depth / interfaces [- 1 ]) * interfaces
4954
55+ if config .has_option ('vertical_grid' , 'inactive_top_cells' ):
56+ interfaces = np .append (np .zeros ((offset )),interfaces )
57+
5058 return interfaces
5159
5260
0 commit comments