Skip to content

Commit

Permalink
Print small snocan values after each snocan state update
Browse files Browse the repository at this point in the history
  • Loading branch information
billsacks committed Apr 4, 2024
1 parent ef7a7f2 commit eff1138
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/biogeophys/CanopyFluxesMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1607,6 +1607,9 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
! In this case, all liqcan will evap. Take remainder from snocan
snocan(p) = max(0._r8, &
snocan(p) + liqcan(p) + (qflx_tran_veg(p) - qflx_evap_veg(p)) * dtime)
if (snocan(p) > 0 .and. snocan(p) < 1.e-290_r8) then
write(iulog,*) 'WJS: tiny snocan: update dew, if: p, snocan = ', p, snocan(p)
end if
end if
liqcan(p) = max(0._r8,liqcan(p)+(qflx_tran_veg(p)-qflx_evap_veg(p))*dtime)

Expand All @@ -1616,6 +1619,9 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
liqcan(p)=liqcan(p)+snocan(p)+(qflx_tran_veg(p)-qflx_evap_veg(p))*dtime
end if
snocan(p) = max(0._r8,snocan(p)+(qflx_tran_veg(p)-qflx_evap_veg(p))*dtime)
if (snocan(p) > 0 .and. snocan(p) < 1.e-290_r8) then
write(iulog,*) 'WJS: tiny snocan: update dew, else: p, snocan = ', p, snocan(p)
end if
end if

end do
Expand Down
9 changes: 9 additions & 0 deletions src/biogeophys/CanopyHydrologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,9 @@ subroutine UpdateState_AddInterceptionToCanopy(bounds, num_soilp, filter_soilp,
p = filter_soilp(fp)

snocan(p) = max(0._r8, snocan(p) + dtime * qflx_intercepted_snow(p))
if (snocan(p) > 0 .and. snocan(p) < 1.e-290_r8) then
write(iulog,*) 'WJS: tiny snocan: AddInterceptionToCanopy: p, snocan = ', p, snocan(p)
end if
liqcan(p) = max(0._r8, liqcan(p) + dtime * qflx_intercepted_liq(p))
end do

Expand Down Expand Up @@ -873,6 +876,9 @@ subroutine UpdateState_RemoveCanfallFromCanopy(bounds, num_soilp, filter_soilp,

liqcan(p) = liqcan(p) - dtime * qflx_liqcanfall(p)
snocan(p) = snocan(p) - dtime * qflx_snocanfall(p)
if (snocan(p) > 0 .and. snocan(p) < 1.e-290_r8) then
write(iulog,*) 'WJS: tiny snocan: RemoveCanfallFromCanopy: p, snocan = ', p, snocan(p)
end if
end do

! If states were supposed to go to 0 but instead ended up near-0 (positive or
Expand Down Expand Up @@ -1040,6 +1046,9 @@ subroutine UpdateState_RemoveSnowUnloading(bounds, num_soilp, filter_soilp, dtim
else
snocan(p) = snocan(p) - qflx_snow_unload(p) * dtime
end if
if (snocan(p) > 0 .and. snocan(p) < 1.e-290_r8) then
write(iulog,*) 'WJS: tiny snocan: RemoveSnowUnloading: p, snocan = ', p, snocan(p)
end if
end do

end subroutine UpdateState_RemoveSnowUnloading
Expand Down

0 comments on commit eff1138

Please sign in to comment.