Index: branches/2011/UKMO_MERCATOR_obc_bdy_merge/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_ts.F90
===================================================================
--- branches/2011/UKMO_MERCATOR_obc_bdy_merge/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_ts.F90	(revision 2796)
+++ branches/2011/UKMO_MERCATOR_obc_bdy_merge/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_ts.F90	(revision 2797)
@@ -25,14 +25,8 @@
    USE domvvl          ! variable volume
    USE zdfbfr          ! bottom friction
-   USE obcdta          ! open boundary condition data     
-   USE obcfla          ! Flather open boundary condition  
    USE dynvor          ! vorticity term
    USE obc_oce         ! Lateral open boundary condition
-   USE obc_par         ! open boundary condition parameters
-   USE bdy_oce         ! unstructured open boundaries
-   USE bdy_par         ! unstructured open boundaries
-   USE bdydta          ! unstructured open boundaries
-   USE bdydyn          ! unstructured open boundaries
-   USE bdytides        ! tidal forcing at unstructured open boundaries.
+   USE obcdta          ! open boundary condition data     
+   USE obcdyn2d        ! open boundary conditions on barotropic variables
    USE lib_mpp         ! distributed memory computing library
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
@@ -352,13 +346,4 @@
       zssh_sum(:,:) = sshn (:,:)
 
-#if defined key_obc
-      ! set ssh corrections to 0
-      ! ssh corrections are applied to normal velocities (Flather's algorithm) and averaged over the barotropic loop
-      IF( lp_obc_east  )   sshfoe_b(:,:) = 0.e0
-      IF( lp_obc_west  )   sshfow_b(:,:) = 0.e0
-      IF( lp_obc_south )   sshfos_b(:,:) = 0.e0
-      IF( lp_obc_north )   sshfon_b(:,:) = 0.e0
-#endif
-
       !                                             ! ==================== !
       DO jn = 1, icycle                             !  sub-time-step loop  ! (from NOW to AFTER+1)
@@ -367,8 +352,7 @@
          IF( jn == 1 )   z2dt_e = rdt / nn_baro
 
-         !                                                !* Update the forcing (OBC, BDY and tides)
+         !                                                !* Update the forcing (OBC and tides)
          !                                                !  ------------------
-         IF( lk_obc )   CALL obc_dta_bt ( kt, jn   )
-         IF( lk_bdy )   CALL bdy_dta_fla( kt, jn+1, icycle )
+         IF( lk_obc )   CALL obc_dta ( kt, jit=jn   )
 
          !                                                !* after ssh_e
@@ -384,13 +368,5 @@
          !
 #if defined key_obc
-         !                                                     ! OBC : zhdiv must be zero behind the open boundary
-!!  mpp remark: The zeroing of hdiv can probably be extended to 1->jpi/jpj for the correct row/column
-         IF( lp_obc_east  )   zhdiv(nie0p1:nie1p1,nje0  :nje1  ) = 0.e0      ! east
-         IF( lp_obc_west  )   zhdiv(niw0  :niw1  ,njw0  :njw1  ) = 0.e0      ! west
-         IF( lp_obc_north )   zhdiv(nin0  :nin1  ,njn0p1:njn1p1) = 0.e0      ! north
-         IF( lp_obc_south )   zhdiv(nis0  :nis1  ,njs0  :njs1  ) = 0.e0      ! south
-#endif
-#if defined key_bdy
-         zhdiv(:,:) = zhdiv(:,:) * bdytmask(:,:)               ! BDY mask
+         zhdiv(:,:) = zhdiv(:,:) * obctmask(:,:)               ! OBC mask
 #endif
          !
@@ -489,10 +465,6 @@
          !                                                !* domain lateral boundary
          !                                                !  -----------------------
-         !                                                      ! Flather's boundary condition for the barotropic loop :
-         !                                                      !         - Update sea surface height on each open boundary
-         !                                                      !         - Correct the velocity
-
-         IF( lk_obc               )   CALL obc_fla_ts ( ua_e, va_e, sshn_e, ssha_e )
-         IF( lk_bdy .OR. ln_tides )   CALL bdy_dyn_fla( sshn_e ) 
+                                                               ! OBC open boundaries
+         IF( lk_obc .OR. ln_tides )   CALL obc_dyn2d( kt, sshn_e ) 
          !
          CALL lbc_lnk( ua_e  , 'U', -1. )                      ! local domain boundaries 
