Skip to content

Commit

Permalink
Add tolerance to disturbance check to resolve issue with precision er…
Browse files Browse the repository at this point in the history
…ror.
  • Loading branch information
Joshua Rady authored and Joshua Rady committed Sep 22, 2020
1 parent 3248e63 commit 4ef49f8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion biogeochem/EDPatchDynamicsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@ subroutine spawn_patches( currentSite, bc_in)
! for both woody and grass species
real(r8) :: leaf_m ! leaf mass during partial burn calculations
logical :: found_youngest_primary ! logical for finding the first primary forest patch

real(r8), parameter :: disturb_tolerance = 1.0e-14_r8 ! Allow for a small precision errors.
!---------------------------------------------------------------------

storesmallcohort => null() ! storage of the smallest cohort for insertion routine
Expand All @@ -500,7 +502,7 @@ subroutine spawn_patches( currentSite, bc_in)
do while(associated(currentPatch))


if(currentPatch%disturbance_rate>1.0_r8) then
if(currentPatch%disturbance_rate > (1.0_r8 + disturb_tolerance)) then
write(fates_log(),*) 'patch disturbance rate > 1 ?',currentPatch%disturbance_rate
call dump_patch(currentPatch)
call endrun(msg=errMsg(sourcefile, __LINE__))
Expand Down

0 comments on commit 4ef49f8

Please sign in to comment.