Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
444d2e1
refactor(biogeophys): Fix mismatched associate aliases for frac_sno_eff
Aug 26, 2026
450531d
refactor(biogeophys): Rename frac_sno to frac_sno_albedo and frac_sno…
Aug 26, 2026
d820749
fix(biogeophys): Correct snow layer division variable usage in SnowHy…
Sep 2, 2026
8b3f65d
Merge branch 'upstream/b4b-dev' into issue822-rename-frac-sno
Sep 4, 2026
afc7b00
Address review feedback on PR #4185 (Snow cover fraction variable ren…
Sep 9, 2026
e8d192c
fix(biogeophys): align BalanceCheckMod log output string and reset fa…
Sep 10, 2026
9bb86ea
Merge branch 'upstream/b4b-dev' into issue822-rename-frac-sno
Sep 10, 2026
106ce6a
fix(biogeophys): update WaterDiagnosticBulkType long_name attributes …
Sep 10, 2026
ce95b87
hand-edited 64 diffs, as part of manual review of all ~200 diffs
Sep 11, 2026
e7c1b5a
standardized scientist-provided flux/albedo comments across all frac_…
Sep 12, 2026
e09b58e
refactor(biogeophys): rename 3 fsno* variables to conform with frac_s…
Sep 12, 2026
4a41fb8
Realigned some associated statements
olyson Sep 15, 2026
4fd8f9a
Revert to fsno_dl as effective means something different here
olyson Sep 16, 2026
9e8e9f8
Revert to generic frac_sno for this function
olyson Sep 16, 2026
ea43737
Revert to original variable name
olyson Sep 16, 2026
99ac1bf
Update comment
olyson Sep 16, 2026
6d00000
Merge branch 'b4b-dev' into issue822-rename-frac-sno
olyson Sep 16, 2026
68da4f1
Merge branch 'b4b-dev' into issue822-rename-frac-sno
olyson Sep 17, 2026
40e395d
Resolve conflict
olyson Sep 22, 2026
d90b550
Update modules
olyson Sep 22, 2026
eb4dedf
Merge remote-tracking branch 'refs/remotes/johnpaulalex/issue822-rena…
olyson Sep 22, 2026
3578002
Update modules
olyson Sep 22, 2026
060abc3
Merge branch 'b4b-dev' into issue822-rename-frac-sno
olyson Sep 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/biogeochem/CNVegStructUpdateMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ subroutine CNVegStructUpdate(bounds,num_soilp, filter_soilp, &
real(r8) :: tsai_min ! PATCH derived minimum tsai
real(r8) :: tsai_alpha ! monthly decay rate of tsai
real(r8) :: dt ! radiation time step (sec)
real(r8) :: frac_sno_adjusted ! frac_sno adjusted per frac_sno_threshold
real(r8) :: frac_sno_albedo_adjusted ! frac_sno_albedo adjusted per frac_sno_albedo_threshold

real(r8), parameter :: dtsmonth = 2592000._r8 ! number of seconds in a 30 day month (60x60x24x30)
real(r8), parameter :: frac_sno_threshold = 0.999_r8 ! frac_sno values greater than this are treated as 1
real(r8), parameter :: frac_sno_albedo_threshold = 0.999_r8 ! frac_sno_albedo values greater than this are treated as 1
!-----------------------------------------------------------------------
! tsai formula from Zeng et. al. 2002, Journal of Climate, p1835
!
Expand Down Expand Up @@ -113,8 +113,8 @@ subroutine CNVegStructUpdate(bounds,num_soilp, filter_soilp, &
nind => dgvs_inst%nind_patch , & ! Input: [real(r8) (:) ] number of individuals (#/m**2)
fpcgrid => dgvs_inst%fpcgrid_patch , & ! Input: [real(r8) (:) ] fractional area of patch (pft area/nat veg area)

frac_sno => waterdiagnosticbulk_inst%frac_sno_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1)
snow_depth => waterdiagnosticbulk_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m)
frac_sno_albedo => waterdiagnosticbulk_inst%frac_sno_albedo_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow for albedo calculations (0 to 1)
snow_depth => waterdiagnosticbulk_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m)

forc_hgt_u_patch => frictionvel_inst%forc_hgt_u_patch , & ! Input: [real(r8) (:) ] observational height of wind at patch-level [m]

Expand Down Expand Up @@ -304,15 +304,15 @@ subroutine CNVegStructUpdate(bounds,num_soilp, filter_soilp, &
!depth of snow required for complete burial of grasses
endif

if (frac_sno(c) <= frac_sno_threshold) then
frac_sno_adjusted = frac_sno(c)
if (frac_sno_albedo(c) <= frac_sno_albedo_threshold) then
frac_sno_albedo_adjusted = frac_sno_albedo(c)
else
! avoid tiny but non-zero elai and esai that can cause radiation and/or photosynthesis code to blow up
frac_sno_adjusted = 1._r8
frac_sno_albedo_adjusted = 1._r8
end if

elai(p) = max(tlai(p)*(1.0_r8 - frac_sno_adjusted) + tlai(p)*fb*frac_sno_adjusted, 0.0_r8)
esai(p) = max(tsai(p)*(1.0_r8 - frac_sno_adjusted) + tsai(p)*fb*frac_sno_adjusted, 0.0_r8)
elai(p) = max(tlai(p)*(1.0_r8 - frac_sno_albedo_adjusted) + tlai(p)*fb*frac_sno_albedo_adjusted, 0.0_r8)
esai(p) = max(tsai(p)*(1.0_r8 - frac_sno_albedo_adjusted) + tsai(p)*fb*frac_sno_albedo_adjusted, 0.0_r8)

! Fraction of vegetation free of snow
if ((elai(p) + esai(p)) > 0._r8) then
Expand Down
4 changes: 2 additions & 2 deletions src/biogeochem/DustEmisLeung2023.F90
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ subroutine DustEmission (this, bounds, &
tlai => canopystate_inst%tlai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index, no burying by snow
tsai => canopystate_inst%tsai_patch , & ! Input: [real(r8) (:) ] one-sided stem area index, no burying by snow

frac_sno => waterdiagnosticbulk_inst%frac_sno_col, & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1)
frac_sno_albedo => waterdiagnosticbulk_inst%frac_sno_albedo_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow for albedo calculations (0 to 1)
h2osoi_vol => waterstatebulk_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat)
h2osoi_liq => waterstatebulk_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid soil water (kg/m2)
h2osoi_ice => waterstatebulk_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] frozen soil water (kg/m2)
Expand Down Expand Up @@ -516,7 +516,7 @@ subroutine DustEmission (this, bounds, &
else
lnd_frc_mbl(p) = 0.0_r8
endif
lnd_frc_mbl(p) = lnd_frc_mbl(p) * (1.0_r8 - frac_sno(c))
lnd_frc_mbl(p) = lnd_frc_mbl(p) * (1.0_r8 - frac_sno_albedo(c))
else
lnd_frc_mbl(p) = 0.0_r8
end if
Expand Down
12 changes: 6 additions & 6 deletions src/biogeochem/DustEmisZender2003.F90
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,10 @@ subroutine DustEmission (this, bounds, &
tlai => canopystate_inst%tlai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index, no burying by snow
tsai => canopystate_inst%tsai_patch , & ! Input: [real(r8) (:) ] one-sided stem area index, no burying by snow

frac_sno => waterdiagnosticbulk_inst%frac_sno_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1)
h2osoi_vol => waterstatebulk_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat)
h2osoi_liq => waterstatebulk_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid soil water (kg/m2)
h2osoi_ice => waterstatebulk_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] frozen soil water (kg/m2)
frac_sno_albedo => waterdiagnosticbulk_inst%frac_sno_albedo_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow for albedo calculations (0 to 1)
h2osoi_vol => waterstatebulk_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat)
h2osoi_liq => waterstatebulk_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid soil water (kg/m2)
h2osoi_ice => waterstatebulk_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] frozen soil water (kg/m2)

fv => frictionvel_inst%fv_patch , & ! Input: [real(r8) (:) ] friction velocity (m/s) (for dust model)
u10 => frictionvel_inst%u10_patch , & ! Input: [real(r8) (:) ] 10-m wind (m/s) (created for dust model)
Expand Down Expand Up @@ -318,7 +318,7 @@ subroutine DustEmission (this, bounds, &
else
lnd_frc_mbl(p) = 0.0_r8
endif
lnd_frc_mbl(p) = lnd_frc_mbl(p) * (1.0_r8 - frac_sno(c))
lnd_frc_mbl(p) = lnd_frc_mbl(p) * (1.0_r8 - frac_sno_albedo(c))
else
lnd_frc_mbl(p) = 0.0_r8
end if
Expand Down Expand Up @@ -467,4 +467,4 @@ end subroutine DustEmission

!------------------------------------------------------------------------

end module DustEmisZender2003
end module DustEmisZender2003
6 changes: 3 additions & 3 deletions src/biogeochem/SatellitePhenologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ subroutine UpdateSatellitePhenologyCanopy(bounds, num_filter, filter, &
end if

associate( &
frac_sno => waterdiagnosticbulk_inst%frac_sno_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1)
frac_sno_albedo => waterdiagnosticbulk_inst%frac_sno_albedo_col, & ! Input: [real(r8) (:) ] fraction of ground covered by snow for albedo calculations (0 to 1)
snow_depth => waterdiagnosticbulk_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m)
tlai_driver => canopystate_inst%tlai_input_patch , & ! Input: [real(r8) (:) ] SP driver data for one-sided leaf area index, no burying by snow
tsai_driver => canopystate_inst%tsai_input_patch , & ! Input: [real(r8) (:) ] SP driver data for one-sided stem area index, no burying by snow
Expand Down Expand Up @@ -245,8 +245,8 @@ subroutine UpdateSatellitePhenologyCanopy(bounds, num_filter, filter, &
fb = 1._r8 - (max(min(snow_depth(c),max(0.05,htop(p)*0.8_r8)),0._r8)/(max(0.05,htop(p)*0.8_r8)))
endif

elai(p) = max(tlai(p)*(1.0_r8 - frac_sno(c)) + tlai(p)*fb*frac_sno(c), 0.0_r8)
esai(p) = max(tsai(p)*(1.0_r8 - frac_sno(c)) + tsai(p)*fb*frac_sno(c), 0.0_r8)
elai(p) = max(tlai(p)*(1.0_r8 - frac_sno_albedo(c)) + tlai(p)*fb*frac_sno_albedo(c), 0.0_r8)
esai(p) = max(tsai(p)*(1.0_r8 - frac_sno_albedo(c)) + tsai(p)*fb*frac_sno_albedo(c), 0.0_r8)
if (elai(p) < 0.05_r8) elai(p) = 0._r8
if (esai(p) < 0.05_r8) esai(p) = 0._r8

Expand Down
4 changes: 2 additions & 2 deletions src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ contains
real(r8) :: flx_mss_vrt_dst_tot

call this%input%create_atm2lnd()
this%input%water_inst%waterdiagnosticbulk_inst%frac_sno_col(:) = 1.0_r8
this%input%water_inst%waterdiagnosticbulk_inst%frac_sno_albedo_col(:) = 1.0_r8
call this%input%create_fv( )
call this%dust_emis%DustEmission(bounds, this%input%num_nolakep, this%input%filter_nolakep, this%input%atm2lnd_inst, &
this%input%soilstate_inst, this%input%canopystate_inst, this%input%water_inst%waterstatebulk_inst, &
Expand Down Expand Up @@ -208,7 +208,7 @@ contains
call this%input%create_atm2lnd()
call this%input%create_fv( )
! Dust should abort with an error on dust mobility when snow fraction greater than 1
this%input%water_inst%waterdiagnosticbulk_inst%frac_sno_col(:) = 1.0_r8 + 1.e-15_r8
this%input%water_inst%waterdiagnosticbulk_inst%frac_sno_albedo_col(:) = 1.0_r8 + 1.e-15_r8
call this%dust_emis%DustEmission(bounds, this%input%num_nolakep, this%input%filter_nolakep, this%input%atm2lnd_inst, &
this%input%soilstate_inst, this%input%canopystate_inst, this%input%water_inst%waterstatebulk_inst, &
this%input%water_inst%waterdiagnosticbulk_inst, this%input%frictionvel_inst)
Expand Down
4 changes: 2 additions & 2 deletions src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ contains
real(r8) :: flx_mss_vrt_dst_tot

call this%input%create_atm2lnd()
this%input%water_inst%waterdiagnosticbulk_inst%frac_sno_col(:) = 1.0_r8
this%input%water_inst%waterdiagnosticbulk_inst%frac_sno_albedo_col(:) = 1.0_r8
call this%input%create_fv( )
call this%dust_emis%DustEmission(bounds, this%input%num_nolakep, this%input%filter_nolakep, this%input%atm2lnd_inst, &
this%input%soilstate_inst, this%input%canopystate_inst, this%input%water_inst%waterstatebulk_inst, &
Expand Down Expand Up @@ -207,7 +207,7 @@ contains
call this%input%create_atm2lnd()
call this%input%create_fv( )
! Dust should abort with an error on dust mobility when snow fraction greater than 1
this%input%water_inst%waterdiagnosticbulk_inst%frac_sno_col(:) = 1.0_r8 + 1.e-15_r8
this%input%water_inst%waterdiagnosticbulk_inst%frac_sno_albedo_col(:) = 1.0_r8 + 1.e-15_r8
call this%dust_emis%DustEmission(bounds, this%input%num_nolakep, this%input%filter_nolakep, this%input%atm2lnd_inst, &
this%input%soilstate_inst, this%input%canopystate_inst, this%input%water_inst%waterstatebulk_inst, &
this%input%water_inst%waterdiagnosticbulk_inst, this%input%frictionvel_inst)
Expand Down
24 changes: 12 additions & 12 deletions src/biogeophys/BalanceCheckMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -489,10 +489,10 @@ subroutine BalanceCheck( bounds, &
forc_snow => wateratm2lnd_inst%forc_snow_downscaled_col , & ! Input: [real(r8) (:) ] column level snow rate [mm/s]
forc_snow_grc => wateratm2lnd_inst%forc_snow_not_downscaled_grc, & ! Input: [real(r8) (:) ] grid cell-level snow rate [mm/s]

h2osno_old => waterbalance_inst%h2osno_old_col , & ! Input: [real(r8) (:) ] snow water (mm H2O) at previous time step
frac_sno_eff => waterdiagnosticbulk_inst%frac_sno_eff_col , & ! Input: [real(r8) (:) ] effective snow fraction
frac_sno => waterdiagnosticbulk_inst%frac_sno_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1)
snow_depth => waterdiagnosticbulk_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m)
h2osno_old => waterbalance_inst%h2osno_old_col , & ! Input: [real(r8) (:) ] snow water (mm H2O) at previous time step
frac_sno_fluxes => waterdiagnosticbulk_inst%frac_sno_fluxes_col, & ! Input: [real(r8) (:) ] fraction of ground covered by snow for heat flux calculations (0 to 1)
frac_sno_albedo => waterdiagnosticbulk_inst%frac_sno_albedo_col, & ! Input: [real(r8) (:) ] fraction of ground covered by snow for albedo calculations (0 to 1)
snow_depth => waterdiagnosticbulk_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m)
begwb_grc => waterbalance_inst%begwb_grc , & ! Input: [real(r8) (:) ] grid cell-level water mass begining of the time step
endwb_grc => waterbalance_inst%endwb_grc , & ! Output: [real(r8) (:) ] grid cell-level water mass end of the time step
begwb_col => waterbalance_inst%begwb_col , & ! Input: [real(r8) (:) ] column-level water mass begining of the time step
Expand Down Expand Up @@ -747,9 +747,9 @@ subroutine BalanceCheck( bounds, &

if (lun%itype(l) == istdlak) then
snow_sources(c) = qflx_snow_grnd_col(c) &
+ frac_sno_eff(c) * (qflx_liq_grnd_col(c) &
+ frac_sno_fluxes(c) * (qflx_liq_grnd_col(c) &
+ qflx_soliddew_to_top_layer(c) + qflx_liqdew_to_top_layer(c) )
snow_sinks(c) = frac_sno_eff(c) * (qflx_solidevap_from_top_layer(c) &
snow_sinks(c) = frac_sno_fluxes(c) * (qflx_solidevap_from_top_layer(c) &
+ qflx_liqevap_from_top_layer(c) ) + qflx_snwcp_ice(c) + qflx_snwcp_liq(c) &
+ qflx_snwcp_discarded_ice_col(c) + qflx_snwcp_discarded_liq_col(c) &
+ qflx_snow_drain(c) + qflx_sl_top_soil(c)
Expand All @@ -759,10 +759,10 @@ subroutine BalanceCheck( bounds, &
lun%itype(l) == istcrop .or. lun%itype(l) == istwet .or. &
lun%itype(l) == istice) then
snow_sources(c) = (qflx_snow_grnd_col(c) - qflx_snow_h2osfc(c) ) &
+ frac_sno_eff(c) * (qflx_liq_grnd_col(c) &
+ frac_sno_fluxes(c) * (qflx_liq_grnd_col(c) &
+ qflx_soliddew_to_top_layer(c) + qflx_liqdew_to_top_layer(c) ) &
+ qflx_h2osfc_to_ice(c)
snow_sinks(c) = frac_sno_eff(c) * (qflx_solidevap_from_top_layer(c) &
snow_sinks(c) = frac_sno_fluxes(c) * (qflx_solidevap_from_top_layer(c) &
+ qflx_liqevap_from_top_layer(c)) + qflx_snwcp_ice(c) + qflx_snwcp_liq(c) &
+ qflx_snwcp_discarded_ice_col(c) + qflx_snwcp_discarded_liq_col(c) &
+ qflx_snow_drain(c) + qflx_sl_top_soil(c)
Expand Down Expand Up @@ -799,7 +799,7 @@ subroutine BalanceCheck( bounds, &
write(iulog,*)'errh2osno = ',errh2osno(indexc)
write(iulog,*)'snl = ',col%snl(indexc)
write(iulog,*)'snow_depth = ',snow_depth(indexc)
write(iulog,*)'frac_sno_eff = ',frac_sno_eff(indexc)
write(iulog,*)'frac_sno_fluxes = ',frac_sno_fluxes(indexc)
write(iulog,*)'h2osno = ',h2osno_total(indexc)
write(iulog,*)'h2osno_old = ',h2osno_old(indexc)
write(iulog,*)'snow_sources = ',snow_sources(indexc)*dtime
Expand Down Expand Up @@ -884,7 +884,7 @@ subroutine EnergyBalanceCheck( bounds, &
forc_solai => atm2lnd_inst%forc_solai_grc , & ! Input: [real(r8) (:,:) ] diffuse radiation (vis=forc_solsd, nir=forc_solld)
forc_lwrad => atm2lnd_inst%forc_lwrad_downscaled_col , & ! Input: [real(r8) (:) ] downward infrared (longwave) radiation (W/m**2)

frac_sno => waterdiagnosticbulk_inst%frac_sno_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1)
frac_sno_albedo => waterdiagnosticbulk_inst%frac_sno_albedo_col, & ! Input: [real(r8) (:) ] fraction of ground covered by snow for albedo calculations (0 to 1)

dhsdt_canopy => energyflux_inst%dhsdt_canopy_patch , & ! Input: [real(r8) (:) ] change in heat content of canopy (W/m**2) [+ to atm]
eflx_lwrad_out => energyflux_inst%eflx_lwrad_out_patch , & ! Input: [real(r8) (:) ] emitted infrared (longwave) radiation (W/m**2)
Expand Down Expand Up @@ -1053,8 +1053,8 @@ subroutine EnergyBalanceCheck( bounds, &
if ( errseb_max_val > error_thresh ) then
write(iulog,*)'CTSM is stopping because errseb > ', error_thresh, ' W/m2'
write(iulog,*)'sabv = ' ,sabv(indexp)
write(iulog,*)'sabg = ' ,sabg(indexp), ((1._r8- frac_sno(indexc))*sabg_soil(indexp) + &
frac_sno(indexc)*sabg_snow(indexp)),sabg_chk(indexp)
write(iulog,*)'sabg = ' ,sabg(indexp), ((1._r8- frac_sno_albedo(indexc))*sabg_soil(indexp) + &
frac_sno_albedo(indexc)*sabg_snow(indexp)),sabg_chk(indexp)
write(iulog,*)'forc_tot = ' ,forc_solad(indexg,1) + forc_solad(indexg,2) + &
forc_solai(indexg,1) + forc_solai(indexg,2)

Expand Down
Loading
Loading