Index: branches/UKMO/dev_r5518_DMP_TOOLS/NEMOGCM/TOOLS/DMP_TOOLS/namelist_orca025
===================================================================
--- branches/UKMO/dev_r5518_DMP_TOOLS/NEMOGCM/TOOLS/DMP_TOOLS/namelist_orca025	(revision 10199)
+++ branches/UKMO/dev_r5518_DMP_TOOLS/NEMOGCM/TOOLS/DMP_TOOLS/namelist_orca025	(revision 10199)
@@ -0,0 +1,25 @@
+&nam_dmp_create
+    cp_cfg = 'orca'            ! Name of model grid (orca and C1D have special options - otherwise ignored)
+    cp_cfz = 'No zoom'         ! Name of zoom configuration (arctic and antarctic have some special treatment if lzoom=.true.)
+    jp_cfg = 025               ! 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 = .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 = 1               ! Damp poleward of this latitude (smooth transition up to maximum damping)
+    pn_surf = 360             ! Surface Relaxation timescale (days) 
+    pn_bot = 360              ! Bottom relaxation timescale (days)
+    pn_dep = 800              ! Transition depth from upper to deep ocean
+    jperio = 4                 ! Lateral boundary condition (as specified in namelist_cfg for model run).
+    ln_readdistcoast = .true.
+/
+
+&nam_zoom_dmp
+    lzoom_n = .true.     ! Open boundary had northern edge?
+    lzoom_e = .true.     ! Open boundary at eastern edge?
+    lzoom_w = .true.     ! Open boundary at western edge?
+    lzoom_s = .false.     ! Open boundary at southern edge?
+/
Index: branches/UKMO/dev_r5518_DMP_TOOLS/NEMOGCM/TOOLS/DMP_TOOLS/src/coast_dist.F90
===================================================================
--- branches/UKMO/dev_r5518_DMP_TOOLS/NEMOGCM/TOOLS/DMP_TOOLS/src/coast_dist.F90	(revision 10198)
+++ branches/UKMO/dev_r5518_DMP_TOOLS/NEMOGCM/TOOLS/DMP_TOOLS/src/coast_dist.F90	(revision 10199)
@@ -9,5 +9,5 @@
    CONTAINS
 
-   SUBROUTINE coast_dist_weight( presto ) 
+   SUBROUTINE coast_dist_weight( presto, ln_read , klev ) 
       !!----------------------------------------------------------------------
       !!                 *** ROUTINE coast_dist_weight ***
@@ -20,11 +20,27 @@
       IMPLICIT NONE
       REAL(wp), DIMENSION(jpi,jpj), INTENT( inout ) :: presto
+      LOGICAL, INTENT( in )                         :: ln_read
+      INTEGER, INTENT( in )                         :: klev
       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
-      
-
-      CALL cofdis( zdct )
+      INTEGER :: ncin, tdist_id
+
+      IF ( ln_read ) THEN
+
+         CALL check_nf90( nf90_open('dist_coast_uvtf.nc', NF90_NOWRITE, ncin), 'Error opening dist to coast file' )
+         CALL check_nf90( nf90_inq_varid( ncin, 'tdist', tdist_id ), 'Cannot get variable ID for tmask')
+         CALL check_nf90( nf90_get_var( ncin, tdist_id, zdct, (/ 1,1,klev /), (/ jpi, jpj,1 /) ) )
+         CALL check_nf90( nf90_close(ncin) ) 
+
+      ELSE
+
+         IF (klev == 1 ) THEN ! Since only a the surface distance to coast is used, only calculate once.
+            CALL cofdis( zdct )
+         ENDIF
+
+      ENDIF
+
       DO jj = 1, jpj
          DO ji = 1, jpi
Index: branches/UKMO/dev_r5518_DMP_TOOLS/NEMOGCM/TOOLS/DMP_TOOLS/src/make_dmp_file.F90
===================================================================
--- branches/UKMO/dev_r5518_DMP_TOOLS/NEMOGCM/TOOLS/DMP_TOOLS/src/make_dmp_file.F90	(revision 10198)
+++ branches/UKMO/dev_r5518_DMP_TOOLS/NEMOGCM/TOOLS/DMP_TOOLS/src/make_dmp_file.F90	(revision 10199)
@@ -94,5 +94,5 @@
            IF (ln_coast) THEN
               ! Reduce damping in vicinity of coastlines
-              CALL coast_dist_weight(resto)
+              CALL coast_dist_weight(resto, ln_readdistcoast, jk)
            ENDIF
         ENDIF
Index: branches/UKMO/dev_r5518_DMP_TOOLS/NEMOGCM/TOOLS/DMP_TOOLS/src/utils.F90
===================================================================
--- branches/UKMO/dev_r5518_DMP_TOOLS/NEMOGCM/TOOLS/DMP_TOOLS/src/utils.F90	(revision 10198)
+++ branches/UKMO/dev_r5518_DMP_TOOLS/NEMOGCM/TOOLS/DMP_TOOLS/src/utils.F90	(revision 10199)
@@ -46,9 +46,10 @@
   LOGICAL :: ln_zero_top_layer = .false.
   LOGICAL :: ln_custom = .false.
+  LOGICAL :: ln_readdistcoast = .false.
 
   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
+                          pn_surf, pn_bot, pn_dep, nn_hdmp, jperio, ln_readdistcoast
 
   CONTAINS 
@@ -72,5 +73,5 @@
      CALL check_nf90( nf90_inq_varid( ncin, 'vmask', vmask_id ), 'Cannot get variable ID for vmask')
      CALL check_nf90( nf90_inq_varid( ncin, 'fmask', fmask_id ), 'Cannot get variable ID for fmask')
-     CALL check_nf90( nf90_inq_varid( ncin, 'gdept_0', gdept_id ), 'Cannot get variable ID for gdept_0')
+     CALL check_nf90( nf90_inq_varid( ncin, 'gdept', gdept_id ), 'Cannot get variable ID for gdept_0')
      CALL check_nf90( nf90_inq_varid( ncin, 'gphit', gphit_id ), 'Cannot get variable ID for gphit')
      CALL check_nf90( nf90_inq_varid( ncin, 'gphiu', gphiu_id ), 'Cannot get variable ID for gphiu')
