C------------------------------------------------------------------------------ C The following routines are part of the FITSIO library C and are specific to SUN SPARC, HP, IBM AIX, other similar computers. C On HP machines the +U77 compiler flag must be used when compiling C fitsio and any programs that call it, in order to link in the C BSF 3F library which contains the IDATE subroutine. C On IBM AIX machines, the -qcharlen=2880 compiler flag must be C used to support long character strings. C------------------------------------------------------------------------------ C This software was prepared by High Energy Astrophysic Science Archive C Research Center (HEASARC) at the NASA Goddard Space Flight Center. Users C shall not, without prior written permission of the U.S. Government, C establish a claim to statutory copyright. The Government and others acting C on its behalf, shall have a royalty-free, non-exclusive, irrevocable, C worldwide license for Government purposes to publish, distribute, C translate, copy, exhibit, and perform such material. C-------------------------------------------------------------------------- subroutine ftopnf(funit,fname,oldnew,rwmode,block,size,status) C low-level, machine-dependent routine to create or open a new file C C funit i Fortran I/O unit number C fname c name of file to be opened C oldnew i file status: 0 = open old/existing file; else open new file C rwmode i file access mode: 0 = readonly; else = read/write C block i FITS record blocking factor C size i min size of file, in bytes C status i returned error status (0=ok) C C written by Wm Pence, HEASARC/GSFC, December 1996 integer funit,oldnew,rwmode,block,size,status character*(*) fname character*3 fstat if (oldnew .eq. 0)then fstat='OLD' C The blocking factor is irrelevant for files on a this machine, C therefore, simply return the default block size. block=1 C no easy way to determine the size of the file, C so just set value to a huge number size=1000000000 else C create a new file fstat='NEW' size = 0 end if C Note that record size is given in units of bytes, not words. open(unit=funit,file=fname,status=fstat,err=900, & recl=2880,form='UNFORMATTED',access='DIRECT') return C error opening file: 900 status=104 + oldnew end