Skip to content

Commit

Permalink
restore
Browse files Browse the repository at this point in the history
  • Loading branch information
kmdeck committed Jul 18, 2024
1 parent 6dcd888 commit e922938
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions src/shared_utilities/Domains.jl
Original file line number Diff line number Diff line change
Expand Up @@ -753,22 +753,20 @@ bottom_center_to_surface(val) = val
A function to return a tuple containing the distance between the top boundary
and its closest center, and the bottom boundary and its closest center,
both as Fields. It also returns the widths of each layer as a field.
both as Fields.
"""
function get_Δz(z::ClimaCore.Fields.Field)
# Extract the differences between levels of the face space
fs = obtain_face_space(axes(z))
z_face = ClimaCore.Fields.coordinate_field(fs).z
Δz_face = ClimaCore.Fields.Δz_field(z_face)
Δz = ClimaCore.Fields.Δz_field(z_face)

Δz_top = ClimaCore.Fields.level(
Δz_face,
Δz,
ClimaCore.Utilities.PlusHalf(ClimaCore.Spaces.nlevels(fs) - 1),
)
Δz_bottom = ClimaCore.Fields.level(Δz_face, ClimaCore.Utilities.PlusHalf(0))

#Layer widths:
Δz_center = ClimaCore.Fields.Δz_field(z)
return Δz_top ./ 2, Δz_bottom ./ 2, Δz_center
Δz_bottom = ClimaCore.Fields.level(Δz, ClimaCore.Utilities.PlusHalf(0))
return Δz_top ./ 2, Δz_bottom ./ 2
end

"""
Expand Down Expand Up @@ -810,17 +808,11 @@ during the simulation.
function get_additional_domain_fields(subsurface_space)
surface_space = obtain_surface_space(subsurface_space)
z = ClimaCore.Fields.coordinate_field(subsurface_space).z
Δz_top, Δz_bottom, Δz = get_Δz(z)
Δz_top, Δz_bottom = get_Δz(z)
face_space = obtain_face_space(subsurface_space)
z_face = ClimaCore.Fields.coordinate_field(face_space).z
z_sfc = top_face_to_surface(z_face, surface_space)
fields = (;
z = z,
Δz_top = Δz_top,
Δz_bottom = Δz_bottom,
z_sfc = z_sfc,
Δz = Δz,
)
fields = (; z = z, Δz_top = Δz_top, Δz_bottom = Δz_bottom, z_sfc = z_sfc)
return fields
end

Expand Down

0 comments on commit e922938

Please sign in to comment.