C-----------------------------------------------------------------------
C atio.f: Input/output routines for RPFITS on an SGI machine.
C-----------------------------------------------------------------------
C 1) The RPFITS routines are no longer directly supported for SGI
C and the SGI version of atio.f is simply a copy of the sun4sol
C Refer to the notes in the prologue of the sun4sol version of
C atio.f for more information.
C $Id: atio.f,v 1.13 2007/07/16 01:11:50 cal103 Exp $
C-----------------------------------------------------------------------
integer function AT_CREATE (fname, async, initsz, lun)
C-----------------------------------------------------------------------
logical async, islabelled, reread
integer initsz, irec(10:99), lenrec(10:99), lun, lunsav
integer TOPEN, istat, GETLUN, lfname
common /atio/ lenrec, irec, reread, lunsav, bufsav
C-----------------------------------------------------------------------
if (fname(1:5).eq.'/dev/') then
lfname = index(fname,' ')
if (lfname.eq.0) lfname = len(fname)
istat = GETLUN(.true., lun)
AT_CREATE = TOPEN(lun, fname(:lfname), islabelled)
istat = GETLUN(.false., lun)
open (lun, file=fname, status='new', access='direct',
+ form='unformatted', recl=lenrec(lun), iostat=AT_CREATE)
integer function AT_REOPEN_WRITE (fname, lun)
C-----------------------------------------------------------------------
C REOPEN file - on disk only.
C-----------------------------------------------------------------------
integer irec(10:99), lenrec(10:99), lun, lunsav
common /atio/ lenrec, irec, reread, lunsav, bufsav
C-----------------------------------------------------------------------
open (lun, file=fname, status='old', access='direct',
+ form='unformatted', recl=lenrec(lun),
+ iostat=AT_REOPEN_WRITE)
integer function AT_OPEN_READ (fname, async, lun)
C-----------------------------------------------------------------------
C "READONLY" is non-standard. Had to remove it.
C-----------------------------------------------------------------------
logical async, islabelled, reread
integer irec(10:99), lenrec(10:99), lun, lunsav, TOPEN
integer TSKIPF, istat, GETLUN, lfname
common /atio/ lenrec, irec, reread, lunsav, bufsav
C-----------------------------------------------------------------------
if (fname(1:5).eq.'/dev/') then
istat = GETLUN(.true., lun)