Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove two not-needed functions #697

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docs/src/APIs/shared_utilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ ClimaLand.turbulent_fluxes_at_a_point
ClimaLand.radiative_fluxes_at_a_point
ClimaLand.set_atmos_ts!
ClimaLand.surface_air_density
ClimaLand.liquid_precipitation
ClimaLand.snow_precipitation
ClimaLand.surface_temperature
ClimaLand.surface_resistance
ClimaLand.surface_specific_humidity
Expand Down
21 changes: 0 additions & 21 deletions src/shared_utilities/drivers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ export AbstractAtmosphericDrivers,
turbulent_fluxes,
net_radiation,
turbulent_fluxes_at_a_point,
liquid_precipitation,
snow_precipitation,
vapor_pressure_deficit,
displacement_height,
relative_humidity,
Expand Down Expand Up @@ -481,25 +479,6 @@ function ClimaLand.net_radiation(
return model_cache.R_n
end


"""
liquid_precipitation(atmos::AbstractAtmosphericDrivers, p, t)

Returns the liquid precipitation (m/s) at the surface.
"""
function liquid_precipitation(atmos::AbstractAtmosphericDrivers, p, t)
return p.drivers.P_liq
end

"""
snow_precipitation(atmos::AbstractAtmosphericDrivers, p, t)

Returns the precipitation in snow (m of liquid water/s) at the surface.
"""
function snow_precipitation(atmos::AbstractAtmosphericDrivers, p, t)
return p.drivers.P_snow
end

"""
surface_temperature(model::AbstractModel, Y, p, t)

Expand Down
8 changes: 3 additions & 5 deletions src/standalone/Bucket/Bucket.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import ClimaLand.Domains: coordinates, SphericalShell
using ClimaLand:
AbstractAtmosphericDrivers,
AbstractRadiativeDrivers,
liquid_precipitation,
snow_precipitation,
turbulent_fluxes,
net_radiation,
compute_ρ_sfc,
Expand Down Expand Up @@ -379,8 +377,8 @@ function make_compute_exp_tendency(model::BucketModel{FT}) where {FT}
# Positive infiltration -> net (negative) flux into soil
@. dY.bucket.W = -p.bucket.infiltration # Equation (2) of the text.

liquid_precip = liquid_precipitation(model.atmos, p, t) # always negative
snow_precip = snow_precipitation(model.atmos, p, t)
liquid_precip = p.drivers.P_liq
snow_precip = p.drivers.P_snow

dY.bucket.Ws = @. -(
liquid_precip +
Expand Down Expand Up @@ -480,7 +478,7 @@ function make_update_aux(model::BucketModel{FT}) where {FT}
p.bucket.snow_cover_fraction # Equation 22

# Partition water fluxes
liquid_precip = liquid_precipitation(model.atmos, p, t) # always negative
liquid_precip = p.drivers.P_liq
# F_melt is negative as it is a downward welling flux warming the snow
@.p.bucket.snow_melt = p.bucket.partitioned_fluxes.F_melt / _ρLH_f0 # defined after Equation (22)

Expand Down
2 changes: 1 addition & 1 deletion test/standalone/Bucket/soil_bucket_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ for FT in (Float32, Float64)
p.bucket.snow_cover_fraction
@test p.bucket.snow_melt ==
p.bucket.partitioned_fluxes.F_melt ./ _ρLH_f0
liquid_precip = ClimaLand.liquid_precipitation(model.atmos, p, t0)
liquid_precip = p.drivers.P_liq

@test p.bucket.infiltration ==
ClimaLand.Bucket.infiltration_at_point.(
Expand Down
Loading