      SUBROUTINE SUBTAB( X, NX )

C     If X(3) = -999.9 then subtabulation is performed
C     i.e, a vector is generated with NX points in [X(1),X(2)]

      REAL X( * )

C     --- testing for equality here is dangerous

      IF ( NX .GE. 3 .AND. X(3) .EQ. -999.9 ) THEN
         XMIN = X( 1 )
         XMAX = X( 2 )
         DELTAX = ( XMAX - XMIN ) / ( NX - 1 )

         DO I = 1, NX
            X( I ) = XMIN + ( I - 1 ) * DELTAX
         END DO

      ENDIF

      RETURN
      END
