      SUBROUTINE VLN(VECR, NVEC)
C
C***********************************************************************
C
C   NAME- VLN
C
C   LANGUAGE- FORTRAN 77      TYPE- SUBROUTINE      COMPUTER- CRAY   
C
C   VERSION- 1.0   DATE- 07/13/89    PROGRAMMER- S.SWEETLAND (SMSRC)
C   VERSION- 3.0   DATE- 05/10/96    PROGRAMMER- A.POZDNYAK (FDC)   
C      FOR REHOSTING TO THE CRAY, CHANGED ALL I*4 DECLARATIONS TO
C      INTEGER AND ALL R*4 DECLARATIONS TO REAL.
C   VERSION- 4.0    DATE- 02/27/03   PROGRAMMER- Rickey Rollins (CSC)
C        Replace R4SPV equivalence test with ISR4SPV function
C
C   FUNCTION- COMPUTES NATURAL LOGARITHM OF EACH ELEMENT OF A VECTOR.
C             IF THE VECTOR ELEMENT IS <= 0, THEN SPECIAL VALUE
C             IS RETURNED INSTEAD OF THE NATURAL LOG
C
C   CALLING SEQUENCE PARAMETERS-
C
C   NAME   TYPE  I/O    DESCRIPTION
C
C   VECR   REAL  I/O    REAL VECTOR OF DIMENSION NVEC
C   NVEC   INT   I      NUMBER OF ELEMENTS IN VECR
C
C***********************************************************************
C
      INTEGER  NVEC
      REAL     VECR(NVEC)
      LOGICAL   ISR4SPV
C
      INCLUDE 'SPVAL'
C
      DO 10 J = 1,NVEC
        IF(ISR4SPV(VECR(J))) GOTO 10
        IF(VECR(J) .GT. 0.)THEN
           VECR(J) = LOG(VECR(J))
        ELSE
           VECR(J) = R4SPV
        ENDIF
   10 CONTINUE
C
      RETURN
      END
