Index: branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv.F90
===================================================================
--- branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv.F90	(revision 8185)
+++ branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv.F90	(revision 8568)
@@ -7,4 +7,5 @@
    !!            3.3  !  2010-10  (C. Ethe, G. Madec)  reorganisation of initialisation phase
    !!            3.6  !  2015-05  (N. Ducousso, G. Madec)  add Hollingsworth scheme as an option 
+   !!            4.0  !  2017-07  (G. Madec)  add a linear dynamics option
    !!----------------------------------------------------------------------
 
@@ -30,16 +31,21 @@
  
    !                                    !* namdyn_adv namelist *
-   LOGICAL, PUBLIC ::   ln_dynadv_vec   !: vector form flag
-   INTEGER, PUBLIC ::   nn_dynkeg       !: scheme of kinetic energy gradient: =0 C2 ; =1 Hollingsworth
+   LOGICAL, PUBLIC ::   ln_dynadv_NONE  !: linear dynamics (no momentum advection)
+   LOGICAL, PUBLIC ::   ln_dynadv_vec   !: vector form
+   INTEGER, PUBLIC ::      nn_dynkeg       !: scheme of grad(KE): =0 C2 ; =1 Hollingsworth
    LOGICAL, PUBLIC ::   ln_dynadv_cen2  !: flux form - 2nd order centered scheme flag
    LOGICAL, PUBLIC ::   ln_dynadv_ubs   !: flux form - 3rd order UBS scheme flag
-   LOGICAL, PUBLIC ::   ln_dynzad_zts   !: vertical advection with sub-timestepping (requires vector form)
    
-   INTEGER ::   nadv   ! choice of the formulation and scheme for the advection
+   INTEGER, PUBLIC ::   n_dynadv   !: choice of the formulation and scheme for momentum advection
+   !                               !  associated indices:
+   INTEGER, PUBLIC, PARAMETER ::   np_LIN_dyn = 0   ! no advection: linear dynamics
+   INTEGER, PUBLIC, PARAMETER ::   np_VEC_c2  = 1   ! vector form : 2nd order centered scheme
+   INTEGER, PUBLIC, PARAMETER ::   np_FLX_c2  = 2   ! flux   form : 2nd order centered scheme
+   INTEGER, PUBLIC, PARAMETER ::   np_FLX_ubs = 3   ! flux   form : 3rd order Upstream Biased Scheme
 
    !! * Substitutions
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.6 , NEMO Consortium (2015)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2017)
    !! $Id$
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -53,5 +59,6 @@
       !! ** Purpose :   compute the ocean momentum advection trend.
       !!
-      !! ** Method  : - Update (ua,va) with the advection term following nadv
+      !! ** Method  : - Update (ua,va) with the advection term following n_dynadv
+      !!
       !!      NB: in flux form advection (ln_dynadv_cen2 or ln_dynadv_ubs=T) 
       !!      a metric term is add to the coriolis term while in vector form 
@@ -62,20 +69,17 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('dyn_adv')
+      IF( ln_timing )   CALL timing_start( 'dyn_adv' )
       !
-      SELECT CASE ( nadv )                  ! compute advection trend and add it to general trend
-      CASE ( 0 )     
-                      CALL dyn_keg     ( kt, nn_dynkeg )    ! vector form : horizontal gradient of kinetic energy
-                      CALL dyn_zad     ( kt )               ! vector form : vertical advection
-      CASE ( 1 )     
-                      CALL dyn_keg     ( kt, nn_dynkeg )    ! vector form : horizontal gradient of kinetic energy
-                      CALL dyn_zad_zts ( kt )               ! vector form : vertical advection with sub-timestepping
-      CASE ( 2 ) 
-                      CALL dyn_adv_cen2( kt )               ! 2nd order centered scheme
-      CASE ( 3 )   
-                      CALL dyn_adv_ubs ( kt )               ! 3rd order UBS      scheme
+      SELECT CASE( n_dynadv )    !==  compute advection trend and add it to general trend  ==!
+      CASE( np_VEC_c2  )     
+         CALL dyn_keg     ( kt, nn_dynkeg )    ! vector form : horizontal gradient of kinetic energy
+         CALL dyn_zad     ( kt )               ! vector form : vertical advection
+      CASE( np_FLX_c2  ) 
+         CALL dyn_adv_cen2( kt )               ! 2nd order centered scheme
+      CASE( np_FLX_ubs )   
+         CALL dyn_adv_ubs ( kt )               ! 3rd order UBS      scheme (UP3)
       END SELECT
       !
-      IF( nn_timing == 1 )  CALL timing_stop('dyn_adv')
+      IF( ln_timing )   CALL timing_stop( 'dyn_adv' )
       !
    END SUBROUTINE dyn_adv
@@ -87,9 +91,9 @@
       !!                
       !! ** Purpose :   Control the consistency between namelist options for 
-      !!              momentum advection formulation & scheme and set nadv
+      !!              momentum advection formulation & scheme and set n_dynadv
       !!----------------------------------------------------------------------
       INTEGER ::   ioptio, ios   ! Local integer
       !
-      NAMELIST/namdyn_adv/ ln_dynadv_vec, nn_dynkeg, ln_dynadv_cen2 , ln_dynadv_ubs, ln_dynzad_zts
+      NAMELIST/namdyn_adv/ ln_dynadv_NONE, ln_dynadv_vec, nn_dynkeg, ln_dynadv_cen2, ln_dynadv_ubs
       !!----------------------------------------------------------------------
       !
@@ -108,38 +112,31 @@
          WRITE(numout,*) '~~~~~~~~~~~~'
          WRITE(numout,*) '   Namelist namdyn_adv : chose a advection formulation & scheme for momentum'
-         WRITE(numout,*) '      Vector/flux form (T/F)                           ln_dynadv_vec  = ', ln_dynadv_vec
-         WRITE(numout,*) '      = 0 standard scheme  ; =1 Hollingsworth scheme   nn_dynkeg      = ', nn_dynkeg
-         WRITE(numout,*) '      2nd order centred advection scheme               ln_dynadv_cen2 = ', ln_dynadv_cen2
-         WRITE(numout,*) '      3rd order UBS advection scheme                   ln_dynadv_ubs  = ', ln_dynadv_ubs
-         WRITE(numout,*) '      Sub timestepping of vertical advection           ln_dynzad_zts  = ', ln_dynzad_zts
+         WRITE(numout,*) '      linear dynamics : no momentum advection          ln_dynadv_NONE = ', ln_dynadv_NONE
+         WRITE(numout,*) '      Vector form: 2nd order centered scheme           ln_dynadv_vec  = ', ln_dynadv_vec
+         WRITE(numout,*) '         with Hollingsworth scheme (=1) or not (=0)       nn_dynkeg   = ', nn_dynkeg
+         WRITE(numout,*) '      flux form: 2nd order centred scheme              ln_dynadv_cen2 = ', ln_dynadv_cen2
+         WRITE(numout,*) '                 3rd order UBS scheme                  ln_dynadv_ubs  = ', ln_dynadv_ubs
       ENDIF
 
-      ioptio = 0                      ! Parameter control
-      IF( ln_dynadv_vec  )   ioptio = ioptio + 1
-      IF( ln_dynadv_cen2 )   ioptio = ioptio + 1
-      IF( ln_dynadv_ubs  )   ioptio = ioptio + 1
+      ioptio = 0                      ! parameter control and set n_dynadv
+      IF( ln_dynadv_NONE ) THEN   ;   ioptio = ioptio + 1   ;   n_dynadv = np_LIN_dyn   ;   ENDIF
+      IF( ln_dynadv_vec  ) THEN   ;   ioptio = ioptio + 1   ;   n_dynadv = np_VEC_c2    ;   ENDIF
+      IF( ln_dynadv_cen2 ) THEN   ;   ioptio = ioptio + 1   ;   n_dynadv = np_FLX_c2    ;   ENDIF
+      IF( ln_dynadv_ubs  ) THEN   ;   ioptio = ioptio + 1   ;   n_dynadv = np_FLX_ubs   ;   ENDIF
 
-      IF( ioptio /= 1 )   CALL ctl_stop( 'Choose ONE advection scheme in namelist namdyn_adv' )
-      IF( ln_dynzad_zts .AND. .NOT. ln_dynadv_vec )   &
-         CALL ctl_stop( 'Sub timestepping of vertical advection requires vector form; set ln_dynadv_vec = .TRUE.' )
-      IF( nn_dynkeg /= nkeg_C2 .AND. nn_dynkeg /= nkeg_HW )   &  
-         CALL ctl_stop( 'KEG scheme wrong value of nn_dynkeg' )
+      IF( ioptio /= 1 )   CALL ctl_stop( 'choose ONE and only ONE advection scheme' )
+      IF( nn_dynkeg /= nkeg_C2 .AND. nn_dynkeg /= nkeg_HW )   CALL ctl_stop( 'KEG scheme wrong value of nn_dynkeg' )
 
-      !                               ! Set nadv
-      IF( ln_dynadv_vec  )   nadv =  0 
-      IF( ln_dynzad_zts  )   nadv =  1
-      IF( ln_dynadv_cen2 )   nadv =  2
-      IF( ln_dynadv_ubs  )   nadv =  3
 
       IF(lwp) THEN                    ! Print the choice
          WRITE(numout,*)
-         IF( nadv ==  0 )   WRITE(numout,*) '      ===>>   vector form : keg + zad + vor is used' 
-         IF( nadv ==  1 )   WRITE(numout,*) '      ===>>   vector form : keg + zad_zts + vor is used'
-         IF( nadv ==  0 .OR. nadv ==  1 ) THEN
+         SELECT CASE( n_dynadv )
+         CASE( np_LIN_dyn )   ;   WRITE(numout,*) '      ===>>   linear dynamics : no momentum advection used'
+         CASE( np_VEC_c2  )   ;   WRITE(numout,*) '      ===>>   vector form : keg + zad + vor is used' 
             IF( nn_dynkeg == nkeg_C2  )   WRITE(numout,*) '              with Centered standard keg scheme'
             IF( nn_dynkeg == nkeg_HW  )   WRITE(numout,*) '              with Hollingsworth keg scheme'
-         ENDIF
-         IF( nadv ==  2 )   WRITE(numout,*) '      ===>>   flux form   : 2nd order scheme is used'
-         IF( nadv ==  3 )   WRITE(numout,*) '      ===>>   flux form   : UBS       scheme is used'
+         CASE( np_FLX_c2  )   ;   WRITE(numout,*) '      ===>>   flux form   : 2nd order scheme is used'
+         CASE( np_FLX_ubs )   ;   WRITE(numout,*) '      ===>>   flux form   : UBS       scheme is used'
+         END SELECT
       ENDIF
       !
