<p><b>qchen3@fsu.edu</b> 2012-05-14 11:12:29 -0600 (Mon, 14 May 2012)</p><p>BRANCH COMMIT<br>
<br>
The ocn_get_h_kappa routine can now assign a constant eddy diffusivity to all<br>
three layers or one different constant to each layer. It can also read in<br>
actual eddy diffusivity from high res reference solution, and can make some <br>
adjustment to the derived eddy diffusivity.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/accgm/src/core_ocean/Registry
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/Registry        2012-05-12 02:26:48 UTC (rev 1905)
+++ branches/ocean_projects/accgm/src/core_ocean/Registry        2012-05-14 17:12:29 UTC (rev 1906)
@@ -236,7 +236,7 @@
 var persistent real    uBolusGMZonal ( nVertLevels nEdges Time ) 2 o uBolusGMZonal state - -
 var persistent real    uBolusGMMeridional ( nVertLevels nEdges Time ) 2 o uBolusGMMeridional state - -
 var persistent real    hEddyFlux ( nVertLevels nEdges Time ) 2 - hEddyFlux state - -
-var persistent real    h_kappa ( nVertLevels nEdges Time ) 2 - h_kappa state - -
+var persistent real    h_kappa ( nVertLevels nEdges Time ) 2 o h_kappa state - -
 var persistent real    h_kappa_q ( nVertLevels nEdges Time ) 2 - h_kappa_q state - -
 var persistent real    divergence ( nVertLevels nCells Time ) 2 o divergence state - -
 var persistent real    vorticity ( nVertLevels nVertices Time ) 2 o vorticity state - -

Modified: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_gm.F
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_gm.F        2012-05-12 02:26:48 UTC (rev 1905)
+++ branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_gm.F        2012-05-14 17:12:29 UTC (rev 1906)
@@ -123,6 +123,7 @@
       integer, parameter                           :: funit = 539
       integer                                      :: nVertLevels, k, nRecs, iEdge, nEdges, ind, iy
       real(RKIND), dimension(:,:), allocatable     :: diffuHighRes
+      logical, save                                :: kappa_read
 
 
       yEdge      =&gt; grid % yEdge % array
@@ -140,6 +141,13 @@
       !h_kappa(:,:) = config_h_kappa
 
       !
+      ! Constant diffusivity for each layer
+      !
+      !h_kappa(1,:) = 428.0
+      !h_kappa(2,:) = 157.0
+      !h_kappa(3,:) = 407.0 
+
+      !
       ! Gaussian-shape diffusivity
       !
       !do k = 1, nVertLevels
@@ -149,31 +157,29 @@
       !
       ! Derived diffusivity
       !
-      open(funit, file='diffuHighRes.txt')
-      read(funit, &quot;(i4)&quot; ) nRecs
-      allocate( diffuHighRes(nRecs,4) )
+      if (.not. kappa_read) then
+         open(funit, file='diffuHighRes.txt')
+         read(funit, &quot;(i4)&quot; ) nRecs
+         allocate( diffuHighRes(nRecs,4) )
 
-      do iy = 1, nRecs
-         read(funit, * ) diffuHighRes(iy,:)
-      end do
-      close(funit)
+         do iy = 1, nRecs
+            read(funit, * ) diffuHighRes(iy,:)
+         end do
+         close(funit)
 
-      ! Cap the diffusivity by 2000, and eliminate negative values
-      !do iy = 1, nRecs
-      !    if (diffuHighRes(iy,2) &gt; 2000.0) then
-      !        diffuHighRes(iy,2) = 2000.0
-      !    end if
+         do iEdge = 1, nEdges
+             ind = minloc(abs(yEdge(iEdge) - diffuHighRes(:,1)),1)
+             h_kappa(:,iEdge) = diffuHighRes(ind,2:4)
+         end do
 
-      !    if (diffuHighRes(iy,2) &lt; 0.0) then
-      !        diffuHighRes(iy,2) = 0.0
-      !    end if
-      !end do
-         
-      do iEdge = 1, nEdges
-          ind = minloc(abs(yEdge(iEdge) - diffuHighRes(:,1)),1)
-          h_kappa(:,iEdge) = diffuHighRes(ind,2:4)
-      end do
+         ! Bound h_kappa from below by zero and set kappa for middle layer to a positive constant
+         where(h_kappa &lt; 0.0) h_kappa = 0.0
+         !h_kappa(2,:) = 157.0
 
+         kappa_read = .true.
+
+      end if
+
    end subroutine ocn_get_h_kappa
 
 

</font>
</pre>