aboutsummaryrefslogtreecommitdiff
path: root/pkg/tbtables/fitsio/ftpcom.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 /pkg/tbtables/fitsio/ftpcom.f
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/tbtables/fitsio/ftpcom.f')
-rw-r--r--pkg/tbtables/fitsio/ftpcom.f39
1 files changed, 39 insertions, 0 deletions
diff --git a/pkg/tbtables/fitsio/ftpcom.f b/pkg/tbtables/fitsio/ftpcom.f
new file mode 100644
index 00000000..f056eea2
--- /dev/null
+++ b/pkg/tbtables/fitsio/ftpcom.f
@@ -0,0 +1,39 @@
+C--------------------------------------------------------------------------
+ subroutine ftpcom(ounit,commnt,status)
+
+C write a COMMENT record to the FITS header
+C
+C ounit i fortran output unit number
+C commnt c input comment string
+C OUTPUT PARAMETERS:
+C status i output error status (0 = ok)
+C
+C written by Wm Pence, HEASARC/GSFC, June 1991
+
+ integer ounit,status,strlen,actlen,i,nkeys,c1,c2
+ character*(*) commnt
+ character*80 rec
+
+ if (status .gt. 0)return
+
+C find the length of the string, and write it out 70 characters at a time
+ nkeys=1
+ strlen=len(commnt)
+ actlen=strlen
+ do 10 i=strlen,1,-1
+ if (commnt(i:i) .ne. ' ')then
+ actlen=i
+ go to 20
+ end if
+10 continue
+
+20 c1=1
+ c2=min(actlen,70)
+ nkeys=(actlen-1)/70+1
+ do 30 i=1,nkeys
+ rec='COMMENT '//commnt(c1:c2)
+ call ftprec(ounit,rec,status)
+ c1=c1+70
+ c2=min(actlen,c2+70)
+30 continue
+ end