From e922938d0a98d3c44ac1b20e87ba9620c84876fc Mon Sep 17 00:00:00 2001 From: kmdeck Date: Thu, 18 Jul 2024 09:17:27 -0700 Subject: [PATCH] restore --- src/shared_utilities/Domains.jl | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/src/shared_utilities/Domains.jl b/src/shared_utilities/Domains.jl index 7d1371a49b..23b43428e3 100644 --- a/src/shared_utilities/Domains.jl +++ b/src/shared_utilities/Domains.jl @@ -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 """ @@ -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