aboutsummaryrefslogtreecommitdiff
path: root/sys/osb/f77pak.f
blob: db7df6f0de46b742302f206d704ea8a01bc8e1b4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
c F77PAK -- Convert an SPP string into a Fortran 77 string.
c
        subroutine f77pak (sppstr, f77str, maxch)
c
        integer*2 sppstr(*)
        character*(*) f77str
        integer maxch
        integer i, ch, last, maxout, EOS
        parameter (EOS=0)
c
        maxout = min (maxch, len(f77str))
c
c       # Unpack the EOS delimited SPP string.
	last = maxout
        do 10 i = 1, maxout
            ch = sppstr(i)
            if (ch .eq. EOS) then
		last = i - 1
		goto 20
	    endif
            f77str(i:i) = char (ch)
 10     continue
 20     continue
c
c       # Pad on the right with blanks.
	if (last .gt. maxch) last = maxch
	if (last .le. 0) then
	    f77str = ' '
	else
	    f77str = f77str(1:last)
	endif
        end