Index: trunk/NEMO/OPA_SRC/OBC/obccli.F90
===================================================================
--- trunk/NEMO/OPA_SRC/OBC/obccli.F90	(revision 367)
+++ trunk/NEMO/OPA_SRC/OBC/obccli.F90	(revision 465)
@@ -1,15 +1,18 @@
 MODULE obccli
-   !!===================================================================================
+   !!======================================================================
    !!                       ***  MODULE  obccli  ***
-   !! Ocean dynamics:   Baroclinic componant of velocities on each open boundary
-   !!===================================================================================
+   !! Ocean dynamics:   Baroclinic velocities on each open boundary
+   !!======================================================================
+   !! History :
+   !!   8.5  !  02-10 (C. Talandier, A-M. Treguier) Free surface, F90
+   !!   9.0  !  06-04 (R.Benshila, G. Madec)  zco, zps, sco coordinate
+   !!----------------------------------------------------------------------
 #if defined key_obc && defined key_dynspg_rl
-   !!-----------------------------------------------------------------------------------
-   !!   'key_obc'               and 
-   !!   'key_dynspg_rl'
-   !!-----------------------------------------------------------------------------------
-   !!   obc_cli_dyn : Compute the baroclinic componant after the radiation phase
-   !!   obc_cli_dta : Compute the baroclinic componant for the climatological velocities
-   !!-----------------------------------------------------------------------------------
+   !!----------------------------------------------------------------------
+   !!   'key_obc' and 'key_dynspg_rl' open boundary condition and rigid-lid
+   !!----------------------------------------------------------------------
+   !!   obc_cli_dyn : baroclinic componant after the radiation phase
+   !!   obc_cli_dta : baroclinic componant for the climatological velocities
+   !!----------------------------------------------------------------------
    !! * Modules used
    USE oce             ! ocean dynamics and tracers   
@@ -30,14 +33,14 @@
    !! * Substitutions
 #  include "domzgr_substitute.h90"
-   !!-----------------------------------------------------------------------------------
+   !!----------------------------------------------------------------------
    !!   OPA 9.0 , LOCEAN-IPSL (2005) 
    !! $Header$ 
-   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
-   !!-----------------------------------------------------------------------------------
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 
 CONTAINS
 
    SUBROUTINE obc_cli_dyn( obvel, velcli, obd, obf, obtyp, obl)
-      !!--------------------------------------------------------------------------------
+      !!----------------------------------------------------------------------
       !!                 ***  SUBROUTINE obc_cli_dyn  ***
       !!                   
@@ -51,7 +54,5 @@
       !!      - obl is the lenght of the OB (jpi or jpj) 
       !!
-      !! History :
-      !!   8.5  !  02-10 (C. Talandier, A-M. Treguier) Free surface, F90
-      !!--------------------------------------------------------------------------------
+      !!-----------------------------------------------------------------------
       !! * Arguments
       INTEGER, INTENT( in ) ::   & ! OB localization:jpieob or jpiwob for East or West 
@@ -74,11 +75,6 @@
          zmskob,                    & ! Velocity mask
          zvel                         ! 2D Local velocity on OB
-# if defined key_partial_steps
       REAL(wp), DIMENSION(obl,jpk) ::   &
          ze3ob                        ! Vertical scale factor
-# else
-      REAL(wp), DIMENSION(jpk) ::   &
-         ze3ob                        ! Vertical scale factor
-# endif
       !!--------------------------------------------------------------------------------
 
@@ -86,54 +82,33 @@
       ! -----------------------
 
-      zhinv(:) = 0.e0
+      zhinv (:)   = 0.e0
       zmskob(:,:) = 0.e0
-      zvel(:,:) = 0.e0
-# if defined key_partial_steps
-      ze3ob(:,:) = 0.e0
-# else
-      ze3ob(:) = 0.e0
-# endif
+      zvel  (:,:) = 0.e0
+      ze3ob (:,:) = 0.e0
 
       IF( obtyp == 0 ) THEN            ! Meridional Open Boundary ( East or West OB )
          DO ji = obd, obf
-            zhinv(:) = hur(ji,:)
+            zhinv (:)   = hur  (ji,:)
             zmskob(:,:) = umask(ji,:,:)
-            zvel(:,:) = obvel(ji,:,:)
-# if defined key_partial_steps
-            ze3ob(:,:) = fse3u(ji,:,:)
-# else
-            ze3ob(:) = fse3u(:,:,:)
-# endif
+            zvel  (:,:) = obvel(ji,:,:)
+            ze3ob (:,:) = fse3u(ji,:,:)
          END DO
       ELSE                             ! Zonal Open Boundary ( North or South OB )
          DO jj = obd, obf
-            zhinv(:) = hvr(:,jj)
+            zhinv (:)   = hvr  (:,jj)
             zmskob(:,:) = vmask(:,jj,:)
-            zvel(:,:) = obvel(:,jj,:)
-# if defined key_partial_steps
-            ze3ob(:,:) = fse3v(:,jj,:)
-# else
-            ze3ob(:) = fse3v(:,:,:)
-# endif
+            zvel  (:,:) = obvel(:,jj,:)
+            ze3ob (:,:) = fse3v(:,jj,:)
          END DO
       END IF
 
-      zvelbtpe(:) = 0.e0
 
       ! 1. vertical sum
       ! ----------------
-# if defined key_vectopt_loop
+      zvelbtpe(1) = 0.e0
 !CDIR NOLOOPCHG
-# endif
-      DO jol = obd, obf ! Vector opt.
-         DO jk = 1, jpkm1
-            DO jle = 1, obl
-               zvelbtpe(jle) = zvelbtpe(jle) + zvel(jle,jk)*zmskob(jle,jk) &
-# if defined key_partial_steps
-                                           * ze3ob(jol,jle,jk)
-# else
-                                           * ze3ob(jk)
-# endif
-            END DO
+      DO jk = 1, jpkm1
+         DO jle = 1, obl
+            zvelbtpe(jle) = zvelbtpe(jle) + zvel(jle,jk) * zmskob(jle,jk) * ze3ob(jle,jk)
          END DO
       END DO
@@ -141,7 +116,5 @@
       ! 2. divide by the depth
       ! -----------------------
-      DO jle = 1, obl
-         zvelbtpe(jle) = zvelbtpe(jle) * zhinv(jle) * zmskob(jle,1) 
-      END DO
+      zvelbtpe(:) = zvelbtpe(:) * zhinv(:) * zmskob(:,1) 
 
       ! 3. substract zvelbtpe to the total velocity
@@ -149,8 +122,5 @@
       ! ------------------------------------------------
       DO jk = 1, jpkm1
-         DO jle = 1, obl
-            zcbl = zvel(jle,jk) - zvelbtpe(jle)*zmskob(jle,jk)
-            velcli(jle,jk) = zcbl * zmskob(jle,jk)
-         END DO
+         velcli(:,jk) = ( zvel(:,jk) - zvelbtpe(:) ) * zmskob(:,jk)
       END DO
 
@@ -172,6 +142,4 @@
       !!      - obl is the lenght of the OB (jpi or jpj) 
       !!
-      !! History :
-      !!   8.5  !  02-10 (C. Talandier, A-M. Treguier) Free surface, F90
       !!--------------------------------------------------------------------------------
       !! * Arguments
@@ -195,11 +163,6 @@
       REAL(wp), DIMENSION(obl,jpk) ::   &
          zmskob                       ! Velocity mask
-# if defined key_partial_steps
       REAL(wp), DIMENSION(obl,jpk) ::   &
          ze3ob                        ! Vertical scale factor
-# else
-      REAL(wp), DIMENSION(jpk) ::   &
-         ze3ob                        ! Vertical scale factor
-# endif
       !!--------------------------------------------------------------------------------
 
@@ -207,52 +170,30 @@
       ! -----------------------
 
-      zhinv(:) = 0.e0
+      zhinv (:)   = 0.e0
       zmskob(:,:) = 0.e0
-# if defined key_partial_steps
-      ze3ob(:,:) = 0.e0
-# else
-      ze3ob(:) = 0.e0
-# endif
+      ze3ob (:,:) = 0.e0
 
       IF( obtyp == 0 ) THEN            ! Meridional Open Boundary ( East or West OB )
          DO ji = obd, obf
-            zhinv(:) = hur(ji,:)
+            zhinv (:)   = hur  (ji,:)
             zmskob(:,:) = umask(ji,:,:)
-# if defined key_partial_steps
-            ze3ob(:,:) = fse3u(ji,:,:)
-# else
-            ze3ob(:) = fse3u(:,:,:)
-# endif
+            ze3ob (:,:) = fse3u(ji,:,:)
          END DO
       ELSE                             ! Zonal Open Boundary ( North or South OB )
          DO jj = obd, obf
-            zhinv(:) = hvr(:,jj)
+            zhinv (:)   = hvr  (:,jj)
             zmskob(:,:) = vmask(:,jj,:)
-# if defined key_partial_steps
-            ze3ob(:,:) = fse3v(:,jj,:)
-# else
-            ze3ob(:) = fse3v(:,:,:)
-# endif
+            ze3ob (:,:) = fse3v(:,jj,:)
          END DO
       END IF
-
-      zvelbtpe(:) = 0.e0
 
       ! 1. vertical sum
       ! ----------------
-# if defined key_vectopt_loop
+      zvelbtpe(1) = 0.e0
 !CDIR NOLOOPCHG
-# endif
-      DO jol = obd, obf ! Vector opt.
-         DO jk = 1, jpkm1
-            DO jle = 1, obl
-               ij = jle -1 + mpp
-               zvelbtpe(jle) = zvelbtpe(jle) + obvel(ij,jk,1)*zmskob(jle,jk) &
-# if defined key_partial_steps
-                                           * ze3ob(jol,jle,jk)
-# else
-                                           * ze3ob(jk)
-# endif
-            END DO
+      DO jk = 1, jpkm1
+         DO jle = 1, obl
+            ij = jle -1 + mpp
+            zvelbtpe(jle) = zvelbtpe(jle) + obvel(ij,jk,1)*zmskob(jle,jk) * ze3ob(jle,jk)
          END DO
       END DO
@@ -260,7 +201,5 @@
       ! 2. divide by the depth
       ! -----------------------
-      DO jle = 1, obl
-         zvelbtpe(jle) = zvelbtpe(jle) * zhinv(jle) * zmskob(jle,1) 
-      END DO 
+         zvelbtpe(:) = zvelbtpe(:) * zhinv(:) * zmskob(:,1) 
 
       ! 3. substract zvelbtpe to the total velocity
