Hello everybody,
i have the following piece of code, that i cant quite figure out why it crashes: defined in the module :
real(kind=selected_real_kind(12)) function dist(delta_w, delta)
real(kind=selected_real_kind(12)) :: delta_w,delta
real(kind=selected_real_kind(12)) :: res
if (delta.lt.0.0000001) call assertion_fail(273)
res= exp((-0.5)*((delta_w/delta)**2))
if (res.gt.one) call assertion_fail(274)
if (res.lt.zero) call assertion_fail(275)
dist = res
end function dist
one and zero are appropriately defined somewhere else. However the code fails at with floating invalid at 274 and 275, even if i use 1 and 0 respectively.
forrtl: error (65): floating invalid
Image PC Routine Line Source
cgehexe.intel-de 0814F1EF scorepmc_mp 275 scoremc.f90
How do i fix this, and why does this error occur in the first place?
- delta_w and delta both have values that dont lead to a NaN.
- The lines that fail are the lines with the call to assertion_fail(linenumber).
- One and zero are of the right types.
- exp is the generic intrinsic function.
Cheers and thanks for any help/suggestions