From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- sys/osb/f77upk.f | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 sys/osb/f77upk.f (limited to 'sys/osb/f77upk.f') diff --git a/sys/osb/f77upk.f b/sys/osb/f77upk.f new file mode 100644 index 00000000..fc875008 --- /dev/null +++ b/sys/osb/f77upk.f @@ -0,0 +1,26 @@ +c F77UPK -- Convert a Fortran 77 string into an SPP string. Unpack +c each Fortran character into an SPP char and trim the blank padding +c at the right. +c + subroutine f77upk (f77str, sppstr, maxch) +c + character*(*) f77str + integer*2 sppstr(*) + integer maxch + integer lastch, nchars, i + integer EOS, BLANK + parameter (EOS=0, BLANK=32) +c +c -- Unpack string. + nchars = min (maxch, len(f77str)) + lastch = 0 + do 10 i = 1, nchars + sppstr(i) = ichar (f77str(i:i)) + if (sppstr(i) .gt. BLANK) lastch = i + 10 continue +c +c -- Add EOS delimiter to SPP string, trimming blank padding at right. + if (lastch .gt. maxch) lastch = maxch + sppstr(lastch+1) = EOS +c + end -- cgit