From 4ef49f85e08019d5e68b321f3817d238dc38ac19 Mon Sep 17 00:00:00 2001 From: Joshua Rady Date: Tue, 22 Sep 2020 11:04:48 -0400 Subject: [PATCH] Add tolerance to disturbance check to resolve issue with precision error. --- biogeochem/EDPatchDynamicsMod.F90 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/biogeochem/EDPatchDynamicsMod.F90 b/biogeochem/EDPatchDynamicsMod.F90 index af0208cf43..84ea9258f6 100644 --- a/biogeochem/EDPatchDynamicsMod.F90 +++ b/biogeochem/EDPatchDynamicsMod.F90 @@ -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 @@ -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__))