C	subroutine to put a positive integer in a character string
C
C
C
	SUBROUTINE PUTINTP (INTP,IPOS,TEXT)
	INTEGER INTP       !  input:  the positive integer
	INTEGER IPOS       !  input:  the first position
C	                   !  output: the next position
	CHARACTER*(*) TEXT !  input/output:  the character string
C
	INTEGER ISKRIV(40)
	CHARACTER*1 CH
C
	IKVAR=INTP
	IANTPOS=0
	DO WHILE (IKVAR.GT.0)
	  IANTPOS=IANTPOS+1
	  IF (IANTPOS.GT.40) STOP 561
	  I=IKVAR/10
	  J=IKVAR-10*I
	  ISKRIV(IANTPOS)=J
	  IKVAR=I
	END DO
C
	ILAST=LEN(TEXT)
C
	DO I=1,IANTPOS
	  IF (IPOS.GT.ILAST) STOP 15151
	  J=ISKRIV(IANTPOS+1-I)
	  IF (J.EQ.0) THEN
	    CH='0'
	  ELSE IF (J.EQ.1) THEN
	    CH='1'
	  ELSE IF (J.EQ.2) THEN
	    CH='2'
	  ELSE IF (J.EQ.3) THEN
	    CH='3'
	  ELSE IF (J.EQ.4) THEN
	    CH='4'
	  ELSE IF (J.EQ.5) THEN
	    CH='5'
	  ELSE IF (J.EQ.6) THEN
	    CH='6'
	  ELSE IF (J.EQ.7) THEN
	    CH='7'
	  ELSE IF (J.EQ.8) THEN
	    CH='8'
	  ELSE IF (J.EQ.9) THEN
	    CH='9'
	  END IF
	  TEXT(IPOS:IPOS) = CH
	  IPOS=IPOS+1
	END DO
C
	RETURN
	END
