*        SUBROUTINE DECISTR (STR, IVAR,KNT)SC_TITLE  DECISTR  Decodes a character string and converts it into integer variablesC_ARGUMENTSJ	CHARACTER*(*) STR   ![I] A sequence of integers with commas as delimters.K	INTEGER IVAR(*)     ![O] Array in which the integer variables are returned1	INTEGER KNT	    ![O] Number of variables in VAR.IC_DESCRIPTION Subroutine to decode a character string and convert it intoC Integer Variables. )C_HISTORY  86March12  R.Gurule  FlagstaffC_END	CHARACTER*200 BUFF	      
	IST =1      	KNT = 0    	IL = LEN(STR)	CHAR=0 !-------Fill buffer with spaces.        DO I=1,IL   	  BUFF(I:I) = ' '
        ENDDO	KNT = 0<!-------Iend is the end of the non-(blank OR tab) character.
	DO J=1,IL	  IF(STR(J:J).NE.' ')THEN	     KNT = KNT + 1%             BUFF(KNT:KNT) = STR(J:J)	  ENDIF	ENDDO	L2=KNTD       TYPE*, BUFF(1:KNT)	KNT = 0        DO 10 I=1,L2D	TYPE*,  IST,IEND,NCHAR,I@         IF(BUFF(I:I).EQ.','.OR.I.EQ.L2.OR.BUFF(I:I).EQ.' ')THEN          KNT = KNT + 1         IF(I.EQ.L2)THEN          IEND=I	  NCHAR = I - IST + 1
         ELSE	  NCHAR= I-IST 	  IEND = I-1         ENDIF;!-----Decode the character string into an integer variable.D	TYPE*, 'NCHAR =',NCHAR         IF(NCHAR.NE.0)THEN;          DECODE(NCHAR,100,BUFF(IST:IEND),ERR=999)IVAR(KNT) 100      FORMAT(I6)          IST = I + 1
         ELSE     	  IVAR(KNT)=0          IST=I+1         ENDIF       ENDIF  10  CONTINUE
 999  RETURN 	      END