Silverfrost Forums

Welcome to our forums

Missing FTN95 intrinsic INVALID_FLOAT@()

23 Dec 2020 12:16 #26826

The FTN95 8.70 help file contains descriptions of the non-standard intrinsic functions INVALID_FLOAT@ and INVALID_DOUBLE@, but I do not see them in the online documentation at https://silverfrost.com/ftn95-help/ftn95/idh_i.aspx.

The following code, in which I attempted to implement the Fortran standard function ISNAN using this intrinsic function, failed to compile.

LOGICAL FUNCTION ISNAN(X)     ! provided for Silverfrost FTN95, which lacks ISNAN
   real X
   isnan = invalid_float@(X)
   return
end function ISNAN

The compiler said:

R:\XLRTR\MARCH\SRC>ftn95 isnan.f90
[FTN95/Win32 Ver. 8.70.0 Copyright (c) Silverfrost Ltd 1993-2020]
ERROR R:\XLRTR\MARCH\SRC\isnan.F90 3:  You cannot assign an expression of type INTEGER(KIND=3) to a variable of type LOG
ICAL(KIND=3)
    1 ERROR  [<ISNAN> FTN95 v8.70.0]
*** Compilation failed
23 Dec 2020 3:54 #26828

mecej4

These routines require

INCLUDE <clearwin.ins>

or similar, or

C_EXTERNAL INVALID_FLOAT@ 'invalid_float'(VAL):LOGICAL*4
C_EXTERNAL INVALID_DOUBLE@ 'invalid_double'(VALD):LOGICAL*4
23 Dec 2020 7:31 #26830

Thank you, Paul.

Please login to reply.