@@ -366,16 +366,40 @@ Interfacer.get_field(sim::ClimaLandSimulation, ::Val{:area_fraction}) = sim.area
366366Interfacer. get_field (sim:: ClimaLandSimulation , :: Val{:beta} ) =
367367 CL. surface_evaporative_scaling (sim. model, sim. integrator. u, sim. integrator. p)
368368Interfacer. get_field (sim:: ClimaLandSimulation , :: Val{:emissivity} ) = sim. integrator. p. ϵ_sfc
369- Interfacer. get_field (sim:: ClimaLandSimulation , :: Val{:energy} ) =
370- CL. total_energy (sim. integrator. u, sim. integrator. p)
371369Interfacer. get_field (sim:: ClimaLandSimulation , :: Val{:surface_direct_albedo} ) =
372370 CL. surface_albedo (sim. model, sim. integrator. u, sim. integrator. p)
373371Interfacer. get_field (sim:: ClimaLandSimulation , :: Val{:surface_diffuse_albedo} ) =
374372 CL. surface_albedo (sim. model, sim. integrator. u, sim. integrator. p)
375- Interfacer. get_field (sim:: ClimaLandSimulation , :: Val{:water} ) =
376- CL. total_water (sim. integrator. u, sim. integrator. p)
377373Interfacer. get_field (sim:: ClimaLandSimulation , :: Val{:surface_temperature} ) =
378374 sim. integrator. p. T_sfc
375+ function Interfacer. get_field (sim:: ClimaLandSimulation , :: Val{:energy} )
376+ energy_per_area = sim. integrator. p. soil. sfc_scratch
377+ CL. total_energy_per_area! (
378+ energy_per_area,
379+ sim. model,
380+ sim. integrator. u,
381+ sim. integrator. p,
382+ sim. integrator. t,
383+ )
384+ # Zero out anywhere the area fraction is zero
385+ @. energy_per_area =
386+ ifelse (sim. area_fraction == 0 , zero (energy_per_area), energy_per_area)
387+ return sum (energy_per_area)
388+ end
389+ function Interfacer. get_field (sim:: ClimaLandSimulation , :: Val{:water} )
390+ water_per_area = sim. integrator. p. soil. sfc_scratch
391+ CL. total_liq_water_vol_per_area! (
392+ water_per_area,
393+ sim. model,
394+ sim. integrator. u,
395+ sim. integrator. p,
396+ sim. integrator. t,
397+ )
398+ # Convert volumetric water content to mass water content
399+ ρ_liq = LP. ρ_cloud_liq (sim. model. soil. parameters. earth_param_set)
400+ @. water_per_area = ifelse (sim. area_fraction == 0 , zero (water_per_area), water_per_area)
401+ return ρ_liq * sum (water_per_area)
402+ end
379403
380404# Update fields stored in land drivers
381405function Interfacer. update_field! (sim:: ClimaLandSimulation , :: Val{:diffuse_fraction} , field)
0 commit comments