Index: /NEMO/branches/UKMO/NEMO_4.0.4_fixed_plus_varying_viscosity/cfgs/SHARED/namelist_ref
===================================================================
--- /NEMO/branches/UKMO/NEMO_4.0.4_fixed_plus_varying_viscosity/cfgs/SHARED/namelist_ref	(revision 15639)
+++ /NEMO/branches/UKMO/NEMO_4.0.4_fixed_plus_varying_viscosity/cfgs/SHARED/namelist_ref	(revision 15640)
@@ -938,5 +938,6 @@
    ln_dynldf_iso = .false.     !  iso-neutral (lap only)
    !                       !  Coefficient
-   nn_ahm_ijk_t  = 0           !  space/time variation of eddy coefficient :
+   nn_ahm_ijk_fix  = 0         !  space variation of time-fixed eddy coefficient :
+      !                             !  =-99  no time-fixed viscosity
       !                             !  =-30  read in eddy_viscosity_3D.nc file
       !                             !  =-20  read in eddy_viscosity_2D.nc file
@@ -945,4 +946,6 @@
       !                             !  = 20  F(i,j)=F(grid spacing)=c2d
       !                             !  = 30  F(i,j,k)=c2d*c1d
+   nn_ahm_ijk_vary  = 0        !  space variation of time-varying eddy coefficient :
+      !                             !  =-99  no time-varying viscosity
       !                             !  = 31  F(i,j,k)=F(grid spacing and local velocity)
       !                             !  = 32  F(i,j,k)=F(local gridscale and deformation rate)
Index: /NEMO/branches/UKMO/NEMO_4.0.4_fixed_plus_varying_viscosity/src/OCE/LDF/ldfdyn.F90
===================================================================
--- /NEMO/branches/UKMO/NEMO_4.0.4_fixed_plus_varying_viscosity/src/OCE/LDF/ldfdyn.F90	(revision 15639)
+++ /NEMO/branches/UKMO/NEMO_4.0.4_fixed_plus_varying_viscosity/src/OCE/LDF/ldfdyn.F90	(revision 15640)
@@ -39,5 +39,6 @@
    LOGICAL , PUBLIC ::   ln_dynldf_hor   !: horizontal (geopotential) direction
 !  LOGICAL , PUBLIC ::   ln_dynldf_iso   !: iso-neutral direction                        (see ldfslp)
-   INTEGER , PUBLIC ::   nn_ahm_ijk_t    !: choice of time & space variations of the lateral eddy viscosity coef.
+   INTEGER , PUBLIC ::   nn_ahm_ijk_fix  !: choice of time & space variations of the time-fixed lateral eddy viscosity coef.
+   INTEGER , PUBLIC ::   nn_ahm_ijk_vary !: choice of time & space variations of the time-varying lateral eddy viscosity coef.
    !                                        !  time invariant coefficients:  aht = 1/2  Ud*Ld   (lap case) 
    !                                           !                             bht = 1/12 Ud*Ld^3 (blp case)
@@ -62,4 +63,5 @@
 
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   ahmt, ahmf   !: eddy viscosity coef. at T- and F-points [m2/s or m4/s]
+   REAL(wp),         ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   ahmt_fixed, ahmf_fixed   !: time-fixed eddy viscosity coef. at T- and F-points [m2/s or m4/s]
    REAL(wp),         ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   dtensq       !: horizontal tension squared         (Smagorinsky only)
    REAL(wp),         ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   dshesq       !: horizontal shearing strain squared (Smagorinsky only)
@@ -111,5 +113,5 @@
       NAMELIST/namdyn_ldf/ ln_dynldf_OFF, ln_dynldf_lap, ln_dynldf_blp,   &   ! type of operator
          &                 ln_dynldf_lev, ln_dynldf_hor, ln_dynldf_iso,   &   ! acting direction of the operator
-         &                 nn_ahm_ijk_t , rn_Uv    , rn_Lv,   rn_ahm_b,   &   ! lateral eddy coefficient
+         &                 nn_ahm_ijk_fix, nn_ahm_ijk_vary, rn_Uv, rn_Lv, rn_ahm_b,   &   ! lateral eddy coefficient
          &                 rn_csmc      , rn_minfac    , rn_maxfac            ! Smagorinsky settings
       !!----------------------------------------------------------------------
@@ -141,5 +143,6 @@
          !
          WRITE(numout,*) '      coefficients :'
-         WRITE(numout,*) '         type of time-space variation         nn_ahm_ijk_t  = ', nn_ahm_ijk_t
+         WRITE(numout,*) '         type of time-fixed space variation         nn_ahm_ijk_fix  = ', nn_ahm_ijk_fix
+         WRITE(numout,*) '         type of time-varying space variation       nn_ahm_ijk_vary = ', nn_ahm_ijk_vary
          WRITE(numout,*) '         lateral viscous velocity  (if cst)      rn_Uv      = ', rn_Uv, ' m/s'
          WRITE(numout,*) '         lateral viscous length    (if cst)      rn_Lv      = ', rn_Lv, ' m'
@@ -239,9 +242,11 @@
          !
          !                                         ! allocate the ahm arrays
-         ALLOCATE( ahmt(jpi,jpj,jpk) , ahmf(jpi,jpj,jpk) , STAT=ierr )
+         ALLOCATE( ahmt(jpi,jpj,jpk) , ahmf(jpi,jpj,jpk) , ahmt_fixed(jpi,jpj,jpk) , ahmf_fixed(jpi,jpj,jpk) , STAT=ierr )
          IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'ldf_dyn_init: failed to allocate arrays')
          !
          ahmt(:,:,:) = 0._wp                       ! init to 0 needed 
          ahmf(:,:,:) = 0._wp
+         ahmt_fixed(:,:,:) = 0._wp                
+         ahmf_fixed(:,:,:) = 0._wp
          !
          !                                         ! value of lap/blp eddy mixing coef.
@@ -252,27 +257,31 @@
          zah_max = zUfac * (ra*rad)**inn              ! maximum reachable coefficient (value at the Equator)
          !
-         SELECT CASE(  nn_ahm_ijk_t  )             !* Specification of space-time variations of ahmt, ahmf
-         !
+         SELECT CASE(  nn_ahm_ijk_fix  )             !* Specification of space variations of time-fixed viscosity
+         !
+         CASE(   -99  )      !==  zero  ==!
+            IF(lwp) WRITE(numout,*) '   ==>>>   time-fixed eddy viscosity = zero '
+            ! Arrays already initialised to zero.
+            !
          CASE(   0  )      !==  constant  ==!
             IF(lwp) WRITE(numout,*) '   ==>>>   eddy viscosity. = constant = ', zah0, cl_Units
-            ahmt(:,:,1:jpkm1) = zah0
-            ahmf(:,:,1:jpkm1) = zah0
+            ahmt_fixed(:,:,1:jpkm1) = zah0
+            ahmf_fixed(:,:,1:jpkm1) = zah0
             !
          CASE(  10  )      !==  fixed profile  ==!
             IF(lwp) WRITE(numout,*) '   ==>>>   eddy viscosity = F( depth )'
             IF(lwp) WRITE(numout,*) '           surface viscous coef. = constant = ', zah0, cl_Units
-            ahmt(:,:,1) = zah0                        ! constant surface value
-            ahmf(:,:,1) = zah0
-            CALL ldf_c1d( 'DYN', ahmt(:,:,1), ahmf(:,:,1), ahmt, ahmf )
+            ahmt_fixed(:,:,1) = zah0                        ! constant surface value
+            ahmf_fixed(:,:,1) = zah0
+            CALL ldf_c1d( 'DYN', ahmt_fixed(:,:,1), ahmf_fixed(:,:,1), ahmt_fixed, ahmf_fixed )
             !
          CASE ( -20 )      !== fixed horizontal shape read in file  ==!
             IF(lwp) WRITE(numout,*) '   ==>>>   eddy viscosity = F(i,j) read in eddy_viscosity.nc file'
             CALL iom_open( 'eddy_viscosity_2D.nc', inum )
-            CALL iom_get ( inum, jpdom_data, 'ahmt_2d', ahmt(:,:,1) )
-            CALL iom_get ( inum, jpdom_data, 'ahmf_2d', ahmf(:,:,1) )
+            CALL iom_get ( inum, jpdom_data, 'ahmt_2d', ahmt_fixed(:,:,1) )
+            CALL iom_get ( inum, jpdom_data, 'ahmf_2d', ahmf_fixed(:,:,1) )
             CALL iom_close( inum )
             DO jk = 2, jpkm1
-               ahmt(:,:,jk) = ahmt(:,:,1)
-               ahmf(:,:,jk) = ahmf(:,:,1)
+               ahmt_fixed(:,:,jk) = ahmt_fixed(:,:,1)
+               ahmf_fixed(:,:,jk) = ahmf_fixed(:,:,1)
             END DO
             !
@@ -281,11 +290,11 @@
             IF(lwp) WRITE(numout,*) '           using a fixed viscous velocity = ', rn_Uv  ,' m/s   and   Lv = Max(e1,e2)'
             IF(lwp) WRITE(numout,*) '           maximum reachable coefficient (at the Equator) = ', zah_max, cl_Units, '  for e1=1°)'
-            CALL ldf_c2d( 'DYN', zUfac      , inn        , ahmt, ahmf )         ! surface value proportional to scale factor^inn
+            CALL ldf_c2d( 'DYN', zUfac      , inn        , ahmt_fixed, ahmf_fixed )         ! surface value proportional to scale factor^inn
             !
          CASE( -30  )      !== fixed 3D shape read in file  ==!
             IF(lwp) WRITE(numout,*) '   ==>>>   eddy viscosity = F(i,j,k) read in eddy_viscosity_3D.nc file'
             CALL iom_open( 'eddy_viscosity_3D.nc', inum )
-            CALL iom_get ( inum, jpdom_data, 'ahmt_3d', ahmt )
-            CALL iom_get ( inum, jpdom_data, 'ahmf_3d', ahmf )
+            CALL iom_get ( inum, jpdom_data, 'ahmt_3d', ahmt_fixed )
+            CALL iom_get ( inum, jpdom_data, 'ahmf_3d', ahmf_fixed )
             CALL iom_close( inum )
             !
@@ -294,6 +303,18 @@
             IF(lwp) WRITE(numout,*) '           using a fixed viscous velocity = ', rn_Uv  ,' m/s   and   Ld = Max(e1,e2)'
             IF(lwp) WRITE(numout,*) '           maximum reachable coefficient (at the Equator) = ', zah_max, cl_Units, '  for e1=1°)'
-            CALL ldf_c2d( 'DYN', zUfac      , inn        , ahmt, ahmf )         ! surface value proportional to scale factor^inn
-            CALL ldf_c1d( 'DYN', ahmt(:,:,1), ahmf(:,:,1), ahmt, ahmf )  ! reduction with depth
+            CALL ldf_c2d( 'DYN', zUfac      , inn        , ahmt_fixed, ahmf_fixed )         ! surface value proportional to scale factor^inn
+            CALL ldf_c1d( 'DYN', ahmt_fixed(:,:,1), ahmf_fixed(:,:,1), ahmt_fixed, ahmf_fixed )  ! reduction with depth
+            !
+         CASE DEFAULT
+            CALL ctl_stop('ldf_dyn_init: wrong choice for nn_ahm_ijk_fix, the type of space variation of time-fixed ahm')
+         END SELECT
+         !
+         !
+         SELECT CASE(  nn_ahm_ijk_vary  )             !* Specification of space variations of time-varying viscosity
+         !
+         CASE(   -99  )      !==  zero  ==!
+            IF(lwp) WRITE(numout,*) '   ==>>>   time-varying eddy viscosity not used. '
+            !
+            l_ldfdyn_time = .FALSE.     
             !
          CASE(  31  )       !==  time varying 3D field  ==!
@@ -321,15 +342,18 @@
             !
          CASE DEFAULT
-            CALL ctl_stop('ldf_dyn_init: wrong choice for nn_ahm_ijk_t, the type of space-time variation of ahm')
+            CALL ctl_stop('ldf_dyn_init: wrong choice for nn_ahm_ijk_vary, the type of space variation of time-varying ahm')
          END SELECT
          !
-         IF( .NOT.l_ldfdyn_time ) THEN             !* No time variation 
-            IF(     ln_dynldf_lap ) THEN                 !   laplacian operator (mask only)
-               ahmt(:,:,1:jpkm1) =       ahmt(:,:,1:jpkm1)   * tmask(:,:,1:jpkm1)
-               ahmf(:,:,1:jpkm1) =       ahmf(:,:,1:jpkm1)   * fmask(:,:,1:jpkm1)
-            ELSEIF( ln_dynldf_blp ) THEN                 ! bilaplacian operator (square root + mask)
-               ahmt(:,:,1:jpkm1) = SQRT( ahmt(:,:,1:jpkm1) ) * tmask(:,:,1:jpkm1)
-               ahmf(:,:,1:jpkm1) = SQRT( ahmf(:,:,1:jpkm1) ) * fmask(:,:,1:jpkm1)
-            ENDIF
+         IF(     ln_dynldf_lap ) THEN                 !   laplacian operator (mask only)
+            ahmt_fixed(:,:,1:jpkm1) =       ahmt_fixed(:,:,1:jpkm1)   * tmask(:,:,1:jpkm1)
+            ahmf_fixed(:,:,1:jpkm1) =       ahmf_fixed(:,:,1:jpkm1)   * fmask(:,:,1:jpkm1)
+         ELSEIF( ln_dynldf_blp ) THEN                 ! bilaplacian operator (square root + mask)
+            ahmt_fixed(:,:,1:jpkm1) = SQRT( ahmt_fixed(:,:,1:jpkm1) ) * tmask(:,:,1:jpkm1)
+            ahmf_fixed(:,:,1:jpkm1) = SQRT( ahmf_fixed(:,:,1:jpkm1) ) * fmask(:,:,1:jpkm1)
+         ENDIF
+         IF( .NOT. l_ldfdyn_time ) THEN
+            ahmt(:,:,1:jpkm1) =       ahmt_fixed(:,:,1:jpkm1)
+            ahmf(:,:,1:jpkm1) =       ahmf_fixed(:,:,1:jpkm1)
+            DEALLOCATE( ahmt_fixed, ahmf_fixed )
          ENDIF
          !
@@ -365,5 +389,5 @@
       IF( ln_timing )   CALL timing_start('ldf_dyn')
       !
-      SELECT CASE(  nn_ahm_ijk_t  )       !== Eddy vicosity coefficients ==!
+      SELECT CASE(  nn_ahm_ijk_vary  )       !== Eddy vicosity coefficients ==!
       !
       CASE(  31  )       !==  time varying 3D field  ==!   = F( local velocity )
@@ -504,4 +528,8 @@
       END SELECT
       !
+      ! Add on time-fixed viscosity (which can be zero):
+      ahmt(:,:,1:jpkm1) = ahmt(:,:,1:jpkm1) + ahmt_fixed(:,:,1:jpkm1)
+      ahmf(:,:,1:jpkm1) = ahmf(:,:,1:jpkm1) + ahmf_fixed(:,:,1:jpkm1)
+      !
       CALL iom_put( "ahmt_2d", ahmt(:,:,1) )   ! surface u-eddy diffusivity coeff.
       CALL iom_put( "ahmf_2d", ahmf(:,:,1) )   ! surface v-eddy diffusivity coeff.
