      SUBROUTINE DEPTHFILETOUSE(infile,nchar,grid)

C     DEPTHFILETOUSE CHECKS WHICH DEPTH SET THE USER HAS DESIGNATED
C     (DEFAULT IS ORIGINAL 33 DEPTHS) AND GRID SIZE, AND SETS UP
C     THE DEPTH FILE ACCORDINGLY

      character*4 cdepthset
      character*(*) infile
      call checkwhichdepthfile(cdepthset)

      call clearstring(infile,nchar)
      if ( grid .le. 0.10 ) then
       infile='etop10th_'//cdepthset//'.d'//CHAR(0)
      elseif ( grid .le. 0.25 ) then
       infile='etopq_'//cdepthset//'.d'//CHAR(0)
      elseif ( grid .le. 1.0 ) then
       infile='etop1_'//cdepthset//'.d'//CHAR(0)
      endif

      return
      end
