C LAST UPDATE: 
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C**************************
C**     LDM_GET_SPDYN    **
C**************************
C
C
CD-Doc:
C SPDY_N           SUBROUTINE LDM_GET_SPDYN (IPACK, IPLATE, IVAL, IFLAG, 
C                 +                          IERR, ERRSTR)
CD-end
      SUBROUTINE LDM_GET_SPDYN (IPACK, IPLATE, IVAL, IFLAG, 
     +                       IERR, ERRSTR)
C
      INCLUDE 'implicit_none.finc'
C
C Purpose: Get value of plate dependent integer parameter SPDYN
C
C Author:  John W. Campbell, June 1993
C
C Arguments:
C
      INTEGER IPACK
      INTEGER IPLATE
      INTEGER IVAL
      INTEGER IFLAG
      INTEGER IERR
      CHARACTER*(*) ERRSTR

C  IPACK     (R)   Pack number (explicit)
C  IPLATE    (R)   Plate number (explicit)
C  IVAL      (W)   Returns the spatial distortion polynomial order
C  IFLAG     (W)   Flag = -1 undefined value
C                       =  0 default value
C                       =  1 value set explicitly
C                       =  2 value set globally
C  IERR      (W)   Error flag = 0 OK
C                             =-1 Invalid pack number
C                             =-2 Invalid plate number
C  ERRSTR    (W)   Error string if error found
C
C====== GLOBALS:
C
      INCLUDE 'ldm_data.finc'
      EXTERNAL LDM_BDAT
C
C====== LOCALS:
C

C
C-------------------------------------------------------------------------------
C
      CALL LDM_CHK_GPL (IPACK, IPLATE, IERR, ERRSTR)
      IF (IERR.NE.0) RETURN
      IVAL = SPDYN(IPACK,IPLATE)
      IFLAG = IS_SPDYN(IPACK,IPLATE)
      RETURN
      END
