<p><b>ringler@lanl.gov</b> 2012-01-05 12:39:29 -0700 (Thu, 05 Jan 2012)</p><p><br>
added option to impose a linear (-gamma * u) tendency term to the RHS of the velocity equation.<br>
<br>
this can be used to smooth out the strong adjustment process resulting from cold starts.<br>
<br>
to use, add the following to the namelist.input (under hmix)<br>
<br>
   config_rayleigh_friction = .true.<br>
   config_rayleigh_damping_coeff = 3.0e-4<br>
<br>
the first config_ turns on the linear drag. the second config_ specifies the relaxation time.<br>
<br>
the units of config_rayleigh_damping_coeff are (1/s), so a damping time scale of one hour will have<br>
config_rayleigh_damping_coeff = 2.78e-4<br>
<br>
the option has been tested with a variable resolution (20 to 160 km) grid focused in the North Atlantic<br>
using split-explicit time stepping with dt (baroclinic) = 600.0 and config_rayleigh_damping_coeff = 2.78e-4<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/rayleigh/src/core_ocean/Makefile
===================================================================
--- trunk/mpas/src/core_ocean/Makefile        2012-01-04 22:45:33 UTC (rev 1294)
+++ branches/ocean_projects/rayleigh/src/core_ocean/Makefile        2012-01-05 19:39:29 UTC (rev 1298)
@@ -13,6 +13,7 @@
            mpas_ocn_vel_forcing.o \
            mpas_ocn_vel_forcing_windstress.o \
            mpas_ocn_vel_forcing_bottomdrag.o \
+           mpas_ocn_vel_forcing_rayleigh.o \
            mpas_ocn_vel_pressure_grad.o \
            mpas_ocn_tracer_vadv.o \
            mpas_ocn_tracer_vadv_spline.o \
@@ -35,13 +36,13 @@
            mpas_ocn_vmix_coefs_tanh.o \
            mpas_ocn_restoring.o \
            mpas_ocn_tendency.o \
-       mpas_ocn_time_integration.o \
-       mpas_ocn_time_integration_rk4.o \
-       mpas_ocn_time_integration_split.o \
+           mpas_ocn_time_integration.o \
+           mpas_ocn_time_integration_rk4.o \
+           mpas_ocn_time_integration_split.o \
            mpas_ocn_equation_of_state.o \
            mpas_ocn_equation_of_state_jm.o \
-           mpas_ocn_equation_of_state_linear.o \
-       mpas_ocn_global_diagnostics.o
+        mpas_ocn_equation_of_state_linear.o \
+        mpas_ocn_global_diagnostics.o
 
 
 all: core_hyd
@@ -77,12 +78,14 @@
 
 mpas_ocn_vel_hmix_del4.o:
 
-mpas_ocn_vel_forcing.o: mpas_ocn_vel_forcing_windstress.o mpas_ocn_vel_forcing_bottomdrag.o
+mpas_ocn_vel_forcing.o: mpas_ocn_vel_forcing_windstress.o mpas_ocn_vel_forcing_bottomdrag.o mpas_ocn_vel_forcing_rayleigh.o
 
 mpas_ocn_vel_forcing_windstress.o:
 
-mpas_ocn_velforcing_bottomdrag.o:
+mpas_ocn_vel_forcing_bottomdrag.o:
 
+mpas_ocn_vel_forcing_rayleigh.o:
+
 mpas_ocn_vel_coriolis.o:
 
 mpas_ocn_tracer_hadv.o:  mpas_ocn_tracer_hadv2.o  mpas_ocn_tracer_hadv3.o  mpas_ocn_tracer_hadv4.o

Modified: branches/ocean_projects/rayleigh/src/core_ocean/Registry
===================================================================
--- trunk/mpas/src/core_ocean/Registry        2012-01-04 22:45:33 UTC (rev 1294)
+++ branches/ocean_projects/rayleigh/src/core_ocean/Registry        2012-01-05 19:39:29 UTC (rev 1298)
@@ -38,7 +38,7 @@
 namelist real      split_explicit_ts config_btr_gam2_SSHWt1  1.0
 namelist real      split_explicit_ts config_btr_gam3_uWt2    1.0
 namelist logical   split_explicit_ts config_btr_solve_SSH2   false
-namelist logical   sw_model config_h_ScaleWithMesh     false
+namelist logical   hmix     config_h_ScaleWithMesh     false
 namelist real      hmix     config_h_mom_eddy_visc2     0.0
 namelist real      hmix     config_h_mom_eddy_visc4     0.0
 namelist logical   hmix     config_visc_vorticity_term true
@@ -50,6 +50,8 @@
 namelist real      hmix     config_apvm_upwinding       0.5
 namelist logical   hmix     config_mom_decay            false 
 namelist real      hmix     config_mom_decay_time       3600.0
+namelist logical   hmix     config_rayleigh_friction    false
+namelist real      hmix     config_rayleigh_damping_coeff 0.0
 namelist character vmix     config_vert_visc_type       const
 namelist character vmix     config_vert_diff_type       const
 namelist logical   vmix     config_implicit_vertical_mix  .true.

Modified: branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_vel_forcing.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_vel_forcing.F        2012-01-04 22:45:33 UTC (rev 1294)
+++ branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_vel_forcing.F        2012-01-05 19:39:29 UTC (rev 1298)
@@ -19,6 +19,7 @@
 
    use ocn_vel_forcing_windstress
    use ocn_vel_forcing_bottomdrag
+   use ocn_vel_forcing_rayleigh
 
    implicit none
    private
@@ -114,7 +115,7 @@
       !
       !-----------------------------------------------------------------
 
-      integer :: err1, err2
+      integer :: err1, err2, err3
 
       !-----------------------------------------------------------------
       !
@@ -126,8 +127,10 @@
 
       call ocn_vel_forcing_windstress_tend(grid, u_src, h_edge, tend, err1)
       call ocn_vel_forcing_bottomdrag_tend(grid, u, ke_edge, h_edge, tend, err2)
+      call ocn_vel_forcing_rayleigh_tend(grid, u, tend, err3)
 
       err = ior(err1, err2)
+      err = ior(err, err3)
 
    !--------------------------------------------------------------------
 
@@ -161,12 +164,14 @@
 
       integer, intent(out) :: err !&lt; Output: error flag
 
-      integer :: err1, err2
+      integer :: err1, err2, err3
 
       call ocn_vel_forcing_windstress_init(err1)
       call ocn_vel_forcing_bottomdrag_init(err2)
+      call ocn_vel_forcing_rayleigh_init(err3)
 
       err = ior(err1, err2)
+      err = ior(err, err3)
 
    !--------------------------------------------------------------------
 

Added: branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_vel_forcing_rayleigh.F
===================================================================
--- branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_vel_forcing_rayleigh.F                                (rev 0)
+++ branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_vel_forcing_rayleigh.F        2012-01-05 19:39:29 UTC (rev 1298)
@@ -0,0 +1,183 @@
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  ocn_vel_forcing_rayleigh
+!
+!&gt; \brief MPAS ocean Rayleigh Friction (to be used to smooth &quot;shocks&quot; from cold starts)
+!&gt; \author Doug Jacobsen
+!&gt; \date   16 September 2011
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This module contains the routine for computing 
+!&gt;  tendencies based on linear Rayleigh friction.
+!
+!-----------------------------------------------------------------------
+
+module ocn_vel_forcing_rayleigh
+
+   use mpas_grid_types
+   use mpas_configure
+
+   implicit none
+   private
+   save
+
+   !--------------------------------------------------------------------
+   !
+   ! Public parameters
+   !
+   !--------------------------------------------------------------------
+
+   !--------------------------------------------------------------------
+   !
+   ! Public member functions
+   !
+   !--------------------------------------------------------------------
+
+   public :: ocn_vel_forcing_rayleigh_tend, &amp;
+             ocn_vel_forcing_rayleigh_init
+
+   !--------------------------------------------------------------------
+   !
+   ! Private module variables
+   !
+   !--------------------------------------------------------------------
+
+   logical :: rayleighFrictionOn
+   real (kind=RKIND) :: rayleighDampingCoef
+
+
+!***********************************************************************
+
+contains
+
+!***********************************************************************
+!
+!  routine ocn_vel_forcing_rayleigh_tend
+!
+!&gt; \brief   Computes tendency term from Rayleigh friction
+!&gt; \author  Doug Jacobsen
+!&gt; \date    15 September 2011
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt;  This routine computes the Rayleigh friction tendency for momentum
+!&gt;  based on current state.
+!
+!-----------------------------------------------------------------------
+
+   subroutine ocn_vel_forcing_rayleigh_tend(grid, u, tend, err)!{{{
+
+      !-----------------------------------------------------------------
+      !
+      ! input variables
+      !
+      !-----------------------------------------------------------------
+
+      real (kind=RKIND), dimension(:,:), intent(in) :: &amp;
+         u    !&lt; Input: velocity 
+
+      type (mesh_type), intent(in) :: &amp;
+         grid          !&lt; Input: grid information
+
+      !-----------------------------------------------------------------
+      !
+      ! input/output variables
+      !
+      !-----------------------------------------------------------------
+
+      real (kind=RKIND), dimension(:,:), intent(inout) :: &amp;
+         tend          !&lt; Input/Output: velocity tendency
+
+      !-----------------------------------------------------------------
+      !
+      ! output variables
+      !
+      !-----------------------------------------------------------------
+
+      integer, intent(out) :: err !&lt; Output: error flag
+
+      !-----------------------------------------------------------------
+      !
+      ! local variables
+      !
+      !-----------------------------------------------------------------
+
+      integer :: iEdge, nEdgesSolve, k
+      integer, dimension(:), pointer :: maxLevelEdgeTop
+
+      !-----------------------------------------------------------------
+      !
+      ! call relevant routines for computing tendencies
+      ! note that the user can choose multiple options and the 
+      !   tendencies will be added together
+      !
+      !-----------------------------------------------------------------
+
+      err = 0
+
+      if(.not.rayleighFrictionOn) return
+
+      nEdgesSolve = grid % nEdgesSolve
+      maxLevelEdgeTop =&gt; grid % maxLevelEdgeTop % array
+
+      do iEdge=1,grid % nEdgesSolve
+
+        do k=1,maxLevelEdgeTop(iEdge)
+
+           tend(k,iEdge) = tend(k,iEdge)  &amp;
+               -rayleighDampingCoef*u(k,iEdge)
+
+        enddo
+
+      enddo
+
+
+   !--------------------------------------------------------------------
+
+   end subroutine ocn_vel_forcing_rayleigh_tend!}}}
+
+!***********************************************************************
+!
+!  routine ocn_vel_forcing_rayleigh_init
+!
+!&gt; \brief   Initializes ocean Rayleigh friction
+!&gt; \author  Doug Jacobsen
+!&gt; \date    16 September 2011
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt;  This routine initializes quantities related to 
+!&gt;  in the ocean. 
+!
+!-----------------------------------------------------------------------
+
+   subroutine ocn_vel_forcing_rayleigh_init(err)!{{{
+
+   !--------------------------------------------------------------------
+
+      !-----------------------------------------------------------------
+      !
+      ! call individual init routines for each parameterization
+      !
+      !-----------------------------------------------------------------
+
+      integer, intent(out) :: err !&lt; Output: error flag
+
+
+      err = 0
+
+      rayleighDampingCoef = 0.0
+
+      if (config_rayleigh_friction) then
+          rayleighFrictionOn = .true.
+          rayleighDampingCoef = config_rayleigh_damping_coeff
+      endif
+
+   !--------------------------------------------------------------------
+
+   end subroutine ocn_vel_forcing_rayleigh_init!}}}
+
+!***********************************************************************
+
+end module ocn_vel_forcing_rayleigh
+
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+! vim: foldmethod=marker

</font>
</pre>