When input parameters to "slasq3" follows below pattern:
i0 =3, n0=16, pp=1,desig=0.2f, qmax=0.2f, nfail=4,iter=1, ndiv = 2, ieee = 0, ttype = -1
this function falls into infinite loop in-between code line 332 ~ 362.
100% reproduce.
Do you think this used to work in earlier versions ? AFAIK none of the slasq functions was modified since at least 3.7.0. From your description it is looping as TAU never gets small enough ?
Do you think this used to work in earlier versions ? AFAIK none of the slasq functions was modified since at least 3.7.0. From your description it is looping as TAU never gets small enough ?
Sorry, I only verified on 3.9.0 so far for this is the only version at hand.
Would you happen to have a complete reproducer for this, in particular with the values contained in the array z ? I cannot reproduce the problem with the data you provided and a random z, and I imagine bad things will happen if not even when any of the array elements is a NaN.
if dmin is nan it should be set to some legit erroneous value; would prevent infinity.
I thought about this as well, but if I am correct about the rules for comparing against NaN this is probably not the problem.
No infinite loop using 4b3c7c249f6a2cfed76603d9987cf5164fa6f9e1 to build the code:
PROGRAM testSLASQ3
IMPLICIT NONE
* .. Scalar Arguments ..
LOGICAL IEEE
INTEGER I0, ITER, N0, NDIV, NFAIL, PP, TTYPE
REAL DESIG, DMIN, DMIN1, DMIN2, DN, DN1, DN2, G,
& QMAX, SIGMA, TAU
* .. Array Arguments ..
REAL Z( 64 )
* .. Subroutines ..
EXTERNAL SLASQ3
PARAMETER ( IEEE=.FALSE. )
PARAMETER ( I0 = 3 )
PARAMETER ( QMAX = 1.0 )
ITER=1
N0=16
NDIV=2
NFAIL=4
PP=1
TTYPE=-1
DESIG=0.2
DMIN1=0.1
DMIN2=0.1
DN=1.0
DN1=1.0
DN2=1.0
G=1.0
TAU=1.0
Z = (/0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,
& 0.1,0.2,0.3,0.4,0.5,0.6,
& 0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,
& 0.1,0.2,0.3,0.4,0.5,0.6,
& 0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,
& 0.1,0.2,0.3,0.4,0.5,0.6,
& 0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,
& 0.1,0.2,0.3,0.4,0.5,0.6/)
CALL SLASQ3( I0, N0, Z, PP, DMIN, SIGMA, DESIG, QMAX, NFAIL,
& ITER, NDIV, IEEE, TTYPE, DMIN1, DMIN2, DN, DN1,
& DN2, G, TAU )
END PROGRAM testSLASQ3
Based on @weslleyspereira post, let us close this issue then.
@Peter9606 thanks for reporting the issue, if the issue comes back, please come back to us.
Julien.
Most helpful comment
Would you happen to have a complete reproducer for this, in particular with the values contained in the array z ? I cannot reproduce the problem with the data you provided and a random z,
and I imagine bad things will happen ifnot even when any of the array elements is a NaN.