        subroutine rasfile(ifile,name)
	integer system
        character*40 name
        character*50 fname
        character*80 dname,wname
        character*80 gname
        character*80 string
        dname='/group/atlas/BOL/RASRES/'//name
        wname='/group/atlas/BOL/RASRES/'//'rasmoni'
        fname='get '//name
        gname=fname//' rasmoni'
        open(29,file='getras.exe')
        write(29,*)'open paling.nikhef.nl'
        write(29,*)'cd /projects/MDT/Data/Rasnik/Daily'
        write(29,*)'lcd /group/atlas/BOL/RASRES'
        write(29,*)gname
        close(29)
C ftp file always
        goto 99
C open file
        open(ifile,file=dname,STATUS='OLD',ERR=99)
	read(ifile,'(a)',ERR=99,END=99)string
        rewind(ifile)
        print *,'RasRes file available '
        goto 200
 99	continue
C if not there ftp file
	close(ifile)
	print *,'RasRes file not there yet '
        istat = system
     +    ('rm /group/atlas/BOL/RASRES/rasmoni')
        istat = system ('ftp < getras.exe')
        istat = system
     +    ('chmod g+w /group/atlas/BOL/RASRES/rasmoni')
        print *, 'ftp ended with status ', istat
	open(ifile,file=wname)
	read(ifile,'(a)',ERR=199,END=199)string
        rewind(ifile)
        print *,'RasRes file available now'
        goto 200
C if not exist give message
 199	print *,' RasRes file does not exist ',dname
 200	continue
        end


