      SUBROUTINE getpos(parval, stepsubxy, nxy, delxyin, ij)
c		PLCONT subroutine to return the location in the array of
c		a given point
c	rashafer 25 October 1986
cSUN	implicit undefined(a-z)
cVMS	implicit none
      INCLUDE '../inc/historysf.inc'
      REAL*4 parval
c
c  I: current parameter value
      RECORD /his_steppar_sub1/stepsubxy
c
c  I: stepping description
      INTEGER*4 nxy
c
c  I: no. of values
      REAL*4 delxyin
c
c  I: 1/steplength
      INTEGER*4 ij
c
c  R: The index in the array
c
      REAL*4 val
      IF (stepsubxy.log) THEN
         val = delxyin*log(parval/stepsubxy.lowpar)
      ELSE
         val = delxyin*(parval-stepsubxy.lowpar)
      ENDIF
      ij = nint(val) + 1
      IF ((ij.LT.0) .OR. (ij.GT.nxy)) THEN
         WRITE (*, *) ' GETPOS:  Steppar parameter outside range:',
     &                parval, stepsubxy.lowpar, stepsubxy.hipar, val,
     &                nxy, ij
         ij = 1
      ENDIF
      RETURN
      END
