C     COPYRIGHT:        NONE, PUBLIC DOMAIN
C     FILENAME:         INTRINSIC.F
C     PURPOSE:          PROVIDES REPLACEMENT FOR THE FORTRAN II
C                       INTRINSIC FUNCTIONS FOR COMPILING WITH
C                       FORTRAN 90 AND LATER.
C     HISTORY:          2010-08-17 RSB  CREATED.
C
      FUNCTION ABSF (X)
      ABSF = ABS(X)
      RETURN
      END
C
      FUNCTION SIGNF (X,Y)
      SIGNF = SIGN(X,Y)
      RETURN
      END
C
      REAL FUNCTION INTF (X)
      INTF = AINT(X)
      RETURN
      END
C
      FUNCTION SQRTF (X)
      SQRTF = SQRT (X)
      RETURN
      END
C
      FUNCTION SINF (X)
      SINF = SIN (X)
      RETURN
      END
C
      FUNCTION COSF (X)
      COSF = COS (X)
      RETURN
      END
C
      FUNCTION ARCOSF (X)
      ARCOSF = ACOS (X)
      RETURN
      END
C
      FUNCTION ARSINF (X)
      ARSINF = ASIN (X)
      RETURN
      END
C
C     I CANNOT FIND ANY DOCUMENTATION ON THIS FUNCTION, SO
C     EQUATING IT TO ATAN2 IS PURELY AN ASSUMPTION ON MY PART.
      FUNCTION ATN1F (X,Y)
      ATN1F = ATAN2 (X,Y)
      RETURN
      END
C
C     CLOCKF APPEARS TO GIVE THE CURRENT TIME, IN MINUTES.
C     (NOTE THAT IT RETURNS A REAL, SO THE RESOLUTION IS GREATER.)
C     I DO NOT KNOW WHAT THE REFERENCE POINT IS, BUT IT
C     DOES NOT MATTER SINCE THE VALUES ARE USED IN A RELATIVE
C     MANNER BY THE CALLING CODE --- I.E., FOR COMPUTING
C     TIME DIFFERENCES.  THE FUNCTION PARAMETER SEEMS TO BE AN
C     UNUSED DUMMY.
      FUNCTION CLOCKF (XX)
      INTEGER COUNT_NOW, COUNT_RATE, COUNT_MAX
      CALL SYSTEM_CLOCK(COUNT_NOW, COUNT_RATE, COUNT_MAX)  
      CLOCKF = (COUNT_NOW / 60.0) / COUNT_RATE
      RETURN
      END
