Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix water balance error associated with transpiration #444

Merged
Merged
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
11 changes: 10 additions & 1 deletion build/source/engine/varSubstep.f90
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,17 @@ subroutine varSubstep(&
ixMax=ubound(flux_data%var(iVar)%dat)
do ixLayer=ixMin(1),ixMax(1)
if(fluxMask%var(iVar)%dat(ixLayer)) then
flux_data%var(iVar)%dat(ixLayer) = flux_data%var(iVar)%dat(ixLayer) + flux_temp%var(iVar)%dat(ixLayer)*dt_wght

! special case of the transpiration sink from soil layers: only computed for the top soil layer
if(iVar==iLookFlux%mLayerTranspire)then
if(ixLayer==1) flux_data%var(iVar)%dat(:) = flux_data%var(iVar)%dat(:) + flux_temp%var(iVar)%dat(:)*dt_wght

! standard case
else
flux_data%var(iVar)%dat(ixLayer) = flux_data%var(iVar)%dat(ixLayer) + flux_temp%var(iVar)%dat(ixLayer)*dt_wght
endif
fluxCount%var(iVar)%dat(ixLayer) = fluxCount%var(iVar)%dat(ixLayer) + 1

endif
end do
endif ! (domain splitting)
Expand Down