Annotation of researchv10no/cmd/pfort/pack.f, revision 1.1.1.1

1.1       root        1:        subroutine s5pack(a,b,n)
                      2: c      integers a(1), a(2), ...a(n) contain characters in a1 format.
                      3: c      the first byte of each integer contains the character
                      4: c      the three remaining bytes are blank. note that the calling program
                      5: c      expects a and b to be integer arrays, but we treat a and b
                      6: c      internally as character arrays with the correspondence
                      7: c      character a(4*i+1;4*i+1)=first byte of integer a(i+1)
                      8: c      s5pack(a,b,n) packs these characters into
                      9: c      elements of the integer array b in a4 format using only as many
                     10: c      elements of b as necessary.
                     11: c      The last element of b used must be padded
                     12: c      with trailing blanks. Unused elements of b are not affected.
                     13:        character *480 a
                     14:        character b
                     15:        integer n,i,k
                     16: c      write(6,1000)
                     17: c1000  format("entered s5pack")
                     18:        do 1 i=0,n-1
                     19:        b(i+1:i+1) = a(4*i+1:4*i+1)
                     20: 1      continue
                     21:        k = mod(n,4)
                     22:        if(k.gt.0) then
                     23:        do 2 i=n+1,n+4-k
                     24:        b(i:i) = ' '
                     25: 2      continue
                     26:        end if
                     27: c      write(6,2000)
                     28: c2000  format("leaving s5pak")
                     29:        return
                     30:        end

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.