@@ -115,7 +115,14 @@ function compute_stomatal_conductance!(
115115end
116116
117117function compute_stomatal_conductance! (out, Y, p, t, land_model:: CanopyModel )
118- compute_stomatal_conductance! (out, Y, p, t, land_model, canopy. conductance)
118+ compute_stomatal_conductance! (
119+ out,
120+ Y,
121+ p,
122+ t,
123+ land_model,
124+ land_model. conductance,
125+ )
119126end
120127
121128function compute_stomatal_conductance! (
@@ -273,61 +280,6 @@ function compute_leaf_water_potential!(out, Y, p, t, land_model::CanopyModel)
273280 end
274281end
275282
276- function compute_moisture_stress_factor! (
277- out,
278- Y,
279- p,
280- t,
281- land_model:: Union{SoilCanopyModel, LandModel} ,
282- )
283- canopy = land_model. canopy
284- hydraulics = canopy. hydraulics
285- n_stem = hydraulics. n_stem
286- n_leaf = hydraulics. n_leaf
287- n = n_stem + n_leaf
288-
289- earth_param_set = canopy. parameters. earth_param_set
290- grav = LP. grav (earth_param_set)
291- ρ_l = LP. ρ_cloud_liq (earth_param_set)
292- (; sc, pc) = canopy. photosynthesis. parameters
293- ψ = p. canopy. hydraulics. ψ
294- if isnothing (out)
295- out = zeros (land_model. canopy. domain. space. surface) # Allocates
296- fill! (field_values (out), NaN )
297- @. out = moisture_stress (ψ.:($$ n) * ρ_l * grav, sc, pc)
298- return out
299- else
300- @. out = moisture_stress (ψ.:($$ n) * ρ_l * grav, sc, pc)
301- end
302- end
303- function compute_moisture_stress_factor! (
304- out,
305- Y,
306- p,
307- t,
308- land_model:: Union{CanopyModel} ,
309- )
310- canopy = land_model
311- hydraulics = canopy. hydraulics
312- n_stem = hydraulics. n_stem
313- n_leaf = hydraulics. n_leaf
314- n = n_stem + n_leaf
315-
316- earth_param_set = canopy. parameters. earth_param_set
317- grav = LP. grav (earth_param_set)
318- ρ_l = LP. ρ_cloud_liq (earth_param_set)
319- (; sc, pc) = canopy. photosynthesis. parameters
320- ψ = p. canopy. hydraulics. ψ
321- if isnothing (out)
322- out = zeros (land_model. canopy. domain. space. surface) # Allocates
323- fill! (field_values (out), NaN )
324- @. out = moisture_stress (ψ.:($$ n) * ρ_l * grav, sc, pc)
325- return out
326- else
327- @. out = moisture_stress (ψ.:($$ n) * ρ_l * grav, sc, pc)
328- end
329- end
330-
331283# @diagnostic_compute "flux_per_ground_area" Union{SoilCanopyModel, LandModel} p.canopy.hydraulics.fa # return a Tuple
332284@diagnostic_compute " root_flux_per_ground_area" Union{
333285 SoilCanopyModel,
340292 CanopyModel,
341293} p. canopy. hydraulics. area_index. leaf
342294
295+ # Canopy - Soil moisture stress
296+ @diagnostic_compute " moisture_stress_factor" Union{
297+ SoilCanopyModel,
298+ LandModel,
299+ CanopyModel,
300+ } p. canopy. soil_moisture_stress. βm
301+
343302# Canopy - Hydraulics
344303@diagnostic_compute " root_area_index" Union{
345304 SoilCanopyModel,
@@ -574,8 +533,8 @@ end # Convert from kg C to mol CO2.
574533
575534# # Other ##
576535@diagnostic_compute " sw_albedo" Union{SoilCanopyModel, LandModel} p. α_sfc
577- @diagnostic_compute " lw_up" Union{SoilCanopyModel, LandModel} p. LW_u
578- @diagnostic_compute " sw_up" Union{SoilCanopyModel, LandModel} p. SW_u
536+ @diagnostic_compute " lw_up" Union{SoilCanopyModel, LandModel, CanopyModel } p. LW_u
537+ @diagnostic_compute " sw_up" Union{SoilCanopyModel, LandModel, CanopyModel } p. SW_u
579538@diagnostic_compute " surface_runoff" Union{SoilCanopyModel, LandModel} p. soil. R_s
580539@diagnostic_compute " subsurface_runoff" Union{SoilCanopyModel, LandModel} p. soil. R_ss
581540
0 commit comments