Index: branches/2013/dev_LOCEAN_CMCC_INGV_MERC_UKMO_2013/NEMOGCM/NEMO/OPA_SRC/TRA/tradmp.F90
===================================================================
--- branches/2013/dev_LOCEAN_CMCC_INGV_MERC_UKMO_2013/NEMOGCM/NEMO/OPA_SRC/TRA/tradmp.F90	(revision 4244)
+++ branches/2013/dev_LOCEAN_CMCC_INGV_MERC_UKMO_2013/NEMOGCM/NEMO/OPA_SRC/TRA/tradmp.F90	(revision 4245)
@@ -27,4 +27,5 @@
    USE oce            ! ocean: variables
    USE dom_oce        ! ocean: domain variables
+   USE c1d            ! 1D vertical configuration
    USE trdmod_oce     ! ocean: trend variables
    USE trdtra         ! active tracers: trends
@@ -44,9 +45,9 @@
    PUBLIC   tra_dmp      ! routine called by step.F90
    PUBLIC   tra_dmp_init ! routine called by opa.F90
-   PUBLIC   dtacof       ! routine called by in both tradmp.F90 and trcdmp.F90
-   PUBLIC   dtacof_zoom  ! routine called by in both tradmp.F90 and trcdmp.F90
+   PUBLIC   dtacof       ! routine called by tradmp.F90, trcdmp.F90 and dyndmp.F90
+   PUBLIC   dtacof_zoom  ! routine called by tradmp.F90, trcdmp.F90 and dyndmp.F90
 
    !                               !!* Namelist namtra_dmp : T & S newtonian damping *
-   LOGICAL, PUBLIC ::   ln_tradmp  = .TRUE.   !: internal damping flag
+   LOGICAL, PUBLIC ::   ln_tradmp   !: internal damping flag
    INTEGER         ::   nn_hdmp     ! = 0/-1/'latitude' for damping over T and S
    INTEGER         ::   nn_zdmp     ! = 0/1/2 flag for damping in the mixed layer
@@ -191,5 +192,5 @@
       !! ** Purpose :   Initialization for the newtonian damping 
       !!
-      !! ** Method  :   read the nammbf namelist and check the parameters
+      !! ** Method  :   read the namtra_dmp namelist and check the parameters
       !!----------------------------------------------------------------------
       NAMELIST/namtra_dmp/ ln_tradmp, nn_hdmp, nn_zdmp, rn_surf, rn_bot, rn_dep, nn_file
@@ -206,5 +207,5 @@
       WRITE ( numond, namtra_dmp )
       
-      IF( lzoom )   nn_zdmp = 0          ! restoring to climatology at closed north or south boundaries
+      IF( lzoom .AND. .NOT. lk_c1d )   nn_zdmp = 0          ! restoring to climatology at closed north or south boundaries
 
       IF(lwp) THEN                       ! Namelist print
@@ -213,7 +214,7 @@
          WRITE(numout,*) '~~~~~~~'
          WRITE(numout,*) '   Namelist namtra_dmp : set damping parameter'
-         WRITE(numout,*) '      add a damping termn or not      ln_tradmp = ', ln_tradmp
+         WRITE(numout,*) '      add a damping term or not       ln_tradmp = ', ln_tradmp
          WRITE(numout,*) '      T and S damping option          nn_hdmp   = ', nn_hdmp
-         WRITE(numout,*) '      mixed layer damping option      nn_zdmp   = ', nn_zdmp, '(zoom: forced to 0)'
+         WRITE(numout,*) '      mixed layer damping option      nn_zdmp   = ', nn_zdmp, '(non-C1D zoom: forced to 0)'
          WRITE(numout,*) '      surface time scale (days)       rn_surf   = ', rn_surf
          WRITE(numout,*) '      bottom time scale (days)        rn_bot    = ', rn_bot
@@ -227,4 +228,5 @@
          IF( tra_dmp_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'tra_dmp_init: unable to allocate arrays' )
          !
+#if ! defined key_c1d
          SELECT CASE ( nn_hdmp )
          CASE (  -1  )   ;   IF(lwp) WRITE(numout,*) '   tracer damping in the Med & Red seas only'
@@ -235,4 +237,5 @@
          END SELECT
          !
+#endif
          SELECT CASE ( nn_zdmp )
          CASE ( 0 )   ;   IF(lwp) WRITE(numout,*) '   tracer damping throughout the water column'
@@ -252,5 +255,5 @@
          ttrdmp(:,:,:) = 0._wp
          !                          ! Damping coefficients initialization
-         IF( lzoom ) THEN   ;   CALL dtacof_zoom( resto )
+         IF( lzoom .AND. .NOT. lk_c1d ) THEN   ;   CALL dtacof_zoom( resto )
          ELSE               ;   CALL dtacof( nn_hdmp, rn_surf, rn_bot, rn_dep, nn_file, 'TRA', resto )
          ENDIF
@@ -360,5 +363,5 @@
       REAL(wp)                        , INTENT(in   )  ::  pn_dep     ! depth of transition (meters)
       INTEGER                         , INTENT(in   )  ::  kn_file    ! save the damping coef on a file or not
-      CHARACTER(len=3)                , INTENT(in   )  ::  cdtype     ! =TRA or TRC (tracer indicator)
+      CHARACTER(len=3)                , INTENT(in   )  ::  cdtype     ! =TRA, TRC or DYN (tracer/dynamics indicator)
       REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout)  ::  presto     ! restoring coeff. (s-1)
       !
@@ -380,4 +383,28 @@
       CALL wrk_alloc( jpi, jpj, zmrs      )
       CALL wrk_alloc( jpi, jpj, jpk, zdct )
+#if defined key_c1d
+      !                                   ! ====================
+      !                                   !  C1D configuration : local domain
+      !                                   ! ====================
+      !
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) '              dtacof : C1D 3x3 local domain'
+      IF(lwp) WRITE(numout,*) '              -----------------------------'
+      !
+      presto(:,:,:) = 0._wp
+      !
+      zsdmp = 1._wp / ( pn_surf * rday )
+      zbdmp = 1._wp / ( pn_bot  * rday )
+      DO jk = 2, jpkm1
+         DO jj = 1, jpj
+            DO ji = 1, jpi
+               !   ONLY vertical variation from zsdmp (sea surface) to zbdmp (bottom)
+               presto(ji,jj,jk) = zbdmp + (zsdmp-zbdmp) * EXP(-fsdept(ji,jj,jk)/pn_dep)
+            END DO
+         END DO
+      END DO
+      !
+      presto(:,:, : ) = presto(:,:,:) * tmask(:,:,:)
+#else
       !                                   ! ====================
       !                                   !  ORCA configuration : global domain
@@ -559,4 +586,5 @@
          CALL ctl_stop( 'Choose a correct value of nn_hdmp or put ln_tradmp to FALSE' )
       ENDIF
+#endif
 
       !                            !--------------------------------!
@@ -566,4 +594,5 @@
          IF( cdtype == 'TRA' ) cfile = 'damping.coeff'
          IF( cdtype == 'TRC' ) cfile = 'damping.coeff.trc'
+         IF( cdtype == 'DYN' ) cfile = 'damping.coeff.dyn'
          cfile = TRIM( cfile )
          CALL iom_open  ( cfile, inum0, ldwrt = .TRUE., kiolib = jprstlib )
