Skip to content

Commit

Permalink
Limit fire btran2 to be <= 1
Browse files Browse the repository at this point in the history
For the older version calculated in CNFireBaseMod, btran2 could
sometimes be roundoff-level greater than 1. Due to a conditional in
CNFireArea, these slightly-greater-than-1 values were being ignored when
computing btran_col, rather than averaging in a 1 value.

I haven't investigated the behavior in the new version in
CNFireLi2021Mod, but it seems like this could have the same issue. It's
also possible, though, that we'd exceed 1 by more than roundoff in that
version under some conditions, if h2osoi_vol > watsat in some
layers. The endrun call will tell us if that's happening. Note that I
plan to remove the endrun call after initial testing, because it seems
like the correct thing to do here is to limit the btran2 value to be no
more than 1 even if it exceeds 1 by more than roundoff.
  • Loading branch information
billsacks committed Oct 2, 2020
1 parent b1cf8b9 commit 4291f06
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/biogeochem/CNFireBaseMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,19 @@ subroutine CNFire_calc_fire_root_wetness( this, bounds, num_exposedvegp, filter_
(smpso(patch%itype(p)) - smpsc(patch%itype(p))), 1._r8))
end do
end do

do f = 1, num_exposedvegp
p = filter_exposedvegp(f)
if (btran2(p) > 1._r8) then
! FIXME(wjs, 2020-10-02) remove this endrun conditional
if (btran2(p) > (1._r8 + 1.e-12_r8)) then
write(iulog,*) 'btran2 exceeds 1 by too much: ', p, btran2(p)
call endrun('btran2 exceeds 1 by too much')
end if
btran2(p) = 1._r8
end if
end do

end associate

end subroutine CNFire_calc_fire_root_wetness
Expand Down
13 changes: 13 additions & 0 deletions src/biogeochem/CNFireLi2021Mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,19 @@ subroutine CNFire_calc_fire_root_wetness( this, bounds, num_exposedvegp, filter_
btran2(p) = btran2(p) + rootfr(p,j)*s_node
end do
end do

do f = 1, num_exposedvegp
p = filter_exposedvegp(f)
if (btran2(p) > 1._r8) then
! FIXME(wjs, 2020-10-02) remove this endrun conditional
if (btran2(p) > (1._r8 + 1.e-12_r8)) then
write(iulog,*) 'btran2 exceeds 1 by too much: ', p, btran2(p)
call endrun('btran2 exceeds 1 by too much')
end if
btran2(p) = 1._r8
end if
end do

end associate

end subroutine CNFire_calc_fire_root_wetness
Expand Down

0 comments on commit 4291f06

Please sign in to comment.