Index: trunk/NEMO/OPA_SRC/DYN/dynspg_flt.F90
===================================================================
--- trunk/NEMO/OPA_SRC/DYN/dynspg_flt.F90	(revision 1556)
+++ trunk/NEMO/OPA_SRC/DYN/dynspg_flt.F90	(revision 1601)
@@ -18,7 +18,5 @@
    !!   'key_dynspg_flt'                              filtered free surface
    !!----------------------------------------------------------------------
-   !!   dyn_spg_flt  : update the momentum trend with the surface pressure
-   !!                  gradient in the filtered free surface case with
-   !!                  vector optimization
+   !!   dyn_spg_flt  : update the momentum trend with the surface pressure gradient in the filtered free surface case 
    !!   flt_rst      : read/write the time-splitting restart fields in the ocean restart file
    !!----------------------------------------------------------------------
@@ -31,4 +29,5 @@
    USE phycst          ! physical constants
    USE domvvl          ! variable volume
+   USE solmat          ! matrix construction for elliptic solvers
    USE solver          ! solver initialization
    USE solpcg          ! preconditionned conjugate gradient solver
@@ -44,5 +43,4 @@
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
    USE prtctl          ! Print control
-   USE solmat          ! matrix construction for elliptic solvers
    USE agrif_opa_interp
    USE iom
@@ -76,6 +74,6 @@
       !! ** Method  :   Filtered free surface formulation. The surface
       !!      pressure gradient is given by:
-      !!         spgu = 1/rau0 d/dx(ps) =  1/e1u di( sshn + rnu btda )
-      !!         spgv = 1/rau0 d/dy(ps) =  1/e2v dj( sshn + rnu btda )
+      !!         spgu = 1/rau0 d/dx(ps) =  1/e1u di( sshn + btda )
+      !!         spgv = 1/rau0 d/dy(ps) =  1/e2v dj( sshn + btda )
       !!      where sshn is the free surface elevation and btda is the after
       !!      time derivative of the free surface elevation
@@ -106,11 +104,11 @@
       USE oce, ONLY :   zvb   => sa   ! ta used as workspace
       !!
-      INTEGER, INTENT( in )  ::   kt       ! ocean time-step index
-      INTEGER, INTENT( out ) ::   kindic   ! solver convergence flag (<0 if not converge)
+      INTEGER, INTENT(in   ) ::   kt       ! ocean time-step index
+      INTEGER, INTENT(  out) ::   kindic   ! solver convergence flag (<0 if not converge)
       !!                                   
-      INTEGER  ::   ji, jj, jk                          ! dummy loop indices
-      REAL(wp) ::   z2dt, z2dtg, zraur, znugdt          ! temporary scalars
-      REAL(wp) ::   znurau, zgcb, zbtd                  !   "          "
-      REAL(wp) ::   ztdgu, ztdgv                        !   "          "
+      INTEGER  ::   ji, jj, jk           ! dummy loop indices
+      REAL(wp) ::   z2dt, z2dtg, zraur   ! temporary scalars
+      REAL(wp) ::   zgcb, zbtd   !   -          -
+      REAL(wp) ::   ztdgu, ztdgv         !   -          -
       !!----------------------------------------------------------------------
       !
@@ -127,16 +125,14 @@
          ! read filtered free surface arrays in restart file
          ! when using agrif, sshn, gcx have to be read in istate
-         IF (.NOT. lk_agrif) CALL flt_rst( nit000, 'READ' )       ! read or initialize the following fields:
+         IF(.NOT. lk_agrif)   CALL flt_rst( nit000, 'READ' )      ! read or initialize the following fields:
          !                                                        ! gcx, gcxb
       ENDIF
 
       ! Local constant initialization
-      z2dt = 2. * rdt                                       ! time step: leap-frog
-      IF( neuler == 0 .AND. kt == nit000 ) z2dt = rdt       ! time step: Euler if restart from rest
-      IF( neuler == 0 .AND. kt == nit000+1 ) CALL sol_mat(kt)
+      z2dt = 2. * rdt                                             ! time step: leap-frog
+      IF( neuler == 0 .AND. kt == nit000   )   z2dt = rdt         ! time step: Euler if restart from rest
+      IF( neuler == 0 .AND. kt == nit000+1 )   CALL sol_mat( kt )
       z2dtg  = grav * z2dt
       zraur  = 1. / rauw
-      znugdt =  rnu * grav * z2dt
-      znurau =  znugdt * zraur
 
       !! Explicit physics with thickness weighted updates
@@ -237,7 +233,5 @@
          END DO
       END DO
-
-      ! Boundary conditions on (spgu,spgv)
-      CALL lbc_lnk( spgu, 'U', -1. )
+      CALL lbc_lnk( spgu, 'U', -1. )       ! lateral boundary conditions 
       CALL lbc_lnk( spgv, 'V', -1. )
 
@@ -245,5 +239,5 @@
 
       ! Right hand side of the elliptic equation and first guess
-      ! -----------------------------------------------------------
+      ! --------------------------------------------------------
       DO jj = 2, jpjm1
          DO ji = fs_2, fs_jpim1   ! vector opt.
@@ -259,5 +253,5 @@
       END DO
       ! applied the lateral boundary conditions
-      IF( nsolv == 2 .AND. MAX( jpr2di, jpr2dj ) > 0 ) CALL lbc_lnk_e( gcb, c_solver_pt, 1. )   
+      IF( nn_solv == 2 .AND. MAX( jpr2di, jpr2dj ) > 0 )   CALL lbc_lnk_e( gcb, c_solver_pt, 1. )   
 
 #if defined key_agrif
@@ -265,11 +259,11 @@
          ! add contribution of gradient of after barotropic transport divergence 
          IF( nbondi == -1 .OR. nbondi == 2 )   gcb(3     ,:) =   &
-            &    gcb(3     ,:) - znugdt * z2dt * laplacu(2     ,:) * gcdprc(3     ,:) * hu(2     ,:) * e2u(2     ,:)
+            &    gcb(3     ,:) - z2dtg * z2dt * laplacu(2     ,:) * gcdprc(3     ,:) * hu(2     ,:) * e2u(2     ,:)
          IF( nbondi ==  1 .OR. nbondi == 2 )   gcb(nlci-2,:) =   &
-            &    gcb(nlci-2,:) + znugdt * z2dt * laplacu(nlci-2,:) * gcdprc(nlci-2,:) * hu(nlci-2,:) * e2u(nlci-2,:)
+            &    gcb(nlci-2,:) + z2dtg * z2dt * laplacu(nlci-2,:) * gcdprc(nlci-2,:) * hu(nlci-2,:) * e2u(nlci-2,:)
          IF( nbondj == -1 .OR. nbondj == 2 )   gcb(:     ,3) =   &
-            &    gcb(:,3     ) - znugdt * z2dt * laplacv(:,2     ) * gcdprc(:,3     ) * hv(:,2     ) * e1v(:,2     )
+            &    gcb(:,3     ) - z2dtg * z2dt * laplacv(:,2     ) * gcdprc(:,3     ) * hv(:,2     ) * e1v(:,2     )
          IF( nbondj ==  1 .OR. nbondj == 2 )   gcb(:,nlcj-2) =   &
-            &    gcb(:,nlcj-2) + znugdt * z2dt * laplacv(:,nlcj-2) * gcdprc(:,nlcj-2) * hv(:,nlcj-2) * e1v(:,nlcj-2)
+            &    gcb(:,nlcj-2) + z2dtg * z2dt * laplacv(:,nlcj-2) * gcdprc(:,nlcj-2) * hv(:,nlcj-2) * e1v(:,nlcj-2)
       ENDIF
 #endif
@@ -298,11 +292,6 @@
       kindic = 0
       IF( ncut == 0 ) THEN
-         IF( nsolv == 1 ) THEN         ! diagonal preconditioned conjuguate gradient
-            CALL sol_pcg( kindic )
-         ELSEIF( nsolv == 2 ) THEN     ! successive-over-relaxation
-            CALL sol_sor( kindic )
-         ELSE                          ! e r r o r in nsolv namelist parameter
-            WRITE(ctmp1,*) ' ~~~~~~~~~~~                not = ', nsolv
-            CALL ctl_stop( ' dyn_spg_flt : e r r o r, nsolv = 1 or 2', ctmp1 )
+         IF    ( nn_solv == 1 ) THEN   ;   CALL sol_pcg( kindic )      ! diagonal preconditioned conjuguate gradient
+         ELSEIF( nn_solv == 2 ) THEN   ;   CALL sol_sor( kindic )      ! successive-over-relaxation
          ENDIF
       ENDIF
@@ -313,6 +302,6 @@
          DO ji = fs_2, fs_jpim1   ! vector opt.
             ! trend of Transport divergence gradient
-            ztdgu = znugdt * (gcx(ji+1,jj  ) - gcx(ji,jj) ) / e1u(ji,jj)
-            ztdgv = znugdt * (gcx(ji  ,jj+1) - gcx(ji,jj) ) / e2v(ji,jj)
+            ztdgu = z2dtg * (gcx(ji+1,jj  ) - gcx(ji,jj) ) / e1u(ji,jj)
+            ztdgv = z2dtg * (gcx(ji  ,jj+1) - gcx(ji,jj) ) / e2v(ji,jj)
             ! multiplied by z2dt
 #if defined key_obc
@@ -336,8 +325,8 @@
       IF( .NOT. Agrif_Root() ) THEN
          ! caution : grad D (fine) = grad D (coarse) at coarse/fine interface
-         IF( nbondi == -1 .OR. nbondi == 2 ) spgu(2     ,:) = znugdt * z2dt * laplacu(2     ,:) * umask(2     ,:,1)
-         IF( nbondi ==  1 .OR. nbondi == 2 ) spgu(nlci-2,:) = znugdt * z2dt * laplacu(nlci-2,:) * umask(nlci-2,:,1)
-         IF( nbondj == -1 .OR. nbondj == 2 ) spgv(:,2     ) = znugdt * z2dt * laplacv(:,2     ) * vmask(:     ,2,1)
-         IF( nbondj ==  1 .OR. nbondj == 2 ) spgv(:,nlcj-2) = znugdt * z2dt * laplacv(:,nlcj-2) * vmask(:,nlcj-2,1)
+         IF( nbondi == -1 .OR. nbondi == 2 ) spgu(2     ,:) = z2dtg * z2dt * laplacu(2     ,:) * umask(2     ,:,1)
+         IF( nbondi ==  1 .OR. nbondi == 2 ) spgu(nlci-2,:) = z2dtg * z2dt * laplacu(nlci-2,:) * umask(nlci-2,:,1)
+         IF( nbondj == -1 .OR. nbondj == 2 ) spgv(:,2     ) = z2dtg * z2dt * laplacv(:,2     ) * vmask(:     ,2,1)
+         IF( nbondj ==  1 .OR. nbondj == 2 ) spgv(:,nlcj-2) = z2dtg * z2dt * laplacv(:,nlcj-2) * vmask(:,nlcj-2,1)
       ENDIF
 #endif      
