<p><b>qchen3@fsu.edu</b> 2012-03-19 16:08:55 -0600 (Mon, 19 Mar 2012)</p><p>BRANCH COMMIT<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/accgm/Makefile
===================================================================
--- branches/ocean_projects/accgm/Makefile        2012-03-19 21:58:27 UTC (rev 1677)
+++ branches/ocean_projects/accgm/Makefile        2012-03-19 22:08:55 UTC (rev 1678)
@@ -112,6 +112,24 @@
         &quot;USE_PAPI = $(USE_PAPI)&quot; \
         &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE -m64 $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
+ifort-serial:
+        ( make all \
+        &quot;FC_PARALLEL = mpif90&quot; \
+        &quot;CC_PARALLEL = gcc&quot; \
+        &quot;FC_SERIAL = ifort&quot; \
+        &quot;CC_SERIAL = gcc&quot; \
+        &quot;FFLAGS_OPT = -real-size 64 -O3 -convert big_endian -FR&quot; \
+        &quot;CFLAGS_OPT = -O3 -m64&quot; \
+        &quot;LDFLAGS_OPT = -O3&quot; \
+        &quot;FFLAGS_DEBUG = -real-size 64 -g -convert big_endian -FR -CU -CB -check all&quot; \
+        &quot;CFLAGS_DEBUG = -g -m64&quot; \
+        &quot;LDFLAGS_DEBUG = -g&quot; \
+        &quot;CORE = $(CORE)&quot; \
+        &quot;DEBUG = $(DEBUG)&quot; \
+        &quot;SERIAL = $(SERIAL)&quot; \
+        &quot;USE_PAPI = $(USE_PAPI)&quot; \
+        &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE -m64 $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+
 gfortran:
         ( make all \
         &quot;FC_PARALLEL = mpif90&quot; \

Modified: branches/ocean_projects/accgm/namelist.input
===================================================================
--- branches/ocean_projects/accgm/namelist.input        2012-03-19 21:58:27 UTC (rev 1677)
+++ branches/ocean_projects/accgm/namelist.input        2012-03-19 22:08:55 UTC (rev 1678)
@@ -1 +1 @@
-link namelist.input.ocean
\ No newline at end of file
+link namelist.input.ocean.inviscid
\ No newline at end of file

Modified: branches/ocean_projects/accgm/namelist.input.ocean
===================================================================
--- branches/ocean_projects/accgm/namelist.input.ocean        2012-03-19 21:58:27 UTC (rev 1677)
+++ branches/ocean_projects/accgm/namelist.input.ocean        2012-03-19 22:08:55 UTC (rev 1678)
@@ -2,16 +2,16 @@
    config_test_case = 0
    config_time_integration = 'RK4'
    config_rk_filter_btr_mode = .false.
-   config_dt = 100.0
+   config_dt = 180.0
    config_start_time = '0000-01-01_00:00:00'
-   config_run_duration = '2000_00:00:00'
-   config_stats_interval = 1920
+   config_run_duration = '1_00:00:00'
+   config_stats_interval = 480
 /
 &amp;io
    config_input_name = 'grid.nc'
    config_output_name = 'output.nc'
    config_restart_name = 'restart.nc'
-   config_output_interval = '20_00:00:00'
+   config_output_interval = '1_00:00:00'
    config_frames_per_outfile = 1000000
 /
 &amp;restart
@@ -19,9 +19,9 @@
    config_restart_interval = '120_00:00:00'
 /
 &amp;grid
-   config_vert_grid_type = 'zlevel'
-   config_pressure_type = 'pressure'
-   config_rho0 = 1000
+   config_vert_grid_type = 'isopycnal'
+   config_pressure_type = 'MontgomeryPotential'
+   config_rho0 = 1014.65
 /
 &amp;split_explicit_ts
    config_n_ts_iter  =  2 

Modified: branches/ocean_projects/accgm/src/core_ocean/Registry
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/Registry        2012-03-19 21:58:27 UTC (rev 1677)
+++ branches/ocean_projects/accgm/src/core_ocean/Registry        2012-03-19 22:08:55 UTC (rev 1678)
@@ -44,24 +44,24 @@
 namelist logical   hmix     config_include_KE_vertex false
 namelist real      hmix     config_h_tracer_eddy_diff2  0.0
 namelist real      hmix     config_h_tracer_eddy_diff4  0.0
-namelist real      hmix     config_apvm_upwinding       0.5
+namelist real      hmix     config_apvm_upwinding       0.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.
-namelist real      vmix     config_convective_visc      1.0
-namelist real      vmix     config_convective_diff      1.0
-namelist real      vmix     config_bottom_drag_coeff    1.0e-3
-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         0.005
-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
-namelist real      vmix_tanh    config_min_diff_tanh    1.0e-5
+namelist real      vmix     config_convective_visc      0.0
+namelist real      vmix     config_convective_diff      0.0
+namelist real      vmix     config_bottom_drag_coeff    0.0
+namelist real      vmix_const   config_vert_visc        0.0
+namelist real      vmix_const   config_vert_diff        0.0
+namelist real      vmix_rich    config_bkrd_vert_visc   0.0
+namelist real      vmix_rich    config_bkrd_vert_diff   0.0
+namelist real      vmix_rich    config_rich_mix         0.0
+namelist real      vmix_tanh    config_max_visc_tanh    0.0
+namelist real      vmix_tanh    config_min_visc_tanh    0.0
+namelist real      vmix_tanh    config_max_diff_tanh    0.0
+namelist real      vmix_tanh    config_min_diff_tanh    0.0
 namelist real      vmix_tanh    config_zMid_tanh        -100
 namelist real      vmix_tanh    config_zWidth_tanh      100
 namelist character eos       config_eos_type            linear
@@ -209,19 +209,20 @@
 var persistent real   uBcl ( nVertLevels nEdges Time )  2 - uBcl state - - 
 
 % Diagnostic fields: only written to output
+var persistent real    z ( nVertLevels nCells Time ) 2 o z state - -
 var persistent real    zMid ( nVertLevels nCells Time ) 2 io zMid state - -
 var persistent real    v ( nVertLevels nEdges Time ) 2 - v state - -
 var persistent real    divergence ( nVertLevels nCells Time ) 2 o divergence state - -
 var persistent real    vorticity ( nVertLevels nVertices Time ) 2 o vorticity state - -
 var persistent real    pv_edge ( nVertLevels nEdges Time ) 2 - pv_edge state - -
 var persistent real    h_edge ( nVertLevels nEdges Time ) 2 - h_edge state - -
-var persistent real    h_vertex ( nVertLevels nVertices Time ) 2 - h_vertex state - -
+var persistent real    h_vertex ( nVertLevels nVertices Time ) 2 o h_vertex state - -
 var persistent real    ke ( nVertLevels nCells Time ) 2 o ke state - -
 var persistent real    kev ( nVertLevels nVertices Time ) 2 o kev state - -
 var persistent real    kevc ( nVertLevels nCells Time ) 2 o kevc state - -
 var persistent real    ke_edge ( nVertLevels nEdges Time ) 2 - ke_edge state - -
-var persistent real    pv_vertex ( nVertLevels nVertices Time ) 2 - pv_vertex state - -
-var persistent real    pv_cell ( nVertLevels nCells Time ) 2 - pv_cell state - -
+var persistent real    pv_vertex ( nVertLevels nVertices Time ) 2 o pv_vertex state - -
+var persistent real    pv_cell ( nVertLevels nCells Time ) 2 o pv_cell state - -
 var persistent real    uReconstructX ( nVertLevels nCells Time ) 2 - uReconstructX state - -
 var persistent real    uReconstructY ( nVertLevels nCells Time ) 2 - uReconstructY state - -
 var persistent real    uReconstructZ ( nVertLevels nCells Time ) 2 - uReconstructZ state - -
@@ -256,9 +257,9 @@
 var persistent real    nAccumulate ( Time ) 2 o nAccumulate state - -
 var persistent real    acc_ssh ( nCells Time ) 2 o acc_ssh state - -
 var persistent real    acc_sshVar ( nCells Time ) 2 o acc_sshVar state - -
-var persistent real    acc_uReconstructZonal ( nVertLevels nCells Time ) 2 o acc_uReconstructZonal state - -
-var persistent real    acc_uReconstructMeridional ( nVertLevels nCells Time ) 2 o acc_uReconstructMeridional state - -
-var persistent real    acc_uReconstructZonalVar ( nVertLevels nCells Time ) 2 o acc_uReconstructZonalVar state - -
-var persistent real    acc_uReconstructMeridionalVar ( nVertLevels nCells Time ) 2 o acc_uReconstructMeridionalVar state - -
+var persistent real    acc_uReconstructZonal ( nVertLevels nCells Time ) 2 - acc_uReconstructZonal state - -
+var persistent real    acc_uReconstructMeridional ( nVertLevels nCells Time ) 2 - acc_uReconstructMeridional state - -
+var persistent real    acc_uReconstructZonalVar ( nVertLevels nCells Time ) 2 - acc_uReconstructZonalVar state - -
+var persistent real    acc_uReconstructMeridionalVar ( nVertLevels nCells Time ) 2 - acc_uReconstructMeridionalVar state - -
 var persistent real           acc_u ( nVertLevels nEdges Time ) 2 o acc_u state - -
 var persistent real           acc_uVar ( nVertLevels nEdges Time ) 2 o acc_uVar state - -

Modified: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tendency.F
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tendency.F        2012-03-19 21:58:27 UTC (rev 1677)
+++ branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tendency.F        2012-03-19 22:08:55 UTC (rev 1678)
@@ -442,7 +442,7 @@
         weightsOnEdge, kiteAreasOnVertex, h_edge, h, u, v, pressure,&amp;
         circulation, vorticity, ke, ke_edge, MontPot, wTop, zMid, &amp;
         pv_edge, pv_vertex, pv_cell, gradPVn, gradPVt, divergence, &amp;
-        rho, temperature, salinity, kev, kevc
+        rho, temperature, salinity, kev, kevc, z
       real (kind=RKIND), dimension(:,:,:), pointer :: tracers, deriv_two
       real (kind=RKIND), dimension(:,:), allocatable:: div_u
       character :: c1*6
@@ -450,6 +450,7 @@
       h           =&gt; s % h % array
       u           =&gt; s % u % array
       v           =&gt; s % v % array
+      z           =&gt; s % z % array
       h_edge      =&gt; s % h_edge % array
       circulation =&gt; s % circulation % array
       vorticity   =&gt; s % vorticity % array
@@ -762,7 +763,7 @@
       do iEdge = 1,nEdges
          do k = 1,maxLevelEdgeBot(iEdge)
            pv_edge(k,iEdge) = pv_edge(k,iEdge) &amp;
-             - 0.5 * dt* (  u(k,iEdge) * gradPVn(k,iEdge) &amp;
+             - config_apvm_upwinding * dt* (  u(k,iEdge) * gradPVn(k,iEdge) &amp;
                           + v(k,iEdge) * gradPVt(k,iEdge) )
          enddo
       enddo
@@ -790,28 +791,45 @@
         ! For Isopycnal model.
         ! Compute pressure at top of each layer, and then
         ! Montgomery Potential.
-        allocate(pTop(nVertLevels))
-        do iCell=1,nCells
+        !allocate(pTop(nVertLevels))
+        !do iCell=1,nCells
 
            ! assume atmospheric pressure at the surface is zero for now.
-           pTop(1) = 0.0
+        !   pTop(1) = 0.0
            ! For isopycnal mode, p is the Montgomery Potential.
            ! At top layer it is g*SSH, where SSH may be off by a 
            ! constant (ie, h_s can be relative to top or bottom)
-           MontPot(1,iCell) = gravity &amp;
-              * (h_s(iCell) + sum(h(1:nVertLevels,iCell)))
+        !   MontPot(1,iCell) = gravity &amp;
+        !      * (h_s(iCell) + sum(h(1:nVertLevels,iCell)))
 
-           do k=2,nVertLevels
-              pTop(k) = pTop(k-1) + rho(k-1,iCell)*gravity* h(k-1,iCell)
+        !   do k=2,nVertLevels
+        !      pTop(k) = pTop(k-1) + rho(k-1,iCell)*gravity* h(k-1,iCell)
 
               ! from delta M = p delta / rho
-              MontPot(k,iCell) = MontPot(k-1,iCell) &amp;
-                 + pTop(k)*(1.0/rho(k,iCell) - 1.0/rho(k-1,iCell)) 
-           end do
+        !      MontPot(k,iCell) = MontPot(k-1,iCell) &amp;
+        !         + pTop(k)*(1.0/rho(k,iCell) - 1.0/rho(k-1,iCell)) 
+        !   end do
 
+        !end do
+        !deallocate(pTop)
+        allocate(pTop(nCells+1))
+        pTop = 0.0    ! For now, atmospheric pressure is uniformly zero
+
+        ! Calculate z from bottom up
+        z(nVertLevels,:) = h_s(:) + h(nVertLevels,:)
+
+        do k = nVertLevels-1, 1, -1
+            z(k,:) = z(k+1,:) + h(k,:)
         end do
-        deallocate(pTop)
 
+        ! Calculate Montgomery potential from top down
+        MontPot(1,:) = pTop(:) + rho(1,:)*gravity*z(1,:)
+        do k = 2, nVertLevels
+           MontPot(k,:) = MontPot(k-1,:) + (rho(k,:)-rho(k-1,:))*gravity*z(k,:)
+        end do
+
+        MontPot(:,:) = MontPot(:,:) / config_rho0
+
       else
 
         do iCell=1,nCells

Modified: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_vel_coriolis.F
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_vel_coriolis.F        2012-03-19 21:58:27 UTC (rev 1677)
+++ branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_vel_coriolis.F        2012-03-19 22:08:55 UTC (rev 1678)
@@ -141,8 +141,12 @@
                workpv = 0.5 * (pv_edge(k,iEdge) + pv_edge(k,eoe))
                q = q + weightsOnEdge(j,iEdge) * u(k,eoe) * workpv * h_edge(k,eoe) 
             end do
+!            if (k .EQ. 1 .AND. iEdge .EQ. 500) then
+            !if (iEdge .EQ. 500) then
+            !    write(*,*) 'Nonlinear Coriolis forcing: ', q
+            !end if
 
-           tend(k,iEdge) = tend(k,iEdge) + edgeMask(k, iEdge) * (q - (   ke(k,cell2) - ke(k,cell1) ) * invLength )
+           tend(k,iEdge) = tend(k,iEdge) + edgeMask(k, iEdge) * (q - (ke(k,cell2) - ke(k,cell1)) * invLength )
 
          end do
       end do

</font>
</pre>