Index: branches/2013/dev_MERGE_2013/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_ts.F90
===================================================================
--- branches/2013/dev_MERGE_2013/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_ts.F90	(revision 4373)
+++ branches/2013/dev_MERGE_2013/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_ts.F90	(revision 4374)
@@ -24,8 +24,6 @@
    USE dynspg_oce      ! surface pressure gradient variables
    USE phycst          ! physical constants
-   USE domvvl          ! variable volume
    USE dynvor          ! vorticity term
    USE bdy_par         ! for lk_bdy
-   USE bdy_oce         ! Lateral open boundary condition
    USE bdytides        ! open boundary condition data     
    USE bdydyn2d        ! open boundary conditions on barotropic variables
@@ -38,5 +36,5 @@
    USE iom             ! IOM library
    USE restart         ! only for lrst_oce
-   USE zdf_oce         ! Vertical diffusion
+   USE zdf_oce         ! Bottom friction coefts
    USE wrk_nemo        ! Memory Allocation
    USE timing          ! Timing    
@@ -111,20 +109,21 @@
       !! ** Purpose :   
       !!      -Compute the now trend due to the explicit time stepping
-      !!      of the quasi-linear barotropic system. Barotropic variables are
-      !!      advanced from internal time steps "n" to "n+1" (if ln_bt_cen=F)
-      !!      or from "n-1" to "n+1" time steps (if ln_bt_cen=T) with a
-      !!      generalized forward-backward (see ref. below) time stepping.
-      !!      -Update the free surface at step "n+1" (ssha, zsshu_a, zsshv_a).
-      !!      -Compute barotropic advective velocities at step "n" to be used 
-      !!      to advect tracers latter on. These are compliant with discrete
-      !!      continuity equation taken at the baroclinic time steps, thus 
-      !!      ensuring tracers conservation.
+      !!      of the quasi-linear barotropic system. 
       !!
       !! ** Method  :  
+      !!      Barotropic variables are advanced from internal time steps
+      !!      "n"   to "n+1" if ln_bt_fw=T
+      !!      or from 
+      !!      "n-1" to "n+1" if ln_bt_fw=F
+      !!      thanks to a generalized forward-backward time stepping (see ref. below).
       !!
-      !! ** Action : - Update barotropic velocities: ua_b, va_b
-      !!             - Update trend (ua,va) with barotropic component
-      !!             - Update ssha, zsshu_a, zsshv_a
-      !!             - Update barotropic advective velocity at kt=now
+      !! ** Action :
+      !!      -Update the filtered free surface at step "n+1"      : ssha
+      !!      -Update filtered barotropic velocities at step "n+1" : ua_b, va_b
+      !!      -Compute barotropic advective velocities at step "n" : un_adv, vn_adv
+      !!      These are used to advect tracers and are compliant with discrete
+      !!      continuity equation taken at the baroclinic time steps. This 
+      !!      ensures tracers conservation.
+      !!      -Update 3d trend (ua, va) with barotropic component.
       !!
       !! References : Shchepetkin, A.F. and J.C. McWilliams, 2005: 
@@ -138,13 +137,13 @@
       !
       LOGICAL  ::   ll_fw_start			! if true, forward integration 
-      LOGICAL  ::   ll_init			! if true, special startup of 2d equations
+      LOGICAL  ::   ll_init			    ! if true, special startup of 2d equations
       INTEGER  ::   ji, jj, jk, jn   		! dummy loop indices
       INTEGER  ::   ikbu, ikbv, noffset    	! local integers
       REAL(wp) ::   zraur, z1_2dt_b, z2dt_bf  	! local scalars
-      REAL(wp) ::   zx1, zy1, zx2, zy2         	!   -      -
-      REAL(wp) ::   z1_12, z1_8, z1_4, z1_2 	!   -      -
-      REAL(wp) ::   zu_spg, zv_spg		!   -      -
-      REAL(wp) ::   zhura, zhvra         	!   -      -
-      REAL(wp) ::   za0, za1, za2, za3		!   -      -
+      REAL(wp) ::   zx1, zy1, zx2, zy2         !   -      -
+      REAL(wp) ::   z1_12, z1_8, z1_4, z1_2 	  !   -      -
+      REAL(wp) ::   zu_spg, zv_spg		           !   -      -
+      REAL(wp) ::   zhura, zhvra         	     !   -      -
+      REAL(wp) ::   za0, za1, za2, za3		       !   -      -
       !
       REAL(wp), POINTER, DIMENSION(:,:) :: zun_e, zvn_e, zsshp2_e
@@ -158,5 +157,5 @@
       IF( nn_timing == 1 )  CALL timing_start('dyn_spg_ts')
       !
-      !                                         !* Allocate temporay arrays
+      !                                         !* Allocate temporary arrays
       CALL wrk_alloc( jpi, jpj, zsshp2_e, zhdiv )
       CALL wrk_alloc( jpi, jpj, zu_trd, zv_trd, zun_e, zvn_e  )
@@ -212,7 +211,7 @@
       ! Do it once at kt=nit000 if volume is fixed, else at each long time step.
       ! Note that these arrays are also used during barotropic loop. These are however frozen
-      ! although they should be updated in variable volume case. Not a big approximation.
+      ! although they should be updated in the variable volume case. Not a big approximation.
       ! To remove this approximation, copy lines below inside barotropic loop
-      ! and update depths at T-F points (ht and hf resp.) at each barotropic time step
+      ! and update depths at T-F points (ht and zhf resp.) at each barotropic time step
       !
       IF ( kt == nit000 .OR. lk_vvl ) THEN
@@ -243,4 +242,6 @@
             zhf(:,:) = 0.
             IF ( .not. ln_sco ) THEN
+! JC: It not clear yet what should be the depth at f-points over land in z-coordinate case
+!     Set it to zero for the time being 
 !              IF( rn_hmin < 0._wp ) THEN    ;   jk = - INT( rn_hmin )                                      ! from a nb of level
 !              ELSE                          ;   jk = MINLOC( gdepw_0, mask = gdepw_0 > rn_hmin, dim = 1 )  ! from a depth
@@ -333,5 +334,5 @@
          END DO
          !
-      ELSEIF ( ln_dynvor_ens ) THEN             ! enstrophy conserving scheme
+      ELSEIF ( ln_dynvor_ens ) THEN                    ! enstrophy conserving scheme
          DO jj = 2, jpjm1
             DO ji = fs_2, fs_jpim1   ! vector opt.
@@ -345,5 +346,5 @@
          END DO
          !
-      ELSEIF ( ln_dynvor_een ) THEN             ! enstrophy and energy conserving scheme
+      ELSEIF ( ln_dynvor_een ) THEN                    ! enstrophy and energy conserving scheme
          DO jj = 2, jpjm1
             DO ji = fs_2, fs_jpim1   ! vector opt.
@@ -529,5 +530,5 @@
             CALL lbc_lnk( zwx, 'U', 1._wp )    ;   CALL lbc_lnk( zwy, 'V', 1._wp )
             !
-            zhup2_e (:,:) = hu_0(:,:) + zwx(:,:)               ! Ocean depth at U- and V-points
+            zhup2_e (:,:) = hu_0(:,:) + zwx(:,:)                ! Ocean depth at U- and V-points
             zhvp2_e (:,:) = hv_0(:,:) + zwy(:,:)
          ELSE
@@ -795,9 +796,9 @@
             DO ji = 1, jpim1      ! NO Vector Opt.
                zsshu_a(ji,jj) = z1_2 * umask(ji,jj,1)  * r1_e12u(ji,jj) &
-                  &              * ( e12t(ji  ,jj) * ssha_e(ji  ,jj)    &
-                  &              +   e12t(ji+1,jj) * ssha_e(ji+1,jj) )
+                  &              * ( e12t(ji  ,jj) * ssha(ji  ,jj)    &
+                  &              +   e12t(ji+1,jj) * ssha(ji+1,jj) )
                zsshv_a(ji,jj) = z1_2 * vmask(ji,jj,1)  * r1_e12v(ji,jj) &
-                  &              * ( e12t(ji,jj  ) * ssha_e(ji,jj  )    &
-                  &              +   e12t(ji,jj+1) * ssha_e(ji,jj+1) )
+                  &              * ( e12t(ji,jj  ) * ssha(ji,jj  )    &
+                  &              +   e12t(ji,jj+1) * ssha(ji,jj+1) )
             END DO
          END DO
@@ -1102,2 +1103,3 @@
 END MODULE dynspg_ts
 
+
