c
c	myfile.f 1.4 92/07/01 15:24:25
c
c  Copyright 1991 Intel Corporation, Inc.
c  See the "Copyright" file for complete rights and liability information.
c
c  Ensures that the cfs file "/cfs/mydata" exists in a known state
c  (deletes any existing file and creates a new, empty one).
c
c  Use before loading executables for cread.f, eseek.f,
c  forceflush.f, forflush.f, iread.f, iseof.f, or lseek.f.
c
c  Can run on a multi-node cube, but only node 0 does anything.

      integer iam

c  Identify self.

      iam = mynode()

c  Node 0 does all the work.

      if(iam .eq. 0) then
         print *,'Starting ...'

c    Delete existing file /cfs/mydata.

         open(unit   = 12,
     1        file   = '/cfs/mydata',
     2        status = 'unknown',
     3        form   = 'unformatted')
         close(unit   = 12,
     1         file   = '/cfs/mydata',
     2         status = 'delete')

         print *, 'File /cfs/mydata deleted.'

c    Create new file /cfs/mydata.

         open(unit   = 12,
     1        file   = '/cfs/mydata',
     2        status = 'new',
     3        form   = 'unformatted')
         close(unit   = 12,
     1         file   = '/cfs/mydata',
     2         status = 'keep')

         print *, 'File /cfs/mydata created.'

      endif

      end
