        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/bol_nul/'//name
        wname='/group/atlas/BOL/bol_nul/'//'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
C mv       goto 99
C open file
	print *,' about to open rasnik file: ', dname
        open(ifile,file=dname,STATUS='OLD',ERR=200)
	read(ifile,'(a)',ERR=200,END=200)string
        rewind(ifile)
        print *,'RasRes file available '
        goto 200
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


