      SUBROUTINE MCSTR_WORDLIM(LINE,INWORD,DELIMS,IWORD1,IWORD2)
C
C  GIVEN THE ADDRESS OF A CHARACTER IN A "WORD" (SUBSTRING) IN
C  THE MAIN STRING "LINE", FIND THE ADDRESS LIMITS OF THE "WORD"
C  THE STRING DELIMS CONTAINS A LIST OF WORD DELIMITERS
C
C  INPUT -
C   LINE -- A CHARACTER STRING
C   INWORD -- LINE(INWORD:INWORD) IS A CHARACTER OF A "WORD" IN LINE
C   DELIMS -- DELIMITER STRING LIST.  A "WORD" IS A CONSECUTIVE SUB
C             SEQUENCE OF CHARACTERS IN "LINE", NOT IN "DELIMS".
C             LINE(INWORD:INWORD) MUST NOT BE IN DELIMS
C
C  OUTPUT-
C   ERROR:  IF INWORD IS OUT OF BOUNDS OR POINTS TO A DELIMITER,
C    IWORD1=IWORD2=0 ON EXIT
C   NORMAL EXIT:  IWORD1= START OF WORD CONTAINING LINE(INWORD:INWORD)
C                 IWORD2= END OF WORD CONTAINING LINE(INWORD:INWORD)
C
      CHARACTER*(*) LINE
      CHARACTER*(*) DELIMS
C
      L=LEN(LINE)
C
      I=INWORD
C
C  ERROR CHECKS
      IWORD1=0
      IWORD2=0
C  WORD ADDRESS IN BOUNDS?
      IF((I.LE.0).OR.(I.GT.L)) RETURN
C  NOT POINTING AT A DELIMITER?
      IF(INDEX(DELIMS,LINE(I:I)).NE.0) RETURN
C
C  FIND WORD LIMITS; LOOP OVER ALL DELIMITERS
      IDELIMS=LEN(DELIMS)
C
      IWORD1=1
      IWORD2=L
C
      DO 10 ID=1,IDELIMS
        CALL MCSTR_DLIMW(LINE,I,DELIMS(ID:ID),IW1,IW2)
        IWORD1=MAX0(IWORD1,IW1)
        IWORD2=MIN0(IWORD2,IW2)
 10   CONTINUE
C
      RETURN
      END
