selected_real_kind(3I)

SELECTED_REAL_KIND - Returns the real kind type parameter

As shipped in IRIX 6.5.22. Last changed in IRIX 6.5.19.

NAME
     SELECTED_REAL_KIND - Returns the real kind type parameter

SYNOPSIS
     SELECTED_REAL_KIND ([[P=]p] [,[R=]r])

STANDARDS
     Fortran

DESCRIPTION
     The SELECTED_REAL_KIND intrinsic function returns the real kind type
     parameter of a real data type with decimal precision of at least p
     digits and a decimal exponent range of at least r.  At least one
     argument must be present, and the arguments are as follows:

     p         Must be scalar and of type integer.

     r         Must be scalar and of type integer.

     SELECTED_REAL_KIND is a transformational function.  The name of this
     intrinsic cannot be passed as an argument.

RETURN VALUES
     This intrinsic function returns the real kind type parameter
     corresponding to the decimal precision and exponent range specified by
     its arguments.  The result is a default integer scalar.  The result
     has a value equal to a value of the kind type parameter of a real data
     type with decimal precision, as returned by the function PRECISION, of
     at least p digits and a decimal exponent range, as returned by the
     function RANGE, of at least r, or if no such kind type parameter
     exists, the result is -1 if the precision is not available, -2 if the
     exponent range is not available, and -3 if neither is available.  If
     more than one kind type parameter value meets the criteria, the value
     returned is the one with the smallest decimal precision, unless there
     are several such values, in which case the smallest of these kind
     values is returned.

EXAMPLES
     The following program is run:

         PARAMETER (NP=9,NR=9)
         INTEGER P(NP),R(NR),A(NR)
   *     TEST CASE FOR IRIX
         DATA P /-1,0,1,6,7,15,16,31,32/
         DATA R /-1,0,1,37,38,291,292,307,308/
         WRITE (6,FMT='('' (P,R)|'',10I5)') R
         WRITE(6,FMT='(" ----------------------------------------------",
       +              "-----------------------")')
         DO I=1,NP
           DO J=1,NR
             A(J)=SELECTED_REAL_KIND(P(I),R(J))
           END DO
           WRITE (6,FMT='(I6,''|'',10I5)') P(I),(A(K),K=1,NR)
         END DO

         WRITE(6,FMT='(//)')
         WRITE (6,FMT='('' (P)  | (R=NULL)'',10I5)')
         WRITE(6,FMT='(" ----------------------------------------------")')
         DO I=1,NP
             A(I)=SELECTED_REAL_KIND(P=P(I))
         END DO
         WRITE (6,FMT='(I6,''|'',I5)') (P(K),A(K),K=1,NP)

         WRITE(6,FMT='(//)')
         WRITE (6,FMT='('' (P=NULL)| (R)'',10I5)') R
         WRITE(6,FMT='(" ----------------------------------------------",
       +              "------------------------------")')
         DO J=1,NR
             A(J)=SELECTED_REAL_KIND(R=R(J))
         END DO
         WRITE (6,FMT='(I9,''|    '',10I5)') 0,(A(K),K=1,NR)

         STOP
         END

     The following tables show the results obtained from the preceding
     program.

         (p,r) |   -1    0    1   37   38  291  292  307  308
         ------------------------------------------------------------------
            -1 |    4    4    4    4    8    8    8    8   -2
             0 |    4    4    4    4    8    8    8    8   -2
             1 |    4    4    4    4    8    8    8    8   -2
             6 |    4    4    4    4    8    8    8    8   -2
             7 |    8    8    8    8    8    8    8    8   -2
            15 |    8    8    8    8    8    8    8    8   -2
            16 |   16   16   16   16   16   -2   -2   -2   -2
            31 |   16   16   16   16   16   -2   -2   -2   -2
            32 |   -1   -1   -1   -1   -1   -1   -1   -1   -3

             (p) | (r=NULL)
           ----------------
              -1 |    4
               0 |    4
               1 |    4
               6 |    4
               7 |    8
              15 |    8
              16 |   16
              31 |   16
              32 |   -1

           (p=NULL) | (r)   -1    0    1   37   38  291  292  307  308
           -----------------------------------------------------------
                  0 |        4    4    4    4    8    8    8    8   -2

SEE ALSO
     MODELS(3I)