Index: /branches/2011/dev_r2787_NOCS_NEPTUNE/NEMOGCM/CONFIG/GYRE/EXP00/namelist
===================================================================
--- /branches/2011/dev_r2787_NOCS_NEPTUNE/NEMOGCM/CONFIG/GYRE/EXP00/namelist	(revision 2824)
+++ /branches/2011/dev_r2787_NOCS_NEPTUNE/NEMOGCM/CONFIG/GYRE/EXP00/namelist	(revision 2825)
@@ -866,8 +866,14 @@
 &nam_dynnept  !   Neptune effect (simplified: lateral and vertical diffusions removed)
 !-----------------------------------------------------------------------
-   ln_neptsimp          = .false.  ! yes/no use simplified neptune
-
-   ln_smoothtopo        = .false.  ! yes/no smooth tsu, tsv
-   rn_tslse             =  1.2e4   ! value of L at the equator
-   rn_tslsp             =  3.0e3   ! value of L at the pole
-/
+! Suggested lengthscale values are those of Eby & Holloway (1994) for a coarse model
+   ln_neptsimp    = .false.  ! yes/no use simplified neptune
+
+   ln_smoothtopo  = .false.  ! yes/no smooth tsu, tsv
+   rn_tslse       =  1.2e4   ! value of lengthscale L at the equator
+   rn_tslsp       =  3.0e3   ! value of lengthscale L at the pole
+! Specify whether to ramp down the Neptune velocity in shallow
+! water, and if so the depth range controlling such ramping down
+   ln_neptramp    = .false.  ! ramp down Neptune velocity in shallow water
+   rn_htrmin      =  100.0   ! min. depth of transition range
+   rn_htrmax      =  200.0   ! max. depth of transition range
+/
Index: /branches/2011/dev_r2787_NOCS_NEPTUNE/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist
===================================================================
--- /branches/2011/dev_r2787_NOCS_NEPTUNE/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist	(revision 2824)
+++ /branches/2011/dev_r2787_NOCS_NEPTUNE/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist	(revision 2825)
@@ -866,9 +866,14 @@
 &nam_dynnept  !   Neptune effect (simplified: lateral and vertical diffusions removed)
 !-----------------------------------------------------------------------
-! Suggested lengthscale values are those of Eby & Holloway (1994) fo a coarse model
-   ln_neptsimp          = .false.  ! yes/no use simplified neptune
-
-   ln_smoothtopo        = .false.  ! yes/no smooth tsu, tsv
-   rn_tslse             =  1.2e4   ! value of lengthscale L at the equator
-   rn_tslsp             =  3.0e3   ! value of lengthscale L at the pole
-/
+! Suggested lengthscale values are those of Eby & Holloway (1994) for a coarse model
+   ln_neptsimp    = .false.  ! yes/no use simplified neptune
+
+   ln_smoothtopo  = .false.  ! yes/no smooth tsu, tsv
+   rn_tslse       =  1.2e4   ! value of lengthscale L at the equator
+   rn_tslsp       =  3.0e3   ! value of lengthscale L at the pole
+! Specify whether to ramp down the Neptune velocity in shallow
+! water, and if so the depth range controlling such ramping down
+   ln_neptramp    = .false.  ! ramp down Neptune velocity in shallow water
+   rn_htrmin      =  100.0   ! min. depth of transition range
+   rn_htrmax      =  200.0   ! max. depth of transition range
+/
Index: /branches/2011/dev_r2787_NOCS_NEPTUNE/NEMOGCM/CONFIG/POMME/EXP00/namelist
===================================================================
--- /branches/2011/dev_r2787_NOCS_NEPTUNE/NEMOGCM/CONFIG/POMME/EXP00/namelist	(revision 2824)
+++ /branches/2011/dev_r2787_NOCS_NEPTUNE/NEMOGCM/CONFIG/POMME/EXP00/namelist	(revision 2825)
@@ -871,8 +871,14 @@
 &nam_dynnept  !   Neptune effect (simplified: lateral and vertical diffusions removed)
 !-----------------------------------------------------------------------
-   ln_neptsimp          = .false.  ! yes/no use simplified neptune
-
-   ln_smoothtopo        = .false.  ! yes/no smooth tsu, tsv
-   rn_tslse             =  1.2e4   ! value of L at the equator
-   rn_tslsp             =  3.0e3   ! value of L at the pole
-/
+! Suggested lengthscale values are those of Eby & Holloway (1994) for a coarse model
+   ln_neptsimp    = .false.  ! yes/no use simplified neptune
+
+   ln_smoothtopo  = .false.  ! yes/no smooth tsu, tsv
+   rn_tslse       =  1.2e4   ! value of lengthscale L at the equator
+   rn_tslsp       =  3.0e3   ! value of lengthscale L at the pole
+! Specify whether to ramp down the Neptune velocity in shallow
+! water, and if so the depth range controlling such ramping down
+   ln_neptramp    = .false.  ! ramp down Neptune velocity in shallow water
+   rn_htrmin      =  100.0   ! min. depth of transition range
+   rn_htrmax      =  200.0   ! max. depth of transition range
+/
Index: /branches/2011/dev_r2787_NOCS_NEPTUNE/NEMOGCM/NEMO/OPA_SRC/DYN/dynnept.F90
===================================================================
--- /branches/2011/dev_r2787_NOCS_NEPTUNE/NEMOGCM/NEMO/OPA_SRC/DYN/dynnept.F90	(revision 2824)
+++ /branches/2011/dev_r2787_NOCS_NEPTUNE/NEMOGCM/NEMO/OPA_SRC/DYN/dynnept.F90	(revision 2825)
@@ -8,8 +8,10 @@
    !!                                                             - horizontal diffusion for Neptune
    !!                                                             - vertical diffusion for gm in momentum eqns
-   !!                                                             - option to use neptune in Coriolis eqn
-   !!                    2011-07  (Jeff Blundell, NOCS) Simplified form for temporally invariant u*, v*
+   !!                                                             - option to use Neptune in Coriolis eqn
+   !!                    2011-08  (Jeff Blundell, NOCS) Simplified form for temporally invariant u*, v*
    !!                                               Horizontal and vertical diffusivity formulations removed
    !!                                               Dynamic allocation of storage added
+   !!                                               Option of ramping Neptune vel. down
+   !!                                               to zero added in shallow depths added
    !!----------------------------------------------------------------------
    !! dyn_nept_init        :
@@ -48,6 +50,11 @@
 
    LOGICAL          ::  ln_smoothtopo  = .FALSE.  ! yes/no smooth zunep, zvnep
-   REAL(wp)         ::  rn_tslse       =  1.2e4   ! value of L at the equator
-   REAL(wp)         ::  rn_tslsp       =  3.0e3   ! value of L at the pole
+   REAL(wp)         ::  rn_tslse       =  1.2e4   ! value of lengthscale L at the equator
+   REAL(wp)         ::  rn_tslsp       =  3.0e3   ! value of lengthscale L at the pole
+!! Specify whether to ramp down the Neptune velocity in shallow
+!! water, and the depth range controlling such ramping down
+   LOGICAL          ::  ln_neptramp    = .FALSE.  ! ramp down Neptune velocity in shallow water
+   REAL(wp)         ::  rn_htrmin      =  100.0   ! min. depth of transition range
+   REAL(wp)         ::  rn_htrmax      =  200.0   ! max. depth of transition range
 
    !! * Module variables
@@ -89,4 +96,5 @@
       !!                    ! Simplified form for temporally invariant u*, v*
       !!                    ! Horizontal and vertical diffusivity formulations removed
+      !!                    ! Includes optional tapering-off in shallow depths
       !!----------------------------------------------------------------------
       USE iom
@@ -102,11 +110,18 @@
       REAL(wp), ALLOCATABLE, DIMENSION(:,:)   ::   hu_n     ! temporary 2D workspace
       REAL(wp), ALLOCATABLE, DIMENSION(:,:)   ::   hv_n     ! temporary 2D workspace
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   znmask  ! temporary 3D array for nmask
-      REAL(wp) :: unemin,unemax,vnemin,vnemax    ! extrema of (u*, v*) fields
-      !!
-      NAMELIST/nam_dynnept/ ln_neptsimp,        &
-                            ln_smoothtopo,      &
-			    rn_tslse,		&
-			    rn_tslsp
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   znmask   ! temporary 3D array for nmask
+      REAL(wp) :: unemin,unemax,vnemin,vnemax   ! extrema of (u*, v*) fields
+      REAL(wp) :: zhdivmin,zhdivmax             ! extrema of horizontal divergence of (u*, v*) fields
+      REAL(wp) :: zmrotmin,zmrotmax             ! extrema of the curl of the (u*, v*) fields
+      REAL(wp) :: ustar,vstar                   ! (u*, v*) before tapering in shallow water
+      REAL(wp) :: hramp                         ! depth over which Neptune vel. is ramped down
+      !!
+      NAMELIST/nam_dynnept/ ln_neptsimp,      &
+                            ln_smoothtopo,    &
+			    rn_tslse,	      &
+			    rn_tslsp,	      &
+                            ln_neptramp,      &
+                            rn_htrmin,        &
+			    rn_htrmax
       !!----------------------------------------------------------------------
 
@@ -132,4 +147,8 @@
          WRITE(numout,*) '       rn_tslsp             = ', rn_tslsp
          WRITE(numout,*)
+         WRITE(numout,*) '       ln_neptramp          = ', ln_neptramp
+         WRITE(numout,*) '       rn_htrmin            = ', rn_htrmin
+         WRITE(numout,*) '       rn_htrmax            = ', rn_htrmax
+         WRITE(numout,*)
          CALL FLUSH(numout)
       ENDIF
@@ -146,4 +165,11 @@
           IF(lwp) WRITE(numout,*) ' -->   ln_neptsimp disabled'
           RETURN
+      ENDIF
+
+      IF( ln_neptramp ) THEN
+          IF(lwp) WRITE(numout,*) ' -->   ln_neptramp enabled, ramp down Neptune'
+          IF(lwp) WRITE(numout,*) ' -->   velocity components in shallow water'
+      ELSE
+          IF(lwp) WRITE(numout,*) ' -->   ln_neptramp disabled'
       ENDIF
 
@@ -247,13 +273,38 @@
       vnemin =  1.0e35
       vnemax = -1.0e35
+      hramp = rn_htrmax - rn_htrmin
       DO jj = 2, jpj-1
          DO ji = 2, jpi-1
             if ( umask(ji,jj,1) /= 0.0_wp ) then
-              zunep(ji,jj) =-1.0_wp/e2u(ji,jj) * hur_n(ji,jj) * ( tsp(ji,jj)-tsp(ji,jj-1) ) * umask(ji,jj,1)
+               ustar =-1.0_wp/e2u(ji,jj) * hur_n(ji,jj) * ( tsp(ji,jj)-tsp(ji,jj-1) ) * umask(ji,jj,1)
+               if ( ln_neptramp ) then
+!!                Apply ramp down to velocity component
+                  if ( hu_n(ji,jj) <= rn_htrmin ) then
+                    zunep(ji,jj) = 0.0_wp
+                   else if ( hu_n(ji,jj) >= rn_htrmax ) then
+                    zunep(ji,jj) = ustar
+                   else if ( hramp > 0.0_wp ) then
+                    zunep(ji,jj) = ( hu_n(ji,jj) - rn_htrmin) * ustar/hramp
+                  endif
+                else
+                 zunep(ji,jj) = ustar
+               endif 
              else
               zunep(ji,jj) = 0.0_wp
             endif
             if ( vmask(ji,jj,1) /= 0.0_wp ) then
-              zvnep(ji,jj) = 1.0_wp/e1v(ji,jj) * hvr_n(ji,jj) * ( tsp(ji,jj)-tsp(ji-1,jj) ) * vmask(ji,jj,1)
+               vstar = 1.0_wp/e1v(ji,jj) * hvr_n(ji,jj) * ( tsp(ji,jj)-tsp(ji-1,jj) ) * vmask(ji,jj,1)
+               if ( ln_neptramp ) then
+!!                Apply ramp down to velocity component
+                  if ( hv_n(ji,jj) <= rn_htrmin ) then
+                    zvnep(ji,jj) = 0.0_wp
+                   else if ( hv_n(ji,jj) >= rn_htrmax ) then
+                    zvnep(ji,jj) = vstar
+                   else if ( hramp > 0.0_wp ) then
+                    zvnep(ji,jj) = ( hv_n(ji,jj) - rn_htrmin) * vstar/hramp
+                  endif
+                else
+                  zvnep(ji,jj) = vstar
+               endif
              else
               zvnep(ji,jj) = 0.0_wp
@@ -274,4 +325,24 @@
       !!  and the curl (zmrotnep) of the Neptune velocity field (zunep, zvnep)
       CALL div_cur_nept_init
+
+      !! Check the ranges of the computed divergence & vorticity
+      zhdivmin =  1.0e35
+      zhdivmax = -1.0e35
+      zmrotmin =  1.0e35
+      zmrotmax = -1.0e35
+      hramp = rn_htrmax - rn_htrmin
+      DO jk = 1, jpkm1                                 ! Horizontal slab
+         DO jj = 2, jpj-1
+            DO ji = 2, jpi-1
+               zhdivmin = min( zhdivmin, zhdivnep(ji,jj,jk) )
+               zhdivmax = max( zhdivmax, zhdivnep(ji,jj,jk) )
+               zmrotmin = min( zmrotmin, zmrotnep(ji,jj,jk) )
+               zmrotmax = max( zmrotmax, zmrotnep(ji,jj,jk) )
+            END DO
+         END DO
+      END DO
+      WRITE(numout,*) '   zhdivnep: min, max       = ', zhdivmin,zhdivmax
+      WRITE(numout,*) '   zmrotnep: min, max       = ', zmrotmin,zmrotmax
+      WRITE(numout,*)
 
 !!    Deallocate temporary workspace arrays, which are all local to
