aboutsummaryrefslogtreecommitdiff
path: root/sys/osb/f77pak.f
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /sys/osb/f77pak.f
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/osb/f77pak.f')
-rw-r--r--sys/osb/f77pak.f32
1 files changed, 32 insertions, 0 deletions
diff --git a/sys/osb/f77pak.f b/sys/osb/f77pak.f
new file mode 100644
index 00000000..db7df6f0
--- /dev/null
+++ b/sys/osb/f77pak.f
@@ -0,0 +1,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