C LAST UPDATE: 
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C**************************
C**     LDM_SPD_PAR      **
C**************************
C
C
      INTEGER FUNCTION LDM_SPD_PAR (IXY, STR)
C
      INCLUDE 'implicit_none.finc'
C
C Purpose: Test for SPDX1, SPDX2..., SPDY1, SPDY2... etc. names
C
C ***** 'LDM' SERVICE ROUTINE ONLY *****
C
C Author:  John W. Campbell, July 1994
C
C Arguments:
C
      INTEGER IXY
      CHARACTER*(*) STR

C IXY     (R)    = 1 check for SPDXi, = 2 check for SPDYi
C STR     (R)    Keyword string
C
C         Return = 0 keyword not of requested type
C                > 0 keyword is of requested type an return value is the
C                    coefficient no. from 1 to LDM_MAXSPD
C
C====== Parameter statements
C 

C
C====== GLOBALS:
C
      INCLUDE 'ldm_data.finc'
C
C====== FUNCTION TYPES:
C
      INTEGER LENSTR
      INTEGER LDM_INTFP
C
C====== LOCALS:
C
      INTEGER I
      INTEGER IV
      INTEGER ND
      REAL FP

C     INTEGER I          !Temp/loop variable
C     INTEGER IV         !Integer value
C     INTEGER ND         !No. of decimal places
C     REAL FP            !Real value
C
C-------------------------------------------------------------------------------
C
      LDM_SPD_PAR = 0
      IF (LENSTR(STR).LT.5) RETURN 
      IF (IXY.EQ.1) THEN
         IF (STR(1:4).NE.'SPDX') RETURN
      ELSE IF (IXY.EQ.2) THEN
         IF (STR(1:4).NE.'SPDY') RETURN
      ELSE
         RETURN
      END IF
      I = LDM_INTFP(STR(5:LENSTR(STR)),FP,IV,ND)
      IF (I.NE.1) RETURN
      IF (IV.GE.1.AND.IV.LE.LDM_MAXSPD) LDM_SPD_PAR = IV
      RETURN
      END
