Index: trunk/NEMO/OPA_SRC/DYN/dynspg.F90
===================================================================
--- trunk/NEMO/OPA_SRC/DYN/dynspg.F90	(revision 474)
+++ trunk/NEMO/OPA_SRC/DYN/dynspg.F90	(revision 503)
@@ -4,4 +4,7 @@
    !! Ocean dynamics:  surface pressure gradient control
    !!======================================================================
+   !! History :  9.0  !  05-12  (C. Talandier, G. Madec)  Original code
+   !!            9.0  !  05-12  (V. Garnier)  dyn_spg_ctl: Original code
+   !!----------------------------------------------------------------------
 
    !!----------------------------------------------------------------------
@@ -9,5 +12,4 @@
    !!   dyn_spg_ctl : initialization, namelist read, and parameters control
    !!----------------------------------------------------------------------
-   !! * Modules used
    USE oce            ! ocean dynamics and tracers variables
    USE dom_oce        ! ocean space and time domain variables
@@ -29,11 +31,8 @@
    PRIVATE
 
-   !! * Accessibility
    PUBLIC dyn_spg         ! routine called by step module
 
    !! * module variables
-   INTEGER ::                        &
-      nspg = 0                         ! type of surface pressure gradient scheme
-      !                                ! defined from lk_dynspg_... 
+   INTEGER ::   nspg = 0   ! type of surface pressure gradient scheme defined from lk_dynspg_... 
 
    !! * Substitutions
@@ -43,5 +42,5 @@
    !!   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)
    !!----------------------------------------------------------------------
 
@@ -53,16 +52,10 @@
       !!
       !! ** Purpose :   compute the lateral ocean dynamics physics.
-      !!
-      !! History :
-      !!   9.0  !  05-12  (C. Talandier, G. Madec)  Original code
-      !!----------------------------------------------------------------------
-      !! * Arguments
+      !!----------------------------------------------------------------------
       INTEGER, INTENT( in  ) ::   kt     ! ocean time-step index
       INTEGER, INTENT( out ) ::   kindic ! solver flag
-
-      !! * local declarations
+      !!
       REAL(wp) ::   z2dt                      ! temporary scalar
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   &
-         ztrdu, ztrdv                         ! 3D temporary workspace
+      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   ztrdu, ztrdv   ! 3D workspace
       !!----------------------------------------------------------------------
 
@@ -75,42 +68,36 @@
 
       SELECT CASE ( nspg )                       ! compute surf. pressure gradient trend and add it to the general trend
+      !                                                      ! k-j-i loops
+      CASE (  0 )   ;   CALL dyn_spg_exp    ( kt )              ! explicit
+      CASE (  1 )   ;   CALL dyn_spg_ts     ( kt )              ! time-splitting
+      CASE (  2 )   ;   CALL dyn_spg_flt    ( kt, kindic )      ! filtered
+      CASE (  3 )   ;   CALL dyn_spg_rl     ( kt, kindic )      ! rigid lid
+      !                                                      ! j-k-i loops
+      CASE ( 10 )   ;   CALL dyn_spg_exp_jki( kt )              ! explicit with j-k-i loop
+      CASE ( 11 )   ;   CALL dyn_spg_ts_jki ( kt )              ! time-splitting with j-k-i loop
+      CASE ( 12 )   ;   CALL dyn_spg_flt_jki( kt, kindic )      ! filtered with j-k-i loop
+      !
       CASE ( -1 )                                       ! esopa: test all possibility with control print
-         CALL dyn_spg_exp    ( kt )
-         IF(ln_ctl)   CALL prt_ctl( tab3d_1=ua, clinfo1=' spg0 - Ua: ', mask1=umask, &
-               &                    tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
-         CALL dyn_spg_ts     ( kt )
-         IF(ln_ctl)   CALL prt_ctl( tab3d_1=ua, clinfo1=' spg1 - Ua: ', mask1=umask, &
-               &                    tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
-         CALL dyn_spg_flt  ( kt, kindic )
-         IF(ln_ctl)   CALL prt_ctl( tab3d_1=ua, clinfo1=' spg2 - Ua: ', mask1=umask, &
-               &                    tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
-         CALL dyn_spg_exp_jki( kt )
-         IF(ln_ctl)   CALL prt_ctl( tab3d_1=ua, clinfo1=' spg10- Ua: ', mask1=umask, &
-               &                    tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
-         CALL dyn_spg_ts_jki ( kt )
-         IF(ln_ctl)   CALL prt_ctl( tab3d_1=ua, clinfo1=' spg12- Ua: ', mask1=umask, &
-               &                    tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
-         CALL dyn_spg_flt_jki( kt, kindic )
-         IF(ln_ctl)   CALL prt_ctl( tab3d_1=ua, clinfo1=' spg13- Ua: ', mask1=umask, &
-               &                    tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
-      CASE (  0 )                                       ! explicit
-         CALL dyn_spg_exp    ( kt )
-      CASE (  1 )                                       ! time-splitting
-         CALL dyn_spg_ts     ( kt )
-      CASE (  2 )                                       ! filtered
-         CALL dyn_spg_flt    ( kt, kindic )
-      CASE (  3 )                                       ! rigid lid
-         CALL dyn_spg_rl     ( kt, kindic )
-
-      CASE ( 10 )                                       ! explicit with j-k-i loop
-         CALL dyn_spg_exp_jki( kt )
-      CASE ( 11 )                                       ! time-splitting with j-k-i loop
-         CALL dyn_spg_ts_jki ( kt )
-      CASE ( 12 )                                       ! filtered with j-k-i loop
-         CALL dyn_spg_flt_jki( kt, kindic )
+         ;              CALL dyn_spg_exp    ( kt )
+         ;              CALL prt_ctl( tab3d_1=ua, clinfo1=' spg0 - Ua: ', mask1=umask, &
+            &                         tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
+         ;              CALL dyn_spg_ts     ( kt )
+         ;              CALL prt_ctl( tab3d_1=ua, clinfo1=' spg1 - Ua: ', mask1=umask, &
+            &                         tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
+         ;              CALL dyn_spg_flt  ( kt, kindic )
+         ;              CALL prt_ctl( tab3d_1=ua, clinfo1=' spg2 - Ua: ', mask1=umask, &
+            &                         tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
+         ;              CALL dyn_spg_exp_jki( kt )
+         ;              CALL prt_ctl( tab3d_1=ua, clinfo1=' spg10- Ua: ', mask1=umask, &
+            &                         tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
+         ;              CALL dyn_spg_ts_jki ( kt )
+         ;              CALL prt_ctl( tab3d_1=ua, clinfo1=' spg12- Ua: ', mask1=umask, &
+            &                         tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
+         ;              CALL dyn_spg_flt_jki( kt, kindic )
+         ;              CALL prt_ctl( tab3d_1=ua, clinfo1=' spg13- Ua: ', mask1=umask, &
+            &                         tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
       END SELECT
-
-      !                                          ! save the horizontal diffusive trends for further diagnostics
-      IF( l_trddyn )   THEN
+      !                    
+      IF( l_trddyn )   THEN                      ! save the horizontal diffusive trends for further diagnostics
          SELECT CASE ( nspg )
          CASE ( 0, 1, 3, 10, 11 )
@@ -123,11 +110,10 @@
             ztrdv(:,:,:) = ( va(:,:,:) - vb(:,:,:) ) / z2dt - ztrdv(:,:,:)
          END SELECT
-         CALL trd_mod( ztrdu, ztrdv, jpdtdspg, 'DYN', kt )
-      ENDIF
-
+         CALL trd_mod( ztrdu, ztrdv, jpdyn_trd_spg, 'DYN', kt )
+      ENDIF
       !                                          ! print mean trends (used for debugging)
       IF(ln_ctl)   CALL prt_ctl( tab3d_1=ua, clinfo1=' spg  - Ua: ', mask1=umask, &
          &                       tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
-
+      !
    END SUBROUTINE dyn_spg
 
@@ -139,7 +125,4 @@
       !! ** Purpose :   Control the consistency between cpp options for 
       !!      surface pressure gradient schemes
-      !!
-      !! History :
-      !!   9.0  !  05-10  (V. Garnier)  Original code : spg re-organization
       !!----------------------------------------------------------------------
       !! * Local declarations
