<p><b>mpetersen@lanl.gov</b> 2011-03-31 17:15:17 -0600 (Thu, 31 Mar 2011)</p><p>BRANCH COMMIT Update to implicit vertical mix branch to include convective viscosity and diffusivity variables for instable stratification (Ri&lt;0).<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/doc/implicit_vert_mix/implicit_vert_diff_design.pdf
===================================================================
(Binary files differ)

Modified: branches/ocean_projects/doc/implicit_vert_mix/implicit_vert_diff_design.tex
===================================================================
--- branches/ocean_projects/doc/implicit_vert_mix/implicit_vert_diff_design.tex        2011-03-31 22:00:05 UTC (rev 772)
+++ branches/ocean_projects/doc/implicit_vert_mix/implicit_vert_diff_design.tex        2011-03-31 23:15:17 UTC (rev 773)
@@ -99,8 +99,8 @@
 </font>
<font color="black">u_v &amp;=&amp; </font>
<font color="black">u_{bkrd} + Rich\_mix/(1+5Ri)^2\\
 \kappa_v &amp;=&amp; \kappa_{bkrd} + (</font>
<font color="red">u_{bkrd} + Rich\_mix/(1+5Ri)^2)/(1+5Ri)
 \end{eqnarray}
-for $Ri&gt;=0$.  For unstable stratification, $Ri&lt;0$ and the viscosity and diffusion are set to be very high, based on the vertical diffusive CFL condition,
-\begin{eqnarray} \label{visc1}  
+for $Ri&gt;=0$.  For unstable stratification, $Ri&lt;0$ and the viscosity and diffusion are set to be very high.  For implicit vertical mixing, it is set by the config\_convective\_visc and config\_convective\_diff input variables.  For explicit vertical diffusion, it is based on the vertical diffusive CFL condition,
+\begin{eqnarray} \label{visc2}  
 </font>
<font color="gray">u_v = 
 \kappa_v = \frac{1}{4} \frac{dz^2}{dt}
 \end{eqnarray}
@@ -242,8 +242,10 @@
 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_const   config_vert_viscosity    2.5e-4
-namelist real      vmix_const   config_vert_diffusion    2.5e-5
+namelist real      vmix     config_convective_visc  1.0
+namelist real      vmix     config_convective_diff  1.0
+namelist real      vmix_const   config_vert_visc         2.5e-4
+namelist real      vmix_const   config_vert_diff         2.5e-5
 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          50

Modified: branches/ocean_projects/imp_vert_mix_mrp/namelist.input.ocean
===================================================================
--- branches/ocean_projects/imp_vert_mix_mrp/namelist.input.ocean        2011-03-31 22:00:05 UTC (rev 772)
+++ branches/ocean_projects/imp_vert_mix_mrp/namelist.input.ocean        2011-03-31 23:15:17 UTC (rev 773)
@@ -33,10 +33,12 @@
    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_vert_viscosity  = 2.5e-5
-   config_vert_diffusion  = 2.5e-5 
+   config_vert_visc       = 2.5e-5
+   config_vert_diff       = 2.5e-5 
 /
 &amp;vmix_rich
    config_bkrd_vert_visc  = 1.0e-4

Modified: branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/Registry
===================================================================
--- branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/Registry        2011-03-31 22:00:05 UTC (rev 772)
+++ branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/Registry        2011-03-31 23:15:17 UTC (rev 773)
@@ -24,8 +24,10 @@
 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_const   config_vert_viscosity    2.5e-4
-namelist real      vmix_const   config_vert_diffusion    2.5e-5
+namelist real      vmix     config_convective_visc  1.0
+namelist real      vmix     config_convective_diff  1.0
+namelist real      vmix_const   config_vert_visc    2.5e-4
+namelist real      vmix_const   config_vert_diff    2.5e-5
 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          50

Modified: branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/module_time_integration.F
===================================================================
--- branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/module_time_integration.F        2011-03-31 22:00:05 UTC (rev 772)
+++ branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/module_time_integration.F        2011-03-31 23:15:17 UTC (rev 773)
@@ -328,10 +328,7 @@
                   nVertLevels,num_tracers)
 
                tracers(:,1:maxLevelCell(iCell),iCell) = tracersTemp(:,1:maxLevelCell(iCell))
-! mrp set as follows
-!               tracers(:,maxLevelCell(iCell)+1:nVertLevels,iCell) = -1e34
-               tracers(:,maxLevelCell(iCell)+1:nVertLevels,iCell) = 0
-
+               tracers(:,maxLevelCell(iCell)+1:nVertLevels,iCell) = -1e34
             end do
             deallocate(A,C,uTemp,tracersTemp)
          end if
@@ -1825,8 +1822,6 @@
 
       type (dm_info) :: dminfo
 
-
-! mrp clean out these after subroutine complete
       integer :: iEdge, iCell, iVertex, k, cell1, cell2, i, j
       integer :: nCells, nEdges, nVertices, nVertLevels
 
@@ -1969,7 +1964,7 @@
    !
    if (config_vert_visc_type.eq.'const') then
 
-      vertViscTopOfEdge = config_vert_viscosity
+      vertViscTopOfEdge = config_vert_visc
 
    elseif (config_vert_visc_type.eq.'tanh') then
 
@@ -1988,6 +1983,7 @@
 
    elseif (config_vert_visc_type.eq.'rich') then
 
+
       vertViscTopOfEdge = 0.0
       do iEdge = 1,nEdges
          do k = 2,maxLevelEdgeTop(iEdge)
@@ -1997,12 +1993,19 @@
                vertViscTopOfEdge(k,iEdge) = config_bkrd_vert_visc &amp;
                   + config_rich_mix / (1.0 + 5.0*RiTopOfEdge(k,iEdge))**2
             else
-               ! for Ri&lt;0, use maximum diffusion allowed by CFL criterion
-               ! mrp 110324 efficiency note: for z-level, could use fixed
-               ! grid array hMeanTopZLevel and compute maxdiff on startup.
-               vertViscTopOfEdge(k,iEdge) = &amp;
-                   (h_edge(k-1,iEdge)+h_edge(k,iEdge))**2/config_dt/4.0
-            endif
+               ! mrp 110324 efficiency note: this if is inside iCell and k loops.
+               if (config_implicit_vertical_mix) then
+                  ! for Ri&lt;0 and implicit mix, use convective diffusion
+                  vertViscTopOfEdge(k,iEdge) = config_convective_visc
+               else
+                  ! for Ri&lt;0 and explicit vertical mix, 
+                  ! use maximum diffusion allowed by CFL criterion
+                  ! mrp 110324 efficiency note: for z-level, could use fixed
+                  ! grid array hMeanTopZLevel and compute maxdiff on startup.
+                  vertViscTopOfEdge(k,iEdge) = &amp;
+                      ((h_edge(k-1,iEdge)+h_edge(k,iEdge))/2.0)**2/config_dt/4.0
+               end if
+            end if
          end do
       end do
 
@@ -2018,7 +2021,7 @@
    !
    if (config_vert_diff_type.eq.'const') then
 
-      vertDiffTopOfCell = config_vert_diffusion
+      vertDiffTopOfCell = config_vert_diff
 
    elseif (config_vert_diff_type.eq.'tanh') then
 
@@ -2049,12 +2052,19 @@
                      + config_rich_mix / (1.0 + 5.0*RiTopOfCell(k,iCell))**2) &amp;
                   / (1.0 + 5.0*RiTopOfCell(k,iCell))
              else
-                ! for Ri&lt;0, use maximum diffusion allowed by CFL criterion
-                ! mrp 110324 efficiency note: for z-level, could use fixed
-                ! grid array hMeanTopZLevel and compute maxdiff on startup.
-                vertDiffTopOfCell(k,iCell) = &amp;
-                   (h(k-1,iCell)+h(k,iCell))**2/config_dt/4.0
-             end if
+               ! mrp 110324 efficiency note: this if is inside iCell and k loops.
+               if (config_implicit_vertical_mix) then
+                  ! for Ri&lt;0 and implicit mix, use convective diffusion
+                  vertDiffTopOfCell(k,iCell) = config_convective_diff
+               else
+                  ! for Ri&lt;0 and explicit vertical mix, 
+                  ! use maximum diffusion allowed by CFL criterion
+                  ! mrp 110324 efficiency note: for z-level, could use fixed
+                  ! grid array hMeanTopZLevel and compute maxdiff on startup.
+                  vertDiffTopOfCell(k,iCell) = &amp;
+                     ((h(k-1,iCell)+h(k,iCell))/2.0)**2/config_dt/4.0
+               end if
+            end if
          end do
       end do
 

</font>
</pre>