Skip to content

Commit

Permalink
Merge branch 'jinyuntang/lnd-use-fix' (PR #6618)
Browse files Browse the repository at this point in the history
When the land use data is on, at the begining of every year, the model
may crash with N balance error due to including spval value in N leaching
flux update. This update fixes this error by keeping those spval values away
from the N balance.

Fixes #6604

[BFB]
  • Loading branch information
bishtgautam committed Sep 19, 2024
2 parents 81312e9 + e7eb37a commit 4c88cca
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions components/elm/src/data_types/ColumnDataType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7538,14 +7538,16 @@ subroutine col_cf_summary(this, bounds, num_soilc, filter_soilc, isotope)
c = filter_soilc(fc)
this%decomp_cpools_leached(c,l) = 0._r8
end do
do j = 1, nlev
do fc = 1,num_soilc
if(l /= i_cwd)then
do j = 1, nlev
do fc = 1,num_soilc
c = filter_soilc(fc)
this%decomp_cpools_leached(c,l) = &
this%decomp_cpools_leached(c,l) + &
this%decomp_cpools_transport_tendency(c,j,l) * dzsoi_decomp(j)
end do
end do
end do
end do
endif
do fc = 1,num_soilc
c = filter_soilc(fc)
this%som_c_leached(c) = &
Expand Down Expand Up @@ -9784,17 +9786,19 @@ subroutine col_nf_summary(this, bounds, num_soilc, filter_soilc)
c = filter_soilc(fc)
this%decomp_npools_leached(c,l) = 0._r8
end do
do j = 1, nlev
do fc = 1,num_soilc
if(l /= i_cwd)then
do j = 1, nlev
do fc = 1,num_soilc
c = filter_soilc(fc)
this%decomp_npools_leached(c,l) = &
this%decomp_npools_leached(c,l) + &
this%decomp_npools_transport_tendency(c,j,l) * dzsoi_decomp(j)

this%bgc_npool_inputs(c,l) = this%bgc_npool_inputs(c,l) + &
(this%bgc_npool_ext_inputs_vr(c,j,l)-this%bgc_npool_ext_loss_vr(c,j,l))*dzsoi_decomp(j)
end do
end do
end do
end do
endif
do fc = 1,num_soilc
c = filter_soilc(fc)
this%som_n_leached(c) = &
Expand Down Expand Up @@ -11314,16 +11318,16 @@ subroutine col_pf_summary(this, bounds, num_soilc, filter_soilc)
c = filter_soilc(fc)
this%decomp_ppools_leached(c,l) = 0._r8
end do

do j = 1, nlevdecomp
do fc = 1,num_soilc
if(l /= i_cwd)then
do j = 1, nlevdecomp
do fc = 1,num_soilc
c = filter_soilc(fc)
this%decomp_ppools_leached(c,l) = &
this%decomp_ppools_leached(c,l) + &
this%decomp_ppools_transport_tendency(c,j,l) * dzsoi_decomp(j)
end do
end do

end do
end do
endif
do fc = 1,num_soilc
c = filter_soilc(fc)
this%som_p_leached(c) = &
Expand Down

0 comments on commit 4c88cca

Please sign in to comment.