diff --git a/source/statistics.distributions.lognormal.F90 b/source/statistics.distributions.lognormal.F90 index c97e4dc1b..bb2d3a8b0 100644 --- a/source/statistics.distributions.lognormal.F90 +++ b/source/statistics.distributions.lognormal.F90 @@ -212,8 +212,12 @@ double precision function logNormalDensity(self,x) class (distributionFunction1DLogNormal), intent(inout) :: self double precision , intent(in ) :: x - logNormalDensity=+self%distributionFunction1DNormal%density(log(x)) & - & /x + if (x > 0.0d0) then + logNormalDensity=+self%distributionFunction1DNormal%density(log(x)) & + & /x + else + logNormalDensity=+0.0d0 + end if return end function logNormalDensity