From 4a5c621d6aeed5b333671545ad20286994477298 Mon Sep 17 00:00:00 2001 From: Chloe Date: Wed, 18 Sep 2024 10:03:19 -0700 Subject: [PATCH 01/16] remove conditional if (create_glacier_mec_landunit) then to include ELM/GLC SMB QICE fields - makes QICE fields in h0 by default --- .../elm/src/data_types/ColumnDataType.F90 | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/components/elm/src/data_types/ColumnDataType.F90 b/components/elm/src/data_types/ColumnDataType.F90 index 724cefb5cfdf..3cec1d2d3039 100644 --- a/components/elm/src/data_types/ColumnDataType.F90 +++ b/components/elm/src/data_types/ColumnDataType.F90 @@ -5843,22 +5843,20 @@ subroutine col_wf_init(this, begc, endc) avgflag='A', long_name='column-integrated snow freezing rate', & ptr_col=this%qflx_snofrz, set_lake=spval, c2l_scale_type='urbanf', default='inactive') - if (create_glacier_mec_landunit) then - this%qflx_glcice(begc:endc) = spval - call hist_addfld1d (fname='QICE', units='mm/s', & - avgflag='A', long_name='ice growth/melt', & - ptr_col=this%qflx_glcice, l2g_scale_type='ice') - - this%qflx_glcice_frz(begc:endc) = spval - call hist_addfld1d (fname='QICE_FRZ', units='mm/s', & - avgflag='A', long_name='ice growth', & - ptr_col=this%qflx_glcice_frz, l2g_scale_type='ice') - - this%qflx_glcice_melt(begc:endc) = spval - call hist_addfld1d (fname='QICE_MELT', units='mm/s', & - avgflag='A', long_name='ice melt', & - ptr_col=this%qflx_glcice_melt, l2g_scale_type='ice') - endif + this%qflx_glcice(begc:endc) = spval + call hist_addfld1d (fname='QICE', units='mm/s', & + avgflag='A', long_name='ice growth/melt', & + ptr_col=this%qflx_glcice, l2g_scale_type='ice') + + this%qflx_glcice_frz(begc:endc) = spval + call hist_addfld1d (fname='QICE_FRZ', units='mm/s', & + avgflag='A', long_name='ice growth', & + ptr_col=this%qflx_glcice_frz, l2g_scale_type='ice') + + this%qflx_glcice_melt(begc:endc) = spval + call hist_addfld1d (fname='QICE_MELT', units='mm/s', & + avgflag='A', long_name='ice melt', & + ptr_col=this%qflx_glcice_melt, l2g_scale_type='ice') ! As defined here, snow_sources - snow_sinks will equal the change in h2osno at any ! given time step but only if there is at least one snow layer (for all landunits From 43f686d5db6cb61aeaf30cfc48c22c434909b80b Mon Sep 17 00:00:00 2001 From: Chloe Date: Wed, 2 Oct 2024 13:11:36 -0700 Subject: [PATCH 02/16] mods to QICE field calcs, added conditional to include land types isice --- components/elm/src/biogeophys/HydrologyDrainageMod.F90 | 2 +- components/elm/src/biogeophys/SoilTemperatureMod.F90 | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/components/elm/src/biogeophys/HydrologyDrainageMod.F90 b/components/elm/src/biogeophys/HydrologyDrainageMod.F90 index 850b7eedac52..b4fb3f4fe959 100755 --- a/components/elm/src/biogeophys/HydrologyDrainageMod.F90 +++ b/components/elm/src/biogeophys/HydrologyDrainageMod.F90 @@ -222,7 +222,7 @@ subroutine HydrologyDrainage(bounds, & g = col_pp%gridcell(c) ! In the following, we convert glc_snow_persistence_max_days to r8 to avoid overflow if ( (snow_persistence(c) >= (real(glc_snow_persistence_max_days, r8) * secspday)) & - .or. lun_pp%itype(l) == istice_mec) then + .or. lun_pp%itype(l) == istice_mec .or. lun_pp%itype(l) == istice) then qflx_glcice_frz(c) = qflx_snwcp_ice(c) qflx_glcice(c) = qflx_glcice(c) + qflx_glcice_frz(c) if (glc_dyn_runoff_routing(g)) qflx_snwcp_ice(c) = 0._r8 diff --git a/components/elm/src/biogeophys/SoilTemperatureMod.F90 b/components/elm/src/biogeophys/SoilTemperatureMod.F90 index d4a1074bf4a7..d4b4753246f6 100644 --- a/components/elm/src/biogeophys/SoilTemperatureMod.F90 +++ b/components/elm/src/biogeophys/SoilTemperatureMod.F90 @@ -1643,8 +1643,7 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, & ! as computed in HydrologyDrainageMod.F90. l = col_pp%landunit(c) - if (lun_pp%itype(l)==istice_mec) then - + if ( (lun_pp%itype(l)==istice) .or. (lun_pp%itype(l)==istice_mec) ) then if (j>=1 .and. h2osoi_liq(c,j) > 0._r8) then ! ice layer with meltwater ! melting corresponds to a negative ice flux qflx_glcice_melt(c) = qflx_glcice_melt(c) + h2osoi_liq(c,j)/dtime From d27d7f4bae14847d62794bb851bf288bd22c52ce Mon Sep 17 00:00:00 2001 From: Chloe Date: Wed, 2 Oct 2024 14:49:34 -0700 Subject: [PATCH 03/16] QICE h0 chnages -- not b4b --- components/elm/src/biogeophys/HydrologyDrainageMod.F90 | 2 +- components/elm/src/biogeophys/SoilTemperatureMod.F90 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/elm/src/biogeophys/HydrologyDrainageMod.F90 b/components/elm/src/biogeophys/HydrologyDrainageMod.F90 index b4fb3f4fe959..a62c5c87ab93 100755 --- a/components/elm/src/biogeophys/HydrologyDrainageMod.F90 +++ b/components/elm/src/biogeophys/HydrologyDrainageMod.F90 @@ -47,7 +47,7 @@ subroutine HydrologyDrainage(bounds, & ! ! !USES: !$acc routine seq - use landunit_varcon , only : istice, istwet, istsoil, istice_mec, istcrop + use landunit_varcon , only : istice, istwet, istsoil, istice_mec, istcrop, istice use column_varcon , only : icol_roof, icol_road_imperv, icol_road_perv, icol_sunwall, icol_shadewall use elm_varcon , only : denh2o, denice, secspday use elm_varctl , only : glc_snow_persistence_max_days, use_vichydro, use_betr diff --git a/components/elm/src/biogeophys/SoilTemperatureMod.F90 b/components/elm/src/biogeophys/SoilTemperatureMod.F90 index d4b4753246f6..9ed41f2afa79 100644 --- a/components/elm/src/biogeophys/SoilTemperatureMod.F90 +++ b/components/elm/src/biogeophys/SoilTemperatureMod.F90 @@ -1316,7 +1316,7 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, & use elm_varctl , only : iulog use elm_varcon , only : tfrz, hfus, grav use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv - use landunit_varcon , only : istsoil, istcrop, istice_mec + use landunit_varcon , only : istsoil, istcrop, istice_mec,istice ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds From 2d38a1f7abd5fbb1ebd74028181e060ba95a81b6 Mon Sep 17 00:00:00 2001 From: Chloe Date: Thu, 3 Oct 2024 13:15:40 -0700 Subject: [PATCH 04/16] added conditionals to calc SMB (QICE vars) even for non MEC runs - these changes should be b4b and just add additional SMB output of what would be passed to mali if we had an active GLC --- .../elm/src/biogeophys/HydrologyDrainageMod.F90 | 8 +++++++- components/elm/src/biogeophys/SoilTemperatureMod.F90 | 12 +++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/components/elm/src/biogeophys/HydrologyDrainageMod.F90 b/components/elm/src/biogeophys/HydrologyDrainageMod.F90 index a62c5c87ab93..05b5f09622e3 100755 --- a/components/elm/src/biogeophys/HydrologyDrainageMod.F90 +++ b/components/elm/src/biogeophys/HydrologyDrainageMod.F90 @@ -222,11 +222,17 @@ subroutine HydrologyDrainage(bounds, & g = col_pp%gridcell(c) ! In the following, we convert glc_snow_persistence_max_days to r8 to avoid overflow if ( (snow_persistence(c) >= (real(glc_snow_persistence_max_days, r8) * secspday)) & - .or. lun_pp%itype(l) == istice_mec .or. lun_pp%itype(l) == istice) then + .or. lun_pp%itype(l) == istice_mec) then qflx_glcice_frz(c) = qflx_snwcp_ice(c) qflx_glcice(c) = qflx_glcice(c) + qflx_glcice_frz(c) if (glc_dyn_runoff_routing(g)) qflx_snwcp_ice(c) = 0._r8 end if + + if (lun_pp%itype(l) == istice) then + qflx_glcice_frz(c) = qflx_snwcp_ice(c) + qflx_glcice(c) = qflx_glcice(c) + qflx_glcice_frz(c) + end if + end do ! Determine wetland and land ice hydrology (must be placed here diff --git a/components/elm/src/biogeophys/SoilTemperatureMod.F90 b/components/elm/src/biogeophys/SoilTemperatureMod.F90 index 9ed41f2afa79..c062f1643fd6 100644 --- a/components/elm/src/biogeophys/SoilTemperatureMod.F90 +++ b/components/elm/src/biogeophys/SoilTemperatureMod.F90 @@ -1643,7 +1643,7 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, & ! as computed in HydrologyDrainageMod.F90. l = col_pp%landunit(c) - if ( (lun_pp%itype(l)==istice) .or. (lun_pp%itype(l)==istice_mec) ) then + if ( lun_pp%itype(l)==istice_mec) then if (j>=1 .and. h2osoi_liq(c,j) > 0._r8) then ! ice layer with meltwater ! melting corresponds to a negative ice flux qflx_glcice_melt(c) = qflx_glcice_melt(c) + h2osoi_liq(c,j)/dtime @@ -1655,6 +1655,16 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, & endif ! liquid water is present endif ! istice_mec + ! for diagnostic QICE SMB output only - + ! these are to calculate SMB even without MECs + if ( lun_pp%itype(l)==istice) then + if (j>=1 .and. h2osoi_liq(c,j) > 0._r8) then ! ice layer with meltwater + ! melting corresponds to a negative ice flux + qflx_glcice_melt(c) = qflx_glcice_melt(c) + h2osoi_liq(c,j)/dtime + qflx_glcice(c) = qflx_glcice(c) - h2osoi_liq(c,j)/dtime + endif ! liquid water is present + endif ! istice_mec + end do ! end of column-loop enddo ! end of level-loop From c95c1e306cf8b504d526afc6f000160b48c6ff75 Mon Sep 17 00:00:00 2001 From: Chloe Date: Fri, 4 Oct 2024 08:02:57 -0700 Subject: [PATCH 05/16] modified conditional for outputting diagnostic QICE fields --- .../src/biogeophys/HydrologyDrainageMod.F90 | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/components/elm/src/biogeophys/HydrologyDrainageMod.F90 b/components/elm/src/biogeophys/HydrologyDrainageMod.F90 index 05b5f09622e3..ca5143567fe7 100755 --- a/components/elm/src/biogeophys/HydrologyDrainageMod.F90 +++ b/components/elm/src/biogeophys/HydrologyDrainageMod.F90 @@ -222,15 +222,16 @@ subroutine HydrologyDrainage(bounds, & g = col_pp%gridcell(c) ! In the following, we convert glc_snow_persistence_max_days to r8 to avoid overflow if ( (snow_persistence(c) >= (real(glc_snow_persistence_max_days, r8) * secspday)) & - .or. lun_pp%itype(l) == istice_mec) then - qflx_glcice_frz(c) = qflx_snwcp_ice(c) - qflx_glcice(c) = qflx_glcice(c) + qflx_glcice_frz(c) - if (glc_dyn_runoff_routing(g)) qflx_snwcp_ice(c) = 0._r8 - end if - - if (lun_pp%itype(l) == istice) then - qflx_glcice_frz(c) = qflx_snwcp_ice(c) - qflx_glcice(c) = qflx_glcice(c) + qflx_glcice_frz(c) + .or. lun_pp%itype(l) == istice_mec .or. lun_pp%itype(l) == istice) then + + if (lun_pp%itype(l) == istice) then + qflx_glcice_frz(c) = qflx_snwcp_ice(c) + qflx_glcice(c) = qflx_glcice(c) + qflx_glcice_frz(c) + else + qflx_glcice_frz(c) = qflx_snwcp_ice(c) + qflx_glcice(c) = qflx_glcice(c) + qflx_glcice_frz(c) + if (glc_dyn_runoff_routing(g)) qflx_snwcp_ice(c) = 0._r8 + end if ! lun_pp%itype(l) == istice end if end do From 1ee9b462c232e860edf5ea8fe134724a951c82ad Mon Sep 17 00:00:00 2001 From: Chloe Date: Fri, 4 Oct 2024 09:07:08 -0700 Subject: [PATCH 06/16] mods to QICE conditions to get b4b --- components/elm/src/biogeophys/HydrologyDrainageMod.F90 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/elm/src/biogeophys/HydrologyDrainageMod.F90 b/components/elm/src/biogeophys/HydrologyDrainageMod.F90 index ca5143567fe7..3e5c8d0221c9 100755 --- a/components/elm/src/biogeophys/HydrologyDrainageMod.F90 +++ b/components/elm/src/biogeophys/HydrologyDrainageMod.F90 @@ -224,13 +224,14 @@ subroutine HydrologyDrainage(bounds, & if ( (snow_persistence(c) >= (real(glc_snow_persistence_max_days, r8) * secspday)) & .or. lun_pp%itype(l) == istice_mec .or. lun_pp%itype(l) == istice) then - if (lun_pp%itype(l) == istice) then + if ( (snow_persistence(c) >= (real(glc_snow_persistence_max_days, r8) * secspday)) & + .or. lun_pp%itype(l) == istice_mec) then qflx_glcice_frz(c) = qflx_snwcp_ice(c) qflx_glcice(c) = qflx_glcice(c) + qflx_glcice_frz(c) - else + if (glc_dyn_runoff_routing(g)) qflx_snwcp_ice(c) = 0._r8 + else qflx_glcice_frz(c) = qflx_snwcp_ice(c) qflx_glcice(c) = qflx_glcice(c) + qflx_glcice_frz(c) - if (glc_dyn_runoff_routing(g)) qflx_snwcp_ice(c) = 0._r8 end if ! lun_pp%itype(l) == istice end if From d8a9c4fc09d3f190c1c3c3ad11326affe51a7b4a Mon Sep 17 00:00:00 2001 From: Chloe Date: Fri, 4 Oct 2024 10:51:49 -0700 Subject: [PATCH 07/16] QICE calc mods --- components/elm/src/biogeophys/BalanceCheckMod.F90 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/elm/src/biogeophys/BalanceCheckMod.F90 b/components/elm/src/biogeophys/BalanceCheckMod.F90 index 7737f2adbe3d..23d6acbfc023 100755 --- a/components/elm/src/biogeophys/BalanceCheckMod.F90 +++ b/components/elm/src/biogeophys/BalanceCheckMod.F90 @@ -503,7 +503,11 @@ subroutine ColWaterBalanceCheck( bounds, num_do_smb_c, filter_do_smb_c, & if (glc_dyn_runoff_routing(g)) then ! Need to add qflx_glcice_frz to snow_sinks for the same reason as it is ! added to errh2o above - see the comment above for details. - snow_sinks(c) = snow_sinks(c) + qflx_glcice_frz(c) + if (lun_pp%itype(l) == istice) then + snow_sinks(c) = snow_sinks(c) + else + snow_sinks(c) = snow_sinks(c) + qflx_glcice_frz(c) + end if end if errh2osno(c) = (h2osno(c) - h2osno_old(c)) - (snow_sources(c) - snow_sinks(c)) * dtime From 9e3f2a85767029480d487b0dd2f029ec316920be Mon Sep 17 00:00:00 2001 From: Chloe Date: Fri, 4 Oct 2024 13:17:06 -0700 Subject: [PATCH 08/16] mods to QICE scheme, if not GLC/MEC output diagnostic QICE fields that do not change h2o mass balance --- .../elm/src/biogeophys/BalanceCheckMod.F90 | 8 +-- .../src/biogeophys/HydrologyDrainageMod.F90 | 25 +++++---- .../elm/src/biogeophys/SoilTemperatureMod.F90 | 6 ++- .../elm/src/data_types/ColumnDataType.F90 | 52 ++++++++++++++----- 4 files changed, 56 insertions(+), 35 deletions(-) diff --git a/components/elm/src/biogeophys/BalanceCheckMod.F90 b/components/elm/src/biogeophys/BalanceCheckMod.F90 index 23d6acbfc023..48144b045e96 100755 --- a/components/elm/src/biogeophys/BalanceCheckMod.F90 +++ b/components/elm/src/biogeophys/BalanceCheckMod.F90 @@ -167,7 +167,7 @@ subroutine ColWaterBalanceCheck( bounds, num_do_smb_c, filter_do_smb_c, & use elm_varcon , only : spval use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall use column_varcon , only : icol_road_perv, icol_road_imperv - use landunit_varcon , only : istice_mec, istdlak, istsoil,istcrop,istwet + use landunit_varcon , only : istice_mec, istice, istdlak, istsoil,istcrop,istwet use elm_varctl , only : create_glacier_mec_landunit use elm_initializeMod , only : surfalb_vars use CanopyStateType , only : canopystate_type @@ -503,11 +503,7 @@ subroutine ColWaterBalanceCheck( bounds, num_do_smb_c, filter_do_smb_c, & if (glc_dyn_runoff_routing(g)) then ! Need to add qflx_glcice_frz to snow_sinks for the same reason as it is ! added to errh2o above - see the comment above for details. - if (lun_pp%itype(l) == istice) then - snow_sinks(c) = snow_sinks(c) - else - snow_sinks(c) = snow_sinks(c) + qflx_glcice_frz(c) - end if + snow_sinks(c) = snow_sinks(c) + qflx_glcice_frz(c) end if errh2osno(c) = (h2osno(c) - h2osno_old(c)) - (snow_sources(c) - snow_sinks(c)) * dtime diff --git a/components/elm/src/biogeophys/HydrologyDrainageMod.F90 b/components/elm/src/biogeophys/HydrologyDrainageMod.F90 index 3e5c8d0221c9..35e7643b8484 100755 --- a/components/elm/src/biogeophys/HydrologyDrainageMod.F90 +++ b/components/elm/src/biogeophys/HydrologyDrainageMod.F90 @@ -120,8 +120,9 @@ subroutine HydrologyDrainage(bounds, & qflx_runoff_r => col_wf%qflx_runoff_r , & ! Output: [real(r8) (:) ] Rural total runoff (qflx_drain+qflx_surf+qflx_qrgwl) (mm H2O /s) qflx_snwcp_ice => col_wf%qflx_snwcp_ice , & ! Output: [real(r8) (:) ] excess snowfall due to snow capping (mm H2O /s) [+]` qflx_glcice => col_wf%qflx_glcice , & ! Output: [real(r8) (:) ] flux of new glacier ice (mm H2O /s) - qflx_glcice_frz => col_wf%qflx_glcice_frz & ! Output: [real(r8) (:) ] ice growth (positive definite) (mm H2O/s) - ) + qflx_glcice_frz => col_wf%qflx_glcice_frz , & ! Output: [real(r8) (:) ] ice growth (positive definite) (mm H2O/s) + qflx_glcice_diag => col_wf%qflx_glcice_diag , & ! Output: [real(r8) (:) ] flux of new glacier ice (mm H2O/s) - diagnostic, no MECs or GLC + qflx_glcice_frz_diag => col_wf%qflx_glcice_frz_diag & ! Output: [real(r8) (:) ] ice growth (positive definite) (mm H2O/s)) - diagnostic, no MECs or GLC ! Determine time step and step size @@ -222,19 +223,17 @@ subroutine HydrologyDrainage(bounds, & g = col_pp%gridcell(c) ! In the following, we convert glc_snow_persistence_max_days to r8 to avoid overflow if ( (snow_persistence(c) >= (real(glc_snow_persistence_max_days, r8) * secspday)) & - .or. lun_pp%itype(l) == istice_mec .or. lun_pp%itype(l) == istice) then - - if ( (snow_persistence(c) >= (real(glc_snow_persistence_max_days, r8) * secspday)) & - .or. lun_pp%itype(l) == istice_mec) then - qflx_glcice_frz(c) = qflx_snwcp_ice(c) - qflx_glcice(c) = qflx_glcice(c) + qflx_glcice_frz(c) - if (glc_dyn_runoff_routing(g)) qflx_snwcp_ice(c) = 0._r8 - else - qflx_glcice_frz(c) = qflx_snwcp_ice(c) - qflx_glcice(c) = qflx_glcice(c) + qflx_glcice_frz(c) - end if ! lun_pp%itype(l) == istice + .or. lun_pp%itype(l) == istice_mec ) then + qflx_glcice_frz(c) = qflx_snwcp_ice(c) + qflx_glcice(c) = qflx_glcice(c) + qflx_glcice_frz(c) + if (glc_dyn_runoff_routing(g)) qflx_snwcp_ice(c) = 0._r8 end if + if (lun_pp%itype(l)==istice) then + qflx_glcice_frz_diags(c) = qflx_snwcp_ice(c) + qflx_glcice_diags(c) = qflx_glcice_diags(c) + qflx_glcice_frz_diags(c) + endif + end do ! Determine wetland and land ice hydrology (must be placed here diff --git a/components/elm/src/biogeophys/SoilTemperatureMod.F90 b/components/elm/src/biogeophys/SoilTemperatureMod.F90 index c062f1643fd6..c97e68f85eff 100644 --- a/components/elm/src/biogeophys/SoilTemperatureMod.F90 +++ b/components/elm/src/biogeophys/SoilTemperatureMod.F90 @@ -1369,6 +1369,8 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, & qflx_snofrz_col => col_wf%qflx_snofrz , & ! Output: [real(r8) (:) ] column-integrated snow freezing rate (positive definite) [kg m-2 s-1] qflx_glcice => col_wf%qflx_glcice , & ! Output: [real(r8) (:) ] flux of new glacier ice (mm H2O/s) [+ = ice grows] qflx_glcice_melt => col_wf%qflx_glcice_melt , & ! Output: [real(r8) (:) ] ice melt (positive definite) (mm H2O/s) + qflx_glcice_diag => col_wf%qflx_glcice_diag , & ! Output: [real(r8) (:) ] flux of new glacier ice (mm H2O/s) [+ = ice grows] + qflx_glcice_melt_diag => col_wf%qflx_glcice_melt_diag , & ! Output: [real(r8) (:) ] ice melt (positive definite) (mm H2O/s) qflx_snomelt => col_wf%qflx_snomelt , & ! Output: [real(r8) (:) ] snow melt (mm H2O /s) eflx_snomelt => col_ef%eflx_snomelt , & ! Output: [real(r8) (:) ] snow melt heat flux (W/m**2) @@ -1660,8 +1662,8 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, & if ( lun_pp%itype(l)==istice) then if (j>=1 .and. h2osoi_liq(c,j) > 0._r8) then ! ice layer with meltwater ! melting corresponds to a negative ice flux - qflx_glcice_melt(c) = qflx_glcice_melt(c) + h2osoi_liq(c,j)/dtime - qflx_glcice(c) = qflx_glcice(c) - h2osoi_liq(c,j)/dtime + qflx_glcice_melt_diags(c) = qflx_glcice_melt_diags(c) + h2osoi_liq(c,j)/dtime + qflx_glcice_diags(c) = qflx_glcice_daigs(c) - h2osoi_liq(c,j)/dtime endif ! liquid water is present endif ! istice_mec diff --git a/components/elm/src/data_types/ColumnDataType.F90 b/components/elm/src/data_types/ColumnDataType.F90 index 3cec1d2d3039..d74827060d76 100644 --- a/components/elm/src/data_types/ColumnDataType.F90 +++ b/components/elm/src/data_types/ColumnDataType.F90 @@ -502,6 +502,9 @@ module ColumnDataType real(r8), pointer :: qflx_glcice (:) => null() ! net flux of new glacial ice (growth - melt) (mm H2O/s), passed to GLC real(r8), pointer :: qflx_glcice_frz (:) => null() ! ice growth (positive definite) (mm H2O/s) real(r8), pointer :: qflx_glcice_melt (:) => null() ! ice melt (positive definite) (mm H2O/s) + real(r8), pointer :: qflx_glcice_diag (:) => null() ! net flux of new glacial ice (growth - melt) (mm H2O/s), passed to GLC + real(r8), pointer :: qflx_glcice_frz_diag (:) => null() ! ice growth (positive definite) (mm H2O/s) + real(r8), pointer :: qflx_glcice_melt_daig(:) => null() ! ice melt (positive definite) (mm H2O/s) real(r8), pointer :: qflx_drain_vr (:,:) => null() ! liquid water lost as drainage (m /time step) real(r8), pointer :: qflx_h2osfc2topsoi (:) => null() ! liquid water coming from surface standing water top soil (mm H2O/s) real(r8), pointer :: qflx_snow2topsoi (:) => null() ! liquid water coming from residual snow to topsoil (mm H2O/s) @@ -5725,6 +5728,9 @@ subroutine col_wf_init(this, begc, endc) allocate(this%qflx_glcice (begc:endc)) ; this%qflx_glcice (:) = spval allocate(this%qflx_glcice_frz (begc:endc)) ; this%qflx_glcice_frz (:) = spval allocate(this%qflx_glcice_melt (begc:endc)) ; this%qflx_glcice_melt (:) = spval + allocate(this%qflx_glcice_diag (begc:endc)) ; this%qflx_glcice_daig (:) = spval + allocate(this%qflx_glcice_frz_diag (begc:endc)) ; this%qflx_glcice_frz_diag (:) = spval + allocate(this%qflx_glcice_melt_diag (begc:endc)) ; this%qflx_glcice_melt_diag(:) = spval allocate(this%qflx_drain_vr (begc:endc,1:nlevgrnd)) ; this%qflx_drain_vr (:,:) = spval allocate(this%qflx_h2osfc2topsoi (begc:endc)) ; this%qflx_h2osfc2topsoi (:) = spval allocate(this%qflx_snow2topsoi (begc:endc)) ; this%qflx_snow2topsoi (:) = spval @@ -5842,21 +5848,39 @@ subroutine col_wf_init(this, begc, endc) call hist_addfld1d (fname='QSNOFRZ', units='kg/m2/s', & avgflag='A', long_name='column-integrated snow freezing rate', & ptr_col=this%qflx_snofrz, set_lake=spval, c2l_scale_type='urbanf', default='inactive') + + if (create_glacier_mec_landunit) then + this%qflx_glcice(begc:endc) = spval + call hist_addfld1d (fname='QICE', units='mm/s', & + avgflag='A', long_name='ice growth/melt', & + ptr_col=this%qflx_glcice, l2g_scale_type='ice') + + this%qflx_glcice_frz(begc:endc) = spval + call hist_addfld1d (fname='QICE_FRZ', units='mm/s', & + avgflag='A', long_name='ice growth', & + ptr_col=this%qflx_glcice_frz, l2g_scale_type='ice') + + this%qflx_glcice_melt(begc:endc) = spval + call hist_addfld1d (fname='QICE_MELT', units='mm/s', & + avgflag='A', long_name='ice melt', & + ptr_col=this%qflx_glcice_melt, l2g_scale_type='ice') + else + this%qflx_glcice_diag(begc:endc) = spval + call hist_addfld1d (fname='QICE', units='mm/s', & + avgflag='A', long_name='diagnostic ice growth/melt (no active GLC/MECs)', & + ptr_col=this%qflx_glcice_diag, l2g_scale_type='ice') + + this%qflx_glcice_frz_diag(begc:endc) = spval + call hist_addfld1d (fname='QICE_FRZ', units='mm/s', & + avgflag='A', long_name='diagnostic ice growth (no active GLC/MECs)', & + ptr_col=this%qflx_glcice_frz_diag, l2g_scale_type='ice') + + this%qflx_glcice_melt_diag(begc:endc) = spval + call hist_addfld1d (fname='QICE_MELT', units='mm/s', & + avgflag='A', long_name='diagnostic ice melt (no active GLC/MECs)', & + ptr_col=this%qflx_glcice_melt_diag, l2g_scale_type='ice') + end if - this%qflx_glcice(begc:endc) = spval - call hist_addfld1d (fname='QICE', units='mm/s', & - avgflag='A', long_name='ice growth/melt', & - ptr_col=this%qflx_glcice, l2g_scale_type='ice') - - this%qflx_glcice_frz(begc:endc) = spval - call hist_addfld1d (fname='QICE_FRZ', units='mm/s', & - avgflag='A', long_name='ice growth', & - ptr_col=this%qflx_glcice_frz, l2g_scale_type='ice') - - this%qflx_glcice_melt(begc:endc) = spval - call hist_addfld1d (fname='QICE_MELT', units='mm/s', & - avgflag='A', long_name='ice melt', & - ptr_col=this%qflx_glcice_melt, l2g_scale_type='ice') ! As defined here, snow_sources - snow_sinks will equal the change in h2osno at any ! given time step but only if there is at least one snow layer (for all landunits From c0874b57abe1979fa25f510e9e9908b56d29f525 Mon Sep 17 00:00:00 2001 From: Chloe Date: Mon, 7 Oct 2024 13:48:09 -0700 Subject: [PATCH 09/16] generated new diagnostic QICE fields for non MEC/GLC sims --- components/elm/src/biogeophys/HydrologyDrainageMod.F90 | 5 +++-- components/elm/src/biogeophys/SoilTemperatureMod.F90 | 4 ++-- components/elm/src/data_types/ColumnDataType.F90 | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/components/elm/src/biogeophys/HydrologyDrainageMod.F90 b/components/elm/src/biogeophys/HydrologyDrainageMod.F90 index 35e7643b8484..753448aae35f 100755 --- a/components/elm/src/biogeophys/HydrologyDrainageMod.F90 +++ b/components/elm/src/biogeophys/HydrologyDrainageMod.F90 @@ -123,6 +123,7 @@ subroutine HydrologyDrainage(bounds, & qflx_glcice_frz => col_wf%qflx_glcice_frz , & ! Output: [real(r8) (:) ] ice growth (positive definite) (mm H2O/s) qflx_glcice_diag => col_wf%qflx_glcice_diag , & ! Output: [real(r8) (:) ] flux of new glacier ice (mm H2O/s) - diagnostic, no MECs or GLC qflx_glcice_frz_diag => col_wf%qflx_glcice_frz_diag & ! Output: [real(r8) (:) ] ice growth (positive definite) (mm H2O/s)) - diagnostic, no MECs or GLC + ) ! Determine time step and step size @@ -230,8 +231,8 @@ subroutine HydrologyDrainage(bounds, & end if if (lun_pp%itype(l)==istice) then - qflx_glcice_frz_diags(c) = qflx_snwcp_ice(c) - qflx_glcice_diags(c) = qflx_glcice_diags(c) + qflx_glcice_frz_diags(c) + qflx_glcice_frz_diag(c) = qflx_snwcp_ice(c) + qflx_glcice_diag(c) = qflx_glcice_diag(c) + qflx_glcice_frz_diag(c) endif end do diff --git a/components/elm/src/biogeophys/SoilTemperatureMod.F90 b/components/elm/src/biogeophys/SoilTemperatureMod.F90 index c97e68f85eff..7610265cbb89 100644 --- a/components/elm/src/biogeophys/SoilTemperatureMod.F90 +++ b/components/elm/src/biogeophys/SoilTemperatureMod.F90 @@ -1662,8 +1662,8 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, & if ( lun_pp%itype(l)==istice) then if (j>=1 .and. h2osoi_liq(c,j) > 0._r8) then ! ice layer with meltwater ! melting corresponds to a negative ice flux - qflx_glcice_melt_diags(c) = qflx_glcice_melt_diags(c) + h2osoi_liq(c,j)/dtime - qflx_glcice_diags(c) = qflx_glcice_daigs(c) - h2osoi_liq(c,j)/dtime + qflx_glcice_melt_diag(c) = qflx_glcice_melt_diag(c) + h2osoi_liq(c,j)/dtime + qflx_glcice_diag(c) = qflx_glcice_diag(c) - h2osoi_liq(c,j)/dtime endif ! liquid water is present endif ! istice_mec diff --git a/components/elm/src/data_types/ColumnDataType.F90 b/components/elm/src/data_types/ColumnDataType.F90 index d74827060d76..fd1a17d74d63 100644 --- a/components/elm/src/data_types/ColumnDataType.F90 +++ b/components/elm/src/data_types/ColumnDataType.F90 @@ -504,7 +504,7 @@ module ColumnDataType real(r8), pointer :: qflx_glcice_melt (:) => null() ! ice melt (positive definite) (mm H2O/s) real(r8), pointer :: qflx_glcice_diag (:) => null() ! net flux of new glacial ice (growth - melt) (mm H2O/s), passed to GLC real(r8), pointer :: qflx_glcice_frz_diag (:) => null() ! ice growth (positive definite) (mm H2O/s) - real(r8), pointer :: qflx_glcice_melt_daig(:) => null() ! ice melt (positive definite) (mm H2O/s) + real(r8), pointer :: qflx_glcice_melt_diag(:) => null() ! ice melt (positive definite) (mm H2O/s) real(r8), pointer :: qflx_drain_vr (:,:) => null() ! liquid water lost as drainage (m /time step) real(r8), pointer :: qflx_h2osfc2topsoi (:) => null() ! liquid water coming from surface standing water top soil (mm H2O/s) real(r8), pointer :: qflx_snow2topsoi (:) => null() ! liquid water coming from residual snow to topsoil (mm H2O/s) @@ -5728,7 +5728,7 @@ subroutine col_wf_init(this, begc, endc) allocate(this%qflx_glcice (begc:endc)) ; this%qflx_glcice (:) = spval allocate(this%qflx_glcice_frz (begc:endc)) ; this%qflx_glcice_frz (:) = spval allocate(this%qflx_glcice_melt (begc:endc)) ; this%qflx_glcice_melt (:) = spval - allocate(this%qflx_glcice_diag (begc:endc)) ; this%qflx_glcice_daig (:) = spval + allocate(this%qflx_glcice_diag (begc:endc)) ; this%qflx_glcice_diag (:) = spval allocate(this%qflx_glcice_frz_diag (begc:endc)) ; this%qflx_glcice_frz_diag (:) = spval allocate(this%qflx_glcice_melt_diag (begc:endc)) ; this%qflx_glcice_melt_diag(:) = spval allocate(this%qflx_drain_vr (begc:endc,1:nlevgrnd)) ; this%qflx_drain_vr (:,:) = spval From e2f149db2d28f3695e2589abadeba4236c6d9af7 Mon Sep 17 00:00:00 2001 From: Chloe Date: Mon, 7 Oct 2024 18:00:53 -0700 Subject: [PATCH 10/16] debugging QICE --- components/elm/src/biogeophys/HydrologyDrainageMod.F90 | 3 +++ components/elm/src/biogeophys/SoilTemperatureMod.F90 | 4 ++++ components/elm/src/main/elm_driver.F90 | 3 +++ 3 files changed, 10 insertions(+) diff --git a/components/elm/src/biogeophys/HydrologyDrainageMod.F90 b/components/elm/src/biogeophys/HydrologyDrainageMod.F90 index 753448aae35f..eafd47da99dc 100755 --- a/components/elm/src/biogeophys/HydrologyDrainageMod.F90 +++ b/components/elm/src/biogeophys/HydrologyDrainageMod.F90 @@ -217,6 +217,7 @@ subroutine HydrologyDrainage(bounds, & do c = bounds%begc,bounds%endc qflx_glcice_frz(c) = 0._r8 + qflx_glcice_frz_diag(c) = 0._r8 end do do fc = 1,num_do_smb_c c = filter_do_smb_c(fc) @@ -233,6 +234,8 @@ subroutine HydrologyDrainage(bounds, & if (lun_pp%itype(l)==istice) then qflx_glcice_frz_diag(c) = qflx_snwcp_ice(c) qflx_glcice_diag(c) = qflx_glcice_diag(c) + qflx_glcice_frz_diag(c) + !write(iulog,*) 'CAW lun_pp%itype(l)==istice',lun_pp%itype(l)==istice + !write(iulog,*) 'qflx_snwcp_ice(c)',qflx_snwcp_ice(c) endif end do diff --git a/components/elm/src/biogeophys/SoilTemperatureMod.F90 b/components/elm/src/biogeophys/SoilTemperatureMod.F90 index 7610265cbb89..034e186e479b 100644 --- a/components/elm/src/biogeophys/SoilTemperatureMod.F90 +++ b/components/elm/src/biogeophys/SoilTemperatureMod.F90 @@ -1395,6 +1395,7 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, & qflx_snofrz_lyr(c,-nlevsno+1:0) = 0._r8 qflx_snofrz_col(c) = 0._r8 qflx_glcice_melt(c) = 0._r8 + qflx_glcice_melt_diag(c) = 0._r8 qflx_snow_melt(c) = 0._r8 end do @@ -1664,6 +1665,9 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, & ! melting corresponds to a negative ice flux qflx_glcice_melt_diag(c) = qflx_glcice_melt_diag(c) + h2osoi_liq(c,j)/dtime qflx_glcice_diag(c) = qflx_glcice_diag(c) - h2osoi_liq(c,j)/dtime + !write(iulog,*) 'CAW lun_pp%itype(l)==istice',lun_pp%itype(l)==istice + !write(iulog,*) 'CAW j',j + !write(iulog,*) 'CAW h2osoi_liq(c,j) ',h2osoi_liq(c,j) endif ! liquid water is present endif ! istice_mec diff --git a/components/elm/src/main/elm_driver.F90 b/components/elm/src/main/elm_driver.F90 index 51f08bf235c3..18ecae88e37f 100644 --- a/components/elm/src/main/elm_driver.F90 +++ b/components/elm/src/main/elm_driver.F90 @@ -1604,6 +1604,8 @@ subroutine elm_drv_init(bounds, & qflx_glcice => col_wf%qflx_glcice , & ! Output: [real(r8) (:) ] flux of new glacier ice (mm H2O/s) [+ = ice grows] + qflx_glcice_diag => col_wf%qflx_glcice_diag , & ! Output: [real(r8) (:) ] flux of new glacier ice (mm H2O/s) [+ = ice grows] + eflx_bot => col_ef%eflx_bot , & ! Output: [real(r8) (:) ] heat flux from beneath soil/ice column (W/m**2) cisun_z => photosyns_vars%cisun_z_patch , & ! Output: [real(r8) (:) ] intracellular sunlit leaf CO2 (Pa) @@ -1637,6 +1639,7 @@ subroutine elm_drv_init(bounds, & ! Initialize qflx_glcice everywhere, to zero. qflx_glcice(c) = 0._r8 + qflx_glcice_diag(c) = 0._r8 end do From a4376cce41a3f19a0a60b974bc2df6e43b1e287f Mon Sep 17 00:00:00 2001 From: Chloe Date: Tue, 8 Oct 2024 09:31:37 -0700 Subject: [PATCH 11/16] removed debugging write statements --- components/elm/src/biogeophys/HydrologyDrainageMod.F90 | 2 -- components/elm/src/biogeophys/SoilTemperatureMod.F90 | 3 --- 2 files changed, 5 deletions(-) diff --git a/components/elm/src/biogeophys/HydrologyDrainageMod.F90 b/components/elm/src/biogeophys/HydrologyDrainageMod.F90 index eafd47da99dc..ea31ca6fd302 100755 --- a/components/elm/src/biogeophys/HydrologyDrainageMod.F90 +++ b/components/elm/src/biogeophys/HydrologyDrainageMod.F90 @@ -234,8 +234,6 @@ subroutine HydrologyDrainage(bounds, & if (lun_pp%itype(l)==istice) then qflx_glcice_frz_diag(c) = qflx_snwcp_ice(c) qflx_glcice_diag(c) = qflx_glcice_diag(c) + qflx_glcice_frz_diag(c) - !write(iulog,*) 'CAW lun_pp%itype(l)==istice',lun_pp%itype(l)==istice - !write(iulog,*) 'qflx_snwcp_ice(c)',qflx_snwcp_ice(c) endif end do diff --git a/components/elm/src/biogeophys/SoilTemperatureMod.F90 b/components/elm/src/biogeophys/SoilTemperatureMod.F90 index 034e186e479b..927c0aac3056 100644 --- a/components/elm/src/biogeophys/SoilTemperatureMod.F90 +++ b/components/elm/src/biogeophys/SoilTemperatureMod.F90 @@ -1665,9 +1665,6 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, & ! melting corresponds to a negative ice flux qflx_glcice_melt_diag(c) = qflx_glcice_melt_diag(c) + h2osoi_liq(c,j)/dtime qflx_glcice_diag(c) = qflx_glcice_diag(c) - h2osoi_liq(c,j)/dtime - !write(iulog,*) 'CAW lun_pp%itype(l)==istice',lun_pp%itype(l)==istice - !write(iulog,*) 'CAW j',j - !write(iulog,*) 'CAW h2osoi_liq(c,j) ',h2osoi_liq(c,j) endif ! liquid water is present endif ! istice_mec From 056c884bbf6f8d7ffc67c30a71131fe9704de704 Mon Sep 17 00:00:00 2001 From: Chloe Date: Tue, 15 Oct 2024 10:18:58 -0700 Subject: [PATCH 12/16] move QICE_FRZ diag calc outside of do_smb loop --- components/elm/src/biogeophys/HydrologyDrainageMod.F90 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/elm/src/biogeophys/HydrologyDrainageMod.F90 b/components/elm/src/biogeophys/HydrologyDrainageMod.F90 index ea31ca6fd302..5512dcc8e51e 100755 --- a/components/elm/src/biogeophys/HydrologyDrainageMod.F90 +++ b/components/elm/src/biogeophys/HydrologyDrainageMod.F90 @@ -218,6 +218,11 @@ subroutine HydrologyDrainage(bounds, & do c = bounds%begc,bounds%endc qflx_glcice_frz(c) = 0._r8 qflx_glcice_frz_diag(c) = 0._r8 + + if (lun_pp%itype(l)==istice .and. qflx_snwcp_ice(c) > 0.0_r8) then + qflx_glcice_frz_diag(c) = qflx_snwcp_ice(c) + qflx_glcice_diag(c) = qflx_glcice_diag(c) + qflx_glcice_frz_diag(c) + endif end do do fc = 1,num_do_smb_c c = filter_do_smb_c(fc) From f3e864b478fd4181e4113c57aec0f7463bffd806 Mon Sep 17 00:00:00 2001 From: Chloe Date: Tue, 15 Oct 2024 13:15:17 -0700 Subject: [PATCH 13/16] remove old QICE diag field calc from do_smb loop --- components/elm/src/biogeophys/HydrologyDrainageMod.F90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/elm/src/biogeophys/HydrologyDrainageMod.F90 b/components/elm/src/biogeophys/HydrologyDrainageMod.F90 index 5512dcc8e51e..8356449be1a6 100755 --- a/components/elm/src/biogeophys/HydrologyDrainageMod.F90 +++ b/components/elm/src/biogeophys/HydrologyDrainageMod.F90 @@ -236,10 +236,10 @@ subroutine HydrologyDrainage(bounds, & if (glc_dyn_runoff_routing(g)) qflx_snwcp_ice(c) = 0._r8 end if - if (lun_pp%itype(l)==istice) then - qflx_glcice_frz_diag(c) = qflx_snwcp_ice(c) - qflx_glcice_diag(c) = qflx_glcice_diag(c) + qflx_glcice_frz_diag(c) - endif + !if (lun_pp%itype(l)==istice) then + ! qflx_glcice_frz_diag(c) = qflx_snwcp_ice(c) + ! qflx_glcice_diag(c) = qflx_glcice_diag(c) + qflx_glcice_frz_diag(c) + !endif end do From da0ce9d0e23d513877167afd8646bda0268ad797 Mon Sep 17 00:00:00 2001 From: Chloe Date: Sat, 19 Oct 2024 10:44:53 -0700 Subject: [PATCH 14/16] seg fault bug fix when snow mass is very low --- components/elm/src/biogeophys/SnowHydrologyMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/elm/src/biogeophys/SnowHydrologyMod.F90 b/components/elm/src/biogeophys/SnowHydrologyMod.F90 index f9270289d05d..49503da8ad8c 100644 --- a/components/elm/src/biogeophys/SnowHydrologyMod.F90 +++ b/components/elm/src/biogeophys/SnowHydrologyMod.F90 @@ -670,7 +670,7 @@ subroutine SnowCompaction(bounds, num_snowc, filter_snowc, & if (bi > dm) ddz1 = ddz1*exp(-46.0e-3_r8*(bi-dm)) else ddz1_fresh = (-grav * (burden(c) + wx/2._r8)) / & - (0.007_r8 * bi**(4.75_r8 + td/40._r8)) + (0.007_r8 * min(max(bi,dm),denice)**(4.75_r8 + min(td,0._r8)/40._r8)) snw_ssa = 3.e6_r8 / (denice * snw_rds(c,j)) if (snw_ssa < 50._r8) then ddz1_fresh = ddz1_fresh * exp(-46.e-2_r8 * (50._r8 - snw_ssa)) From 55f2a364f7b6c6000c7483a235a1445ee8a03018 Mon Sep 17 00:00:00 2001 From: Chloe Date: Fri, 15 Nov 2024 13:05:50 -0800 Subject: [PATCH 15/16] comment and white space changes --- components/elm/src/biogeophys/BalanceCheckMod.F90 | 2 +- .../elm/src/biogeophys/HydrologyDrainageMod.F90 | 12 +++--------- components/elm/src/biogeophys/SoilTemperatureMod.F90 | 1 + 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/components/elm/src/biogeophys/BalanceCheckMod.F90 b/components/elm/src/biogeophys/BalanceCheckMod.F90 index 48144b045e96..7737f2adbe3d 100755 --- a/components/elm/src/biogeophys/BalanceCheckMod.F90 +++ b/components/elm/src/biogeophys/BalanceCheckMod.F90 @@ -167,7 +167,7 @@ subroutine ColWaterBalanceCheck( bounds, num_do_smb_c, filter_do_smb_c, & use elm_varcon , only : spval use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall use column_varcon , only : icol_road_perv, icol_road_imperv - use landunit_varcon , only : istice_mec, istice, istdlak, istsoil,istcrop,istwet + use landunit_varcon , only : istice_mec, istdlak, istsoil,istcrop,istwet use elm_varctl , only : create_glacier_mec_landunit use elm_initializeMod , only : surfalb_vars use CanopyStateType , only : canopystate_type diff --git a/components/elm/src/biogeophys/HydrologyDrainageMod.F90 b/components/elm/src/biogeophys/HydrologyDrainageMod.F90 index 8356449be1a6..fbd4d8e2b6f3 100755 --- a/components/elm/src/biogeophys/HydrologyDrainageMod.F90 +++ b/components/elm/src/biogeophys/HydrologyDrainageMod.F90 @@ -231,16 +231,10 @@ subroutine HydrologyDrainage(bounds, & ! In the following, we convert glc_snow_persistence_max_days to r8 to avoid overflow if ( (snow_persistence(c) >= (real(glc_snow_persistence_max_days, r8) * secspday)) & .or. lun_pp%itype(l) == istice_mec ) then - qflx_glcice_frz(c) = qflx_snwcp_ice(c) - qflx_glcice(c) = qflx_glcice(c) + qflx_glcice_frz(c) - if (glc_dyn_runoff_routing(g)) qflx_snwcp_ice(c) = 0._r8 + qflx_glcice_frz(c) = qflx_snwcp_ice(c) + qflx_glcice(c) = qflx_glcice(c) + qflx_glcice_frz(c) + if (glc_dyn_runoff_routing(g)) qflx_snwcp_ice(c) = 0._r8 end if - - !if (lun_pp%itype(l)==istice) then - ! qflx_glcice_frz_diag(c) = qflx_snwcp_ice(c) - ! qflx_glcice_diag(c) = qflx_glcice_diag(c) + qflx_glcice_frz_diag(c) - !endif - end do ! Determine wetland and land ice hydrology (must be placed here diff --git a/components/elm/src/biogeophys/SoilTemperatureMod.F90 b/components/elm/src/biogeophys/SoilTemperatureMod.F90 index 927c0aac3056..451b3cbccf22 100644 --- a/components/elm/src/biogeophys/SoilTemperatureMod.F90 +++ b/components/elm/src/biogeophys/SoilTemperatureMod.F90 @@ -1646,6 +1646,7 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, & ! as computed in HydrologyDrainageMod.F90. l = col_pp%landunit(c) + if ( lun_pp%itype(l)==istice_mec) then if (j>=1 .and. h2osoi_liq(c,j) > 0._r8) then ! ice layer with meltwater ! melting corresponds to a negative ice flux From d98b0997b4db7d4e8594067f4a58258034e44f75 Mon Sep 17 00:00:00 2001 From: Chloe Date: Mon, 25 Nov 2024 13:46:53 -0800 Subject: [PATCH 16/16] mods to QICE long name --- components/elm/src/data_types/ColumnDataType.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/elm/src/data_types/ColumnDataType.F90 b/components/elm/src/data_types/ColumnDataType.F90 index fd1a17d74d63..460a1f715779 100644 --- a/components/elm/src/data_types/ColumnDataType.F90 +++ b/components/elm/src/data_types/ColumnDataType.F90 @@ -5852,17 +5852,17 @@ subroutine col_wf_init(this, begc, endc) if (create_glacier_mec_landunit) then this%qflx_glcice(begc:endc) = spval call hist_addfld1d (fname='QICE', units='mm/s', & - avgflag='A', long_name='ice growth/melt', & + avgflag='A', long_name='ice growth/melt (with active GLC/MECs)', & ptr_col=this%qflx_glcice, l2g_scale_type='ice') this%qflx_glcice_frz(begc:endc) = spval call hist_addfld1d (fname='QICE_FRZ', units='mm/s', & - avgflag='A', long_name='ice growth', & + avgflag='A', long_name='ice growth (with active GLC/MECs)', & ptr_col=this%qflx_glcice_frz, l2g_scale_type='ice') this%qflx_glcice_melt(begc:endc) = spval call hist_addfld1d (fname='QICE_MELT', units='mm/s', & - avgflag='A', long_name='ice melt', & + avgflag='A', long_name='ice melt (with active GLC/MECs)', & ptr_col=this%qflx_glcice_melt, l2g_scale_type='ice') else this%qflx_glcice_diag(begc:endc) = spval