      SUBROUTINE readgournew6(maxyear,monthx,maxdepth,ntyp,dstretch,
     * myearmin,myearmax)
      parameter (icmax=10)
      character*80 text, filename
c      parameter (dstretch=3000)
      dimension dstretch(maxyear,monthx,maxdepth,ntyp)
      dimension icomma(icmax,2)
      call extraname('sys.inf'//CHAR(0),
     * 'stretching_t5_monthly_1meter.dat'//CHAR(0),
     * filename)
       open(9,file=filename,status='old')
c       open(10,file='./gour_res.dat')
c      read(9,*,end=44) depth,iyear,xmonth,thermal_bias
c    read in headers
c      read(9,'(a)') text
      myearmin=maxyear
      myearmax=0
      do 50 ny=1,500000
       call clearstring(text,80)
      read(9, '(a)', end=4) text
      call findlastchar(nsp,text,80)

      call commafindx(nsp,icmax,ncomma,icomma,text)
      if ( ncomma .lt. 2) goto 50
      read(text(icomma(2,1):icomma(2,1)+icomma(2,2)-1),*)
     * nyear
       if (nyear .lt. 1984) myearmin=nyear
       if (nyear .gt. myearmax) myearmax=nyear
c       write(6,*)'myearmin,myearmin,t5',myearmin,myearmin
      read(text(icomma(3,1):icomma(3,1)+icomma(3,2)-1),*)
     * month
      read(text(icomma(4,1):icomma(4,1)+icomma(4,2)-1),*)
     * idepth
      read(text(icomma(5,1):icomma(5,1)+icomma(5,2)-1),*)
     * dstretch(nyear,month,idepth,3)
c       write(6,*) iyear,monthx,idepth,dstretch(iyear,monthx,idepth,3)
50    continue
4     continue
      close(9)
      return
      end
