From 52105c4cd824764e1e2f862eacd7ace8696a76f3 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Tue, 1 Sep 2020 16:28:48 -0600 Subject: [PATCH] Use tracer ratio when counting lake water This is needed for water tracer masses to be counted correctly --- src/biogeophys/TotalWaterAndHeatMod.F90 | 19 ++++++++++++------- src/dyn_subgrid/dynConsBiogeophysMod.F90 | 5 +++-- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/biogeophys/TotalWaterAndHeatMod.F90 b/src/biogeophys/TotalWaterAndHeatMod.F90 index 9cb1d948d6..ba794f67a4 100644 --- a/src/biogeophys/TotalWaterAndHeatMod.F90 +++ b/src/biogeophys/TotalWaterAndHeatMod.F90 @@ -390,7 +390,7 @@ end subroutine AccumulateSoilLiqIceMassNonLake !----------------------------------------------------------------------- subroutine ComputeLiqIceMassLake(bounds, num_lakec, filter_lakec, & - waterstate_inst, lakestate_inst,& + waterstate_inst, lakestate_inst, & add_lake_water_and_subtract_dynbal_baselines, & liquid_mass, ice_mass) ! @@ -410,7 +410,6 @@ subroutine ComputeLiqIceMassLake(bounds, num_lakec, filter_lakec, & class(waterstate_type), intent(in) :: waterstate_inst type(lakestate_type) , intent(in) :: lakestate_inst - ! Whether to (1) add lake water/ice to total accounting, and (2) subtract ! dynbal_baseline_liq and dynbal_baseline_ice from liquid_mass and ice_mass ! @@ -459,7 +458,10 @@ subroutine ComputeLiqIceMassLake(bounds, num_lakec, filter_lakec, & if (add_lake_water_and_subtract_dynbal_baselines) then ! Lake water content call AccumulateLiqIceMassLake(bounds, num_lakec, filter_lakec, & - lakestate_inst, liquid_mass, ice_mass) + lakestate_inst, & + tracer_ratio = waterstate_inst%info%get_ratio(), & + liquid_mass = liquid_mass(bounds%begc:bounds%endc), & + ice_mass = ice_mass(bounds%begc:bounds%endc)) end if ! Soil water content of the soil under the lake @@ -486,7 +488,7 @@ end subroutine ComputeLiqIceMassLake !----------------------------------------------------------------------- subroutine AccumulateLiqIceMassLake(bounds, num_c, filter_c, & - lakestate_inst, liquid_mass, ice_mass) + lakestate_inst, tracer_ratio, liquid_mass, ice_mass) ! ! !DESCRIPTION: ! Accumulate lake water mass of lake columns, separated into liquid and ice. @@ -501,6 +503,7 @@ subroutine AccumulateLiqIceMassLake(bounds, num_c, filter_c, & integer , intent(in) :: num_c ! number of column points in column filter (should not include lake points; can be a subset of the no-lake filter) integer , intent(in) :: filter_c(:) ! column filter (should not include lake points; can be a subset of the no-lake filter) type(lakestate_type) , intent(in) :: lakestate_inst + real(r8) , intent(in) :: tracer_ratio ! for water tracers, standard ratio of this tracer to bulk water (1 for bulk water) real(r8) , intent(inout) :: liquid_mass( bounds%begc: ) ! accumulated liquid mass (kg m-2) real(r8) , intent(inout) :: ice_mass( bounds%begc: ) ! accumulated ice mass (kg m-2) ! @@ -524,12 +527,14 @@ subroutine AccumulateLiqIceMassLake(bounds, num_c, filter_c, & do j = 1, nlevlak do fc = 1, num_c c = filter_c(fc) - ! calculate lake liq and ice content per lake layer first - h2olak_liq = dz_lake(c,j) * denh2o * (1 - lake_icefrac(c,j)) + ! Lake water volume isn't tracked explicitly, so we calculate it from lake + ! depth. Because it isn't tracked explicitly, we also don't have any water + ! tracer information, so we assume a fixed, standard tracer ratio. + h2olak_liq = dz_lake(c,j) * denh2o * (1 - lake_icefrac(c,j)) * tracer_ratio ! use water density rather than ice density because lake layer depths are not ! adjusted when the layer freezes - h2olak_ice = dz_lake(c,j) * denh2o * lake_icefrac(c,j) + h2olak_ice = dz_lake(c,j) * denh2o * lake_icefrac(c,j) * tracer_ratio liquid_mass(c) = liquid_mass(c) + h2olak_liq ice_mass(c) = ice_mass(c) + h2olak_ice diff --git a/src/dyn_subgrid/dynConsBiogeophysMod.F90 b/src/dyn_subgrid/dynConsBiogeophysMod.F90 index 9dc9b46002..6e42b405eb 100644 --- a/src/dyn_subgrid/dynConsBiogeophysMod.F90 +++ b/src/dyn_subgrid/dynConsBiogeophysMod.F90 @@ -205,8 +205,9 @@ subroutine dyn_water_content_set_baselines(bounds, natveg_and_glc_filterc, & ! Calculate the total water volume of the lake column call AccumulateLiqIceMassLake(bounds, num_lakec, filter_lakec, lakestate_inst, & - liquid_mass = lake_liquid_mass_col(bounds%begc:bounds%endc), & - ice_mass = lake_ice_mass_col(bounds%begc:bounds%endc)) + tracer_ratio = waterstate_inst%info%get_ratio(), & + liquid_mass = lake_liquid_mass_col(bounds%begc:bounds%endc), & + ice_mass = lake_ice_mass_col(bounds%begc:bounds%endc)) do fc = 1, num_lakec c = filter_lakec(fc)