<p><b>dwj07@fsu.edu</b> 2012-11-30 10:49:07 -0700 (Fri, 30 Nov 2012)</p><p><br>
        -- BRANCH COMMIT --<br>
<br>
        Allowing multiple vertical mixing options to be turned on in a given run.<br>
<br>
        Changing namelist flags to correspond with this.<br>
<br>
        Updating default namelist.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/namelist_cleanup/namelist.input.ocean
===================================================================
--- branches/ocean_projects/namelist_cleanup/namelist.input.ocean        2012-11-29 22:23:06 UTC (rev 2329)
+++ branches/ocean_projects/namelist_cleanup/namelist.input.ocean        2012-11-30 17:49:07 UTC (rev 2330)
@@ -86,25 +86,29 @@
 /
 
 &amp;vmix
-        config_vert_visc_type = 'rich'
-        config_vert_diff_type = 'rich'
         config_implicit_vertical_mix = .true.
         config_convective_visc = 1.0
         config_convective_diff = 1.0
 /
 
 &amp;vmix_const
+        config_use_const_visc = .true.
+        config_use_const_diff = .true.
         config_vert_visc = 2.5e-4
         config_vert_diff = 2.5e-5
 /
 
 &amp;vmix_rich
+        config_use_rich_visc = .false.
+        config_use_rich_diff = .false.
         config_bkrd_vert_visc = 1.0e-4
         config_bkrd_vert_diff = 1.0e-5
         config_rich_mix = 50.0
 /
 
 &amp;vmix_tanh
+        config_use_tanh_visc = .false.
+        config_use_tanh_diff = .false.
         config_max_visc_tanh = 2.5e-1
         config_min_visc_tanh = 1.0e-4
         config_max_diff_tanh = 2.5e-2

Modified: branches/ocean_projects/namelist_cleanup/src/core_ocean/Registry
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/core_ocean/Registry        2012-11-29 22:23:06 UTC (rev 2329)
+++ branches/ocean_projects/namelist_cleanup/src/core_ocean/Registry        2012-11-30 17:49:07 UTC (rev 2330)
@@ -66,19 +66,23 @@
 namelist logical   Rayleigh_damping     config_Rayleigh_friction    .false.
 namelist real      Rayleigh_damping     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.
 namelist real      vmix     config_convective_visc      1.0
 namelist real      vmix     config_convective_diff      1.0
 
+namelist logical   vmix_const   config_use_const_visc   .true.
+namelist logical   vmix_const   config_use_const_diff   .true.
 namelist real      vmix_const   config_vert_visc        2.5e-4
 namelist real      vmix_const   config_vert_diff        2.5e-5
 
+namelist logical   vmix_rich    config_use_rich_visc    .true.
+namelist logical   vmix_rich    config_use_rich_diff    .true.
 namelist real      vmix_rich    config_bkrd_vert_visc   1.0e-4
 namelist real      vmix_rich    config_bkrd_vert_diff   1.0e-5
 namelist real      vmix_rich    config_rich_mix         0.005
 
+namelist logical   vmix_tanh    config_use_tanh_visc    .true.
+namelist logical   vmix_tanh    config_use_tanh_diff    .true.
 namelist real      vmix_tanh    config_max_visc_tanh    2.5e-1
 namelist real      vmix_tanh    config_min_visc_tanh    1.0e-4
 namelist real      vmix_tanh    config_max_diff_tanh    2.5e-2

Modified: branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_vmix.F
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_vmix.F        2012-11-29 22:23:06 UTC (rev 2329)
+++ branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_vmix.F        2012-11-30 17:49:07 UTC (rev 2330)
@@ -15,6 +15,7 @@
 
 module ocn_vmix
 
+   use mpas_kind_types
    use mpas_grid_types
    use mpas_configure
    use mpas_timer
@@ -124,6 +125,9 @@
 
       err = 0
 
+      d % vertViscTopOfEdge % array = 0.0_RKIND
+      d % vertDiffTopOfCell % array = 0.0_RKIND
+
       call ocn_vmix_coefs_const_build(grid, s, d, err1)
       call ocn_vmix_coefs_tanh_build(grid, s, d, err2)
       call ocn_vmix_coefs_rich_build(grid, s, d, err3)

Modified: branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_vmix_coefs_const.F
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_vmix_coefs_const.F        2012-11-29 22:23:06 UTC (rev 2329)
+++ branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_vmix_coefs_const.F        2012-11-30 17:49:07 UTC (rev 2330)
@@ -121,7 +121,6 @@
       !-----------------------------------------------------------------
 
       err = 0
-      if((.not.constViscOn) .and. (.not.constDiffOn)) return
 
       vertViscTopOfEdge =&gt; d % vertViscTopOfEdge % array
       vertDiffTopOfCell =&gt; d % vertDiffTopOfCell % array
@@ -185,7 +184,7 @@
 
       if(.not.constViscOn) return
 
-      vertViscTopOfEdge = constVisc
+      vertViscTopOfEdge = vertViscTopOfEdge + constVisc
 
    !--------------------------------------------------------------------
 
@@ -241,7 +240,7 @@
 
       if(.not.constDiffOn) return
 
-      vertDiffTopOfCell = constDiff
+      vertDiffTopOfCell = vertDiffTopOfCell + constDiff
 
    !--------------------------------------------------------------------
 
@@ -279,18 +278,18 @@
 
       err = 0
 
-      constViscOn = .false.
-      constDiffOn = .false.
+      constViscOn = config_use_const_visc
+      constDiffOn = config_use_const_diff
 
-      if (config_vert_visc_type.eq.'const') then
-          constViscOn = .true.
-          constVisc = config_vert_visc
-      endif
+!     if (config_vert_visc_type.eq.'const') then
+!         constViscOn = .true.
+!         constVisc = config_vert_visc
+!     endif
 
-      if (config_vert_diff_type.eq.'const') then
-          constDiffOn = .true.
-          constDiff = config_vert_diff
-      endif
+!     if (config_vert_diff_type.eq.'const') then
+!         constDiffOn = .true.
+!         constDiff = config_vert_diff
+!     endif
 
 
    !--------------------------------------------------------------------

Modified: branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_vmix_coefs_rich.F
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_vmix_coefs_rich.F        2012-11-29 22:23:06 UTC (rev 2329)
+++ branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_vmix_coefs_rich.F        2012-11-30 17:49:07 UTC (rev 2330)
@@ -124,7 +124,6 @@
       !-----------------------------------------------------------------
 
       err = 0
-      if((.not.richViscOn) .and. (.not.richDiffOn)) return
 
       indexT = s%index_temperature
       indexS = s%index_salinity
@@ -222,13 +221,12 @@
 
       maxLevelEdgeTop =&gt; grid % maxLevelEdgeTop % array
 
-      vertViscTopOfEdge = 0.0
       do iEdge = 1,nEdges
          do k = 2,maxLevelEdgeTop(iEdge)
             ! mrp 110324 efficiency note: this if is inside iEdge and k loops.
             ! Perhaps there is a more efficient way to do this.
             if (RiTopOfEdge(k,iEdge)&gt;0.0) then
-               vertViscTopOfEdge(k,iEdge) = config_bkrd_vert_visc &amp;
+               vertViscTopOfEdge(k,iEdge) = vertViscTopOfEdge(k, iEdge) + config_bkrd_vert_visc &amp;
                   + config_rich_mix / (1.0 + 5.0*RiTopOfEdge(k,iEdge))**2
             ! maltrud do limiting of coefficient--should not be necessary
             ! also probably better logic could be found
@@ -248,8 +246,7 @@
                else
                   ! for Ri&lt;0 and explicit vertical mix, 
                   ! use maximum diffusion allowed by CFL criterion
-                  vertViscTopOfEdge(k,iEdge) = &amp;
-                      ((h_edge(k-1,iEdge)+h_edge(k,iEdge))/2.0)**2/config_dt/4.0
+                  vertViscTopOfEdge(k,iEdge) = vertViscTopOfEdge(k,iEdge) + ((h_edge(k-1,iEdge)+h_edge(k,iEdge))/2.0)**2/config_dt/4.0
                end if
             end if
          end do
@@ -326,14 +323,13 @@
 
       maxLevelCell =&gt; grid % maxLevelCell % array
 
-      vertDiffTopOfCell = 0.0
       coef = -gravity/config_rho0/2.0
       do iCell = 1,nCells
          do k = 2,maxLevelCell(iCell)
             ! mrp 110324 efficiency note: this if is inside iCell and k loops.
             ! Perhaps there is a more efficient way to do this.
             if (RiTopOfCell(k,iCell)&gt;0.0) then
-               vertDiffTopOfCell(k,iCell) = config_bkrd_vert_diff &amp;
+               vertDiffTopOfCell(k,iCell) = vertDiffTopOfCell(k, iCell) + config_bkrd_vert_diff &amp;
                   + (config_bkrd_vert_visc &amp; 
                      + config_rich_mix / (1.0 + 5.0*RiTopOfCell(k,iCell))**2) &amp;
                   / (1.0 + 5.0*RiTopOfCell(k,iCell))
@@ -355,8 +351,7 @@
                else
                   ! for Ri&lt;0 and explicit vertical mix, 
                   ! use maximum diffusion allowed by CFL criterion
-                  vertDiffTopOfCell(k,iCell) = &amp;
-                     ((h(k-1,iCell)+h(k,iCell))/2.0)**2/config_dt/4.0
+                  vertDiffTopOfCell(k,iCell) = vertDiffTopOfCell(k, iCell) + ((h(k-1,iCell)+h(k,iCell))/2.0)**2/config_dt/4.0
                end if
             end if
          end do
@@ -573,16 +568,16 @@
 
       err = 0
 
-      richViscOn = .false.
-      richDiffOn = .false.
+      richViscOn = config_use_rich_visc
+      richDiffOn = config_use_rich_diff
 
-      if (config_vert_visc_type.eq.'rich') then
-          richViscOn = .true.
-      endif
+!     if (config_vert_visc_type.eq.'rich') then
+!         richViscOn = .true.
+!     endif
 
-      if (config_vert_diff_type.eq.'rich') then
-          richDiffOn = .true.
-      endif
+!     if (config_vert_diff_type.eq.'rich') then
+!         richDiffOn = .true.
+!     endif
 
 
    !--------------------------------------------------------------------

Modified: branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_vmix_coefs_tanh.F
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_vmix_coefs_tanh.F        2012-11-29 22:23:06 UTC (rev 2329)
+++ branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_vmix_coefs_tanh.F        2012-11-30 17:49:07 UTC (rev 2330)
@@ -115,7 +115,6 @@
       !-----------------------------------------------------------------
 
       err = 0
-      if((.not.tanhViscOn) .and. (.not.tanhDiffOn)) return
 
       vertViscTopOfEdge =&gt; d % vertViscTopOfEdge % array
       vertDiffTopOfCell =&gt; d % vertDiffTopOfCell % array
@@ -189,9 +188,8 @@
       ! refBottomDepth is used here for simplicity.  Using zMid and h, which 
       ! vary in time, would give the exact location of the top, but it
       ! would only change the diffusion value very slightly.
-      vertViscTopOfEdge = 0.0
       do k=2,nVertLevels
-         vertViscTopOfEdge(k,:) = -(config_max_visc_tanh-config_min_visc_tanh)/2.0 &amp;
+         vertViscTopOfEdge(k,:) = vertViscTopOfEdge(k,:)-(config_max_visc_tanh-config_min_visc_tanh)/2.0 &amp;
             *tanh((refBottomDepth(k-1)+config_ZMid_tanh) &amp;
                   /config_zWidth_tanh) &amp;
             + (config_max_visc_tanh+config_min_visc_tanh)/2
@@ -262,9 +260,8 @@
       ! refBottomDepth is used here for simplicity.  Using zMid and h, which 
       ! vary in time, would give the exact location of the top, but it
       ! would only change the diffusion value very slightly.
-      vertDiffTopOfCell = 0.0
       do k=2,nVertLevels
-         vertDiffTopOfCell(k,:) = -(config_max_diff_tanh-config_min_diff_tanh)/2.0 &amp;
+         vertDiffTopOfCell(k,:) = vertDiffTopOfCell(k,:)-(config_max_diff_tanh-config_min_diff_tanh)/2.0 &amp;
             *tanh((refBottomDepth(k-1)+config_ZMid_tanh) &amp;
                   /config_zWidth_tanh) &amp;
             + (config_max_diff_tanh+config_min_diff_tanh)/2
@@ -305,16 +302,16 @@
 
       err = 0
 
-      tanhViscOn = .false.
-      tanhDiffOn = .false.
+      tanhViscOn = config_use_tanh_visc
+      tanhDiffOn = config_use_tanh_diff
 
-      if (config_vert_visc_type.eq.'tanh') then
-          tanhViscOn = .true.
-      endif
+!     if (config_vert_visc_type.eq.'tanh') then
+!         tanhViscOn = .true.
+!     endif
 
-      if (config_vert_diff_type.eq.'tanh') then
-          tanhDiffOn = .true.
-      endif
+!     if (config_vert_diff_type.eq.'tanh') then
+!         tanhDiffOn = .true.
+!     endif
 
    !--------------------------------------------------------------------
 

</font>
</pre>