Skip to content

Commit a6e453a

Browse files
committed
fixes
1 parent 105484c commit a6e453a

File tree

4 files changed

+52
-14
lines changed

4 files changed

+52
-14
lines changed

docs/src/api.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,21 @@ ClimaAtmos.InitialConditions.Bomex
4343
ClimaAtmos.InitialConditions.Soares
4444
```
4545

46-
### Helper
46+
## Helper
4747

4848
```@docs
4949
ClimaAtmos.InitialConditions.ColumnInterpolatableField
5050
```
5151

52+
## Grids
53+
54+
```@docs
55+
ClimaAtmos.ColGrid
56+
ClimaAtmos.SphereGrid
57+
ClimaAtmos.PlaneGrid
58+
ClimaAtmos.BoxGrid
59+
```
60+
5261
## Jacobian
5362

5463
```@docs

src/simulation/grids.jl

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ domain system but use ClimaCore grids directly.
66
"""
77

88
using ClimaCore: Geometry, Hypsography, Fields, Spaces, Meshes
9-
using ClimaCore.CommonGrids: ExtrudedCubedSphereGrid, ColumnGrid, Box3DGrid, SliceXZGrid
9+
using ClimaCore.CommonGrids: ExtrudedCubedSphereGrid, ColumnGrid, Box3DGrid, SliceXZGrid, DefaultZMesh
1010
using ClimaUtilities: SpaceVaryingInputs.SpaceVaryingInput
1111
import .AtmosArtifacts as AA
1212
import ClimaComms
@@ -123,10 +123,16 @@ function ColGrid(
123123
)
124124
stretch =
125125
z_stretch ? Meshes.HyperbolicTangentStretching{FT}(dz_bottom) : Meshes.Uniform()
126-
126+
z_mesh = DefaultZMesh(
127+
FT;
128+
z_min = 0,
129+
z_max,
130+
z_elem,
131+
stretch,
132+
)
127133
grid = ColumnGrid(
128134
FT;
129-
z_elem, z_min = 0, z_max,
135+
z_elem, z_min = 0, z_max, z_mesh,
130136
device = ClimaComms.device(comms_ctx),
131137
context = comms_ctx,
132138
stretch,
@@ -199,10 +205,16 @@ function BoxGrid(
199205
topography, topography_damping_factor, mesh_warp_type,
200206
sleve_eta, sleve_s, topo_smoothing, comms_ctx,
201207
)
202-
208+
z_mesh = DefaultZMesh(
209+
FT;
210+
z_min = 0,
211+
z_max,
212+
z_elem,
213+
stretch,
214+
)
203215
grid = Box3DGrid(
204216
FT;
205-
z_elem, x_min = 0, x_max, y_min = 0, y_max, z_min = 0, z_max,
217+
z_elem, x_min = 0, x_max, y_min = 0, y_max, z_min = 0, z_max, z_mesh,
206218
periodic_x, periodic_y, n_quad_points, x_elem, y_elem,
207219
device = ClimaComms.device(comms_ctx),
208220
context = comms_ctx,
@@ -274,9 +286,17 @@ function PlaneGrid(
274286
sleve_eta, sleve_s, topo_smoothing, comms_ctx,
275287
)
276288

289+
z_mesh = DefaultZMesh(
290+
FT;
291+
z_min = 0,
292+
z_max,
293+
z_elem,
294+
stretch,
295+
)
296+
277297
grid = SliceXZGrid(
278298
FT;
279-
z_elem, x_elem, x_min = 0, x_max, z_min = 0, z_max,
299+
z_elem, x_elem, x_min = 0, x_max, z_min = 0, z_max, z_mesh,
280300
periodic_x,
281301
n_quad_points,
282302
device = ClimaComms.device(comms_ctx),

src/solver/type_getters.jl

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -255,15 +255,21 @@ function get_spaces(grid, params, comms_ctx)
255255
ExtrudedFiniteDifferenceGrid or FiniteDifferenceGrid""",
256256
)
257257
end
258-
h_elem = Spaces.n_elements_per_panel_direction(center_space)
259258
z_elem = Spaces.nlevels(center_space)
260259
ncols = Fields.ncolumns(center_space)
261260
ndofs_total = ncols * z_elem
262-
hspace = Spaces.horizontal_space(center_space)
263-
quad_style = Spaces.quadrature_style(hspace)
264-
Nq = Quadratures.degrees_of_freedom(quad_style)
265-
266-
@info "Resolution stats: " Nq h_elem z_elem ncols ndofs_total
261+
if grid isa Grids.ExtrudedFiniteDifferenceGrid
262+
h_elem = Spaces.n_elements_per_panel_direction(center_space)
263+
z_elem = Spaces.nlevels(center_space)
264+
ncols = Fields.ncolumns(center_space)
265+
ndofs_total = ncols * z_elem
266+
hspace = Spaces.horizontal_space(center_space)
267+
quad_style = Spaces.quadrature_style(hspace)
268+
Nq = Quadratures.degrees_of_freedom(quad_style)
269+
@info "Resolution stats: " Nq h_elem z_elem ncols ndofs_total
270+
else
271+
@info "Resolution stats: " z_elem ncols ndofs_total
272+
end
267273
return (; center_space, face_space)
268274
end
269275

@@ -750,7 +756,7 @@ function get_grid(parsed_args, params, comms_ctx)
750756
topo_smoothing = parsed_args["topo_smoothing"],
751757
)
752758
elseif parsed_args["config"] == "column"
753-
ColumnGrid(
759+
ColGrid(
754760
FT,
755761
params,
756762
comms_ctx;

src/utils/utilities.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,9 @@ function do_dss(space::Spaces.AbstractSpace)
271271
Quadratures.GLL
272272
end
273273

274+
function do_dss(space::Spaces.FiniteDifferenceSpace)
275+
return false
276+
end
274277

275278
using ClimaComms
276279
is_distributed(::ClimaComms.SingletonCommsContext) = false

0 commit comments

Comments
 (0)