        subroutine forcefile(ifile,name)
	include 'Online.cmm'
	integer system
	character*40 name
        character*50 fname
	character*80 dname,wname
	character*80 gname
	character*80 string
        dname='/group/atlas/BOL/sagcomp/'//name
        wname='/group/atlas/BOL/sagcomp/'//'forcefile'
        fname='get '//name
        gname=fname//' forcefile'
         print *,gname
	print *,wname
	open(29,file='getforce.exe')
	write(29,*)'open paling.nikhef.nl'
          write(29,*)'user MDToper BOLroom'
        write(29,*)'cd /projects/MDT/Data/SAGcomp/'
        write(29,*)'lcd /group/atlas/BOL/sagcomp'
        write(29,*)gname 
        write(29,*)'bye'
	close(29)
C go for forcefile 
        if (iforceloc.eq.1) then
          open(ifile,file=wname)
          read(ifile,'(a)',ERR=199,END=199)string
          rewind(ifile)
          print *,'Temp file available '
          goto 200
        endif
C
        if (iforceloc.eq.1) then
	  open(ifile,file=dname)
	  read(ifile,'(a)',ERR=99,END=99)string
          rewind(ifile)
          print *,'Temp file available '
          goto 200
	endif
 99	continue
C if not there ftp file
	close(ifile)
	print *,'Force file not there yet '
        istat = system
     +    ('rm /group/atlas/BOL/sagcomp/forcefile')
        istat = system ('ftp -n < getforce.exe')
        istat = system 
     +    ('chmod g+w /group/atlas/BOL/sagcomp/forcefile')
        print *, 'ftp ended with status ', istat
	open(ifile,file=wname)
	read(ifile,'(a)',ERR=199,END=199)string
        rewind(ifile)
        print *,'Force file available now'
        goto 200
C if not exist give message
 199	print *,' Force file does not exist ',dname
 200	continue
        end


