Index: /NEMO/branches/UKMO/tools_r4.0-HEAD_dev_DMP_TOOLS/DMP_TOOLS/namelist
===================================================================
--- /NEMO/branches/UKMO/tools_r4.0-HEAD_dev_DMP_TOOLS/DMP_TOOLS/namelist	(revision 15744)
+++ /NEMO/branches/UKMO/tools_r4.0-HEAD_dev_DMP_TOOLS/DMP_TOOLS/namelist	(revision 15745)
@@ -1,18 +1,31 @@
 &nam_dmp_create
-    cp_cfg = 'orca'            ! Name of model grid (orca and C1D have special options - otherwise ignored)
-    cp_cfz = 'antarctic'       ! Name of zoom configuration (arctic and antarctic have some special treatment if lzoom=.true.)
-    jp_cfg = 2                 ! Resolution of the model (used for med_red_seas damping)
-    lzoom = .false.            ! Zoom configuration or not
-    ln_full_field = .false.    ! Calculate coefficient over whole of domain 
-    ln_med_red_seas = .true.   ! Damping in Med/Red Seas (or local modifications here if ln_full_field=.true.)
-    ln_old_31_lev_code = .true.   ! Replicate behaviour of old online code for 31 level model (Med/Red seas damping based on level number instead of depth)
-    ln_coast = .true.          ! Reduce near to coastlines 
-    ln_zero_top_layer = .true. ! No damping in top layer
-    ln_custom = .false.        ! Call "custom" module to apply user modifications to the damping coefficient field
-    nn_hdmp = 10               ! Damp poleward of this latitude (smooth transition up to maximum damping)
-    pn_surf = 0.25             ! Surface Relaxation timescale (days) 
-    pn_bot = 0.25              ! Bottom relaxation timescale (days)
-    pn_dep = 1000              ! Transition depth from upper to deep ocean
-    jperio = 2                 ! Lateral boundary condition (as specified in namelist_cfg for model run).
+    cp_cfg = 'orca025'           ! Name of model grid (orca and C1D have 
+                                 ! special options - otherwise ignored)
+    cp_cfz = 'antarctic'         ! Name of zoom configuration (arctic and 
+                                 ! antarctic have some special 
+                                 ! treatment if lzoom=.true.)
+    jp_cfg = 2                   ! Resolution of the model (used for med_red_seas damping)
+    lzoom = .false.              ! Zoom configuration or not
+    ln_full_field = .true.       ! Calculate coefficient over whole of domain 
+    ln_med_red_seas = .false.    ! Damping in Med/Red Seas (or local modifications 
+                                 ! here if ln_full_field=.true.)
+    ln_old_31_lev_code = .false. ! Replicate behaviour of old online code for 31 level model 
+                                 ! (Med/Red seas damping based on level number instead of depth)
+    ln_coast = .true.            ! Reduce near to coastlines 
+    ln_zero_top_layer = .false.  ! No damping in top layer
+    ln_custom = .true.           ! Call "custom" module to apply user modifications to 
+                                 ! the damping coefficient field
+    nn_hdmp = 0                  ! Damp poleward of this latitude 
+                                 ! (smooth transition up to maximum damping)
+    pn_surf = 0.25               ! Surface Relaxation timescale (days) 
+    pn_bot  = 0.                 ! Bottom relaxation timescale (days)
+    ln_exp  = .false.             ! Using exponential (T) or logistic (F)
+                                 ! vertical decay of restoring
+    pn_dep  = 250.               ! Transition depth from upper to deep ocean
+                                 ! (value of the sigmoid's midpoint if logistic decay)
+    rn_k    = 4.                 ! steepness of logistic curve
+    pn_cst  = 200.               ! distance from the coast (km)
+    jperio  = 4                  ! Lateral boundary condition 
+                                 ! (as specified in namelist_cfg for model run).
 /
 
Index: /NEMO/branches/UKMO/tools_r4.0-HEAD_dev_DMP_TOOLS/DMP_TOOLS/src/coast_dist.F90
===================================================================
--- /NEMO/branches/UKMO/tools_r4.0-HEAD_dev_DMP_TOOLS/DMP_TOOLS/src/coast_dist.F90	(revision 15744)
+++ /NEMO/branches/UKMO/tools_r4.0-HEAD_dev_DMP_TOOLS/DMP_TOOLS/src/coast_dist.F90	(revision 15745)
@@ -9,5 +9,5 @@
    CONTAINS
 
-   SUBROUTINE coast_dist_weight( presto ) 
+   SUBROUTINE coast_dist_weight( presto, zdct ) 
       !!----------------------------------------------------------------------
       !!                 *** ROUTINE coast_dist_weight ***
@@ -20,15 +20,20 @@
       IMPLICIT NONE
       REAL(wp), DIMENSION(jpi,jpj), INTENT( inout ) :: presto
-      REAL(wp), DIMENSION(jpi,jpj) :: zdct
-      REAL(wp) :: zinfl = 1000.e3_wp  ! Distance of influence of coast line (could be
-                                  ! a namelist setting)
-      INTEGER :: jj, ji           ! dummy loop indices
+      REAL(wp), DIMENSION(jpi,jpj), INTENT( in    ) :: zdct
+      REAL(wp) :: zinfl = 200.e3_wp  ! Distance of influence of coast line (could be
+                                     ! a namelist setting)
+      REAL(wp) :: rdct               ! coastal distance factor
+      INTEGER  :: jj, ji             ! dummy loop indices
       
 
-      CALL cofdis( zdct )
+      zinfl = pn_cst * 1000._wp ! in m
+
+      !CALL cofdis( zdct )
       DO jj = 1, jpj
          DO ji = 1, jpi
-            zdct(ji,jj) = MIN( zinfl, zdct(ji,jj) )
-            presto(ji,jj) = presto(ji, jj) * 0.5_wp * (  1._wp - COS( rpi*zdct(ji,jj)/zinfl) )
+            !zdct(ji,jj) = MIN( zinfl, zdct(ji,jj) )
+            rdct = MIN( zinfl, zdct(ji,jj) ) / zinfl
+            !presto(ji,jj) = presto(ji, jj) * 0.5_wp * (  1._wp - COS( rpi*zdct(ji,jj)/zinfl) )
+            presto(ji,jj) = presto(ji, jj) * 0.5_wp * (  1._wp - COS( rpi*rdct) )
          END DO
       END DO
Index: /NEMO/branches/UKMO/tools_r4.0-HEAD_dev_DMP_TOOLS/DMP_TOOLS/src/make_dmp_file.F90
===================================================================
--- /NEMO/branches/UKMO/tools_r4.0-HEAD_dev_DMP_TOOLS/DMP_TOOLS/src/make_dmp_file.F90	(revision 15744)
+++ /NEMO/branches/UKMO/tools_r4.0-HEAD_dev_DMP_TOOLS/DMP_TOOLS/src/make_dmp_file.F90	(revision 15745)
@@ -49,4 +49,5 @@
 
   ALLOCATE( resto(jpi, jpj) )
+  ALLOCATE( dcst(jpi, jpj) )
 
   !Create output file
@@ -57,5 +58,12 @@
   !Calculate surface and bottom damping coefficients
   zsdmp = 1._wp / ( pn_surf * rday )
-  zbdmp = 1._wp / ( pn_bot  * rday )
+  IF (pn_bot > 0.) THEN
+     zbdmp = 1._wp / ( pn_bot  * rday )
+  ELSE
+     zbdmp = 0.
+  ENDIF
+
+  ! Calculate distance from the coast
+  IF (ln_coast) CALL cofdis( dcst ) 
 
   !Loop through levels and read in tmask for each level as starting point for
@@ -74,5 +82,10 @@
            DO jj = 1, jpj
               DO ji = 1, jpi
-                 resto(ji,jj) = tmask(ji, jj) * (zbdmp + (zsdmp-zbdmp) * EXP(-gdept(ji,jj)/pn_dep))
+                 IF ( ln_exp ) THEN
+                    resto(ji,jj) = tmask(ji, jj) * (zbdmp + (zsdmp-zbdmp) * EXP(-gdept(ji,jj)/pn_dep))
+                 ELSE
+                    resto(ji,jj) = tmask(ji, jj) * (zbdmp + (zsdmp-zbdmp) / &
+                       &           (1._wp + EXP(rn_k * (gdept(ji,jj) - pn_dep) / 100._wp)))
+                 ENDIF 
               END DO
            END DO
@@ -94,5 +107,5 @@
            IF (ln_coast) THEN
               ! Reduce damping in vicinity of coastlines
-              CALL coast_dist_weight(resto)
+              CALL coast_dist_weight(resto, dcst)
            ENDIF
         ENDIF
@@ -109,5 +122,6 @@
         !Any user modifications can be added in the custom module
         IF ( ln_custom ) THEN
-              CALL custom_resto( resto )
+              WHERE (resto(:,:) <= 1.e-07) resto(:,:) = 0._wp
+              !CALL custom_resto( resto )
         ENDIF
      ENDIF
Index: /NEMO/branches/UKMO/tools_r4.0-HEAD_dev_DMP_TOOLS/DMP_TOOLS/src/utils.F90
===================================================================
--- /NEMO/branches/UKMO/tools_r4.0-HEAD_dev_DMP_TOOLS/DMP_TOOLS/src/utils.F90	(revision 15744)
+++ /NEMO/branches/UKMO/tools_r4.0-HEAD_dev_DMP_TOOLS/DMP_TOOLS/src/utils.F90	(revision 15745)
@@ -19,4 +19,5 @@
   REAL(wp), DIMENSION(:,:),   ALLOCATABLE :: gphif, glamf
   REAL(wp), DIMENSION(:,:),   ALLOCATABLE :: tmask, umask, vmask, fmask
+  REAL(wp), DIMENSION(:,:),   ALLOCATABLE :: dcst
   REAL(wp), DIMENSION(:,:),   ALLOCATABLE :: gdept
   REAL(wp), DIMENSION(:,:),   ALLOCATABLE :: resto
@@ -37,4 +38,6 @@
   REAL(KIND=8) :: pn_bot = 1
   REAL(KIND=8) :: pn_dep = 1000         
+  REAL(KIND=8) :: pn_cst = 1000
+  REAL(KIND=8) :: rn_k = 50
   INTEGER  :: nn_hdmp = 0                          ! damping option
   INTEGER  :: jperio = 0                          ! damping option
@@ -46,9 +49,10 @@
   LOGICAL :: ln_zero_top_layer = .false.
   LOGICAL :: ln_custom = .false.
+  LOGICAL :: ln_exp = .true.
 
-  NAMELIST/nam_dmp_create/cp_cfg, cp_cfz, jp_cfg, lzoom, ln_full_field, &
+  NAMELIST/nam_dmp_create/cp_cfg, cp_cfz, jp_cfg, lzoom, ln_full_field,  &
                           ln_med_red_seas, ln_old_31_lev_code, ln_coast, &
-                          ln_zero_top_layer, ln_custom, &
-                          pn_surf, pn_bot, pn_dep, nn_hdmp, jperio
+                          ln_zero_top_layer, ln_custom, ln_exp,          &
+                          pn_surf, pn_bot, pn_dep, rn_k, pn_cst, nn_hdmp, jperio
 
   CONTAINS 
