      subroutine advec(ihbin,Ut,Vt,Wt)

#include "oparams.F.h"
#include "poseidon.F.h"

      logical first
      data    first/.TRUE./    ! Force static loading
      
      real Wk1(LEN)
      real Wk2(LEN)

     
      real  Zt(LEN)
      real Ut(len,km),Vt(len,km),Wt(len,km)


c---------------------------------------------------------------------

       if (first) then
              call CHEKCFL
      endif !first


c------------------HYDRODYNAMICS ----------------------------------

! 08/24/95 
         if ( ihbin .gt. 0) then
          i = ISMAX( nwater , B(1,1,indext1) , 1 )
          call SET_BINIT( KM, binit(KM), B(i,1,indext1), binit )
         endif

         if (LOTH) call ACCUMQ( LEN, nwater, Qbuoy_acc, tbuoy, 
     &        T(1,1,indext2),S(1,1,indext2), Woc, Qoc, Fso ,c2dt)
         
c         tpshydr = tpshydr - SECOND()

         call HYDRO( LEN, KM, NTRACE, nwater, nland, EXTMODE,
     &               H(1,1,indext2), U(1,1,indext2),
     &               V(1,1,indext2), T(1,1,indext2),S(1,1,indext2),
     &               B(1,1,indext2),
     &               H(1,1,indext1), U(1,1,indext1),
     &               V(1,1,indext1), T(1,1,indext1),S(1,1,indext1),
     &               B(1,1,indext1),
     &               H(1,1,indext3), U(1,1,indext3),
     &               V(1,1,indext3), T(1,1,indext3),S(1,1,indext3),
     &               B(1,1,indext3),
     &               Dx_h, Dy_h, Area_h,Area_u,Zbottom,
     &               ieast,iwest,inorth,isouth,Bh, Bu,
     &               Coriolis, U_metric, V_metric, ocn_taux, ocn_tauy,
     &               Woc, Qoc, Fso, Qrad_net, 
     &               D_min, D_max, hmin, hmax ,binit, MATERL, MLK,  
     &               PENDEPTH, PENFRAC, T_deep, S_deep, 
     &               Entrainment, M_O_Depth, c2dt , W_ent,
     *               Area_h_r, Area_u_r,Ut,Vt,Wt)
     

         first = .FALSE.  ! Set to false on first time through
                          ! that actually takes a step


      END
