@@ -321,6 +321,8 @@ auxiliary_types(::BucketModel{FT}) where {FT} = (
321
321
FT,
322
322
FT,
323
323
ClimaCore. Geometry. WVector{FT},
324
+ FT,
325
+ FT,
324
326
)
325
327
auxiliary_vars (:: BucketModel ) = (
326
328
:q_sfc ,
@@ -336,6 +338,8 @@ auxiliary_vars(::BucketModel) = (
336
338
:snow_melt ,
337
339
:infiltration ,
338
340
:top_bc_wvec ,
341
+ :total_energy ,
342
+ :total_water ,
339
343
)
340
344
auxiliary_domain_names (:: BucketModel ) = (
341
345
:surface ,
@@ -351,6 +355,8 @@ auxiliary_domain_names(::BucketModel) = (
351
355
:surface ,
352
356
:surface ,
353
357
:surface ,
358
+ :surface ,
359
+ :surface ,
354
360
)
355
361
356
362
@@ -497,6 +503,8 @@ function make_update_aux(model::BucketModel{FT}) where {FT}
497
503
model. parameters. W_f,
498
504
) # Equation (2) of the text.
499
505
506
+ # Compute the integrated energy per area
507
+ ClimaLand. total_energy_per_area! (p. bucket. total_energy, model, Y, p, t)
500
508
end
501
509
return update_aux!
502
510
end
@@ -576,6 +584,81 @@ function surface_air_density(
576
584
return p. bucket. ρ_sfc
577
585
end
578
586
587
+ """
588
+
589
+ ClimaLand.total_energy_per_area!(
590
+ surface_field,
591
+ model::BucketModel,
592
+ Y,
593
+ p,
594
+ t,
595
+ )
596
+
597
+ A function which updates `surface_field` in place with the value for
598
+ the total energy per unit ground area for the `BucketModel`.
599
+
600
+ The ground of the bucket model has temperature `Y.bucket.T`, with
601
+ volumetric specific heat approximated with the parameter `ρc_soil`.
602
+ Additional energy is present due to the latent heat of fusion of
603
+ frozen water, in the form of snow. We also add in this energy (below).
604
+ We do not model or account for the sensible energy of snow (`ρ_snow T_snow`),
605
+ as this is much smaller.
606
+ """
607
+ function ClimaLand. total_energy_per_area! (
608
+ surface_field,
609
+ model:: BucketModel ,
610
+ Y,
611
+ p,
612
+ t,
613
+ )
614
+ surface_field .= 0
615
+ # Sensible energy of the soil
616
+ ClimaCore. Operators. column_integral_definite! (
617
+ surface_field,
618
+ model. parameters. ρc_soil .* Y. bucket. T,
619
+ )
620
+
621
+ # Latent heat of fusion of frozen water in the snow
622
+ surface_field .+ =
623
+ - LP. LH_f0 (model. parameters. earth_param_set) .*
624
+ LP. ρ_cloud_liq (model. parameters. earth_param_set) .* Y. bucket. σS
625
+ return nothing
626
+ end
627
+
628
+ """
629
+
630
+ ClimaLand.total_water_per_area!(
631
+ surface_field,
632
+ model::BucketModel,
633
+ Y,
634
+ p,
635
+ t,
636
+ )
637
+
638
+ A function which updates `surface_field` in place with the value for
639
+ the total water per unit ground area for the `BucketModel`, in kg m⁻².
640
+
641
+ The total water contained in the bucket is the sum of the
642
+ subsurface water storage `W`, the snow water equivalent `σS` and
643
+ surface water content `Ws`, times the density of liquid water `ρ_cloud_liq`.
644
+ """
645
+ function ClimaLand. total_water_per_area! (
646
+ surface_field,
647
+ model:: BucketModel ,
648
+ Y,
649
+ p,
650
+ t,
651
+ )
652
+ ρ_cloud_liq = CL. LP. ρ_cloud_liq (sim. model. parameters. earth_param_set)
653
+ @. surface_field =
654
+ (
655
+ sim. integrator. u. bucket. σS +
656
+ sim. integrator. u. bucket. W +
657
+ sim. integrator. u. bucket. Ws
658
+ ) * ρ_cloud_liq
659
+ return nothing
660
+ end
661
+
579
662
include (" ./bucket_parameterizations.jl" )
580
663
581
664
end
0 commit comments