aboutsummaryrefslogtreecommitdiff
path: root/pkg/tbtables/fitsio/ftptbb.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/ftptbb.f
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/tbtables/fitsio/ftptbb.f')
-rw-r--r--pkg/tbtables/fitsio/ftptbb.f64
1 files changed, 64 insertions, 0 deletions
diff --git a/pkg/tbtables/fitsio/ftptbb.f b/pkg/tbtables/fitsio/ftptbb.f
new file mode 100644
index 00000000..11b96776
--- /dev/null
+++ b/pkg/tbtables/fitsio/ftptbb.f
@@ -0,0 +1,64 @@
+C----------------------------------------------------------------------
+ subroutine ftptbb(iunit,frow,fchar,nchars,value,status)
+
+C write a consecutive string of bytes to an ascii or binary
+C table. This will span multiple rows of the table if NCHARS+FCHAR is
+C greater than the length of a row.
+
+C iunit i fortran unit number
+C frow i starting row number (1st row = 1)
+C fchar i starting byte in the row to write (1st character=1)
+C nchars i number of bytes to write (can span multiple rows)
+C value i array of bytes to write
+C status i output error status
+C
+C written by Wm Pence, HEASARC/GSFC, Dec 1991
+
+ integer iunit,frow,fchar,nchars,status
+ integer value(*)
+
+C COMMON BLOCK DEFINITIONS:--------------------------------------------
+ integer nf,nb,ne
+ parameter (nb = 20)
+ parameter (nf = 3000)
+ parameter (ne = 200)
+ integer bufnum,chdu,hdutyp,maxhdu,hdstrt,hdend,nxthdr,dtstrt
+ integer nxtfld
+ logical wrmode
+ common/ft0001/bufnum(199),chdu(nb),hdutyp(nb),maxhdu(nb),
+ & wrmode(nb),hdstrt(nb,ne),hdend(nb),nxthdr(nb),dtstrt(nb),nxtfld
+ integer tfield,tstart,tbcol,rowlen,tdtype,trept,tnull,scount
+ integer theap,nxheap
+ double precision tscale,tzero
+ common/ft0002/tfield(nb),tstart(nb),tbcol(nf),rowlen(nb),
+ & tdtype(nf),trept(nf),tscale(nf),tzero(nf),tnull(nf),scount(nb)
+ & ,theap(nb),nxheap(nb)
+C END OF COMMON BLOCK DEFINITIONS-----------------------------------
+
+ integer ibuff,bstart
+
+ if (status .gt. 0)return
+
+ ibuff=bufnum(iunit)
+
+C check for errors
+ if (nchars .le. 0)then
+C zero or negative number of character requested
+ return
+ else if (frow .lt. 1)then
+C error: illegal first row number
+ status=307
+ return
+ else if (fchar .lt. 1)then
+C error: illegal starting character
+ status=308
+ return
+ end if
+
+C move the i/o pointer to the start of the sequence of characters
+ bstart=dtstrt(ibuff)+(frow-1)*rowlen(ibuff)+fchar-1
+ call ftmbyt(iunit,bstart,.true.,status)
+
+C put the string of bytes
+ call ftpbyt(iunit,nchars,value,status)
+ end