Skip to content

Commit

Permalink
review comments pt I
Browse files Browse the repository at this point in the history
  • Loading branch information
kmdeck committed Jan 14, 2025
1 parent 353a65f commit 6f640e7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions ext/neural_snow/NeuralSnow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ This function clips the snow depth to be between 0 and SWE.
function snow_depth!(z_snow, m::NeuralDepthModel{FT}, Y, p, params) where {FT}
z_snow .= min(Y.snow.Z, Y.snow.S) # z cannot be larger than SWE
z_snow .= max(z_snow, eps(FT)) # z must be positive
return nothing
end

"""
Expand Down
17 changes: 8 additions & 9 deletions src/standalone/Snow/Snow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -331,15 +331,14 @@ function ClimaLand.make_update_aux(model::SnowModel{FT}) where {FT}

@. p.snow.T_sfc = snow_surface_temperature(p.snow.T)

p.snow.water_runoff .=
compute_water_runoff.(
Y.snow.S,
p.snow.q_l,
p.snow.T,
p.snow.ρ_snow,
p.snow.z_snow,
parameters,
)
@. p.snow.water_runoff = compute_water_runoff(
Y.snow.S,
p.snow.q_l,
p.snow.T,
p.snow.ρ_snow,
p.snow.z_snow,
parameters,
)

@. p.snow.energy_runoff =
p.snow.water_runoff * volumetric_internal_energy_liq(FT, parameters)
Expand Down
3 changes: 2 additions & 1 deletion src/standalone/Snow/snow_parameterizations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ the density of liquid water ρ_l for a constant density model.
"""
function snow_depth!(z_snow, density::ConstantDensityModel, Y, p, params)
ρ_l = LP.ρ_cloud_liq(params.earth_param_set)
return @. z_snow = ρ_l * Y.snow.S / density.ρ_snow
@. z_snow = ρ_l * Y.snow.S / density.ρ_snow
return nothing
end

"""
Expand Down

0 comments on commit 6f640e7

Please sign in to comment.