      SUBROUTINE TIMEFROMDEPTH(nlevels,t0,maxlevel,ihanawa,depth)

C     BACKS OUT TIME FROM GIVEN XBT DEPTH BASED ON HANAWA DROP RATE

      dimension t0(maxlevel),depth(maxlevel)
      if ( ihanawa .eq. 1 ) then
c      Sippican equation
       t1=444.44423
       t2=2210838.36
       t3=1486.88882
      elseif ( ihanawa .eq. 2 ) then
c      ?
       t1=1388.8888
       t2=12425525.9
       t3=3524.98594
      elseif ( ihanawa .eq. 3 ) then
c      Fast Deep
       t1=549.450523
       t2=3081760.67
       t3=1755.49442
      elseif ( ihanawa .eq. 4 ) then
c      T11 XBT
       t1=3921.56844
       t2=12167784.3
       t3=3488.23513
      elseif ( ihanawa .eq. 5 ) then
c      T10 XBT
       t1=462.962941
       t2=2127411.12
       t3=1458.56475
      elseif ( ihanawa .eq. 6 ) then
c     T5 XBT
       t1=549.450523
       t2=3518716.
       t3=1875.82409
      else
c      Hanawa equation
       t1=462.962941
       t2=2244447.66
       t3=1498.14808
      endif

      do 50 n=1,nlevels
       xn=depth(n)
       t0(n)=t3 - sqrt(t2 - (t1*xn))
c      write(6,*) 'xn',n,xn,t0(n)
50    continue

      return
      end
