C LAST UPDATE: 
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C*****************************
C**     LDM_GET_SPIN        **
C*****************************
C
C
CD-Doc:
C SPINdle          SUBROUTINE LDM_GET_SPIN (IPACK, VALUE, IFLAG, ND, 
C                 +                         IERR, ERRSTR)       
CD-end
      SUBROUTINE LDM_GET_SPIN (IPACK, VALUE, IFLAG, ND, IERR, ERRSTR)       
C
      INCLUDE 'implicit_none.finc'
C
C Purpose: Get value of pack dependent real parameter SPINDLE
C
C Author:  John W. Campbell, June 1993
C
C Arguments:
C
      INTEGER IPACK
      REAL VALUE
      INTEGER IFLAG
      INTEGER ND
      INTEGER IERR
      CHARACTER*(*) ERRSTR

C  IPACK     (R)   Pack number (explicit)
C  VALUE     (W)   Returns the value for the spindle angle in degrees
C  IFLAG     (W)   Flag = -1 undefined value
C                       =  0 default value
C                       =  1 value set explicitly
C                       =  2 value set globally
C  ND        (W)   Number of decimal places for print (- if E format)
C  IERR      (W)   Error flag = 0 OK
C                             =-1 Invalid pack number
C  ERRSTR    (W)   Error string if error found
C
C====== GLOBALS:
C
      INCLUDE 'ldm_data.finc'
      EXTERNAL LDM_BDAT
C
C====== LOCALS:
C
      INTEGER I
C
C-------------------------------------------------------------------------------
C
      IF (.NOT.INIT_SPIN) THEN
         CALL LDM_DF_SPIN (0, IERR, ERRSTR, LDM_MAXPK)
         INIT_SPIN = .TRUE.
         DO 10 I = 1, LDM_MAXPK
            CH_SPIN(I) = 0
10       CONTINUE
      END IF
      CALL LDM_CHK_GPK (IPACK, IERR, ERRSTR)
      IF (IERR.NE.0) RETURN
      VALUE = SPIN(IPACK)
      IFLAG = IS_SPIN(IPACK)
      ND = ND_SPIN(IPACK)
      IF (ND.EQ.-1000) ND = 3
      RETURN
      END
