<p><b>qchen3@fsu.edu</b> 2012-05-01 10:01:14 -0600 (Tue, 01 May 2012)</p><p><br>
BRANCH COMMIT<br>
<br>
The function ocn_get_h_kappa can now read kappa from an external file.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/accgm/namelist.input.ocean
===================================================================
--- branches/ocean_projects/accgm/namelist.input.ocean        2012-05-01 00:34:41 UTC (rev 1851)
+++ branches/ocean_projects/accgm/namelist.input.ocean        2012-05-01 16:01:14 UTC (rev 1852)
@@ -9,7 +9,7 @@
 /
 &amp;io
    config_input_name = 'grid.nc'
-   config_output_name = 'output..nc'
+   config_output_name = 'output.nc'
    config_restart_name = 'restart.nc'
    config_output_interval = '1_00:00:00'
    config_frames_per_outfile = 1000000

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-01 00:34:41 UTC (rev 1851)
+++ branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_gm.F        2012-05-01 16:01:14 UTC (rev 1852)
@@ -120,22 +120,60 @@
       real(kind=RKIND), dimension(:), pointer      :: yEdge
       real(kind=RKIND), dimension(:,:), pointer    :: h_kappa
       real(kind=RKIND)                             :: ymid, Ly
-      integer                                      :: nVertLevels, k
+      integer, parameter                           :: funit = 539
+      integer                                      :: nVertLevels, k, nRecs, iEdge, nEdges, ind, iy
+      real(RKIND), dimension(:,:), allocatable     :: diffuHighRes
 
 
       yEdge      =&gt; grid % yEdge % array
       h_kappa  =&gt; s % h_kappa % array
 
       nVertLevels = grid % nVertLevels
+      nEdges      = grid % nEdges
 
       Ly = 2000000.0*sqrt(3.0)/2.0
       ymid = 0.5*Ly
 
+      !
+      ! Constant diffusivity across all layers
+      !
       !h_kappa(:,:) = config_h_kappa
-      do k = 1, nVertLevels
-         h_kappa(k,:) = config_h_kappa*exp(-((yEdge(:)-ymid)*4/Ly)**2)
+
+      !
+      ! Gaussian-shape diffusivity
+      !
+      !do k = 1, nVertLevels
+      !   h_kappa(k,:) = config_h_kappa*exp(-((yEdge(:)-ymid)*4/Ly)**2)
+      !end do
+
+      !
+      ! Derived diffusivity
+      !
+      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)
 
+      ! 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
+
+      !    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
+
    end subroutine ocn_get_h_kappa
 
 

</font>
</pre>