aboutsummaryrefslogtreecommitdiff
path: root/pkg/tbtables/fitsio/ftdelt.f
blob: 16e5e46ec3288f27800dc06790e5c7d633cf0e8c (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
33
34
35
36
37
38
39
C--------------------------------------------------------------------------
        subroutine ftdelt(iunit,status)

C       delete a FITS file that was previously opened with ftopen or ftinit
C
C       iunit   i  Fortran I/O unit number
C       status  i  returned error status (0=ok)
C
C       written by Wm Pence, HEASARC/GSFC, July 1994

        integer iunit,status,ibuff

C       COMMON BLOCK DEFINITIONS:--------------------------------------------
        integer nb,ne
        parameter (nb = 20)
        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
C       END OF COMMON BLOCK DEFINITIONS-----------------------------------

C       ignore input status, and delete file regardless of status value

        ibuff=bufnum(iunit)

C       set current column name buffer as undefined
        call ftrsnm

C       flush the buffers holding data for this HDU
        call ftflsh(ibuff,status)

C       recover common block space containing column descriptors for this HDU
        call ftfrcl(iunit,status)

C       delete the file
        call ftclsx(iunit,.false.,status)
        end