From b2aab6afe17586ea44c0b8ad4a42b489e1ca7d61 Mon Sep 17 00:00:00 2001 From: Austin Blevins Date: Tue, 7 Feb 2023 16:12:07 -0500 Subject: [PATCH] fixed a bug that caused an underflow in the depth model with debug flags on --- src/regolith/regolith_depth_model.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/regolith/regolith_depth_model.f90 b/src/regolith/regolith_depth_model.f90 index 6b424055..4ca62181 100644 --- a/src/regolith/regolith_depth_model.f90 +++ b/src/regolith/regolith_depth_model.f90 @@ -97,8 +97,8 @@ subroutine regolith_depth_model(user,domain,finterval,nflux,p) f = 0.5_DP * dr * ( fmin + fmax ) psum = psum + f end do - psumfunc = exp(-1.0_DP * PI * psum * t) - if (psumfunc > epsilon(psum)) then + psumfunc = -1.0_DP * PI * psum * t + if (psumfunc > exp(epsilon(psum))) then p(2,i) = 1.0_DP - exp(-1.0_DP * PI * psum * t) else p(2,i) = 1.0_DP