<p><b>mpetersen@lanl.gov</b> 2012-10-17 11:34:51 -0600 (Wed, 17 Oct 2012)</p><p>branch commit, partial_bottom_cells: Change namelist variables so that sigma coordinates may be used.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/partial_bottom_cells/namelist.input.ocean
===================================================================
--- branches/ocean_projects/partial_bottom_cells/namelist.input.ocean        2012-10-17 14:57:04 UTC (rev 2216)
+++ branches/ocean_projects/partial_bottom_cells/namelist.input.ocean        2012-10-17 17:34:51 UTC (rev 2217)
@@ -32,8 +32,9 @@
    config_rho0 = 1014.65
 /
 &amp;partial_bottom_cells
-   config_alter_ICs_for_pbc = .false.
+   config_alter_ICs_for_pbcs = 'no'
    config_min_pbc_fraction = 0.10
+   config_check_zlevel_consistency = .false.
 /
 &amp;split_explicit_ts
    config_n_ts_iter  =  2 

Modified: branches/ocean_projects/partial_bottom_cells/src/core_ocean/Registry
===================================================================
--- branches/ocean_projects/partial_bottom_cells/src/core_ocean/Registry        2012-10-17 14:57:04 UTC (rev 2216)
+++ branches/ocean_projects/partial_bottom_cells/src/core_ocean/Registry        2012-10-17 17:34:51 UTC (rev 2217)
@@ -31,8 +31,9 @@
 namelist character grid     config_pressure_type       pressure
 namelist real      grid     config_rho0                1028
 namelist logical   grid     config_enforce_zstar_at_restart false
-namelist logical   partial_bottom_cells config_alter_ICs_for_pbc false
+namelist character partial_bottom_cells config_alter_ICs_for_pbcs no
 namelist real      partial_bottom_cells config_min_pbc_fraction  0.10
+namelist logical   partial_bottom_cells config_check_zlevel_consistency true
 namelist integer   split_explicit_ts config_n_ts_iter     2
 namelist integer   split_explicit_ts config_n_bcl_iter_beg   2
 namelist integer   split_explicit_ts config_n_bcl_iter_mid   2

Modified: branches/ocean_projects/partial_bottom_cells/src/core_ocean/mpas_ocn_mpas_core.F
===================================================================
--- branches/ocean_projects/partial_bottom_cells/src/core_ocean/mpas_ocn_mpas_core.F        2012-10-17 14:57:04 UTC (rev 2216)
+++ branches/ocean_projects/partial_bottom_cells/src/core_ocean/mpas_ocn_mpas_core.F        2012-10-17 17:34:51 UTC (rev 2217)
@@ -540,6 +540,7 @@
       implicit none
 
       type (domain_type), intent(inout) :: domain
+      type (dm_info) :: dminfo
 
       integer :: i, iCell, iEdge, iVertex, k, nCells, num_tracers
       type (block_type), pointer :: block
@@ -615,14 +616,18 @@
 
          ! Initial condition files (ocean.nc, produced by basin) include a realistic
          ! bottomDepth variable and h,T,S variables for full thickness cells.
-         ! If running with pbcs, set config_alter_ICs_for_pbc=.true. Then thin pbc cells
+         ! If running with pbcs, set config_alter_ICs_for_pbc='zlevel_pbcs_on'. Then thin pbc cells
          !    will be changed, and h,T,S will be altered to match the pbcs.
-         ! If running without pbcs, set config_alter_ICs_for_pbc=.false. Then 
+         ! If running without pbcs, set config_alter_ICs_for_pbc='zlevel_pbcs_off'. Then 
          !    bottomDepth will be altered so it is full cells everywhere.
          !    If your input file does not include bottomDepth, the false option will
          !    initialize bottomDepth correctly for a non-pbc run.
 
-         if (config_alter_ICs_for_pbc.and..not.config_do_restart) then
+
+         if (.not.config_do_restart) then
+
+          if (config_alter_ICs_for_pbcs.eq.'zlevel_pbcs_on') then
+
             write (0,'(a)') ' Altering bottomDepth to avoid very thin cells.'
             write (0,'(a)') ' Altering h and tracer initial conditions to conform with partial bottom cells.'
 
@@ -643,10 +648,6 @@
             do iCell=1,nCells
                k = maxLevelCell(iCell)
 
-! original. delete soon.  This version always rounds down.
-!               ! For pbcs, bottom depth must be altered to prevent very thin cells.
-!               bottomDepth(iCell) = max(bottomDepth(iCell),minBottomDepth(k))
-
                 if (bottomDepth(iCell).lt.minBottomDepthMid(k)) then
                    ! Round up to cell above
                    maxLevelCell(iCell) = maxLevelCell(iCell) - 1
@@ -674,25 +675,27 @@
 
             deallocate(minBottomDepth,zMidZLevel)
 
-         elseif (.not.config_alter_ICs_for_pbc.and..not.config_do_restart) then
+          elseif (config_alter_ICs_for_pbcs.eq.'zlevel_pbcs_off') then
 
             do iCell = 1,nCells
                bottomDepth(iCell) = refBottomDepth(maxLevelCell(iCell))
             enddo
 
+          elseif (config_alter_ICs_for_pbcs.eq.'no') then
+            ! No action taken.  This is for isopycnal or sigma coordinates,
+            !  or if ICs were already altered upon start-up.
+
+          else
+
+             write (0,*) ' Incorrect choice of config_alter_ICs_for_pbcs.'
+             call mpas_dmpar_abort(dminfo)
+
+          endif
          endif
 
-         if (config_vert_grid_type.eq.'zlevel'.or. &amp;
-             config_vert_grid_type.eq.'zstar'.or. &amp;
-             config_vert_grid_type.eq.'zstarweights') then
+         if (config_check_zlevel_consistency) then
             do iCell = 1,nCells
 
-               ! mrp, for debugging. 
-               !write (0,'(a,2i5,10f10.3)') ' iCell, maxLevelCell, bdepth, refb, reft, sumh-bottomDepth: ', &amp;
-               !                             iCell, maxLevelCell(iCell), bottomDepth(iCell), &amp;
-               !                 refBottomDepth(maxLevelCell(iCell)), refBottomDepthTopOfCell(maxLevelCell(iCell)), &amp;
-               !                 sum(h(1:maxLevelCell(iCell),iCell))-bottomDepth(iCell)
-
                ! Check if abs(ssh)&gt;2m.  If so, print warning.
                if (abs(sum(h(1:maxLevelCell(iCell),iCell))-bottomDepth(iCell))&gt;2.0) then
                   write (0,*) ' Warning: abs(sum(h)-bottomDepth)&gt;2m.  Most likely, initial h does not match bottomDepth.'
@@ -701,7 +704,7 @@
                                 hZLevel(maxLevelCell(iCell)), h(maxLevelCell(iCell),iCell)
                endif
 
-               ! Check that bottomDepth and maxLevelCell match forSome older grids do not have the bottomDepth variable.
+               ! Check that bottomDepth and maxLevelCell match.  Some older grids do not have the bottomDepth variable.
                if (bottomDepth(iCell) &gt; refBottomDepth(maxLevelCell(iCell)).or. &amp;
                    bottomDepth(iCell) &lt; refBottomDepthTopOfCell(maxLevelCell(iCell))) then
                   write (0,'(a)') ' fatal error: bottomDepth and maxLevelCell do not match:'
@@ -709,7 +712,7 @@
                                 iCell, maxLevelCell(iCell), bottomDepth(iCell)
                   write (0,'(a,10f10.2)') ' refBottomDepth(maxLevelCell(iCell)), refBottomDepthTopOfCell(maxLevelCell(iCell)): ', &amp;
                                 refBottomDepth(maxLevelCell(iCell)), refBottomDepthTopOfCell(maxLevelCell(iCell))
-                  call mpas_dmpar_finalize(domain % dminfo)
+                  call mpas_dmpar_abort(dminfo)
                endif
 
             enddo

</font>
</pre>