Skip to content

Commit

Permalink
use 0 for surface height
Browse files Browse the repository at this point in the history
  • Loading branch information
juliasloan25 committed Dec 3, 2024
1 parent 4f0ca04 commit 06ba0ca
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
21 changes: 11 additions & 10 deletions src/standalone/Snow/snow_parameterizations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,20 @@ end
p,
) where {FT}
Returns the surface height of the `Snow` model; this returns the depth
of the snow and hence implicitly treats the surface (ground) elevation as
at zero.
Returns the surface height of the `Snow` model; surface (ground) elevation
and ignores snow depth (CLM).
Once topography or land ice is incorporated, this will need to change to
z_sfc + land_ice_depth + snow_depth. Note that land ice can
z_sfc + land_ice_depth. Note that land ice can
be ~1-3 km thick on Greenland/
In order to compute surface fluxes, this cannot be large than the
height of the atmosphere measurement location (z_atmos > z_land always).
In order to compute surface fluxes, this cannot be large than the
height of the atmosphere measurement location (z_atmos > z_land always).
This assumes that the surface elevation is zero.
"""
function ClimaLand.surface_height(model::SnowModel{FT}, Y, p) where {FT}
return p.snow.z
return FT(0)
end


Expand All @@ -67,7 +68,7 @@ end
"""
ClimaLand.surface_temperature(model::SnowModel, Y, p)
a helper function which returns the surface temperature for the snow
a helper function which returns the surface temperature for the snow
model, which is stored in the aux state.
"""
function ClimaLand.surface_temperature(model::SnowModel, Y, p, t)
Expand Down Expand Up @@ -318,7 +319,7 @@ end
"""
energy_from_q_l_and_swe(S::FT, q_l::FT, parameters) where {FT}
A helper function for compute the snow energy per unit area, given snow
A helper function for compute the snow energy per unit area, given snow
water equivalent S, liquid fraction q_l, and snow model parameters.
Note that liquid water can only exist at the freezing point in this model,
Expand All @@ -340,7 +341,7 @@ end
"""
energy_from_T_and_swe(S::FT, T::FT, parameters) where {FT}
A helper function for compute the snow energy per unit area, given snow
A helper function for compute the snow energy per unit area, given snow
water equivalent S, bulk temperature T, and snow model parameters.
If T = T_freeze, we return the energy as if q_l = 0.
Expand Down
12 changes: 7 additions & 5 deletions src/standalone/Vegetation/canopy_boundary_fluxes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ to as ``boundary conditions", at the surface and
bottom of the canopy, for water and energy.
These fluxes include turbulent surface fluxes
computed with Monin-Obukhov theory, radiative fluxes,
computed with Monin-Obukhov theory, radiative fluxes,
and root extraction.
$(DocStringExtensions.FIELDS)
"""
Expand Down Expand Up @@ -61,7 +61,7 @@ end
An outer constructor for `AtmosDrivenCanopyBC` which is
intended for use as a default when running standlone canopy
models.
models.
This is also checks the logic that:
- If the `ground` field is Prescribed, :soil should not be a prognostic_land_component
Expand Down Expand Up @@ -129,9 +129,11 @@ end
A helper function which returns the surface height for the canopy
model, which is stored in the parameter struct.
This assumes that the surface elevation is zero.
"""
function ClimaLand.surface_height(model::CanopyModel, _...)
return model.hydraulics.compartment_surfaces[1]
function ClimaLand.surface_height(model::CanopyModel{FT}, _...) where {FT}
return FT(0)
end

function make_update_boundary_fluxes(canopy::CanopyModel)
Expand Down Expand Up @@ -382,7 +384,7 @@ function canopy_turbulent_fluxes_at_a_point(
states,
scheme,
) * r_ae / (canopy_r_b + r_ae)
# The above follows from CLM 5, tech note Equation 5.88, setting H_v = SH and solving to remove T_s, ignoring difference between cp in atmos and above canopy.
# The above follows from CLM 5, tech note Equation 5.88, setting H_v = SH and solving to remove T_s, ignoring difference between cp in atmos and above canopy.
LH = _LH_v0 * E

# Derivatives
Expand Down

0 comments on commit 06ba0ca

Please sign in to comment.