Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 8 additions & 8 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,7 +113,7 @@ 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)
frac_sno_albedo => waterdiagnosticbulk_inst%frac_sno_albedo_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)

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 (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
4 changes: 2 additions & 2 deletions src/biogeochem/DustEmisZender2003.F90
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,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 (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 @@ -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
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 (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
20 changes: 10 additions & 10 deletions src/biogeophys/BalanceCheckMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,8 @@ subroutine BalanceCheck( bounds, &
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)
frac_sno_fluxes => waterdiagnosticbulk_inst%frac_sno_fluxes_col , & ! Input: [real(r8) (:) ] effective snow fraction
frac_sno_albedo => waterdiagnosticbulk_inst%frac_sno_albedo_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)
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
Expand Down Expand Up @@ -771,9 +771,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 @@ -783,10 +783,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 @@ -823,7 +823,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 @@ -908,7 +908,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 (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 @@ -1077,8 +1077,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
10 changes: 5 additions & 5 deletions src/biogeophys/BiogeophysPreFluxCalcsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ subroutine CalcInitialTemperatureAndEnergyVars(bounds, &
elai => canopystate_inst%elai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index with burying by snow
esai => canopystate_inst%esai_patch , & ! Input: [real(r8) (:) ] one-sided stem area index with burying by snow
forc_hgt_t_patch => frictionvel_inst%forc_hgt_t_patch , & ! Input: [real(r8) (:) ] observational height of temperature at patch level [m]
frac_sno_eff => waterdiagnosticbulk_inst%frac_sno_eff_col , & ! Input: [real(r8) (:) ] eff. fraction of ground covered by snow (0 to 1)
frac_sno => waterdiagnosticbulk_inst%frac_sno_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1)
frac_sno_fluxes => waterdiagnosticbulk_inst%frac_sno_fluxes_col , & ! Input: [real(r8) (:) ] eff. 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 (0 to 1)
frac_h2osfc => waterdiagnosticbulk_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1)
h2osoi_ice => waterstatebulk_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2)
h2osoi_liq => waterstatebulk_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2)
Expand Down Expand Up @@ -332,8 +332,8 @@ subroutine CalcInitialTemperatureAndEnergyVars(bounds, &

! ground temperature is weighted average of exposed soil, snow, and h2osfc
if (snl(c) < 0) then
t_grnd(c) = frac_sno_eff(c) * t_soisno(c,snl(c)+1) &
+ (1.0_r8 - frac_sno_eff(c) - frac_h2osfc(c)) * t_soisno(c,1) &
t_grnd(c) = frac_sno_fluxes(c) * t_soisno(c,snl(c)+1) &
+ (1.0_r8 - frac_sno_fluxes(c) - frac_h2osfc(c)) * t_soisno(c,1) &
+ frac_h2osfc(c) * t_h2osfc(c)
else
t_grnd(c) = (1 - frac_h2osfc(c)) * t_soisno(c,1) + frac_h2osfc(c) * t_h2osfc(c)
Expand All @@ -345,7 +345,7 @@ subroutine CalcInitialTemperatureAndEnergyVars(bounds, &
if (lun%itype(l)==istice) then
emg(c) = 0.97_r8
else
emg(c) = (1._r8-frac_sno(c))*0.96_r8 + frac_sno(c)*0.97_r8
emg(c) = (1._r8-frac_sno_albedo(c))*0.96_r8 + frac_sno_albedo(c)*0.97_r8
end if
end if

Expand Down
Loading
Loading