C     GENPLT-II UTILITY PROGRAM PACK
C     PACK                                                      09/20/67
C     DONALD BARTH, C/O K.B. WIBERG, DEPT. OF CHEMISTRY, YALE UNIVERSITY
C
C     THIS PROGRAM WRITES THE POINTER AND COORDINATE ARRAYS FOR LTRPLT
C     INPUT DATA CARDS (FORMAT(2I2,1X,2I2,1X,2I2,6X,9I1,1X,I2)) CONTAIN
C     3 SETS OF CONSECUTIVE X AND Y COORDINATES FORMAT 2I2,1X,2I2,1X,2I2
C     FOLLOWED BY 9 INDICATORS ( FORMAT 9I1 ) WHICH ARE 1 IF THE LETTER
C     IS TO BE INCLUDED WITHIN THE RESPECTIVE FONT OR 0 IF IT IS NOT,
C     FOLLOWED BY THE DECIMAL CODE OF THE LETTER ( FORMAT 1I2 )
C     COORDINATES 2929 0000 0000 ARE INTERNALLY PROVIDED FOR BLANKS
C     CARD WITH NO PUNCHED COLUMNS SHOULD FOLLOW LAST DATA CARD
C     LOCATN POINTER ARRAY IS REFORMED TO CORRESPOND TO NEW COORDINATES
C
C     DIMENSION STATEMENT MAY REQUIRE MODIFICATION FOR LARGE FONTS
      DIMENSION K(6),KIND(9),LOCATN(576),KRD(1000),MODE(64)
      DATA (MODE(I),I=1,64)/11*0,9,4*0,1,10*0,7,11,3*0,2,10*0,5,3,4*0,4,
     19*0,6,10,3*0/
      DATA KOUNT/1/,KRD(1)/1003487232/
      DO 1 J=1,576
    1 LOCATN(J)=0
      DO 2 J=2,1000
    2 KRD(J)=0
    3 READ(5,4)(KIND(I),I=1,9),KODE
    4 FORMAT(20X,9I1,1X,I2)
      BACKSPACE 5
      IF(KIND(1)+KIND(2)+KIND(3)+KIND(4)+KIND(5)+KIND(6)+KIND(7)
     1+KIND(8)+KIND(9))11,11,5
    5 DO 7 J=1,9
      IF(KIND(J))7,7,6
    6 MODE(J+1)=8
      M=(KODE+1)+(((J-1)/2)*64)
      MULT=(9999*(J-(2*(J/2))))+1
      LOCATN(M)=LOCATN(M)+((KOUNT+1)*MULT)
    7 CONTINUE
    8 READ(5,9)(K(I),I=1,6)
    9 FORMAT(3(2I2,1X))
      KOUNT=KOUNT+1
      KRD(KOUNT)=(K(1)*(32**5))+(K(2)*(32**4))+(K(3)*(32**3))
     1+(K(4)*(32**2))+(K(5)*32)+K(6)
      DO 10 J=2,6
      IF(K(J)-29)10,3,10
   10 CONTINUE
      GO TO 8
   11 DO 12 J=1,9
      KEEP=10-J
      IF(MODE(KEEP+1))12,12,13
   12 CONTINUE
   13 LIMIT=64*KEEP
      DO 15 J=1,LIMIT
      M=J-(((J-1)/64)*64)
      IF(LOCATN(J))14,14,15
   14 LOCATN(J)=10001
   15 LOCATN(J)=LOCATN(J)+(MODE(M)*100000000)
      DO 16 J=1,KEEP
      INDEX1=(32*J)-31
      INDEX2=INDEX1+31
      WRITE(6,18)INDEX1,INDEX2,(LOCATN(I),I=INDEX1,INDEX2)
   16 WRITE(7,18)INDEX1,INDEX2,(LOCATN(I),I=INDEX1,INDEX2)
      LIMIT=(KOUNT+49)/50
      DO 17 J=1,LIMIT
      INDEX1=(50*J)-49
      INDEX2=INDEX1+49
      WRITE(6,19)INDEX1,INDEX2,(KRD(I),I=INDEX1,INDEX2)
   17 WRITE(7,19)INDEX1,INDEX2,(KRD(I),I=INDEX1,INDEX2)
   18 FORMAT(6X,21HDATA   (LOCATN(I), I=,I3,1H,,I3,5H)   /,3(I10,1H,)/5X
     1,1H1,6(I10,1H,)/5X,1H2,6(I10,1H,)/5X,1H3,6(I10,1H,)/5X,1H4,6(I10,1
     2H,)/5X,1H5,4(I10,1H,),I10,1H/)
   19 FORMAT(6X,19HDATA   ( KRD(I), I=,I4,1H,,I4,5H)   /,3(I10,1H,)/5X,1
     1H1,6(I10,1H,)/5X,1H2,6(I10,1H,)/5X,1H3,6(I10,1H,)/5X,1H4,6(I10,1H,
     2)/5X,1H5,6(I10,1H,)/5X,1H6,6(I10,1H,)/5X,1H7,6(I10,1H,)/5X,1H8,4(I
     310,1H,),I10,1H/)
      STOP
      END
