<p><b>qchen3@fsu.edu</b> 2012-03-20 09:59:44 -0600 (Tue, 20 Mar 2012)</p><p>BRANCH COMMIT<br>
<br>
Merging updates from the trunk.<br>
</p><hr noshade><pre><font color="gray">
Property changes on: branches/ocean_projects/accgm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/cam_mpas_nh:1260-1270
/branches/ocean_projects/ale_split_exp:1437-1483
/branches/ocean_projects/ale_vert_coord:1225-1383
/branches/ocean_projects/ale_vert_coord_new:1387-1428
/branches/ocean_projects/gmvar:1214-1494
/branches/ocean_projects/imp_vert_mix_mrp:754-986
/branches/ocean_projects/split_explicit_mrp:1134-1138
/branches/ocean_projects/split_explicit_timestepping:1044-1097
/branches/ocean_projects/vert_adv_mrp:704-745
/branches/source_renaming:1082-1113
/branches/time_manager:924-962
   + /branches/cam_mpas_nh:1260-1270
/branches/ocean_projects/ale_split_exp:1437-1483
/branches/ocean_projects/ale_vert_coord:1225-1383
/branches/ocean_projects/ale_vert_coord_new:1387-1428
/branches/ocean_projects/gmvar:1214-1494
/branches/ocean_projects/imp_vert_mix_mrp:754-986
/branches/ocean_projects/monotonic_advection:1499-1640
/branches/ocean_projects/split_explicit_mrp:1134-1138
/branches/ocean_projects/split_explicit_timestepping:1044-1097
/branches/ocean_projects/vert_adv_mrp:704-745
/branches/source_renaming:1082-1113
/branches/time_manager:924-962
/trunk/mpas:1618-1679

Modified: branches/ocean_projects/accgm/Makefile
===================================================================
--- branches/ocean_projects/accgm/Makefile        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/Makefile        2012-03-20 15:59:44 UTC (rev 1682)
@@ -14,10 +14,10 @@
 
 
 dummy:
-        ( make error )
+        ( $(MAKE) error )
 
 xlf:
-        ( make all \
+        ( $(MAKE) all \
         &quot;FC_PARALLEL = mpxlf90&quot; \
         &quot;CC_PARALLEL = mpcc&quot; \
         &quot;FC_SERIAL = xlf90&quot; \
@@ -32,7 +32,7 @@
         &quot;CPPFLAGS = $(MODEL_FORMULATION) $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
  
 ftn:
-        ( make all \
+        ( $(MAKE) all \
         &quot;FC_PARALLEL = ftn&quot; \
         &quot;CC_PARALLEL = cc&quot; \
         &quot;FC_SERIAL = ftn&quot; \
@@ -47,7 +47,7 @@
         &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
 pgi:
-        ( make all \
+        ( $(MAKE) all \
         &quot;FC_PARALLEL = mpif90&quot; \
         &quot;CC_PARALLEL = mpicc&quot; \
         &quot;FC_SERIAL = pgf90&quot; \
@@ -65,7 +65,7 @@
         &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
 pgi-nersc:
-        ( make all \
+        ( $(MAKE) all \
         &quot;FC_PARALLEL = ftn&quot; \
         &quot;CC_PARALLEL = cc&quot; \
         &quot;FC_SERIAL = ftn&quot; \
@@ -80,7 +80,7 @@
         &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
 pgi-llnl:
-        ( make all \
+        ( $(MAKE) all \
         &quot;FC_PARALLEL = mpipgf90&quot; \
         &quot;CC_PARALLEL = pgcc&quot; \
         &quot;FC_SERIAL = pgf90&quot; \
@@ -95,7 +95,7 @@
         &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
 ifort:
-        ( make all \
+        ( $(MAKE) all \
         &quot;FC_PARALLEL = mpif90&quot; \
         &quot;CC_PARALLEL = gcc&quot; \
         &quot;FC_SERIAL = ifort&quot; \
@@ -131,7 +131,7 @@
         &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE -m64 $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
 gfortran:
-        ( make all \
+        ( $(MAKE) all \
         &quot;FC_PARALLEL = mpif90&quot; \
         &quot;CC_PARALLEL = mpicc&quot; \
         &quot;FC_SERIAL = gfortran&quot; \
@@ -149,7 +149,7 @@
         &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE -m64 $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
 g95:
-        ( make all \
+        ( $(MAKE) all \
         &quot;FC_PARALLEL = mpif90&quot; \
         &quot;CC_PARALLEL = mpicc&quot; \
         &quot;FC_SERIAL = g95&quot; \
@@ -164,7 +164,7 @@
         &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
 pathscale-nersc:
-        ( make all \
+        ( $(MAKE) all \
         &quot;FC_PARALLEL = ftn&quot; \
         &quot;CC_PARALLEL = cc&quot; \
         &quot;FC_SERIAL = ftn&quot; \
@@ -179,7 +179,7 @@
         &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
 cray-nersc:
-        ( make all \
+        ( $(MAKE) all \
         &quot;FC_PARALLEL = ftn&quot; \
         &quot;CC_PARALLEL = cc&quot; \
         &quot;FC_SERIAL = ftn&quot; \
@@ -194,7 +194,7 @@
         &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
 intel-nersc:
-        ( make all \
+        ( $(MAKE) all \
         &quot;FC_PARALLEL = ftn&quot; \
         &quot;CC_PARALLEL = cc&quot; \
         &quot;FC_SERIAL = ftn&quot; \
@@ -245,9 +245,9 @@
         LDFLAGS=$(LDFLAGS_OPT)
         DEBUG_MESSAGE=&quot;Debug flags are not defined for this compile group. Defaulting to Optimized flags&quot;
 else # FFLAGS_DEBUG IF
-        FFLAGS=$(FFLAGS_DEBUG)
-        CFLAGS=$(CFLAGS_DEBUG)
-        LDFLAGS=$(LDFLAGS_DEBUG)
+        FFLAGS=$(FFLAGS_DEBUG) -DMPAS_DEBUG
+        CFLAGS=$(CFLAGS_DEBUG) -DMPAS_DEBUG
+        LDFLAGS=$(LDFLAGS_DEBUG) -DMPAS_DEBUG
         DEBUG_MESSAGE=&quot;Debugging is on.&quot;
 endif # FFLAGS_DEBUG IF
 
@@ -282,10 +282,14 @@
         PAPI_MESSAGE=&quot;Papi libraries are off.&quot;
 endif # USE_PAPI IF
 
+ifneq ($(wildcard $(NETCDF)/lib/libnetcdff.*), ) # CHECK FOR NETCDF4
+        LIBS += -lnetcdff
+endif # CHECK FOR NETCDF4
+
 all: mpas_main
 
 mpas_main: 
-        cd src; make FC=&quot;$(FC)&quot; \
+        cd src; $(MAKE) -j1 FC=&quot;$(FC)&quot; \
                  CC=&quot;$(CC)&quot; \
                  SFC=&quot;$(SFC)&quot; \
                  SCC=&quot;$(SCC)&quot; \
@@ -305,7 +309,7 @@
         @echo $(SERIAL_MESSAGE)
         @echo $(PAPI_MESSAGE)
 clean:
-        cd src; make clean RM=&quot;$(RM)&quot; CORE=&quot;$(CORE)&quot;
+        cd src; $(MAKE) clean RM=&quot;$(RM)&quot; CORE=&quot;$(CORE)&quot;
         $(RM) $(CORE)_model.exe
 error: errmsg
 
@@ -323,7 +327,7 @@
 
 errmsg:
         @echo &quot;&quot;
-        @echo &quot;Usage: make target CORE=[core] [options]&quot;
+        @echo &quot;Usage: $(MAKE) target CORE=[core] [options]&quot;
         @echo &quot;&quot;
         @echo &quot;Example targets:&quot;
         @echo &quot;    ifort&quot;

Modified: branches/ocean_projects/accgm/namelist.input.ocean
===================================================================
--- branches/ocean_projects/accgm/namelist.input.ocean        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/namelist.input.ocean        2012-03-20 15:59:44 UTC (rev 1682)
@@ -1,6 +1,6 @@
 &amp;sw_model
    config_test_case = 0
-   config_time_integration = 'RK4'
+   config_time_integration = 'rk4'
    config_rk_filter_btr_mode = .false.
    config_dt = 180.0
    config_start_time = '0000-01-01_00:00:00'
@@ -39,23 +39,23 @@
    config_btr_solve_SSH2  = .false.
 /
 &amp;hmix
-   config_h_mom_eddy_visc2 = 1.0e5
+   config_h_mom_eddy_visc2 = 0.0
    config_h_mom_eddy_visc4 = 0.0
    config_visc_vorticity_term = .true.
    config_h_tracer_eddy_diff2 = 1.0e5
    config_h_tracer_eddy_diff4 = 0.0
 /
 &amp;vmix
-   config_vert_visc_type  = 'rich'
-   config_vert_diff_type  = 'rich'
-   config_implicit_vertical_mix = .true.
+   config_vert_visc_type  = 'const'
+   config_vert_diff_type  = 'const'
+   config_implicit_vertical_mix = .false.
    config_convective_visc       = 1.0
    config_convective_diff       = 1.0
    config_bottom_drag_coeff     = 1.0e-3
 /
 &amp;vmix_const
-   config_vert_visc       = 1.0e-5
-   config_vert_diff       = 1.0e-5 
+   config_vert_visc       = 0.0
+   config_vert_diff       = 0.0 
 /
 &amp;vmix_rich
    config_bkrd_vert_visc  = 1.0e-5
@@ -76,9 +76,8 @@
 &amp;advection
    config_vert_tracer_adv = 'stencil'
    config_vert_tracer_adv_order = 2
-   config_tracer_adv_order = 2
+   config_horiz_tracer_adv_order = 2
    config_thickness_adv_order = 2
-   config_positive_definite = .false.
    config_monotonic = .false.
 /
 &amp;restore


Property changes on: branches/ocean_projects/accgm/src
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src:1260-1270
/branches/ocean_projects/ale_split_exp/src:1437-1483
/branches/ocean_projects/ale_vert_coord/src:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src:1387-1428
/branches/ocean_projects/gmvar/src:1214-1494
/branches/ocean_projects/imp_vert_mix_mrp/src:754-986
/branches/ocean_projects/rayleigh/src:1298-1311
/branches/ocean_projects/split_explicit_mrp/src:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src:1044-1097
/branches/ocean_projects/vert_adv_mrp/src:704-745
/branches/source_renaming/src:1082-1113
/branches/time_manager/src:924-962

Modified: branches/ocean_projects/accgm/src/Makefile
===================================================================
--- branches/ocean_projects/accgm/src/Makefile        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/Makefile        2012-03-20 15:59:44 UTC (rev 1682)
@@ -6,35 +6,35 @@
         $(FC) $(LDFLAGS) -o $(CORE)_model.exe driver/*.o -L. -ldycore -lops -lframework $(LIBS) -I./external/esmf_time_f90 -L./external/esmf_time_f90 -lesmf_time
 
 reg_includes: 
-        ( cd registry; make CC=&quot;$(SCC)&quot; )
+        ( cd registry; $(MAKE) CC=&quot;$(SCC)&quot; )
         ( cd inc; $(CPP) ../core_$(CORE)/Registry | ../registry/parse &gt; Registry.processed)
 
-externals:
-        ( cd external; make FC=&quot;$(FC)&quot; SFC=&quot;$(SFC)&quot; CC=&quot;$(CC)&quot; SCC=&quot;$(SCC)&quot; FFLAGS=&quot;$(FFLAGS)&quot; CFLAGS=&quot;$(CFLAGS)&quot; CPP=&quot;$(CPP)&quot; NETCDF=&quot;$(NETCDF)&quot; CORE=&quot;$(CORE)&quot; )
+externals: reg_includes
+        ( cd external; $(MAKE) FC=&quot;$(FC)&quot; SFC=&quot;$(SFC)&quot; CC=&quot;$(CC)&quot; SCC=&quot;$(SCC)&quot; FFLAGS=&quot;$(FFLAGS)&quot; CFLAGS=&quot;$(CFLAGS)&quot; CPP=&quot;$(CPP)&quot; NETCDF=&quot;$(NETCDF)&quot; CORE=&quot;$(CORE)&quot; )
 
-frame: 
-        ( cd framework; make all ) 
+frame: reg_includes externals
+        ( cd framework; $(MAKE) all ) 
         ln -sf framework/libframework.a libframework.a
 
-ops: 
-        ( cd operators; make all ) 
+ops: reg_includes externals frame
+        ( cd operators; $(MAKE) all ) 
         ln -sf operators/libops.a libops.a
 
-dycore: 
-        ( cd core_$(CORE); make all ) 
+dycore: reg_includes externals frame ops
+        ( cd core_$(CORE); $(MAKE) all ) 
         ln -sf core_$(CORE)/libdycore.a libdycore.a
 
-drver: 
-        ( cd driver; make all ) 
+drver:  reg_includes externals frame ops dycore
+        ( cd driver; $(MAKE) all ) 
 
 clean:
         $(RM) $(CORE)_model.exe libframework.a libops.a libdycore.a
-        ( cd registry; make clean )
-        ( cd external; make clean )
-        ( cd framework; make clean )
-        ( cd operators; make clean )
+        ( cd registry; $(MAKE) clean )
+        ( cd external; $(MAKE) clean )
+        ( cd framework; $(MAKE) clean )
+        ( cd operators; $(MAKE) clean )
         ( cd inc; rm -f *.inc Registry.processed )
         if [ -d core_$(CORE) ] ; then \
-           ( cd core_$(CORE); make clean ) \
+           ( cd core_$(CORE); $(MAKE) clean ) \
         fi;
-        ( cd driver; make clean )
+        ( cd driver; $(MAKE) clean )

Modified: branches/ocean_projects/accgm/src/core_atmos_physics/Makefile
===================================================================
--- branches/ocean_projects/accgm/src/core_atmos_physics/Makefile        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/core_atmos_physics/Makefile        2012-03-20 15:59:44 UTC (rev 1682)
@@ -194,23 +194,28 @@
         mpas_atmphys_vars.o
 
 mpas_atmphys_driver_microphysics.o: \
-        ./physics_wrf/module_mp_kessler.o     \
-        ./physics_wrf/module_mp_thompson.o    \
-        ./physics_wrf/module_mp_wsm6.o        \
+        ./physics_wrf/module_mp_kessler.o   \
+        ./physics_wrf/module_mp_thompson.o  \
+        ./physics_wrf/module_mp_wsm6.o      \
         mpas_atmphys_constants.o            \
         mpas_atmphys_interface_nhyd.o       \
         mpas_atmphys_vars.o
 
 mpas_atmphys_driver.o: \
-        mpas_atmphys_driver_convection_deep.o       \
-        mpas_atmphys_driver_pbl.o                   \
-        mpas_atmphys_driver_radiation_lw.o          \
-        mpas_atmphys_driver_radiation_sw.o          \
-        mpas_atmphys_driver_sfclayer.o              \
-        mpas_atmphys_constants.o            \
-        mpas_atmphys_interface_nhyd.o       \
+        mpas_atmphys_driver_convection_deep.o \
+        mpas_atmphys_driver_pbl.o             \
+        mpas_atmphys_driver_radiation_lw.o    \
+        mpas_atmphys_driver_radiation_sw.o    \
+        mpas_atmphys_driver_sfclayer.o        \
+        mpas_atmphys_constants.o              \
+        mpas_atmphys_interface_nhyd.o         \
+        mpas_atmphys_update.o                 \
         mpas_atmphys_vars.o
 
+mpas_atmphys_update.o: \
+        mpas_atmphys_driver_convection_deep.o \
+        mpas_atmphys_vars.o
+
 endif
 
 clean:

Modified: branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_date_time.F
===================================================================
--- branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_date_time.F        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_date_time.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -96,9 +96,9 @@
 
 !---------------------------------------------------------------------------------------------
 
- write(0,*)
- write(0,*) '--- enter subroutine monthly_interp_to_date:'
- write(0,*) '--- current_date  = ',date_str
+!write(0,*)
+!write(0,*) '--- enter subroutine monthly_interp_to_date:'
+!write(0,*) '--- current_date  = ',date_str
 
  write(day15,fmt='(I2.2)') 15
  do l = 1 , 12
@@ -116,8 +116,8 @@
 
  call get_julgmt(date_str,target_julyr,target_julday,gmt)
  target_date = target_julyr * 1000 + target_julday
- write(0,*) '--- target_julday =',target_julday
- write(0,*) '--- target_date   =',target_date
+!write(0,*) '--- target_julday =',target_julday
+!write(0,*) '--- target_date   =',target_date
 
  find_month : do l = 0 , 12
     if((middle(l) .lt. target_date) .and. (middle(l+1) .ge. target_date)) then
@@ -131,8 +131,8 @@
              month2 = month1 + 1
           endif
           if(n == 1) then
-             write(0,*) '--- month1 =',month1
-             write(0,*) '--- month2 =',month2
+!            write(0,*) '--- month1 =',month1
+!            write(0,*) '--- month2 =',month2
           endif
           field_out(n) = ( field_in(month2,n) * (target_date - middle(l))    &amp;
                        +   field_in(month1,n) * (middle(l+1) - target_date)) &amp;

Modified: branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_driver.F
===================================================================
--- branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_driver.F        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_driver.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -11,6 +11,7 @@
  use mpas_atmphys_driver_radiation_lw
  use mpas_atmphys_driver_sfclayer
  use mpas_atmphys_constants
+ use mpas_atmphys_update
  use mpas_atmphys_vars
 #ifdef non_hydrostatic_core
  use mpas_atmphys_interface_nhyd
@@ -80,16 +81,21 @@
     !call to long wave radiation scheme:
     if(l_radtlw) then
        call allocate_radiation_lw(xtime_s)
-       call driver_radiation_lw(itimestep,block%mesh,block%state%time_levs(1)%state,  &amp;
-                               block%diag_physics,block%sfc_input,block%tend_physics, &amp;
-                               xtime_s)
+       call driver_radiation_lw(xtime_s,block%mesh,block%state%time_levs(1)%state, &amp;
+                              block%diag_physics,block%sfc_input,block%tend_physics)
     endif
+    if(l_camlw .and. config_radt_lw_scheme .eq. 'cam_lw') &amp;
+                              call radiation_camlw_to_MPAS(block%diag_physics)
 
+    !call to accumulate long- and short-wave diagnostics if needed:
+     if(config_bucket_update /= 'none' .and. config_bucket_radt .gt. 0._RKIND) &amp;
+        call update_radiation_diagnostics(config_bucket_radt,block%mesh,block%diag_physics)
+
     !deallocate all radiation arrays:
     if(config_radt_sw_scheme.ne.'off' .or. config_radt_lw_scheme.ne.'off') &amp;
        call deallocate_cloudiness
     if(config_radt_sw_scheme.ne.'off') call deallocate_radiation_sw
-    if(config_radt_lw_scheme.ne.'off') call deallocate_radiation_lw(xtime_s)
+    if(config_radt_lw_scheme.ne.'off') call deallocate_radiation_lw
 
     !call to surface-layer scheme:
     if(config_sfclayer_scheme .ne. 'off') then
@@ -118,6 +124,9 @@
        call driver_convection_deep(itimestep,block%mesh,block%sfc_input,block%diag_physics, &amp;
                                   block%tend_physics)
        call deallocate_convection_deep
+
+       !update diagnostics:
+       call update_convection_deep(config_bucket_rainc,block%mesh,block%diag_physics)
     endif
 
     !deallocate arrays shared by all physics parameterizations:

Modified: branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_driver_convection_deep.F
===================================================================
--- branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_driver_convection_deep.F        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_driver_convection_deep.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -413,12 +413,12 @@
  end subroutine convection_to_MPAS
 
 !=============================================================================================
- subroutine update_convection_deep(dt_dyn,mesh,diag_physics)
+ subroutine update_convection_deep(bucket_rainc,mesh,diag_physics)
 !=============================================================================================
 
 !input arguments:
  type(mesh_type),intent(in):: mesh
- real(kind=RKIND),intent(in):: dt_dyn
+ real(kind=RKIND),intent(in):: bucket_rainc
 
 !inout arguments:
  type(diag_physics_type),intent(inout):: diag_physics
@@ -427,11 +427,19 @@
  integer:: iCell
 
 !---------------------------------------------------------------------------------------------
-
-!update the accumuluted precipitation rate at the end of each dynamic time-step:
- do iCell = 1, mesh % nCells

+!update the accumulated precipitation at the end of each dynamic time-step:
+ do iCell = 1, mesh % nCellsSolve
     diag_physics % rainc % array(iCell) = diag_physics % rainc % array(iCell) &amp;
                                     + diag_physics % cuprec % array(iCell) * dt_dyn
+
+    if(l_acrain .and. bucket_rainc.gt.0._RKIND .and. &amp;
+       diag_physics%rainc%array(iCell).gt.bucket_rainc) then
+       diag_physics % i_rainc % array(iCell) = diag_physics % i_rainc % array(iCell) + 1
+       diag_physics % rainc % array(iCell) = diag_physics % rainc % array(iCell) &amp;
+                                           - bucket_rainc
+    endif
+
  enddo
 
  end subroutine update_convection_deep

Modified: branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_driver_microphysics.F
===================================================================
--- branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_driver_microphysics.F        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_driver_microphysics.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -296,7 +296,7 @@
 
 !... copy updated precipitation from the wrf-physics grid back to the geodesic-dynamics grid:
 
- call precip_to_MPAS(diag_physics)
+ call precip_to_MPAS(config_bucket_rainnc,diag_physics)
 
 !... copy updated cloud microphysics variables from the wrf-physics grid back to the geodesic-
 !    dynamics grid:
@@ -374,10 +374,11 @@
  end subroutine precip_from_MPAS
 
 !=============================================================================================
- subroutine precip_to_MPAS(diag_physics)
+ subroutine precip_to_MPAS(bucket_rainnc,diag_physics)
 !=============================================================================================
 
 !output variables:
+ real(kind=RKIND),intent(in):: bucket_rainnc
  type(diag_physics_type),intent(inout):: diag_physics
 
 !local variables:
@@ -396,7 +397,13 @@
     !accumulated precipitation:
     diag_physics % rainnc % array(i) = diag_physics % rainnc % array(i) &amp;
                                      + diag_physics % rainncv % array(i)
-    
+
+   if(l_acrain .and. bucket_rainnc.gt.0._RKIND .and. &amp;
+      diag_physics%rainnc%array(i).gt.bucket_rainnc) then
+      diag_physics % i_rainnc % array(i) = diag_physics % i_rainnc % array(i) + 1
+      diag_physics % rainnc % array(i) = diag_physics % rainnc % array(i) - bucket_rainnc
+   endif

  enddo
  enddo
 

Modified: branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_driver_radiation_lw.F
===================================================================
--- branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_driver_radiation_lw.F        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_driver_radiation_lw.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -20,7 +20,8 @@
  public:: allocate_radiation_lw,   &amp;
           deallocate_radiation_lw, &amp;
           driver_radiation_lw,     &amp;
-          init_radiation_lw
+          init_radiation_lw,       &amp;
+          radiation_camlw_to_MPAS
 
  integer,private:: i,j,k,n
 
@@ -101,17 +102,11 @@
 
        !allocate these arrays on the first time step, only:
        if(xtime_s .lt. 1.e-12) then
-
-          write(0,*) 
-          write(0,*) '--- end subroutine allocate_radiation_lw:'
-          write(0,*) '--- allocate emstot_p,abstot_p,absnxt_p'
-
           if(.not.allocated(emstot_p) ) allocate(emstot_p(ims:ime,kms:kme,jms:jme) )
           if(.not.allocated(abstot_p) ) &amp;
              allocate(abstot_p(ims:ime,kms:kme,cam_abs_dim2,jms:jme) )
           if(.not.allocated(absnxt_p) ) &amp;
              allocate(absnxt_p(ims:ime,kms:kme,cam_abs_dim1,jms:jme) )
-
        endif
 
     case default
@@ -121,14 +116,9 @@
  end subroutine allocate_radiation_lw
 
 !=============================================================================================
- subroutine deallocate_radiation_lw(xtime_s)
+ subroutine deallocate_radiation_lw
 !=============================================================================================
 
-!input arguments:
- real(kind=RKIND),intent(in):: xtime_s
-
-!---------------------------------------------------------------------------------------------
-
  if(allocated(f_ice)        ) deallocate(f_ice        )
  if(allocated(f_rain)       ) deallocate(f_rain       )
  if(allocated(sfc_emiss_p)  ) deallocate(sfc_emiss_p  )
@@ -196,7 +186,7 @@
  end subroutine deallocate_radiation_lw
 
 !=============================================================================================
- subroutine radiation_lw_from_MPAS(mesh,state,diag_physics,sfc_input,xtime_s)
+ subroutine radiation_lw_from_MPAS(xtime_s,mesh,state,diag_physics,sfc_input)
 !=============================================================================================
 
 !input arguments:
@@ -301,30 +291,30 @@
        enddo
        enddo
 
+       !On the first time-step of each model run, the local arrays absnxt_p, absnst_p,
+       !and emstot_p are filled with the MPAS arrays abstot, absnxt, and emstot. If it
+       !is a new run, these three arrays will be initialized to zero;If a restart run,
+       !these three arrays will be filled with the restart values.
        call mpas_timer_start(&quot;CAM lw: fill arrays for infrared absorption&quot;)
        if(xtime_s .lt. 1.e-12) then
-          write(0,*)
-          write(0,*) '--- radiation_lw_from_MPAS:'
-          write(0,*) '--- initialize emstot_p,abstot_p,absnxt_p'
-          !infrared absorption:
           do j = jts,jte
           do n = 1,cam_abs_dim1
           do k = kts,kte
           do i = its,ite
-             absnxt_p(i,k,n,j) = 0.
+             absnxt_p(i,k,n,j) = diag_physics % absnxt % array(k,n,i)
           enddo
           enddo
           enddo
           do n = 1,cam_abs_dim2
           do k = kts,kte+1
           do i = its,ite
-             abstot_p(i,k,n,j) = 0.
+             abstot_p(i,k,n,j) = diag_physics % abstot % array(k,n,i)
           enddo
           enddo
           enddo
           do k = kts,kte+1
           do i = its,ite
-             emstot_p(i,k,j) = 0.
+             emstot_p(i,k,j) = diag_physics % emstot % array(k,i)
           enddo
           enddo
           enddo
@@ -377,40 +367,29 @@
  end subroutine radiation_lw_from_MPAS
 
 !=============================================================================================
- subroutine radiation_lw_to_MPAS(diag_physics,tend_physics,xtime_s)
+ subroutine radiation_lw_to_MPAS(diag_physics,tend_physics)
 !=============================================================================================
 
 !input arguments:
  type(diag_physics_type),intent(inout):: diag_physics
  type(tend_physics_type),intent(inout):: tend_physics
 
- real(kind=RKIND),intent(in):: xtime_s
-
 !---------------------------------------------------------------------------------------------
 
  do j = jts,jte
  do i = its,ite
-    diag_physics % glw      % array(i) = glw_p(i,j)
-    diag_physics % lwcf     % array(i) = lwcf_p(i,j)
-    diag_physics % lwdnb    % array(i) = lwdnb_p(i,j)
-    diag_physics % lwdnbc   % array(i) = lwdnbc_p(i,j)
-    diag_physics % lwdnt    % array(i) = lwdnt_p(i,j)
-    diag_physics % lwdntc   % array(i) = lwdntc_p(i,j)
-    diag_physics % lwupb    % array(i) = lwupb_p(i,j)
-    diag_physics % lwupbc   % array(i) = lwupbc_p(i,j)
-    diag_physics % lwupt    % array(i) = lwupt_p(i,j)
-    diag_physics % lwuptc   % array(i) = lwuptc_p(i,j)
-    diag_physics % olrtoa   % array(i) = olrtoa_p(i,j)
+    diag_physics % glw    % array(i) = glw_p(i,j)
+    diag_physics % lwcf   % array(i) = lwcf_p(i,j)
+    diag_physics % lwdnb  % array(i) = lwdnb_p(i,j)
+    diag_physics % lwdnbc % array(i) = lwdnbc_p(i,j)
+    diag_physics % lwdnt  % array(i) = lwdnt_p(i,j)
+    diag_physics % lwdntc % array(i) = lwdntc_p(i,j)
+    diag_physics % lwupb  % array(i) = lwupb_p(i,j)
+    diag_physics % lwupbc % array(i) = lwupbc_p(i,j)
+    diag_physics % lwupt  % array(i) = lwupt_p(i,j)
+    diag_physics % lwuptc % array(i) = lwuptc_p(i,j)
+    diag_physics % olrtoa % array(i) = olrtoa_p(i,j)
  enddo
-!not needed: 
-!do k = kts,kte+2
-!do i = its,ite
-!   diag_physics % lwdnflx  % array(k,i) = lwdnflx_p(i,k,j)
-!   diag_physics % lwdnflxc % array(k,i) = lwdnflxc_p(i,k,j)
-!   diag_physics % lwupflx  % array(k,i) = lwupflx_p(i,k,j)
-!   diag_physics % lwupflxc % array(k,i) = lwupflxc_p(i,k,j)
-!enddo
-!enddo
 
  do k = kts,kte
  do i = its,ite
@@ -419,13 +398,45 @@
  enddo
  enddo
 
-!format:
- 101 format(i3,2i6,12(1x,e15.8))
- 102 format(i6,12(1x,e15.8))
+!end select radiation_lw_select
 
  end subroutine radiation_lw_to_MPAS
 
 !=============================================================================================
+ subroutine radiation_camlw_to_MPAS(diag_physics)
+!=============================================================================================
+
+!input arguments:
+ type(diag_physics_type),intent(inout):: diag_physics
+
+!---------------------------------------------------------------------------------------------
+
+!write(0,*) '--- writing absnxt,abstot,and emstot to restart =', l_camlw
+ do j = jts,jte
+ do n = 1,cam_abs_dim1
+ do k = kts,kte
+ do i = its,ite
+    diag_physics % absnxt % array(k,n,i) = absnxt_p(i,k,n,j)
+ enddo
+ enddo
+ enddo
+ do n = 1,cam_abs_dim2
+ do k = kts,kte+1
+ do i = its,ite
+    diag_physics % abstot % array(k,n,i) = abstot_p(i,k,n,j)
+ enddo
+ enddo
+ enddo
+ do k = kts,kte+1
+ do i = its,ite
+    diag_physics % emstot % array(k,i) = emstot_p(i,k,j)
+ enddo
+ enddo
+ enddo
+
+ end subroutine radiation_camlw_to_MPAS
+
+!=============================================================================================
  subroutine init_radiation_lw(dminfo,mesh,state_1,state_2)
 !=============================================================================================
 
@@ -460,12 +471,10 @@
  end subroutine init_radiation_lw
 
 !=============================================================================================
- subroutine driver_radiation_lw(itimestep,mesh,state,diag_physics,sfc_input, &amp;
-                                tend_physics,xtime_s)
+ subroutine driver_radiation_lw(xtime_s,mesh,state,diag_physics,sfc_input,tend_physics)
 !=============================================================================================
 
 !input arguments:
- integer,intent(in):: itimestep
  type(mesh_type),intent(in) :: mesh
  real(kind=RKIND),intent(in):: xtime_s
 
@@ -480,14 +489,14 @@
 
 !---------------------------------------------------------------------------------------------
  call mpas_timer_start(&quot;radiation_lw&quot;)
- write(0,100) itimestep
+ write(0,100)
 
 !formats:
  100 format(/,' --- enter subroutine driver_radiation_lw: ',i6)
  101 format(i8,12(1x,e15.8))
 
 !copy all MPAS arrays to rectangular grid:
- call radiation_lw_from_MPAS(mesh,state,diag_physics,sfc_input,xtime_s)
+ call radiation_lw_from_MPAS(xtime_s,mesh,state,diag_physics,sfc_input)
 
 !call to longwave radiation scheme:
  radiation_lw_select: select case (trim(radt_lw_scheme))
@@ -594,7 +603,7 @@
  end select radiation_lw_select
 
 !copy all arrays back to MPAS geodesic grid:
- call radiation_lw_to_MPAS(diag_physics,tend_physics,xtime_s)
+ call radiation_lw_to_MPAS(diag_physics,tend_physics)
 
  write(0,*) '--- end subroutine driver_radiation_lw'
  call mpas_timer_stop(&quot;radiation_lw&quot;)

Modified: branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_init.F
===================================================================
--- branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_init.F        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_init.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -58,19 +58,72 @@
 !edges:
  call init_dirs_forphys(mesh)
 
-!initialization of temperatures needed for updating the deep soil temperature:
- do iCell = 1, mesh % nCellsSolve
-    diag_physics % nsteps_accum % array(iCell) = 0
-    diag_physics % ndays_accum  % array(iCell) = 1
+!initialization of counters i_rainc and i_rainnc. i_rainc and i_rainnc track the number of
+!times the accumulated convective (rainc) and grid-scale (rainnc) rain exceed the prescribed
+!threshold value:
+ if(.not. config_do_restart) then
+    do iCell = 1, mesh % nCellsSolve
+       diag_physics % i_rainc  % array(iCell) = 0
+       diag_physics % i_rainnc % array(iCell) = 0
+    enddo
+ endif
 
-    diag_physics % tday_accum  % array(iCell) = sfc_input % tmn % array(iCell)
-    diag_physics % tyear_mean  % array(iCell) = sfc_input % tmn % array(iCell)
-    diag_physics % tyear_accum % array(iCell) = sfc_input % tmn % array(iCell)
-    do iLag = 1, mesh % nLags
-       diag_physics % tlag % array(iLag,iCell) = sfc_input % tmn % array(iCell)
+!initialization of counters i_acsw* and i_aclw*. i_acsw* and i_aclw* track the number of times
+!the accumulated long and short-wave radiation fluxes exceed their prescribed theshold values.
+ if(.not. config_do_restart) then
+    do iCell = 1, mesh % nCellsSolve
+       diag_physics % i_acswdnb  % array(iCell) = 0
+       diag_physics % i_acswdnbc % array(iCell) = 0
+       diag_physics % i_acswdnt  % array(iCell) = 0
+       diag_physics % i_acswdntc % array(iCell) = 0
+       diag_physics % i_acswupb  % array(iCell) = 0
+       diag_physics % i_acswupbc % array(iCell) = 0
+       diag_physics % i_acswupt  % array(iCell) = 0
+       diag_physics % i_acswuptc % array(iCell) = 0
+
+       diag_physics % i_aclwdnb  % array(iCell) = 0
+       diag_physics % i_aclwdnbc % array(iCell) = 0
+       diag_physics % i_aclwdnt  % array(iCell) = 0
+       diag_physics % i_aclwdntc % array(iCell) = 0
+       diag_physics % i_aclwupb  % array(iCell) = 0
+       diag_physics % i_aclwupbc % array(iCell) = 0
+       diag_physics % i_aclwupt  % array(iCell) = 0
+       diag_physics % i_aclwuptc % array(iCell) = 0
+
+       diag_physics % acswdnb  % array(iCell) = 0._RKIND
+       diag_physics % acswdnbc % array(iCell) = 0._RKIND
+       diag_physics % acswdnt  % array(iCell) = 0._RKIND
+       diag_physics % acswdntc % array(iCell) = 0._RKIND
+       diag_physics % acswupb  % array(iCell) = 0._RKIND
+       diag_physics % acswupbc % array(iCell) = 0._RKIND
+       diag_physics % acswupt  % array(iCell) = 0._RKIND
+       diag_physics % acswuptc % array(iCell) = 0._RKIND
+
+       diag_physics % aclwdnb  % array(iCell) = 0._RKIND
+       diag_physics % aclwdnbc % array(iCell) = 0._RKIND
+       diag_physics % aclwdnt  % array(iCell) = 0._RKIND
+       diag_physics % aclwdntc % array(iCell) = 0._RKIND
+       diag_physics % aclwupb  % array(iCell) = 0._RKIND
+       diag_physics % aclwupbc % array(iCell) = 0._RKIND
+       diag_physics % aclwupt  % array(iCell) = 0._RKIND
+       diag_physics % aclwuptc % array(iCell) = 0._RKIND
     enddo
- enddo
+ endif
 
+!initialization of temperatures needed for updating the deep soil temperature:
+ if(.not. config_do_restart) then
+    do iCell = 1, mesh % nCellsSolve
+       diag_physics % nsteps_accum % array(iCell) = 0._RKIND
+       diag_physics % ndays_accum  % array(iCell) = 0._RKIND
+       diag_physics % tday_accum   % array(iCell) = 0._RKIND
+       diag_physics % tyear_accum  % array(iCell) = 0._RKIND
+       diag_physics % tyear_mean   % array(iCell) = sfc_input % tmn % array(iCell)
+       do iLag = 1, mesh % nLags
+          diag_physics % tlag % array(iLag,iCell) = sfc_input % tmn % array(iCell)
+       enddo
+    enddo
+ endif
+
 !initialization of global surface properties. set here for now, but may be moved when time
 !manager is implemented:
  call landuse_init_forMPAS(dminfo,julday,mesh,diag_physics,sfc_input)

Modified: branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_initialize_real.F
===================================================================
--- branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_initialize_real.F        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_initialize_real.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -60,14 +60,16 @@
 !scan through all the fields in the file:
  call read_next_met_field(field,istatus)
  do while (istatus == 0)

-    write(0,*) field % field
-    if(index(field % field,'SST'   ) /= 0 .or. &amp;
-       index(field % field,'SEAICE') /= 0 .or. &amp;
-       index(field % field,'ALBEDO') /= 0 .or. &amp;
-       index(field % field,'VEGFRA') /= 0 ) then
-       write(0,*) field % field
 
+    !initialization of the sea-surface temperature (SST) and sea-ice fraction (XICE) arrays,
+    !prior to reading the input data:
+    fg % sst  % array (1:mesh%nCells) = 0.0_RKIND
+    fg % xice % array (1:mesh%nCells) = 0.0_RKIND
+
+    if(index(field % field,'SKINTEMP') /= 0 .or. &amp;
+       index(field % field,'SST'     ) /= 0 .or. &amp;
+       index(field % field,'SEAICE'  ) /= 0 ) then
+
        !Interpolation routines use real(kind=RKIND), so copy from default real array
        allocate(slab_r8(field % nx, field % ny))
        do j=1,field % ny
@@ -106,7 +108,7 @@
                        lat1 = real(field % startlat,RKIND), &amp;
                        lon1 = real(field % startlon,RKIND))
        end if
-   

        !Interpolate field to each MPAS grid cell:
        do iCell=1,mesh % nCells
           lat = mesh % latCell % array(iCell) * DEG_PER_RAD
@@ -124,7 +126,7 @@
               lon = lon - 360.0
               call latlon_to_ij(proj, lat, lon, x, y)
           end if
-

           if(index(field % field,'SST') /= 0) then
              fg % sst % array(iCell) = interp_sequence(x,y,1,slab_r8,1,field%nx, &amp;
                                               1,field%ny,1,1,-1.e30_RKIND,interp_list,1)
@@ -139,9 +141,7 @@
 !      exit
     end if
     call read_next_met_field(field,istatus)
-
  enddo
- write(0,*) '--- end subroutine physics_initialize_sst:'
 
  end subroutine physics_initialize_sst
 
@@ -202,16 +202,28 @@
  if(config_input_sst) then
     call physics_initialize_sst(mesh,fg)
 
+    if(maxval(xice(1:nCellsSolve)) == 0._RKIND .and. minval(xice(1:nCellsSolve)) == 0._RKIND) then
+       write(0,*)
+       write(0,*) &quot;The input file does not contain sea-ice data. We freeze the really cold ocean instead&quot;
+       do iCell = 1, nCellsSolve
+          if(landmask(iCell).eq.0 .and. sst(iCell).lt.271._RKIND) xice(iCell) = 1._RKIND
+       enddo
+    endif
+    write(0,*) 'max sst  =',maxval(fg % sst  % array(1:mesh%nCells))
+    write(0,*) 'min sst  =',minval(fg % sst  % array(1:mesh%nCells))
+    write(0,*) 'max xice =',maxval(fg % xice % array(1:mesh%nCells))
+    write(0,*) 'min xice =',minval(fg % xice % array(1:mesh%nCells))
+
     do iCell = 1, nCellsSolve
        !recalculate the sea-ice flag:
-       if(xice(iCell) .gt. 0.) then
-          seaice(iCell) = 1
+       if(xice(iCell) .gt. 0._RKIND) then
+          seaice(iCell) = 1._RKIND
        else
-          seaice(iCell) = 0
+          seaice(iCell) = 0._RKIND
        endif
 
        !set the skin temperature to the sea-surface temperature over the oceans:
-       if(landmask(iCell).eq.0 .and. sst(iCell).gt.170. .and. sst(iCell).lt.400.) &amp;
+       if(landmask(iCell).eq.0 .and. sst(iCell).gt.170._RKIND .and. sst(iCell).lt.400._RKIND) &amp;
           skintemp(iCell) = sst(iCell)
     enddo
  endif
@@ -222,8 +234,8 @@
  call monthly_interp_to_date(nCellsSolve,initial_date,albedo12m,sfc_albbck)
 
  do iCell = 1, nCellsSolve
-    sfc_albbck(iCell) = sfc_albbck(iCell) / 100.
-    if(landmask(iCell) .eq. 0) sfc_albbck(iCell) = 0.08
+    sfc_albbck(iCell) = sfc_albbck(iCell) / 100._RKIND
+    if(landmask(iCell) .eq. 0) sfc_albbck(iCell) = 0.08_RKIND
  enddo
 
 !initialization of the green-ness (vegetation) fraction: interpolation of the monthly values to
@@ -237,10 +249,10 @@
 
 !limit the annual maximum snow albedo to 0.08 over open-ocean and to 0.75 over sea-ice cells::
  do iCell = 1, nCellsSolve
-    if(landmask(iCell) .eq. 0 .and. seaice(iCell) .eq. 0.) then
-       snoalb(iCell) = 0.08
-    elseif(landmask(iCell) .eq. 0 .and. seaice(iCell) .eq. 1.) then
-       snoalb(iCell) = 0.75
+    if(landmask(iCell) .eq. 0 .and. seaice(iCell) .eq. 0._RKIND) then
+       snoalb(iCell) = 0.08_RKIND
+    elseif(landmask(iCell) .eq. 0 .and. seaice(iCell) .eq. 1._RKIND) then
+       snoalb(iCell) = 0.75_RKIND
     endif
  enddo
 
@@ -248,12 +260,12 @@
 !(m) as functions of the input snow water content (kg/m2). we use a 5:1 ratio from liquid
 !water equivalent to snow depth:
  do iCell = 1, nCellsSolve
-    if(snow(iCell) .ge. 10.) then
-       snowc(iCell) = 1.
+    if(snow(iCell) .ge. 10._RKIND) then
+       snowc(iCell) = 1._RKIND
     else
-       snowc(iCell) = 0.
+       snowc(iCell) = 0._RKIND
     endif
-    snowh(iCell) = snow(iCell) * 5.0 / 1000.
+    snowh(iCell) = snow(iCell) * 5.0_RKIND / 1000._RKIND
  enddo
 
 !initialization of soil layers properties:
@@ -264,10 +276,10 @@
 
 !define xland over land and ocean:
  do iCell = 1, nCellsSolve
-    if(landmask(iCell) .eq. 1 .or. (landmask(iCell).eq.0 .and. seaice(iCell).eq.1.)) then
-       xland(iCell) = 1.
+    if(landmask(iCell) .eq. 1 .or. (landmask(iCell).eq.0 .and. seaice(iCell).eq.1._RKIND)) then
+       xland(iCell) = 1._RKIND
     elseif(landmask(iCell) .eq. 0) then
-       xland(iCell) = 2.
+       xland(iCell) = 2._RKIND
     endif
  enddo
 

Modified: branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_manager.F
===================================================================
--- branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_manager.F        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_manager.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -38,6 +38,22 @@
 !between updates is 6 hours and is set with config_camrad_abs_update (00:30:00).
  integer, parameter:: camAlarmID    = 17
 
+!defines alarm to save the CAM arrays absnst, absnxt, and emstot to restart files. When the
+!alarm rings, the local arrays absnt_p, absnxt_p, and emstot_p are copied to the MPAS arrays
+!for writing to restart files at the bottom of the time-step:
+ integer, parameter:: camlwAlarmID  = 18
+ type(MPAS_TimeInterval_Type):: camlwTimeStep
+
+!defines alarm to check if the accumulated rain due to cloud microphysics and convection is
+!greater than its maximum allowed value:
+ integer, parameter:: acrainAlarmID   = 19
+ type(MPAS_TimeInterval_Type):: acrainTimeStep
+
+!defines alarm to check if the accumulated radiation diagnostics due to long- and short-wave
+!radiation is greater than its maximum allowed value:
+ integer, parameter:: acradtAlarmID   = 20
+ type(MPAS_TimeInterval_Type):: acradtTimeStep
+
  integer :: h, m, s, s_n, s_d, DoY, yr
  real(kind=RKIND) :: utc_h
 
@@ -76,7 +92,8 @@
             '     GMT         =', f16.9,/, &amp;
             '     UTC_H       =', f16.9,/, &amp;
             '     CURR_JULDAY =', f16.9,/, &amp;
-            '     LEAP_YEAR   =', 1x,l1,/)
+            '     LEAP_YEAR   =', 1x,l1,/, &amp;
+            '     TIME STAMP  =', 1x,a32,/)
 
  currTime = mpas_get_clock_time(clock,MPAS_NOW,ierr)
  call mpas_get_time(curr_time=currTime,dateTimeString=timeStamp,YYYY=yr,H=h,M=m, &amp;
@@ -88,7 +105,7 @@
  julday = DoY
  curr_julday = real(julday-1) + utc_h / 24.0
  LeapYear = isLeapYear(year)
- write(0,100) year,julday,gmt,utc_h,curr_julday,LeapYear
+ write(0,100) year,julday,gmt,utc_h,curr_julday,LeapYear,timeStamp
 
  block =&gt; domain % blocklist
  do while(associated(block))
@@ -97,7 +114,7 @@
     !monthly values to current day:
     if(mpas_is_alarm_ringing(clock,greenAlarmID,ierr=ierr)) then
        call mpas_reset_clock_alarm(clock,greenAlarmID,ierr=ierr)
-       write(0,*) '--- update background surface albedo, greeness fraction:', timeStamp
+       write(0,*) '--- time to update background surface albedo, greeness fraction.'
        call physics_update_surface(timeStamp,block%mesh,block%sfc_input)
     endif
 
@@ -133,7 +150,6 @@
     elseif(config_radtlw_interval == &quot;none&quot;) then
        l_radtlw = .true.
     endif
-    write(0,*)
     write(0,*) '--- time to run the LW radiation scheme L_RADLW =',l_radtlw
  endif
 
@@ -151,6 +167,21 @@
     write(0,*) '--- time to run the SW radiation scheme L_RADSW =',l_radtsw
  endif
 
+!check to see if it is time to run the parameterization of convection:
+ if(trim(config_conv_deep_scheme) /= &quot;off&quot;) then
+    l_conv = .false.
+
+    if(config_conv_interval /= &quot;none&quot;) then
+       if(mpas_is_alarm_ringing(clock,convAlarmID,ierr=ierr)) then
+          call mpas_reset_clock_alarm(clock,convAlarmID,ierr=ierr)
+          l_conv = .true.
+       endif
+    elseif(config_conv_interval == &quot;none&quot;) then
+       l_conv = .true.
+    endif
+    write(0,*) '--- time to run the convection scheme L_CONV    =',l_conv
+ endif
+
 !check to see if it is time to update the ozone trace gas path lengths,the total emissivity,
 !and the total absorptivity in the &quot;CAM&quot; long-wave radiation codes.
  if(trim(config_radt_lw_scheme) .eq. &quot;cam_lw&quot; .or. &amp;
@@ -161,13 +192,42 @@
        call mpas_reset_clock_alarm(clock,camAlarmID,ierr=ierr)
        doabsems = .true.
     endif
-    write(0,*) '--- update CAM absorptivity and emissivity arrays DOABSEMS =',doabsems
+    write(0,*) '--- time to update CAM absorptivity and emissivity arrays DOABSEMS =',doabsems
+ endif
 
+!check to see if it is time to save the local CAM arrays absnst_p, absnxt_p, and emstot_p to
+!the MPAS arrays:
+ if(trim(config_radt_lw_scheme) .eq. &quot;cam_lw&quot;) then
+    l_camlw = .false.
+    if(mpas_is_alarm_ringing(clock,camlwAlarmID,camlwTimeStep,ierr=ierr)) then
+       call mpas_reset_clock_alarm(clock,camlwAlarmID,camlwTimeStep,ierr=ierr)
+       l_camlw = .true.
+    endif
+    write(0,*) '--- time to write local CAM arrays to MPAS arrays L_CAMLW          =',l_camlw
  endif

-!formats:
- 101 format(3x,'l_radtlw = ',l1,3x,'l_radtsw = ',l1)
 
+!check to see if it is time to apply limit to the accumulated rain due to cloud microphysics
+!and convection:
+ if(trim(config_conv_deep_scheme) /= &quot;off&quot;) then
+    l_acrain = .false.
+    if(mpas_is_alarm_ringing(clock,acrainAlarmID,acrainTimeStep,ierr=ierr)) then
+       call mpas_reset_clock_alarm(clock,acrainAlarmID,acrainTimeStep,ierr=ierr)
+       l_acrain = .true.
+    endif
+    write(0,*) '--- time to apply limit to accumulated rainc and rainnc L_ACRAIN   =',l_acrain
+ endif
+
+!check to see if it is time to apply limit to the accumulated radiation diagnostics due to
+!long- and short-wave radiation:
+ if(trim(config_radt_lw_scheme) /= &quot;off&quot; .or. trim(config_radt_sw_scheme) /= &quot;off&quot;) then
+    l_acradt = .false.
+    if(mpas_is_alarm_ringing(clock,acradtAlarmID,acradtTimeStep,ierr=ierr)) then
+       call mpas_reset_clock_alarm(clock,acradtAlarmID,acradtTimeStep,ierr=ierr)
+       l_acradt = .true.
+    endif
+    write(0,*) '--- time to apply limit to accumulated radiation diags. L_ACRADT   =',l_acradt
+ endif
+
  end subroutine physics_timetracker
 
 !=============================================================================================
@@ -325,6 +385,39 @@
        call physics_error_fatal('subroutine physics_init: error creating alarm CAM')
  endif
 
+!set alarm to write the &quot;CAM&quot; local arrays absnst_p, absnxt_p, and emstot_p to the MPAS arrays
+!for writing to the restart file at the bottom of the time-step:
+ if(trim(config_radt_lw_scheme) .eq. &quot;cam_lw&quot; ) then
+    call mpas_set_timeInterval(camlwTimeStep,dt=config_dt,ierr=ierr)
+    call mpas_set_timeInterval(alarmTimeStep,timeString=config_restart_interval,ierr=ierr)
+    alarmStartTime = startTime + alarmTimeStep
+    call mpas_add_clock_alarm(clock,camlwAlarmID,alarmStartTime,alarmTimeStep,ierr=ierr)
+    if(ierr /= 0) &amp;
+       call physics_error_fatal('subroutine physics_init: error creating alarm CAMLW')
+ endif
+
+!set alarm to check if the accumulated rain due to cloud microphysics and convection is
+!greater than its maximum allowed value:
+ if(config_bucket_update /= &quot;none&quot;) then
+    call mpas_set_timeInterval(acrainTimeStep,dt=config_dt,ierr=ierr)
+    call mpas_set_timeInterval(alarmTimeStep,timeString=config_bucket_update,ierr=ierr)
+    alarmStartTime = startTime + alarmTimeStep
+    call mpas_add_clock_alarm(clock,acrainAlarmID,alarmStartTime,alarmTimeStep,ierr=ierr)
+       if(ierr /= 0) &amp;
+          call physics_error_fatal('subroutine physics_init: error creating alarm rain limit')
+ endif
+
+!set alarm to check if the accumulated radiation diagnostics due to long- and short-wave radiation
+!is greater than its maximum allowed value:
+ if(config_bucket_update /= &quot;none&quot;) then
+    call mpas_set_timeInterval(acradtTimeStep,dt=config_dt,ierr=ierr)
+    call mpas_set_timeInterval(alarmTimeStep,timeString=config_bucket_update,ierr=ierr)
+    alarmStartTime = startTime + alarmTimeStep
+    call mpas_add_clock_alarm(clock,acradtAlarmID,alarmStartTime,alarmTimeStep,ierr=ierr)
+       if(ierr /= 0) &amp;
+          call physics_error_fatal('subroutine physics_init: error creating alarm radiation limit')
+ endif
+
  write(0,102) dt_radtlw,dt_radtsw,dt_cu,dt_pbl
 
 !initialization of physics dimensions to mimic a rectangular grid:
@@ -344,31 +437,39 @@
               ids,ide,jds,jde,kds,kde, &amp;
               its,ite,jts,jte,kts,kte
 
-!initialization:
+!initialization local physics variables:
  num_months = mesh % nMonths
+ num_soils  = mesh% nSoilLevels
 
-!initialization of physics time-steps:
- dt_dyn     = config_dt
- n_microp   = config_n_microp
- n_cu       = config_n_conv
-
- dt_microp  = dt_dyn/n_microp  !for now.
-
-!write(0,*) 'mod =',mod(dt_dyn,dt_radtsw)
-!write(0,*) 'mod =',mod(dt_dyn,dt_microp)
-!stop
-
-!cloud microphysics scheme:
- microp_scheme       = trim(config_microp_scheme)
  conv_deep_scheme    = trim(config_conv_deep_scheme)
  conv_shallow_scheme = trim(config_conv_shallow_scheme)
- sfclayer_scheme     = trim(config_sfclayer_scheme)
+ lsm_scheme          = trim(config_lsm_scheme)
+ microp_scheme       = trim(config_microp_scheme)
  pbl_scheme          = trim(config_pbl_scheme)
  radt_cld_scheme     = trim(config_radt_cld_scheme)
  radt_lw_scheme      = trim(config_radt_lw_scheme)
  radt_sw_scheme      = trim(config_radt_sw_scheme)
+ sfclayer_scheme     = trim(config_sfclayer_scheme)
 
-!CAM radiation schemes:
+!initialization of local physics time-steps:
+!... dynamics:
+ dt_dyn     = config_dt
+!... cloud microphysics:
+ n_microp   = config_n_microp
+ dt_microp  = dt_dyn/n_microp  !for now.
+!... convection:
+ l_conv = .false.
+ n_cu   = nint(dt_cu/dt_dyn)
+ n_cu   = max(n_cu,1)
+!... radiation:
+ l_radtlw = .false.
+ l_radtsw = .false.
+!... others:
+ l_camlw  = .false.
+ l_acrain = .false.
+ l_acradt = .false.
+
+!initialization for CAM radiation schemes only:
  if(trim(config_radt_lw_scheme) .eq. &quot;cam_lw&quot; .or. &amp;
     trim(config_radt_sw_scheme) .eq. &quot;cam_sw&quot; ) then
 
@@ -387,10 +488,7 @@
 
  endif 
 
-!land-surface scheme:
- lsm_scheme = trim(config_lsm_scheme)
- num_soils  = mesh% nSoilLevels
-
+!initialization of sea-ice threshold:
  if(.not. config_frac_seaice) then
     xice_threshold = 0.5
  elseif(config_frac_seaice) then

Modified: branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_update.F
===================================================================
--- branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_update.F        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_update.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -4,10 +4,12 @@
  use mpas_grid_types
 
  use mpas_atmphys_driver_convection_deep
+ use mpas_atmphys_vars
 
  implicit none
  private
- public:: physics_update
+ public:: physics_update, &amp;
+          update_radiation_diagnostics
 
  contains
  
@@ -31,7 +33,7 @@
  do while(associated(block))
 
     !parameterization of convection: update accumulated precipitation.
-    call update_convection_deep(dt,block%mesh,block%diag_physics)
+    !call update_convection_deep(dt,config_bucket_rainc,block%mesh,block%diag_physics)
 
     block =&gt; block % next
  end do
@@ -40,5 +42,117 @@
  end subroutine physics_update
 
 !=============================================================================================
+ subroutine update_radiation_diagnostics(bucket_radt,mesh,diag)
+!=============================================================================================
+
+!input arguments:
+ real(kind=RKIND),intent(in):: bucket_radt
+ type(mesh_type),intent(in):: mesh
+
+!inout arguments:
+ type(diag_physics_type),intent(inout):: diag
+
+!local variables:
+ integer:: iCell
+
+!--------------------------------------------------------------------------------------------
+
+ do iCell = 1, mesh%nCellsSolve
+    !short-wave radiation:
+    diag%acswdnb %array(iCell) = diag%acswdnb %array(iCell) + diag%swdnb %array(iCell)*dt_dyn
+    diag%acswdnbc%array(iCell) = diag%acswdnbc%array(iCell) + diag%swdnbc%array(iCell)*dt_dyn
+    diag%acswdnt %array(iCell) = diag%acswdnt %array(iCell) + diag%swdnt %array(iCell)*dt_dyn
+    diag%acswdntc%array(iCell) = diag%acswdntc%array(iCell) + diag%swdntc%array(iCell)*dt_dyn
+    diag%acswupb %array(iCell) = diag%acswupb %array(iCell) + diag%swupb %array(iCell)*dt_dyn
+    diag%acswupbc%array(iCell) = diag%acswupbc%array(iCell) + diag%swupbc%array(iCell)*dt_dyn
+    diag%acswupt %array(iCell) = diag%acswupt %array(iCell) + diag%swupt %array(iCell)*dt_dyn
+    diag%acswuptc%array(iCell) = diag%acswuptc%array(iCell) + diag%swuptc%array(iCell)*dt_dyn
+    !long-wave radiation:
+    diag%aclwdnb %array(iCell) = diag%aclwdnb %array(iCell) + diag%lwdnb %array(iCell)*dt_dyn
+    diag%aclwdnbc%array(iCell) = diag%aclwdnbc%array(iCell) + diag%lwdnbc%array(iCell)*dt_dyn
+    diag%aclwdnt %array(iCell) = diag%aclwdnt %array(iCell) + diag%lwdnt %array(iCell)*dt_dyn
+    diag%aclwdntc%array(iCell) = diag%aclwdntc%array(iCell) + diag%lwdntc%array(iCell)*dt_dyn
+    diag%aclwupb %array(iCell) = diag%aclwupb %array(iCell) + diag%lwupb %array(iCell)*dt_dyn
+    diag%aclwupbc%array(iCell) = diag%aclwupbc%array(iCell) + diag%lwupbc%array(iCell)*dt_dyn
+    diag%aclwupt %array(iCell) = diag%aclwupt %array(iCell) + diag%lwupt %array(iCell)*dt_dyn
+    diag%aclwuptc%array(iCell) = diag%aclwuptc%array(iCell) + diag%lwuptc%array(iCell)*dt_dyn
+ enddo
+
+ if(l_acradt .and. bucket_radt.gt.0._RKIND) then
+
+    do iCell = 1, mesh%nCellsSolve
+       !short-wave radiation:
+       if(diag%acswdnb%array(iCell) .gt. bucket_radt) then
+          diag%i_acswdnb%array(iCell) = diag%i_acswdnb%array(iCell) + 1
+          diag%acswdnb%array(iCell) = diag%acswdnb%array(iCell) - bucket_radt
+       endif   
+       if(diag%acswdnbc%array(iCell) .gt. bucket_radt) then
+          diag%i_acswdnbc%array(iCell) = diag%i_acswdnbc%array(iCell) + 1
+          diag%acswdnbc%array(iCell) = diag%acswdnbc%array(iCell) - bucket_radt
+       endif   
+       if(diag%acswdnt%array(iCell) .gt. bucket_radt) then
+          diag%i_acswdnt%array(iCell) = diag%i_acswdnt%array(iCell) + 1
+          diag%acswdnt%array(iCell) = diag%acswdnt%array(iCell) - bucket_radt
+       endif   
+       if(diag%acswdntc%array(iCell) .gt. bucket_radt) then
+          diag%i_acswdntc%array(iCell) = diag%i_acswdntc%array(iCell) + 1
+          diag%acswdntc%array(iCell) = diag%acswdntc%array(iCell) - bucket_radt
+       endif
+       if(diag%acswupb%array(iCell) .gt. bucket_radt) then
+          diag%i_acswupb%array(iCell) = diag%i_acswupb%array(iCell) + 1
+          diag%acswupb%array(iCell) = diag%acswupb%array(iCell) - bucket_radt
+       endif   
+       if(diag%acswupbc%array(iCell) .gt. bucket_radt) then
+          diag%i_acswupbc%array(iCell) = diag%i_acswupbc%array(iCell) + 1
+          diag%acswupbc%array(iCell) = diag%acswupbc%array(iCell) - bucket_radt
+       endif   
+       if(diag%acswupt%array(iCell) .gt. bucket_radt) then
+          diag%i_acswupt%array(iCell) = diag%i_acswupt%array(iCell) + 1
+          diag%acswupt%array(iCell) = diag%acswupt%array(iCell) - bucket_radt
+       endif   
+       if(diag%acswuptc%array(iCell) .gt. bucket_radt) then
+          diag%i_acswuptc%array(iCell) = diag%i_acswuptc%array(iCell) + 1
+          diag%acswuptc%array(iCell) = diag%acswuptc%array(iCell) - bucket_radt
+       endif
+       !long-wave radiation:
+       if(diag%aclwdnb%array(iCell) .gt. bucket_radt) then
+          diag%i_aclwdnb%array(iCell) = diag%i_aclwdnb%array(iCell) + 1
+          diag%aclwdnb%array(iCell) = diag%aclwdnb%array(iCell) - bucket_radt
+       endif   
+       if(diag%aclwdnbc%array(iCell) .gt. bucket_radt) then
+          diag%i_aclwdnbc%array(iCell) = diag%i_aclwdnbc%array(iCell) + 1
+          diag%aclwdnbc%array(iCell) = diag%aclwdnbc%array(iCell) - bucket_radt
+       endif   
+       if(diag%aclwdnt%array(iCell) .gt. bucket_radt) then
+          diag%i_aclwdnt%array(iCell) = diag%i_aclwdnt%array(iCell) + 1
+          diag%aclwdnt%array(iCell) = diag%aclwdnt%array(iCell) - bucket_radt
+       endif   
+       if(diag%aclwdntc%array(iCell) .gt. bucket_radt) then
+          diag%i_aclwdntc%array(iCell) = diag%i_aclwdntc%array(iCell) + 1
+          diag%aclwdntc%array(iCell) = diag%aclwdntc%array(iCell) - bucket_radt
+       endif
+       if(diag%aclwupb%array(iCell) .gt. bucket_radt) then
+          diag%i_aclwupb%array(iCell) = diag%i_aclwupb%array(iCell) + 1
+          diag%aclwupb%array(iCell) = diag%aclwupb%array(iCell) - bucket_radt
+       endif   
+       if(diag%aclwupbc%array(iCell) .gt. bucket_radt) then
+          diag%i_aclwupbc%array(iCell) = diag%i_aclwupbc%array(iCell) + 1
+          diag%aclwupbc%array(iCell) = diag%aclwupbc%array(iCell) - bucket_radt
+       endif   
+       if(diag%aclwupt%array(iCell) .gt. bucket_radt) then
+          diag%i_aclwupt%array(iCell) = diag%i_aclwupt%array(iCell) + 1
+          diag%aclwupt%array(iCell) = diag%aclwupt%array(iCell) - bucket_radt
+       endif   
+       if(diag%aclwuptc%array(iCell) .gt. bucket_radt) then
+          diag%i_aclwuptc%array(iCell) = diag%i_aclwuptc%array(iCell) + 1
+          diag%aclwuptc%array(iCell) = diag%aclwuptc%array(iCell) - bucket_radt
+       endif
+    enddo
+
+ endif
+
+ end subroutine update_radiation_diagnostics
+
+!=============================================================================================
  end module mpas_atmphys_update
 !=============================================================================================

Modified: branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_update_surface.F
===================================================================
--- branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_update_surface.F        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_update_surface.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -128,6 +128,12 @@
  sfc_emibck =&gt; diag_physics % sfc_emibck % array
  xicem      =&gt; diag_physics % xicem      % array
 
+ write(0,*)
+ write(0,*) 'max sst  =',maxval(sst(1:nCellsSolve))
+ write(0,*) 'min sst  =',minval(sst(1:nCellsSolve))
+ write(0,*) 'max xice =',maxval(xice(1:nCellsSolve))
+ write(0,*) 'min xice =',minval(xice(1:nCellsSolve))
+
  do iCell = 1, nCellsSolve
 
     !update the skin temperature and the temperature in the first soil layer to the updated
@@ -236,8 +242,8 @@
  real(kind=RKIND),dimension(:),pointer:: dtw1,emiss,ust
 
 !---------------------------------------------------------------------------------------------
- write(0,*)
- write(0,*) '--- enter subroutine physics_update_sstskin:'
+!write(0,*)
+!write(0,*) '--- enter subroutine physics_update_sstskin:'
 
  nCellsSolve = mesh % nCellsSolve
 
@@ -349,14 +355,16 @@
 
 !local variables:
  integer:: iCell,iLag,n,nCellsSolve,nLags
- integer,dimension(:),pointer:: nsteps_accum,ndays_accum
 
  real(kind=RKIND),parameter:: tconst = 0.6
  real(kind=RKIND):: deltat,julian,tprior,yrday
+ real(kind=RKIND),dimension(:),pointer:: nsteps_accum,ndays_accum
  real(kind=RKIND),dimension(:),pointer  :: tday_accum,tmn,tsk,tyear_accum,tyear_mean
  real(kind=RKIND),dimension(:,:),pointer:: tlag 
 
 !---------------------------------------------------------------------------------------------
+!write(0,*)
+!write(0,*) '--- enter subroutine physics_update_deepsoiltemp:' 
 
  nCellsSolve = mesh % nCellsSolve
  nLags       = mesh % nLags
@@ -380,26 +388,27 @@
 
 !... accumulate the skin temperature for current day:
  do iCell = 1, nCellsSolve
-    tday_accum(iCell)  = tday_accum(iCell)  + tsk(iCell)
+    tday_accum(iCell)  = tday_accum(iCell)  + tsk(iCell)*dt
+!   tday_accum(iCell)  = tday_accum(iCell)  + tsk(iCell)
     nsteps_accum(iCell) = nsteps_accum(iCell) + dt
+!   nsteps_accum(iCell) = nsteps_accum(iCell) + 1
  enddo
 
 !... update the deep soil temperature at the end of the day:
  deltat = (julian_in-nint(julian_in))*24.*3600.
 
- write(0,*)
- write(0,*) 'yrday          = ',yrday
- write(0,*) 'julian_in      = ',julian_in
- write(0,*) 'nint(julian_in)= ',nint(julian_in)
- write(0,*) 'deltat         = ',deltat
- write(0,*) 'nint(deltat)-dt= ',nint(deltat) .lt. dt
+!write(0,*) '--- yrday          = ',yrday
+!write(0,*) '--- julian_in      = ',julian_in
+!write(0,*) '--- nint(julian_in)= ',nint(julian_in)
+!write(0,*) '--- deltat         = ',deltat
+!write(0,*) '--- nint(deltat)-dt= ',nint(deltat) .lt. dt
 
  if(abs(deltat) .le. dt/2) then
-    write(0,*) '--- end of day: update deep soil temperature'
     julian = julian_in - 1. + dt/(3600.*24.)
 
     do iCell = 1, nCellsSolve
 
+!--- update tmn:
        tprior = 0.
        do iLag = 1, nLags
           tprior = tprior + tlag(iLag,iCell)
@@ -407,21 +416,22 @@
        tprior = tprior / nLags
        tmn(iCell) = tconst*tyear_mean(iCell) + (1-tconst)*tprior 
 
+!--- update tlag:
        do iLag = 1, nLags-1
           tlag(iLag,iCell) = tlag(iLag+1,iCell)
        enddo
        tlag(nLags,iCell)   = tday_accum(iCell) / nsteps_accum(iCell)
        tday_accum(iCell)   = 0.0
-       nsteps_accum(iCell)  = 0.0
+       nsteps_accum(iCell) = 0.0
 
        !... end of year:
        if(yrday-julian .le. 1.) then
           tyear_mean(iCell)  = tyear_accum(iCell) / ndays_accum(iCell)
           tyear_accum(iCell) = 0.
-          ndays_accum(iCell) = 0
+          ndays_accum(iCell) = 0.0
        else
           tyear_accum(iCell) = tyear_accum(iCell) + tlag(nLags,iCell)
-          ndays_accum(iCell) = ndays_accum(iCell) + 1
+          ndays_accum(iCell) = ndays_accum(iCell) + 1.
        endif
        
     enddo

Modified: branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_vars.F
===================================================================
--- branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_vars.F        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/core_atmos_physics/mpas_atmphys_vars.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -27,7 +27,11 @@
 !=============================================================================================
 
  logical:: l_radtlw                   !controls call to longwave radiation parameterization.
- logical:: l_radtsw                   !controls call to shortwave parameterization.
+ logical:: l_radtsw                   !controls call to shortwave radiation parameterization.
+ logical:: l_conv                     !controls call to convective parameterization.
+ logical:: l_camlw                    !controls when to save local CAM LW abs and ems arrays.
+ logical:: l_acrain                   !when .true., limit to accumulated rain is applied.
+ logical:: l_acradt                   !when .true., limit to lw and sw radiation is applied.
 
  integer,public:: ids,ide,jds,jde,kds,kde
  integer,public:: ims,ime,jms,jme,kms,kme

Modified: branches/ocean_projects/accgm/src/core_nhyd_atmos/Registry
===================================================================
--- branches/ocean_projects/accgm/src/core_nhyd_atmos/Registry        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/core_nhyd_atmos/Registry        2012-03-20 15:59:44 UTC (rev 1682)
@@ -348,6 +348,7 @@
 namelist character physics  config_pbl_interval          none
 namelist character physics  config_camrad_abs_update     06:00:00
 namelist character physics  config_greeness_update       24:00:00
+namelist character physics  config_bucket_update         none
 
 namelist character physics  config_microp_scheme          off
 namelist character physics  config_conv_shallow_scheme    off
@@ -360,6 +361,10 @@
 namelist character physics  config_radt_sw_scheme         off
 namelist character physics  config_sfclayer_scheme        off
 
+namelist real      physics  config_bucket_radt            0.0_RKIND
+namelist real      physics  config_bucket_rainc           0.0_RKIND
+namelist real      physics  config_bucket_rainnc          0.0_RKIND
+
 var persistent real    east       ( R3 nCells               ) 0  r   east          mesh         - -
 var persistent real    north      ( R3 nCells               ) 0  r   north         mesh         - -
 
@@ -374,8 +379,8 @@
 % tyear_mean  : annual mean surface temperature                                                 [K]
 % tyear_accum : accumulated yearly surface temperature for current year                         [K]
 
-var persistent integer nsteps_accum ( nCells Time           ) 1  r  nsteps_accum   diag_physics - -
-var persistent integer ndays_accum  ( nCells Time           ) 1  r  ndays_accum    diag_physics - -
+var persistent real    nsteps_accum ( nCells Time           ) 1  r  nsteps_accum   diag_physics - -
+var persistent real    ndays_accum  ( nCells Time           ) 1  r  ndays_accum    diag_physics - -
 
 var persistent real    tlag         ( nLags nCells Time     ) 1  r  tlag           diag_physics - -
 var persistent real    tday_accum   ( nCells Time           ) 1  r  tday_accum     diag_physics - -           
@@ -385,7 +390,7 @@
 %--------------------------------------------------------------------------------------------------
 %... PARAMETERIZATION OF CLOUD MICROPHYSICS:
 %--------------------------------------------------------------------------------------------------
-
+% i_rainnc  : counter related to how often rainnc is being reset relative to its bucket value   (-)
 % rainnc    : accumulated total time-step grid-scale precipitation                             (mm)
 % rainncv   : time-step total grid-scale precipitation                                         (mm)
 % snownc    : accumulated grid-scale precipitation of snow                                     (mm)
@@ -394,6 +399,7 @@
 % graupelncv: time-step grid-scale precipitation of graupel                                    (mm)
 % sr        : time-step ratio of frozen versus total grid-scale precipitation                   (-)
 
+var persistent integer i_rainnc   ( nCells Time             ) 1  ro i_rainnc       diag_physics - -
 var persistent real    sr         ( nCells Time             ) 1  ro sr             diag_physics - -
 var persistent real    rainncv    ( nCells Time             ) 1  ro rainncv        diag_physics - -
 var persistent real    snowncv    ( nCells Time             ) 1   o snowncv        diag_physics - -
@@ -409,7 +415,7 @@
 %--------------------------------------------------------------------------------------------------
 %... PARAMETERIZATION OF CONVECTION:
 %--------------------------------------------------------------------------------------------------
-
+% i_rainc   : counter related to how often rainc is begin reset relative to its bucket value    (-)
 % cuprec    : convective precipitation rate                                                  (mm/s)
 % rainc     : accumulated time-step convective precipitation                                   (mm)
 % raincv    : time-step convective precipitation                                               (mm)
@@ -418,9 +424,10 @@
 % rqccuten  : tendency of cloud water mixing ratio due to cumulus convection            (kg/kg s-1)
 % rqicuten  : tendency of cloud ice mixing ratio due to cumulus convection              (kg/kg s-1)
 
-var persistent real   cuprec    ( nCells Time              ) 1  ro cuprec          diag_physics - -
-var persistent real   rainc     ( nCells Time              ) 1  ro rainc           diag_physics - -
-var persistent real   raincv    ( nCells Time              ) 1  ro raincv          diag_physics - -
+var persistent integer i_rainc  ( nCells Time              ) 1  ro i_rainc         diag_physics - -
+var persistent real    cuprec   ( nCells Time              ) 1  ro cuprec          diag_physics - -
+var persistent real    rainc    ( nCells Time              ) 1  ro rainc           diag_physics - -
+var persistent real    raincv   ( nCells Time              ) 1  ro raincv          diag_physics - -
 
 var persistent real   rthcuten  ( nVertLevels nCells Time  ) 1  ro rthcuten        tend_physics - -
 var persistent real   rqvcuten  ( nVertLevels nCells Time  ) 1  ro rqvcuten        tend_physics - -
@@ -555,25 +562,49 @@
 %--------------------------------------------------------------------------------------------------
 %... PARAMETERIZATION OF SHORTWAVE RADIATION:
 %--------------------------------------------------------------------------------------------------
-
 % coszr     :cosine of the solar zenith angle                                                   [-]
-
 % gsw       :net shortwave flux at surface                                                  [W m-2]
 % swcf      :shortwave cloud forcing at top-of-atmosphere                                   [W m-2]
-% swdnb     :all-sky downwelling shortwave flux at bottom-of-atmosphere                     [J m-2]
-% swdnbc    :clear-sky downwelling shortwave flux at bottom-of-atmosphere                   [J m-2]
-% swdnt     :all-sky downwelling shortwave flux at top-of-atmosphere                        [J m-2]
-% swdntc    :clear-sky downwelling shortwave flux at top-of-atmosphere                      [J m-2] 
-% swupb     :all-sky upwelling shortwave flux at bottom-of-atmosphere                       [J m-2]
-% swupbc    :clear-sky upwelling shortwave flux at bottom-of-atmosphere                     [J m-2]
-% swupt     :all-sky upwelling shortwave flux at top-of-atmosphere                          [J m-2]
-% swuptc    :clear-sky upwelling shortwave flux at top-of-atmosphere                        [J m-2]
+% swdnb     :all-sky downwelling shortwave flux at bottom-of-atmosphere                     [W m-2]
+% swdnbc    :clear-sky downwelling shortwave flux at bottom-of-atmosphere                   [W m-2]
+% swdnt     :all-sky downwelling shortwave flux at top-of-atmosphere                        [W m-2]
+% swdntc    :clear-sky downwelling shortwave flux at top-of-atmosphere                      [W m-2] 
+% swupb     :all-sky upwelling shortwave flux at bottom-of-atmosphere                       [W m-2]
+% swupbc    :clear-sky upwelling shortwave flux at bottom-of-atmosphere                     [W m-2]
+% swupt     :all-sky upwelling shortwave flux at top-of-atmosphere                          [W m-2]
+% swuptc    :clear-sky upwelling shortwave flux at top-of-atmosphere                        [W m-2]
+% acswdnb   :accumulated all-sky downwelling shortwave flux at bottom-of-atmosphere         [J m-2]
+% acswdnbc  :accumulated clear-sky downwelling shortwave flux at bottom-of-atmosphere       [J m-2]
+% acswdnt   :accumulated all-sky downwelling shortwave flux at top-of-atmosphere            [J m-2]
+% acswdntc  :accumulated clear-sky downwelling shortwave flux at top-of-atmosphere          [J m-2] 
+% acswupb   :accumulated all-sky upwelling shortwave flux at bottom-of-atmosphere           [J m-2]
+% acswupbc  :accumulated clear-sky upwelling shortwave flux at bottom-of-atmosphere         [J m-2]
+% acswupt   :accumulated all-sky upwelling shortwave flux at top-of-atmosphere              [J m-2]
+% acswuptc  :accumulated clear-sky upwelling shortwave flux at top-of-atmosphere            [J m-2]
 % swdnflx   :
 % swdnflxc  :
 % swupflx   :
 % swupflxc  :
 % rthratensw:uncoupled theta tendency due to shortwave radiation                            [K s-1]
 
+% i_acswdnb : counter related to how often swdnb is begin reset relative to its bucket value    (-)
+% i_acswdnbc: counter related to how often swdnbc is begin reset relative to its bucket value   (-)
+% i_acswdnt : counter related to how often swdnt is begin reset relative to its bucket value    (-)
+% i_acswdntc: counter related to how often swdntc is begin reset relative to its bucket value   (-)
+% i_acswupb : counter related to how often swupb is begin reset relative to its bucket value    (-)
+% i_acswupbc: counter related to how often swupbc is begin reset relative to its bucket value   (-)
+% i_acswupt : counter related to how often swupt is begin reset relative to its bucket value    (-)
+% i_acswuptc: counter related to how often swuptc is begin reset relative to its bucket value   (-)
+
+var persistent integer i_acswdnb  ( nCells Time               ) 1  ro i_acswdnb    diag_physics - -
+var persistent integer i_acswdnbc ( nCells Time               ) 1  ro i_acswdnbc   diag_physics - -
+var persistent integer i_acswdnt  ( nCells Time               ) 1  ro i_acswdnt    diag_physics - -
+var persistent integer i_acswdntc ( nCells Time               ) 1  ro i_acswdntc   diag_physics - -
+var persistent integer i_acswupb  ( nCells Time               ) 1  ro i_acswupb    diag_physics - -
+var persistent integer i_acswupbc ( nCells Time               ) 1  ro i_acswupbc   diag_physics - -
+var persistent integer i_acswupt  ( nCells Time               ) 1  ro i_acswupt    diag_physics - -
+var persistent integer i_acswuptc ( nCells Time               ) 1  ro i_acswuptc   diag_physics - -
+
 var persistent real    coszr      ( nCells Time               ) 1   o coszr        diag_physics - -
 var persistent real    swcf       ( nCells Time               ) 1   o swcf         diag_physics - -
 var persistent real    swdnb      ( nCells Time               ) 1   o swdnb        diag_physics - -
@@ -584,6 +615,14 @@
 var persistent real    swupbc     ( nCells Time               ) 1   o swupbc       diag_physics - -
 var persistent real    swupt      ( nCells Time               ) 1   o swupt        diag_physics - -
 var persistent real    swuptc     ( nCells Time               ) 1   o swuptc       diag_physics - -
+var persistent real    acswdnb    ( nCells Time               ) 1  ro acswdnb      diag_physics - -
+var persistent real    acswdnbc   ( nCells Time               ) 1  ro acswdnbc     diag_physics - -
+var persistent real    acswdnt    ( nCells Time               ) 1  ro acswdnt      diag_physics - -
+var persistent real    acswdntc   ( nCells Time               ) 1  ro acswdntc     diag_physics - -
+var persistent real    acswupb    ( nCells Time               ) 1  ro acswupb      diag_physics - -
+var persistent real    acswupbc   ( nCells Time               ) 1  ro acswupbc     diag_physics - -
+var persistent real    acswupt    ( nCells Time               ) 1  ro acswupt      diag_physics - -
+var persistent real    acswuptc   ( nCells Time               ) 1  ro acswuptc     diag_physics - -
 var persistent real    gsw        ( nCells Time               ) 1  ro gsw          diag_physics - -
 
 var persistent real    rthratensw ( nVertLevels nCells Time   ) 1  ro rthratensw   tend_physics - -
@@ -613,6 +652,14 @@
 % lwupbc    :clear-sky upwelling longwave flux at bottom-of-atmosphere                      [W m-2]
 % lwupt     :all-sky upwelling longwave flux at top-of-atmosphere                           [W m-2]
 % lwuptc    :clear-sky upwelling longwave flux at top-of-atmosphere                         [W m-2]
+% aclwdnb   :accumulated all-sky downwelling longwave flux at bottom-of-atmosphere          [J m-2]
+% aclwdnbc  :accumulated clear-sky downwelling longwave flux at bottom-of-atmosphere        [J m-2]
+% aclwdnt   :accumulated all-sky downwelling longwave flux at top-of-atmosphere             [J m-2]
+% aclwdntc  :accumulated clear-sky downwelling longwave flux at top-of-atmosphere           [J m-2]
+% aclwupb   :accumulated all-sky upwelling longwave flux at bottom-of-atmosphere            [J m-2]
+% aclwupbc  :accumulated clear-sky upwelling longwave flux at bottom-of-atmosphere          [J m-2]
+% aclwupt   :accumulated all-sky upwelling longwave flux at top-of-atmosphere               [J m-2]
+% aclwuptc  :accumulated clear-sky upwelling longwave flux at top-of-atmosphere             [J m-2]
 % lwdnflx   :
 % lwdnflxc  :
 % lwupflx   :
@@ -620,6 +667,24 @@
 % olrtoa    :outgoing longwave radiation at top-of-the-atmosphere                           [W m-2]
 % rthratenlw:uncoupled theta tendency due to longwave radiation                             [K s-1]
 
+% i_aclwdnb : counter related to how often lwdnb is begin reset relative to its bucket value    (-)
+% i_aclwdnbc: counter related to how often lwdnbc is begin reset relative to its bucket value   (-)
+% i_aclwdnt : counter related to how often lwdnt is begin reset relative to its bucket value    (-)
+% i_aclwdntc: counter related to how often lwdntc is begin reset relative to its bucket value   (-)
+% i_aclwupb : counter related to how often lwupb is begin reset relative to its bucket value    (-)
+% i_aclwupbc: counter related to how often lwupbc is begin reset relative to its bucket value   (-)
+% i_aclwupt : counter related to how often lwupt is begin reset relative to its bucket value    (-)
+% i_aclwuptc: counter related to how often lwuptc is begin reset relative to its bucket value   (-)
+
+var persistent integer i_aclwdnb  ( nCells Time               ) 1  ro i_aclwdnb    diag_physics - -
+var persistent integer i_aclwdnbc ( nCells Time               ) 1  ro i_aclwdnbc   diag_physics - -
+var persistent integer i_aclwdnt  ( nCells Time               ) 1  ro i_aclwdnt    diag_physics - -
+var persistent integer i_aclwdntc ( nCells Time               ) 1  ro i_aclwdntc   diag_physics - -
+var persistent integer i_aclwupb  ( nCells Time               ) 1  ro i_aclwupb    diag_physics - -
+var persistent integer i_aclwupbc ( nCells Time               ) 1  ro i_aclwupbc   diag_physics - -
+var persistent integer i_aclwupt  ( nCells Time               ) 1  ro i_aclwupt    diag_physics - -
+var persistent integer i_aclwuptc ( nCells Time               ) 1  ro i_aclwuptc   diag_physics - -
+
 var persistent real    lwcf       ( nCells Time               ) 1   o lwcf         diag_physics - -
 var persistent real    lwdnb      ( nCells Time               ) 1   o lwdnb        diag_physics - -
 var persistent real    lwdnbc     ( nCells Time               ) 1   o lwdnbc       diag_physics - -
@@ -629,6 +694,14 @@
 var persistent real    lwupbc     ( nCells Time               ) 1   o lwupbc       diag_physics - -
 var persistent real    lwupt      ( nCells Time               ) 1   o lwupt        diag_physics - -
 var persistent real    lwuptc     ( nCells Time               ) 1   o lwuptc       diag_physics - -
+var persistent real    aclwdnb    ( nCells Time               ) 1  ro aclwdnb      diag_physics - -
+var persistent real    aclwdnbc   ( nCells Time               ) 1  ro aclwdnbc     diag_physics - -
+var persistent real    aclwdnt    ( nCells Time               ) 1  ro aclwdnt      diag_physics - -
+var persistent real    aclwdntc   ( nCells Time               ) 1  ro aclwdntc     diag_physics - -
+var persistent real    aclwupb    ( nCells Time               ) 1  ro aclwupb      diag_physics - -
+var persistent real    aclwupbc   ( nCells Time               ) 1  ro aclwupbc     diag_physics - -
+var persistent real    aclwupt    ( nCells Time               ) 1  ro aclwupt      diag_physics - -
+var persistent real    aclwuptc   ( nCells Time               ) 1  ro aclwuptc     diag_physics - -
 var persistent real    olrtoa     ( nCells Time               ) 1   o olrtoa       diag_physics - -
 var persistent real    glw        ( nCells Time               ) 1  ro glw          diag_physics - -
 
@@ -645,9 +718,9 @@
 %--------------------------------------------------------------------------------------------------
 
 %INFRARED ABSORPTION:
-var persistent real absnxt  ( nVertLevels   cam_dim1      nCells Time ) 1 - absnxt diag_physics - -
-var persistent real abstot  ( nVertLevelsP1 nVertLevelsP1 nCells Time ) 1 - abstot diag_physics - -
-var persistent real emstot  ( nVertLevelsP1 nCells Time               ) 1 - emstot diag_physics - -
+var persistent real absnxt  ( nVertLevels   cam_dim1      nCells Time ) 1 r absnxt diag_physics - -
+var persistent real abstot  ( nVertLevelsP1 nVertLevelsP1 nCells Time ) 1 r abstot diag_physics - -
+var persistent real emstot  ( nVertLevelsP1 nCells Time               ) 1 r emstot diag_physics - -
 
 % OZONE:
 var persistent real    pin      ( nOznLevels nCells         ) 0 -  pin       mesh  - -

Modified: branches/ocean_projects/accgm/src/core_nhyd_atmos/mpas_atm_mpas_core.F
===================================================================
--- branches/ocean_projects/accgm/src/core_nhyd_atmos/mpas_atm_mpas_core.F        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/core_nhyd_atmos/mpas_atm_mpas_core.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -499,11 +499,6 @@
 
       call atm_timestep(domain, dt, timeStamp, itimestep)
 
-#ifdef DO_PHYSICS
-      !update physics diagnostics at the end of dynamic time-step:
-      if(moist_physics) call physics_update(domain,dt)
-#endif
-
    end subroutine atm_do_timestep
    
    

Modified: branches/ocean_projects/accgm/src/core_nhyd_atmos/mpas_atm_time_integration.F
===================================================================
--- branches/ocean_projects/accgm/src/core_nhyd_atmos/mpas_atm_time_integration.F        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/core_nhyd_atmos/mpas_atm_time_integration.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -395,11 +395,24 @@
            block =&gt; block % next
         end do
 
-!... call to parameterizations of cloud microphysics:
+!... call to parameterizations of cloud microphysics. calculation of the tendency of water vapor to horizontal and
+!... vertical advection needed for the Tiedtke parameterization of convection.
 #ifdef DO_PHYSICS
       block =&gt; domain % blocklist
       do while(associated(block))
 
+         !NOTE: The calculation of the tendency due to horizontal and vertical advection for the water vapor mixing ratio
+         !requires that the subroutine atm_advance_scalars_mono was called on the third Runge Kutta step, so that a halo
+         !update for the scalars at time_levs(1) is applied. A halo update for the scalars at time_levs(2) is done above. 
+         if(config_monotonic) then
+            block % tend_physics % rqvdynten % array(:,:) = &amp;
+                 ( block % state % time_levs(2) % state % scalars % array(block % state % time_levs(2) % state % index_qv,:,:)   &amp;
+                 - block % state % time_levs(1) % state % scalars % array(block % state % time_levs(1) % state % index_qv,:,:) ) &amp;
+                 / config_dt
+         else
+            block % tend_physics % rqvdynten % array(:,:) = 0._RKIND
+         endif
+
          !simply set to zero negative mixing ratios of different water species (for now):
          where ( block % state % time_levs(2) % state % scalars % array(:,:,:) .lt. 0.) &amp;
             block % state % time_levs(2) % state % scalars % array(:,:,:) = 0.


Property changes on: branches/ocean_projects/accgm/src/core_ocean
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean:754-986
/branches/ocean_projects/rayleigh/src/core_ocean:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean:704-745
/branches/source_renaming/src/core_ocean:1082-1113
/branches/time_manager/src/core_ocean:924-962

Modified: branches/ocean_projects/accgm/src/core_ocean/Makefile
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/Makefile        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/core_ocean/Makefile        2012-03-20 15:59:44 UTC (rev 1682)
@@ -36,6 +36,15 @@
            mpas_ocn_vmix_coefs_tanh.o \
            mpas_ocn_restoring.o \
            mpas_ocn_tendency.o \
+           mpas_ocn_tracer_advection.o \
+           mpas_ocn_tracer_advection_std.o \
+           mpas_ocn_tracer_advection_std_hadv.o \
+           mpas_ocn_tracer_advection_std_vadv.o \
+           mpas_ocn_tracer_advection_std_vadv2.o \
+           mpas_ocn_tracer_advection_std_vadv3.o \
+           mpas_ocn_tracer_advection_std_vadv4.o \
+           mpas_ocn_tracer_advection_mono.o \
+           mpas_ocn_tracer_advection_helpers.o \
        mpas_ocn_time_integration.o \
        mpas_ocn_time_integration_rk4.o \
        mpas_ocn_time_integration_split.o \
@@ -120,6 +129,24 @@
 
 mpas_ocn_tracer_hmix_del4.o:
 
+mpas_ocn_tracer_advection.o: mpas_ocn_tracer_advection_std.o mpas_ocn_tracer_advection_mono.o
+
+mpas_ocn_tracer_advection_std.o: mpas_ocn_tracer_advection_std_hadv.o mpas_ocn_tracer_advection_std_vadv.o
+
+mpas_ocn_tracer_advection_std_hadv.o: mpas_ocn_tracer_advection_helpers.o
+
+mpas_ocn_tracer_advection_std_vadv.o: mpas_ocn_tracer_advection_std_vadv2.o mpas_ocn_tracer_advection_std_vadv3.o mpas_ocn_tracer_advection_std_vadv4.o
+
+mpas_ocn_tracer_advection_std_vadv2.o: mpas_ocn_tracer_advection_helpers.o
+
+mpas_ocn_tracer_advection_std_vadv3.o: mpas_ocn_tracer_advection_helpers.o
+
+mpas_ocn_tracer_advection_std_vadv4.o: mpas_ocn_tracer_advection_helpers.o
+
+mpas_ocn_tracer_advection_mono.o: mpas_ocn_tracer_advection_helpers.o
+
+mpas_ocn_tracer_advection_helpers.o:
+
 mpas_ocn_restoring.o:
 
 mpas_ocn_vmix.o: mpas_ocn_vmix_coefs_const.o mpas_ocn_vmix_coefs_rich.o mpas_ocn_vmix_coefs_tanh.o
@@ -170,6 +197,15 @@
                                           mpas_ocn_vmix_coefs_rich.o \
                                           mpas_ocn_vmix_coefs_tanh.o \
                                           mpas_ocn_restoring.o \
+                                          mpas_ocn_tracer_advection.o \
+                                          mpas_ocn_tracer_advection_std.o \
+                                          mpas_ocn_tracer_advection_std_hadv.o \
+                                          mpas_ocn_tracer_advection_std_vadv.o \
+                                          mpas_ocn_tracer_advection_std_vadv2.o \
+                                          mpas_ocn_tracer_advection_std_vadv3.o \
+                                          mpas_ocn_tracer_advection_std_vadv4.o \
+                                          mpas_ocn_tracer_advection_mono.o \
+                                          mpas_ocn_tracer_advection_helpers.o \
                                           mpas_ocn_tendency.o \
                                           mpas_ocn_time_integration.o \
                                           mpas_ocn_time_integration_rk4.o \

Modified: branches/ocean_projects/accgm/src/core_ocean/Registry
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/Registry        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/core_ocean/Registry        2012-03-20 15:59:44 UTC (rev 1682)
@@ -11,6 +11,8 @@
 namelist character sw_model config_run_duration        none
 namelist integer   sw_model config_stats_interval      100
 namelist logical   sw_model config_initial_stats       false
+namelist logical   sw_model config_prescribe_velocity  false
+namelist logical   sw_model config_prescribe_thickness false
 namelist character io       config_input_name          grid.nc
 namelist character io       config_output_name         output.nc
 namelist character io       config_restart_name        restart.nc
@@ -44,9 +46,9 @@
 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.0
 namelist logical   hmix     config_rayleigh_friction    false
 namelist real      hmix     config_rayleigh_damping_coeff 0.0
+namelist real      hmix     config_apvm_scale_factor      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.
@@ -66,11 +68,12 @@
 namelist real      vmix_tanh    config_zWidth_tanh      100
 namelist character eos       config_eos_type            linear
 namelist character advection config_vert_tracer_adv     stencil
-namelist integer   advection config_vert_tracer_adv_order 4
-namelist integer   advection config_tracer_adv_order    2
+namelist integer   advection config_vert_tracer_adv_order  4
+namelist integer   advection config_horiz_tracer_adv_order 2
 namelist integer   advection config_thickness_adv_order 2
-namelist logical   advection config_positive_definite   false
+namelist real      advection config_coef_3rd_order      0.25
 namelist logical   advection config_monotonic           false
+namelist logical   advection config_check_monotonicity  false
 namelist logical   restore   config_restoreTS           false
 namelist real      restore   config_restoreT_timescale  90.0
 namelist real      restore   config_restoreS_timescale  90.0
@@ -82,6 +85,7 @@
 dim nEdges nEdges
 dim maxEdges maxEdges
 dim maxEdges2 maxEdges2
+dim nAdvectionCells maxEdges2+0
 dim nVertices nVertices
 dim TWO 2
 dim R3 3
@@ -149,9 +153,17 @@
 var persistent real    h_s ( nCells ) 0 iro h_s mesh - -
 
 % Space needed for advection
-var persistent real    deriv_two ( FIFTEEN TWO nEdges ) 0 - deriv_two mesh - -
-var persistent integer advCells ( TWENTYONE nCells ) 0 - advCells mesh - -
+var persistent real    deriv_two ( maxEdges2 TWO nEdges ) 0 - deriv_two mesh - -
 
+% Added for monotonic advection scheme
+var persistent real    adv_coefs ( nAdvectionCells nEdges ) 0 - adv_coefs mesh - -
+var persistent real    adv_coefs_2nd ( nAdvectionCells nEdges ) 0 - adv_coefs_2nd mesh - -
+var persistent real    adv_coefs_3rd ( nAdvectionCells nEdges ) 0 - adv_coefs_3rd mesh - -
+var persistent integer advCellsForEdge ( nAdvectionCells nEdges ) 0 - advCellsForEdge mesh - -
+var persistent integer nAdvCellsForEdge ( nEdges ) 0 - nAdvCellsForEdge mesh - -
+var persistent integer highOrderAdvectionMask ( nVertLevels nEdges ) 0 - highOrderAdvectionMask mesh - -
+var persistent integer lowOrderAdvectionMask ( nVertLevels nEdges ) 0 - lowOrderAdvectionMask mesh - -
+
 % !! NOTE: the following arrays are needed to allow the use
 % !! of the module_advection.F w/o alteration
 % Space needed for deformation calculation weights
@@ -214,15 +226,15 @@
 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    Vor_edge ( nVertLevels nEdges Time ) 2 - Vor_edge state - -
 var persistent real    h_edge ( nVertLevels nEdges Time ) 2 - h_edge 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 o pv_vertex state - -
-var persistent real    pv_cell ( nVertLevels nCells Time ) 2 o pv_cell state - -
+var persistent real    Vor_vertex ( nVertLevels nVertices Time ) 2 o Vor_vertex state - -
+var persistent real    Vor_cell ( nVertLevels nCells Time ) 2 o Vor_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 - -
@@ -236,8 +248,8 @@
 % Other diagnostic variables: neither read nor written to any files
 var persistent real    vh ( nVertLevels nEdges Time ) 2 - vh state - -
 var persistent real    circulation ( nVertLevels nVertices Time ) 2 - circulation state - -
-var persistent real    gradPVt ( nVertLevels nEdges Time ) 2 - gradPVt state - -
-var persistent real    gradPVn ( nVertLevels nEdges Time ) 2 - gradPVn state - -
+var persistent real    gradVor_t ( nVertLevels nEdges Time ) 2 - gradVor_t state - -
+var persistent real    gradVor_n ( nVertLevels nEdges Time ) 2 - gradVor_n state - -
 
 % Globally reduced diagnostic variables: only written to output
 var persistent real    areaCellGlobal ( Time ) 2 o areaCellGlobal state - -


Property changes on: branches/ocean_projects/accgm/src/core_ocean/Registry
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/Registry:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/Registry:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/Registry:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/Registry:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/Registry:754-986
/branches/ocean_projects/performance/src/core_ocean/Registry:1120-1372
/branches/ocean_projects/rayleigh/src/core_ocean/Registry:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/Registry:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/Registry:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/Registry:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/Registry:704-745
/branches/source_renaming/src/core_ocean/Registry:1082-1113
/branches/time_manager/src/core_ocean/Registry:924-962

Modified: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_advection.F
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_advection.F        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_advection.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -9,19 +9,25 @@
    contains
 
 
-   subroutine ocn_initialize_advection_rk( grid )!{{{
+   subroutine ocn_initialize_advection_rk( grid, err )!{{{
                                       
 !
 ! compute the cell coefficients for the polynomial fit.
 ! this is performed during setup for model integration.
 ! WCS, 31 August 2009
 !
+! Described in:
+! Skamarock, W. C., &amp; Gassmann, A. (2011). 
+! Conservative Transport Schemes for Spherical Geodesic Grids: High-Order Flux Operators for ODE-Based Time Integration. 
+! Monthly Weather Review, 139(9), 2962-2975. doi:10.1175/MWR-D-10-05056.1
+!
       implicit none
 
       type (mesh_type), intent(in) :: grid
+      integer, intent(out) :: err
 
       real (kind=RKIND), dimension(:,:,:), pointer :: deriv_two
-      integer, dimension(:,:), pointer :: advCells
+      integer, dimension(:), pointer :: advCells
 
 !  local variables
 
@@ -50,9 +56,7 @@
 
       integer :: cell1, cell2
       integer, parameter :: polynomial_order = 2
-!      logical, parameter :: debug = .true.
       logical, parameter :: debug = .false.
-!      logical, parameter :: least_squares = .false.
       logical, parameter :: least_squares = .true.
       logical :: add_the_cell, do_the_cell
 
@@ -61,11 +65,19 @@
       real (kind=RKIND) :: rcell, cos2t, costsint, sin2t
       real (kind=RKIND), dimension(grid%maxEdges) :: angle_2d
 
-!---
+!---    
+      err = 0
 
+      if(polynomial_order &gt; 2) then
+        write (*,*) 'Polynomial for second derivitave can only be 2'
+        err = 1
+        return
+      end if
+
       pii = 2.*asin(1.0)
 
-      advCells =&gt; grid % advCells % array
+!     advCells =&gt; grid % advCells % array
+      allocate(advCells(grid % maxEdges2))
       deriv_two =&gt; grid % deriv_two % array
       deriv_two(:,:,:) = 0.
 
@@ -93,7 +105,7 @@
             end do
          end if
  
-         advCells(1,iCell) = n
+         advCells(1) = n
 
 !  check to see if we are reaching outside the halo
 
@@ -110,10 +122,10 @@
          if ( grid % on_a_sphere ) then
 
             do i=1,n
-               advCells(i+1,iCell) = cell_list(i)
-               xc(i) = grid % xCell % array(advCells(i+1,iCell))/a
-               yc(i) = grid % yCell % array(advCells(i+1,iCell))/a
-               zc(i) = grid % zCell % array(advCells(i+1,iCell))/a
+               advCells(i+1) = cell_list(i)
+               xc(i) = grid % xCell % array(advCells(i+1))/a
+               yc(i) = grid % yCell % array(advCells(i+1))/a
+               zc(i) = grid % zCell % array(advCells(i+1))/a
             end do
 
             theta_abs(iCell) =  pii/2. - sphere_angle( xc(1), yc(1), zc(1),  &amp;


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_advection.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_advection.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_advection.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_advection.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_advection.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_advection.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_advection.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_advection.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_advection.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_advection.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_advection.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_advection.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_advection.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_advection.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_equation_of_state.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_equation_of_state.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_equation_of_state.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_equation_of_state.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_equation_of_state.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_equation_of_state.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_equation_of_state.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_equation_of_state.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_equation_of_state.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_equation_of_state.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_equation_of_state.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_equation_of_state.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_equation_of_state.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_equation_of_state.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_equation_of_state_jm.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_equation_of_state_jm.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_equation_of_state_jm.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_equation_of_state_jm.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_equation_of_state_jm.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_equation_of_state_jm.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_equation_of_state_jm.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_equation_of_state_jm.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_equation_of_state_jm.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_equation_of_state_jm.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_equation_of_state_jm.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_equation_of_state_jm.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_equation_of_state_jm.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_equation_of_state_jm.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_equation_of_state_linear.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_equation_of_state_linear.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_equation_of_state_linear.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_equation_of_state_linear.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_equation_of_state_linear.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_equation_of_state_linear.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_equation_of_state_linear.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_equation_of_state_linear.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_equation_of_state_linear.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_equation_of_state_linear.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_equation_of_state_linear.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_equation_of_state_linear.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_equation_of_state_linear.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_equation_of_state_linear.F:924-962

Modified: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_global_diagnostics.F
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_global_diagnostics.F        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_global_diagnostics.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -46,8 +46,8 @@
 
       real (kind=RKIND) :: volumeCellGlobal, volumeEdgeGlobal, CFLNumberGlobal, localCFL, localSum, areaCellGlobal, areaEdgeGlobal, areaTriangleGlobal
       real (kind=RKIND), dimension(:), pointer ::  areaCell, dcEdge, dvEdge, areaTriangle, areaEdge
-      real (kind=RKIND), dimension(:,:), pointer :: h, u, v, h_edge, circulation, vorticity, ke, pv_edge, pv_vertex, &amp;
-         pv_cell, gradPVn, gradPVt, pressure, MontPot, wTop, rho, tracerTemp
+      real (kind=RKIND), dimension(:,:), pointer :: h, u, v, h_edge, circulation, vorticity, ke, Vor_edge, Vor_vertex, &amp;
+         Vor_cell, gradVor_n, gradVor_t, pressure, MontPot, wTop, rho, tracerTemp
       real (kind=RKIND), dimension(:,:,:), pointer :: tracers
       
       real (kind=RKIND), dimension(kMaxVariables) :: sums, mins, maxes, averages, verticalSumMins, verticalSumMaxes, reductions
@@ -93,11 +93,11 @@
          circulation =&gt; state % circulation % array
          vorticity =&gt; state % vorticity % array
          ke =&gt; state % ke % array
-         pv_edge =&gt; state % pv_edge % array
-         pv_vertex =&gt; state % pv_vertex % array
-         pv_cell =&gt; state % pv_cell % array
-         gradPVn =&gt; state % gradPVn % array
-         gradPVt =&gt; state % gradPVt % array
+         Vor_edge =&gt; state % Vor_edge % array
+         Vor_vertex =&gt; state % Vor_vertex % array
+         Vor_cell =&gt; state % Vor_cell % array
+         gradVor_n =&gt; state % gradVor_n % array
+         gradVor_t =&gt; state % gradVor_t % array
          MontPot =&gt; state % MontPot % array
          pressure =&gt; state % pressure % array
 
@@ -176,10 +176,10 @@
          verticalSumMins(variableIndex) = min(verticalSumMins(variableIndex), verticalSumMins_tmp(variableIndex))
          verticalSumMaxes(variableIndex) = max(verticalSumMaxes(variableIndex), verticalSumMaxes_tmp(variableIndex))
 
-         ! pv_edge
+         ! Vor_edge
          variableIndex = variableIndex + 1
          call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels, nEdgesSolve, areaEdge(1:nEdgesSolve), h_edge(:,1:nEdgesSolve), &amp;
-            pv_edge(:,1:nEdgesSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &amp;
+            Vor_edge(:,1:nEdgesSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &amp;
             verticalSumMaxes_tmp(variableIndex))
          sums(variableIndex) = sums(variableIndex) + sums_tmp(variableIndex)
          mins(variableIndex) = min(mins(variableIndex), mins_tmp(variableIndex))
@@ -187,10 +187,10 @@
          verticalSumMins(variableIndex) = min(verticalSumMins(variableIndex), verticalSumMins_tmp(variableIndex))
          verticalSumMaxes(variableIndex) = max(verticalSumMaxes(variableIndex), verticalSumMaxes_tmp(variableIndex))
 
-         ! pv_vertex
+         ! Vor_vertex
          variableIndex = variableIndex + 1
          call ocn_compute_field_area_weighted_local_stats(dminfo, nVertLevels, nVerticesSolve, areaTriangle(1:nVerticesSolve), &amp;
-            pv_vertex(:,1:nVerticesSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), &amp;
+            Vor_vertex(:,1:nVerticesSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), &amp;
             verticalSumMins_tmp(variableIndex), verticalSumMaxes_tmp(variableIndex))
          sums(variableIndex) = sums(variableIndex) + sums_tmp(variableIndex)
          mins(variableIndex) = min(mins(variableIndex), mins_tmp(variableIndex))
@@ -198,10 +198,10 @@
          verticalSumMins(variableIndex) = min(verticalSumMins(variableIndex), verticalSumMins_tmp(variableIndex))
          verticalSumMaxes(variableIndex) = max(verticalSumMaxes(variableIndex), verticalSumMaxes_tmp(variableIndex))
 
-         ! pv_cell
+         ! Vor_cell
          variableIndex = variableIndex + 1
          call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels, nCellsSolve, areaCell(1:nCellsSolve), h(:,1:nCellsSolve), &amp;
-            pv_cell(:,1:nCellsSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &amp;
+            Vor_cell(:,1:nCellsSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &amp;
             verticalSumMaxes_tmp(variableIndex))
          sums(variableIndex) = sums(variableIndex) + sums_tmp(variableIndex)
          mins(variableIndex) = min(mins(variableIndex), mins_tmp(variableIndex))
@@ -209,10 +209,10 @@
          verticalSumMins(variableIndex) = min(verticalSumMins(variableIndex), verticalSumMins_tmp(variableIndex))
          verticalSumMaxes(variableIndex) = max(verticalSumMaxes(variableIndex), verticalSumMaxes_tmp(variableIndex))
 
-         ! gradPVn
+         ! gradVor_n
          variableIndex = variableIndex + 1
          call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels, nEdgesSolve, areaEdge(1:nEdgesSolve), h_edge(:,1:nEdgesSolve), &amp;
-            gradPVn(:,1:nEdgesSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &amp;
+            gradVor_n(:,1:nEdgesSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &amp;
             verticalSumMaxes_tmp(variableIndex))
          sums(variableIndex) = sums(variableIndex) + sums_tmp(variableIndex)
          mins(variableIndex) = min(mins(variableIndex), mins_tmp(variableIndex))
@@ -220,10 +220,10 @@
          verticalSumMins(variableIndex) = min(verticalSumMins(variableIndex), verticalSumMins_tmp(variableIndex))
          verticalSumMaxes(variableIndex) = max(verticalSumMaxes(variableIndex), verticalSumMaxes_tmp(variableIndex))
 
-         ! gradPVt
+         ! gradVor_t
          variableIndex = variableIndex + 1
          call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels, nEdgesSolve, areaEdge(1:nEdgesSolve), h_edge(:,1:nEdgesSolve), &amp;
-            gradPVt(:,1:nEdgesSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &amp;
+            gradVor_t(:,1:nEdgesSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &amp;
             verticalSumMaxes_tmp(variableIndex))
          sums(variableIndex) = sums(variableIndex) + sums_tmp(variableIndex)
          mins(variableIndex) = min(mins(variableIndex), mins_tmp(variableIndex))
@@ -374,23 +374,23 @@
       variableIndex = variableIndex + 1
       averages(variableIndex) = sums(variableIndex)/volumeCellGlobal
 
-      ! pv_edge
+      ! Vor_edge
       variableIndex = variableIndex + 1
       averages(variableIndex) = sums(variableIndex)/volumeEdgeGlobal
 
-      ! pv_vertex
+      ! Vor_vertex
       variableIndex = variableIndex + 1
       averages(variableIndex) = sums(variableIndex)/(areaTriangleGlobal*nVertLevels)
 
-      ! pv_cell
+      ! Vor_cell
       variableIndex = variableIndex + 1
       averages(variableIndex) = sums(variableIndex)/volumeCellGlobal
 
-      ! gradPVn
+      ! gradVor_n
       variableIndex = variableIndex + 1
       averages(variableIndex) = sums(variableIndex)/volumeEdgeGlobal
 
-      ! gradPVt
+      ! gradVor_t
       variableIndex = variableIndex + 1
       averages(variableIndex) = sums(variableIndex)/volumeEdgeGlobal
 


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_global_diagnostics.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_global_diagnostics.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_global_diagnostics.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_global_diagnostics.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_global_diagnostics.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_global_diagnostics.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_global_diagnostics.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_global_diagnostics.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_global_diagnostics.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_global_diagnostics.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_global_diagnostics.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_global_diagnostics.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_global_diagnostics.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_global_diagnostics.F:924-962

Modified: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_mpas_core.F
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_mpas_core.F        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_mpas_core.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -45,6 +45,7 @@
    subroutine mpas_core_init(domain, startTimeStamp)!{{{
 
       use mpas_grid_types
+      use mpas_ocn_tracer_advection
 
       implicit none
 
@@ -88,6 +89,9 @@
       call ocn_tendency_init(err_tmp)
       err = ior(err,err_tmp)
 
+      call mpas_ocn_tracer_advection_init(err_tmp)
+      err = ior(err,err_tmp)
+
       call mpas_timer_init(domain)
 
       if(err.eq.1) then
@@ -134,7 +138,10 @@
 
       block =&gt; domain % blocklist
       do while (associated(block))
-         call mpas_init_block(block, block % mesh, dt)
+         call mpas_init_block(block, block % mesh, dt, err)
+         if(err.eq.1) then
+             call mpas_dmpar_abort(dminfo)
+         endif
          block % state % time_levs(1) % state % xtime % scalar = startTimeStamp 
          block =&gt; block % next
       end do
@@ -213,19 +220,27 @@
 
    end subroutine ocn_simulation_clock_init!}}}
 
-   subroutine mpas_init_block(block, mesh, dt)!{{{
+   subroutine mpas_init_block(block, mesh, dt, err)!{{{
    
       use mpas_grid_types
       use mpas_rbf_interpolation
       use mpas_vector_reconstruction
+      use mpas_ocn_tracer_advection
+      use ocn_advection
    
       implicit none
    
       type (block_type), intent(inout) :: block
       type (mesh_type), intent(inout) :: mesh
       real (kind=RKIND), intent(in) :: dt
+      integer, intent(out) :: err
       integer :: i, iEdge, iCell, k
+      integer :: err1
    
+      call ocn_initialize_advection_rk(mesh, err)
+      call mpas_ocn_tracer_advection_coefficients(mesh, err1)
+      err = ior(err, err1)
+
       call ocn_time_average_init(block % state % time_levs(1) % state)
    
       call mpas_timer_start(&quot;diagnostic solve&quot;, .false., initDiagSolveTimer)
@@ -272,29 +287,13 @@
               :block % mesh % nVertLevels,iCell) =  0.0
 ! mrp changed to 0
 !              :block % mesh % nVertLevels,iCell) =  -1e34
-
-! mrp 110516, added just to test for conservation of tracers
-         block % state % time_levs(1) % state % tracers % array(block % state % time_levs(1) % state % index_tracer1,:,iCell) = 1.0
-
       end do
 
-      if (.not. config_do_restart) then 
-
-! mrp 110808 add, so that variables are copied to * variables for split explicit
-          do i=2,nTimeLevs
-             call mpas_copy_state(block % state % time_levs(i) % state, &amp;
+      do i=2,nTimeLevs
+        call mpas_copy_state(block % state % time_levs(i) % state, &amp;
                              block % state % time_levs(1) % state)
-          end do
-! mrp 110808 add end
+      end do
 
-
-      else
-          do i=2,nTimeLevs
-             call mpas_copy_state(block % state % time_levs(i) % state, &amp;
-                             block % state % time_levs(1) % state)
-          end do
-      endif
-
    end subroutine mpas_init_block!}}}
    
    subroutine mpas_core_run(domain, output_obj, output_frame)!{{{
@@ -508,8 +507,8 @@
 
       integer :: iTracer, cell, cell1, cell2
       real (kind=RKIND) :: uhSum, hSum, hEdge1
-      real (kind=RKIND), dimension(:), pointer :: &amp;
-         referenceBottomDepth, referenceBottomDepthTopOfCell
+      real (kind=RKIND), dimension(:), pointer :: referenceBottomDepth, referenceBottomDepthTopOfCell
+         
       real (kind=RKIND), dimension(:,:), pointer :: h
       integer :: nVertLevels
 
@@ -732,8 +731,12 @@
             if (boundaryEdge(k,iEdge).eq.1) then
                boundaryCell(k,cellsOnEdge(1,iEdge)) = 1
                boundaryCell(k,cellsOnEdge(2,iEdge)) = 1
-               cellMask(k,cellsOnEdge(1,iEdge)) = 0
-               cellMask(k,cellsOnEdge(2,iEdge)) = 0
+               if(maxLevelCell(cellsOnEdge(1,iEdge)) &gt; k) then
+                   cellMask(k, cellsOnEdge(1,iEdge)) = 0
+               end if
+               if(maxLevelCell(cellsOnEdge(2,iEdge)) &gt; k) then
+                   cellMask(k, cellsOnEdge(2,iEdge)) = 0
+               end if
                boundaryVertex(k,verticesOnEdge(1,iEdge)) = 1
                boundaryVertex(k,verticesOnEdge(2,iEdge)) = 1
                vertexMask(k,verticesOnEdge(1,iEdge)) = 0


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_mpas_core.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_mpas_core.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_mpas_core.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_mpas_core.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_mpas_core.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_mpas_core.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_mpas_core.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_mpas_core.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_mpas_core.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_mpas_core.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_mpas_core.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_mpas_core.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_mpas_core.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_mpas_core.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_restoring.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_restoring.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_restoring.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_restoring.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_restoring.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_restoring.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_restoring.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_restoring.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_restoring.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_restoring.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_restoring.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_restoring.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_restoring.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_restoring.F:924-962

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-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tendency.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -21,6 +21,8 @@
    use mpas_constants
    use mpas_timer
 
+   use mpas_ocn_tracer_advection
+
    use ocn_thick_hadv
    use ocn_thick_vadv
 
@@ -97,22 +99,12 @@
 !
 !-----------------------------------------------------------------------
 
-   subroutine ocn_tend_h(tend, s, d, grid)!{{{
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   ! Compute height and normal wind tendencies, as well as diagnostic variables
-   !
-   ! Input: s - current model state
-   !        grid - grid metadata
-   !
-   ! Output: tend - computed tendencies for prognostic variables
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
+   subroutine ocn_tend_h(tend, s, grid)!{{{
       implicit none
 
-      type (tend_type), intent(inout) :: tend
-      type (state_type), intent(in) :: s
-      type (diagnostics_type), intent(in) :: d
-      type (mesh_type), intent(in) :: grid
+      type (tend_type), intent(inout) :: tend !&lt; Input/Output: Tendency structure
+      type (state_type), intent(in) :: s !&lt; Input: State information
+      type (mesh_type), intent(in) :: grid !&lt; Input: Grid information
 
       real (kind=RKIND), dimension(:,:), pointer :: h_edge, u, wTop, tend_h
 
@@ -166,25 +158,16 @@
 !-----------------------------------------------------------------------
 
    subroutine ocn_tend_u(tend, s, d, grid)!{{{
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   ! Compute height and normal wind tendencies, as well as diagnostic variables
-   !
-   ! Input: s - current model state
-   !        grid - grid metadata
-   !
-   ! Output: tend - computed tendencies for prognostic variables
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
       implicit none
 
-      type (tend_type), intent(inout) :: tend
-      type (state_type), intent(in) :: s
-      type (diagnostics_type), intent(in) :: d
-      type (mesh_type), intent(in) :: grid
+      type (tend_type), intent(inout) :: tend !&lt; Input/Output: Tendency structure
+      type (state_type), intent(in) :: s !&lt; Input: State information
+      type (diagnostics_type), intent(in) :: d !&lt; Input: Diagnostic information
+      type (mesh_type), intent(in) :: grid !&lt; Input: Grid information
 
       real (kind=RKIND), dimension(:,:), pointer :: &amp;
         h_edge, h, u, rho, zMid, pressure, &amp;
-        tend_u, circulation, vorticity, ke, ke_edge, pv_edge, &amp;
+        tend_u, circulation, vorticity, ke, ke_edge, Vor_edge, &amp;
         MontPot, wTop, divergence, vertViscTopOfEdge
 
       real (kind=RKIND), dimension(:,:), pointer :: u_src
@@ -202,7 +185,7 @@
       divergence  =&gt; s % divergence % array
       ke          =&gt; s % ke % array
       ke_edge     =&gt; s % ke_edge % array
-      pv_edge     =&gt; s % pv_edge % array
+      Vor_edge     =&gt; s % Vor_edge % array
       MontPot     =&gt; s % MontPot % array
       pressure    =&gt; s % pressure % array
       vertViscTopOfEdge =&gt; d % vertViscTopOfEdge % array
@@ -222,7 +205,7 @@
       !
 
       call mpas_timer_start(&quot;coriolis&quot;, .false., velCorTimer)
-      call ocn_vel_coriolis_tend(grid, pv_edge, h_edge, u, ke, tend_u, err)
+      call ocn_vel_coriolis_tend(grid, Vor_edge, h_edge, u, ke, tend_u, err)
       call mpas_timer_stop(&quot;coriolis&quot;, velCorTimer)
 
       !
@@ -267,7 +250,7 @@
       !
       if (.not.config_implicit_vertical_mix) then
           call mpas_timer_start(&quot;explicit vmix&quot;, .false., velExpVmixTimer)
-          call ocn_vel_vmix_tend_explicit(grid, u, h_edge, vertvisctopofedge, tend_u, err)
+!          call ocn_vel_vmix_tend_explicit(grid, u, h_edge, vertvisctopofedge, tend_u, err)
           call mpas_timer_stop(&quot;explicit vmix&quot;, velExpVmixTimer)
       endif
       call mpas_timer_stop(&quot;ocn_tend_u&quot;)
@@ -286,31 +269,21 @@
 !&gt;  This routine computes the scalar (tracer) tendency for the ocean
 !
 !-----------------------------------------------------------------------
-
-   subroutine ocn_tend_scalar(tend, s, d, grid)!{{{
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   !
-   ! Input: s - current model state
-   !        grid - grid metadata
-   !        note: the variable s % tracers really contains the tracers, 
-   !              not tracers*h
-   !
-   ! Output: tend - computed scalar tendencies
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
+   subroutine ocn_tend_scalar(tend, s, d, grid, dt)!{{{
       implicit none
 
-      type (tend_type), intent(inout) :: tend
-      type (state_type), intent(in) :: s
-      type (diagnostics_type), intent(in) :: d
-      type (mesh_type), intent(in) :: grid
+      type (tend_type), intent(inout) :: tend !&lt; Input/Output: Tendency structure
+      type (state_type), intent(in) :: s !&lt; Input: State information
+      type (diagnostics_type), intent(in) :: d !&lt; Input: Diagnostic information
+      type (mesh_type), intent(in) :: grid !&lt; Input: Grid information
+      real (kind=RKIND), intent(in) :: dt !&lt; Input: Time step
 
       real (kind=RKIND), dimension(:,:), pointer :: &amp;
-        u,h,wTop, h_edge, vertDiffTopOfCell
+        u, h,wTop, h_edge, vertDiffTopOfCell, tend_h, uh
       real (kind=RKIND), dimension(:,:,:), pointer :: &amp;
         tracers, tend_tr
 
-      integer :: err
+      integer :: err, iEdge, k
 
       call mpas_timer_start(&quot;ocn_tend_scalar&quot;)
 
@@ -322,7 +295,16 @@
       vertDiffTopOfCell =&gt; d % vertDiffTopOfCell % array
 
       tend_tr     =&gt; tend % tracers % array
+      tend_h      =&gt; tend % h % array
 
+      allocate(uh(grid % nVertLevels, grid % nEdges+1))
+
+      do iEdge = 1, grid % nEdges
+        do k = 1, grid % nVertLevels
+            uh(k, iEdge) = u(k, iEdge) * h_edge(k, iEdge)
+        end do
+      end do
+
       !
       ! initialize tracer tendency (RHS of tracer equation) to zero.
       !
@@ -336,20 +318,13 @@
       ! and then change maxLevelEdgeTop to maxLevelEdgeBot in the following section.
       ! tracer_edge at the boundary will also need to be defined for flux boundaries.
 
-      call mpas_timer_start(&quot;hadv&quot;, .false., tracerHadvTimer)
-      call ocn_tracer_hadv_tend(grid, u, h_edge, tracers, tend_tr, err)
-      call mpas_timer_stop(&quot;hadv&quot;, tracerHadvTimer)
+      ! Monotonoic Advection, or standard advection
+      call mpas_timer_start(&quot;adv&quot;, .false., tracerHadvTimer)
+      call mpas_ocn_tracer_advection_tend(tracers, uh, wTop, h, h, dt, grid, tend_h, tend_tr)
+      call mpas_timer_stop(&quot;adv&quot;, tracerHadvTimer)
 
 
       !
-      ! tracer tendency: vertical advection term -d/dz( h \phi w)
-      !
-
-      call mpas_timer_start(&quot;vadv&quot;, .false., tracerVadvTimer)
-      call ocn_tracer_vadv_tend(grid, h, wtop, tracers, tend_tr, err)
-      call mpas_timer_stop(&quot;vadv&quot;, tracerVadvTimer)
-
-      !
       ! tracer tendency: del2 horizontal tracer diffusion, div(h \kappa_2 </font>
<font color="gray">abla \phi)
       !
       call mpas_timer_start(&quot;hmix&quot;, .false., tracerHmixTimer)
@@ -391,6 +366,8 @@
  10   format(2i8,10e20.10)
       call mpas_timer_stop(&quot;ocn_tend_scalar&quot;)
 
+      deallocate(uh)
+
    end subroutine ocn_tend_scalar!}}}
 
 !***********************************************************************
@@ -407,19 +384,11 @@
 !-----------------------------------------------------------------------
 
    subroutine ocn_diagnostic_solve(dt, s, grid)!{{{
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   ! Compute diagnostic fields used in the tendency computations
-   !
-   ! Input: grid - grid metadata
-   !
-   ! Output: s - computed diagnostics
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
       implicit none
 
-      real (kind=RKIND), intent(in) :: dt
-      type (state_type), intent(inout) :: s
-      type (mesh_type), intent(in) :: grid
+      real (kind=RKIND), intent(in) :: dt !&lt; Input: Time step
+      type (state_type), intent(inout) :: s !&lt; Input/Output: State information
+      type (mesh_type), intent(in) :: grid !&lt; Input: Grid information
 
 
       integer :: iEdge, iCell, iVertex, k, cell1, cell2, vertex1, vertex2, eoe, i, j
@@ -441,7 +410,7 @@
       real (kind=RKIND), dimension(:,:), pointer :: &amp;
         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;
+        Vor_edge, Vor_vertex, Vor_cell, gradVor_n, gradVor_t, divergence, &amp;
         rho, temperature, salinity, kev, kevc, z
       real (kind=RKIND), dimension(:,:,:), pointer :: tracers, deriv_two
       real (kind=RKIND), dimension(:,:), allocatable:: div_u
@@ -459,11 +428,11 @@
       kev         =&gt; s % kev % array
       kevc        =&gt; s % kevc % array
       ke_edge     =&gt; s % ke_edge % array
-      pv_edge     =&gt; s % pv_edge % array
-      pv_vertex   =&gt; s % pv_vertex % array
-      pv_cell     =&gt; s % pv_cell % array
-      gradPVn     =&gt; s % gradPVn % array
-      gradPVt     =&gt; s % gradPVt % array
+      Vor_edge     =&gt; s % Vor_edge % array
+      Vor_vertex   =&gt; s % Vor_vertex % array
+      Vor_cell     =&gt; s % Vor_cell % array
+      gradVor_n     =&gt; s % gradVor_n % array
+      gradVor_t     =&gt; s % gradVor_t % array
       rho         =&gt; s % rho % array
       MontPot     =&gt; s % MontPot % array
       pressure    =&gt; s % pressure % array
@@ -510,6 +479,7 @@
 
       ! initialize h_edge to avoid divide by zero and NaN problems.
       h_edge = -1.0e34
+      coef_3rd_order = config_coef_3rd_order
 
       do iEdge=1,nEdges*hadv2nd
          cell1 = cellsOnEdge(1,iEdge)
@@ -610,8 +580,9 @@
          invAreaTri1 = 1.0 / areaTriangle(vertex1)
          invAreaTri2 = 1.0 / areaTriangle(vertex2)
 
-         invAreaCell1 = 1.0 / areaCell(cell1)
-         invAreaCell2 = 1.0 / areaCell(cell2)
+         !dwj: 02/23/12 arraCell(nCells+1) is still 0, this is a temporary fix
+         invAreaCell1 = 1.0 / max(areaCell(cell1), 1.0)
+         invAreaCell2 = 1.0 / max(areaCell(cell2), 1.0)
 
          do k=1,maxLevelEdgeBot(iEdge)
             ! Compute circulation and relative vorticity at each vertex
@@ -664,7 +635,8 @@
       do iVertex = 1, nVertices*ke_vertex_flag
        do i=1,grid % vertexDegree
          iCell = cellsOnVertex(i,iVertex)
-         invAreaCell1 = 1.0 / areaCell(iCell)
+         !dwj: 02/23/12 arraCell(nCells+1) is still 0, this is a temporary fix
+         invAreaCell1 = 1.0 / max(areaCell(iCell), 1.0)
          do k=1,nVertLevels
            kevc(k,iCell) = kevc(k,iCell) + kiteAreasOnVertex(i, iVertex) * kev(k, iVertex) * invAreaCell1
          enddo
@@ -695,7 +667,7 @@
 
       !
       ! Compute height at vertices, pv at vertices, and average pv to edge locations
-      !  ( this computes pv_vertex at all vertices bounding real cells and distance-1 ghost cells )
+      !  ( this computes Vor_vertex at all vertices bounding real cells and distance-1 ghost cells )
       !
       do iVertex = 1,nVertices
          invAreaTri1 = 1.0 / areaTriangle(iVertex)
@@ -706,35 +678,36 @@
             end do
             h_vertex = h_vertex * invAreaTri1
 
-            pv_vertex(k,iVertex) = (fCoef*fVertex(iVertex) + vorticity(k,iVertex)) / h_vertex
+            Vor_vertex(k,iVertex) = (fCoef*fVertex(iVertex) + vorticity(k,iVertex)) / h_vertex
          end do
       end do
 
-      pv_cell(:,:) = 0.0
-      pv_edge(:,:) = 0.0
+      Vor_cell(:,:) = 0.0
+      Vor_edge(:,:) = 0.0
       do iVertex = 1,nVertices
          do i=1,vertexDegree
             iCell = cellsOnVertex(i,iVertex)
             iEdge = edgesOnVertex(i,iVertex)
 
-            invAreaCell1 = 1.0 / areaCell(iCell)
+            !dwj: 02/23/12 arraCell(nCells+1) is still 0, this is a temporary fix
+            invAreaCell1 = 1.0 / max(areaCell(iCell), 1.0)
 
             ! Compute pv at cell centers
-            !    ( this computes pv_cell for all real cells and distance-1 ghost cells )
+            !    ( this computes Vor_cell for all real cells and distance-1 ghost cells )
             do k = 1,maxLevelCell(iCell)
-               pv_cell(k,iCell) = pv_cell(k,iCell) + kiteAreasOnVertex(i, iVertex) * pv_vertex(k, iVertex) * invAreaCell1
+               Vor_cell(k,iCell) = Vor_cell(k,iCell) + kiteAreasOnVertex(i, iVertex) * Vor_vertex(k, iVertex) * invAreaCell1
             enddo
 
             ! Compute pv at the edges
-            !   ( this computes pv_edge at all edges bounding real cells )
+            !   ( this computes Vor_edge at all edges bounding real cells )
             do k=1,maxLevelEdgeBot(iEdge)
-               pv_edge(k,iEdge) = pv_edge(k,iEdge) + 0.5 * pv_vertex(k,iVertex)
+               Vor_edge(k,iEdge) = Vor_edge(k,iEdge) + 0.5 * Vor_vertex(k,iVertex)
             enddo
          enddo
       enddo
 
-!     gradPVn(:,:) = 0.0
-!     gradPVt(:,:) = 0.0
+!     gradVor_n(:,:) = 0.0
+!     gradVor_t(:,:) = 0.0
       do iEdge = 1,nEdges
          cell1 = cellsOnEdge(1, iEdge)
          cell2 = cellsOnEdge(2, iEdge)
@@ -743,16 +716,16 @@
 
          invLength = 1.0 / dcEdge(iEdge)
          ! Compute gradient of PV in normal direction
-         !   ( this computes gradPVn for all edges bounding real cells )
+         !   ( this computes gradVor_n for all edges bounding real cells )
          do k=1,maxLevelEdgeTop(iEdge)
-            gradPVn(k,iEdge) = (pv_cell(k,cell2) - pv_cell(k,cell1)) * invLength
+            gradVor_n(k,iEdge) = (Vor_cell(k,cell2) - Vor_cell(k,cell1)) * invLength
          enddo
 
          invLength = 1.0 / dvEdge(iEdge)
          ! Compute gradient of PV in the tangent direction
-         !   ( this computes gradPVt at all edges bounding real cells and distance-1 ghost cells )
+         !   ( this computes gradVor_t at all edges bounding real cells and distance-1 ghost cells )
          do k = 1,maxLevelEdgeBot(iEdge)
-           gradPVt(k,iEdge) = (pv_vertex(k,vertex2) - pv_vertex(k,vertex1)) * invLength
+           gradVor_t(k,iEdge) = (Vor_vertex(k,vertex2) - Vor_vertex(k,vertex1)) * invLength
          enddo
 
       enddo
@@ -762,9 +735,9 @@
       !
       do iEdge = 1,nEdges
          do k = 1,maxLevelEdgeBot(iEdge)
-           pv_edge(k,iEdge) = pv_edge(k,iEdge) &amp;
-             - config_apvm_upwinding * dt* (  u(k,iEdge) * gradPVn(k,iEdge) &amp;
-                          + v(k,iEdge) * gradPVt(k,iEdge) )
+           Vor_edge(k,iEdge) = Vor_edge(k,iEdge) &amp;
+             - config_apvm_scale_factor * dt* (  u(k,iEdge) * gradVor_n(k,iEdge) &amp;
+                          + v(k,iEdge) * gradVor_t(k,iEdge) )
          enddo
       enddo
 
@@ -890,23 +863,13 @@
 !&gt;  This routine computes the vertical velocity in the top layer for the ocean
 !
 !-----------------------------------------------------------------------
-
    subroutine ocn_wtop(s1,s2, grid)!{{{
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   ! Compute diagnostic fields used in the tendency computations
-   !
-   ! Input: grid - grid metadata
-   !
-   ! Output: s - computed diagnostics
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
       implicit none
 
-      type (state_type), intent(inout) :: s1
-      type (state_type), intent(inout) :: s2
-      type (mesh_type), intent(in) :: grid
+      type (state_type), intent(inout) :: s1 !&lt; Input/Output: State 1 information
+      type (state_type), intent(inout) :: s2 !&lt; Input/Output: State 2 information
+      type (mesh_type), intent(in) :: grid !&lt; Input: Grid information
 
-      ! mrp 110512 could clean this out, remove pointers?
       integer :: iEdge, iCell, iVertex, k, cell1, cell2, vertex1, vertex2, eoe, i, j, cov
       real (kind=RKIND) :: flux, vorticity_abs, h_vertex, workpv, rho0Inv, hSum
 
@@ -1080,19 +1043,10 @@
 !-----------------------------------------------------------------------
 
    subroutine ocn_fuperp(s, grid)!{{{
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   ! Put f*uBcl^{perp} in u as a work variable
-   !
-   ! Input: s - current model state
-   !        grid - grid metadata
-   !
-   ! Output: tend - computed tendencies for prognostic variables
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
       implicit none
 
-      type (state_type), intent(inout) :: s
-      type (mesh_type), intent(in) :: grid
+      type (state_type), intent(inout) :: s !&lt; Input/Output: State information
+      type (mesh_type), intent(in) :: grid !&lt; Input: Grid information
 
 ! mrp 110512 I just split compute_tend into compute_tend_u and compute_tend_h.
 !  Some of these variables can be removed, but at a later time.
@@ -1155,9 +1109,8 @@
 !&gt;  other tendency routines.
 !
 !-----------------------------------------------------------------------
-
     subroutine ocn_tendency_init(err)!{{{
-        integer, intent(out) :: err
+        integer, intent(out) :: err !&lt; Output: Error flag
 
         err = 0
 


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tendency.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_tendency.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_tendency.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_tendency.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_tendency.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_tendency.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tendency.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_tendency.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_tendency.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_tendency.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_tendency.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_tendency.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_tendency.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_tendency.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_thick_hadv.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_thick_hadv.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_thick_hadv.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_thick_hadv.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_thick_hadv.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_thick_hadv.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_thick_hadv.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_thick_hadv.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_thick_hadv.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_thick_hadv.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_thick_hadv.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_thick_hadv.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_thick_hadv.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_thick_hadv.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_thick_vadv.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_thick_vadv.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_thick_vadv.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_thick_vadv.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_thick_vadv.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_thick_vadv.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_thick_vadv.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_thick_vadv.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_thick_vadv.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_thick_vadv.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_thick_vadv.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_thick_vadv.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_thick_vadv.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_thick_vadv.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_time_integration.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_time_integration.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_time_integration.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_time_integration.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_time_integration.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_time_integration.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_time_integration.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_time_integration.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_time_integration.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_time_integration.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_time_integration.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_time_integration.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_time_integration.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_time_integration.F:924-962

Modified: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_time_integration_rk4.F
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_time_integration_rk4.F        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_time_integration_rk4.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -144,7 +144,7 @@
         call mpas_timer_start(&quot;RK4-diagnostic halo update&quot;)
         block =&gt; domain % blocklist
         do while (associated(block))
-           call mpas_dmpar_exch_halo_field2d_real(domain % dminfo, provis % pv_edge % array(:,:), &amp;
+           call mpas_dmpar_exch_halo_field2d_real(domain % dminfo, provis % Vor_edge % array(:,:), &amp;
                                             block % mesh % nVertLevels, block % mesh % nEdges, &amp;
                                             block % parinfo % edgesToSend, block % parinfo % edgesToRecv)
 
@@ -173,7 +173,7 @@
            if (.not.config_implicit_vertical_mix) then
               call ocn_vmix_coefs(block % mesh, provis, block % diagnostics, err)
            end if
-           call ocn_tend_h(block % tend, provis, block % diagnostics, block % mesh)
+           call ocn_tend_h(block % tend, provis, block % mesh)
            call ocn_tend_u(block % tend, provis, block % diagnostics, block % mesh)
 
            ! mrp 110718 filter btr mode out of u_tend
@@ -182,7 +182,7 @@
                call filter_btr_mode_tend_u(block % tend, provis, block % diagnostics, block % mesh)
            endif
 
-           call ocn_tend_scalar(block % tend, provis, block % diagnostics, block % mesh)
+           call ocn_tend_scalar(block % tend, provis, block % diagnostics, block % mesh, dt)
            block =&gt; block % next
         end do
         call mpas_timer_stop(&quot;RK4-tendency computations&quot;)
@@ -231,6 +231,14 @@
                  provis % u % array(:,:) = block % state % time_levs(1) % state % u % array(:,:)
               end if
 
+              if (config_prescribe_velocity) then
+                 provis % u % array(:,:) = block % state % time_levs(1) % state % u % array(:,:)
+              end if
+
+              if (config_prescribe_thickness) then
+                 provis % h % array(:,:) = block % state % time_levs(1) % state % h % array(:,:)
+              end if
+
               call ocn_diagnostic_solve(dt, provis, block % mesh)
 
               block =&gt; block % next
@@ -325,6 +333,14 @@
             block % state % time_levs(2) % state % u % array(:,:) = block % state % time_levs(1) % state % u % array(:,:)
          end if
 
+         if (config_prescribe_velocity) then
+            block % state % time_levs(2) % state % u % array(:,:) = block % state % time_levs(1) % state % u % array(:,:)
+         end if
+
+         if (config_prescribe_thickness) then
+            block % state % time_levs(2) % state % h % array(:,:) = block % state % time_levs(1) % state % h % array(:,:)
+         end if
+
          call ocn_diagnostic_solve(dt, block % state % time_levs(2) % state, block % mesh)
 
          call mpas_reconstruct(block % mesh, block % state % time_levs(2) % state % u % array,          &amp;
@@ -374,7 +390,7 @@
         meshScalingDel2, meshScalingDel4
       real (kind=RKIND), dimension(:,:), pointer :: &amp;
         weightsOnEdge, kiteAreasOnVertex, h_edge, h, u, v, pressure, &amp;
-        tend_u, circulation, vorticity, ke, ke_edge, pv_edge, &amp;
+        tend_u, circulation, vorticity, ke, ke_edge, Vor_edge, &amp;
         MontPot, wTop, divergence, vertViscTopOfEdge
       type (dm_info) :: dminfo
 
@@ -406,7 +422,7 @@
       divergence  =&gt; s % divergence % array
       ke          =&gt; s % ke % array
       ke_edge     =&gt; s % ke_edge % array
-      pv_edge     =&gt; s % pv_edge % array
+      Vor_edge     =&gt; s % Vor_edge % array
       MontPot     =&gt; s % MontPot % array
       pressure    =&gt; s % pressure % array
       vertViscTopOfEdge =&gt; d % vertViscTopOfEdge % array
@@ -489,7 +505,7 @@
         meshScalingDel2, meshScalingDel4
       real (kind=RKIND), dimension(:,:), pointer :: &amp;
         weightsOnEdge, kiteAreasOnVertex, h_edge, h, u, v, pressure, &amp;
-        tend_u, circulation, vorticity, ke, ke_edge, pv_edge, &amp;
+        tend_u, circulation, vorticity, ke, ke_edge, Vor_edge, &amp;
         MontPot, wTop, divergence, vertViscTopOfEdge
       type (dm_info) :: dminfo
 
@@ -521,7 +537,7 @@
       divergence  =&gt; s % divergence % array
       ke          =&gt; s % ke % array
       ke_edge     =&gt; s % ke_edge % array
-      pv_edge     =&gt; s % pv_edge % array
+      Vor_edge     =&gt; s % Vor_edge % array
       MontPot     =&gt; s % MontPot % array
       pressure    =&gt; s % pressure % array
 


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_time_integration_rk4.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_time_integration_rk4.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_time_integration_rk4.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_time_integration_rk4.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_time_integration_rk4.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_time_integration_rk4.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_time_integration_rk4.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_time_integration_rk4.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_time_integration_rk4.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_time_integration_rk4.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_time_integration_rk4.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_time_integration_rk4.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_time_integration_rk4.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_time_integration_rk4.F:924-962

Modified: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_time_integration_split.F
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_time_integration_split.F        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_time_integration_split.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -167,7 +167,7 @@
          do while (associated(block))
 
             call mpas_dmpar_exch_halo_field2d_real(domain % dminfo, &amp;
-               block % state % time_levs(2) % state % pv_edge % array(:,:), &amp;
+               block % state % time_levs(2) % state % Vor_edge % array(:,:), &amp;
                block % mesh % nVertLevels, block % mesh % nEdges, &amp;
                block % parinfo % edgesToSend, block % parinfo % edgesToRecv)
 
@@ -200,7 +200,7 @@
             if (.not.config_implicit_vertical_mix) then
                call ocn_vmix_coefs(block % mesh, block % state % time_levs(2) % state, block % diagnostics, err)
             end if
-            call ocn_tend_u(block % tend, block % state % time_levs(2) % state , block % diagnostics, block % mesh)
+            call ocn_tend_u(block % tend, block % state % time_levs(2) % state, block % diagnostics, block % mesh)
             block =&gt; block % next
          end do
 
@@ -716,13 +716,12 @@
          !TDR: at this point, I am suggesting just pushing some of this code into subroutines. 
          !TDR: see comments farther down
 
+         ! dwj: 02/22/12 splitting thickness and tracer tendency computations and halo updates to allow monotonic advection.
          block =&gt; domain % blocklist
          do while (associated(block))
             call ocn_wtop(block % state % time_levs(1) % state,block % state % time_levs(2) % state, block % mesh)
 
-            call ocn_tend_h     (block % tend, block % state % time_levs(2) % state , block % diagnostics, block % mesh)
-            call ocn_tend_scalar(block % tend, block % state % time_levs(2) % state , block % diagnostics, block % mesh)
-
+            call ocn_tend_h(block % tend, block % state % time_levs(2) % state, block % mesh)
             block =&gt; block % next
          end do
 
@@ -733,14 +732,31 @@
             call mpas_dmpar_exch_halo_field2d_real(domain % dminfo, block % tend % h % array(:,:), &amp;
                block % mesh % nVertLevels, block % mesh % nCells, &amp;
                block % parinfo % cellsToSend, block % parinfo % cellsToRecv)
-
             block =&gt; block % next
          end do
          call mpas_timer_stop(&quot;se halo h&quot;, timer_halo_h)
 
          block =&gt; domain % blocklist
          do while (associated(block))
+            call ocn_tend_scalar(block % tend, block % state % time_levs(2) % state, block % diagnostics, block % mesh, dt)
 
+            block =&gt; block % next
+         end do
+
+         ! update halo for thickness and tracer tendencies
+         call mpas_timer_start(&quot;se halo tracers&quot;, .false., timer_halo_tracers)
+         block =&gt; domain % blocklist
+         do while (associated(block))
+            call mpas_dmpar_exch_halo_field3d_real(domain % dminfo, block % tend % tracers % array(:,:,:), &amp;
+               block % tend % num_tracers, block % mesh % nVertLevels, block % mesh % nCells, &amp;
+               block % parinfo % cellsToSend, block % parinfo % cellsToRecv)
+            block =&gt; block % next
+         end do
+         call mpas_timer_stop(&quot;se halo tracers&quot;, timer_halo_tracers)
+
+         block =&gt; domain % blocklist
+         do while (associated(block))
+
             !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
             !
             !  If iterating, reset variables for next iteration
@@ -846,22 +862,8 @@
             block =&gt; block % next
          end do
 
-        ! Boundary update on tracers.  This is placed here, rather than 
-        ! on tend % tracers as in RK4, because I needed to update 
-        ! afterwards for the del4 diffusion operator.
-         call mpas_timer_start(&quot;se halo tracers&quot;, .false., timer_halo_tracers)
-         block =&gt; domain % blocklist
-         do while (associated(block))
 
-            call mpas_dmpar_exch_halo_field3d_real(domain % dminfo, block % state % time_levs(2) % state % tracers % array(:,:,:), &amp;
-               block % tend % num_tracers, block % mesh % nVertLevels, block % mesh % nCells, block % parinfo % cellsToSend, block % parinfo % cellsToRecv)
 
-            block =&gt; block % next
-         end do
-         call mpas_timer_stop(&quot;se halo tracers&quot;, timer_halo_tracers)
-
-
-
       end do  ! split_explicit_step = 1, config_n_ts_iter
       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
       ! END large iteration loop 
@@ -901,6 +903,15 @@
          if (config_test_case == 1) then    ! For case 1, wind field should be fixed
             block % state % time_levs(2) % state % u % array(:,:) = block % state % time_levs(1) % state % u % array(:,:)
          end if
+
+         if (config_prescribe_velocity) then
+            block % state % time_levs(2) % state % u % array(:,:) = block % state % time_levs(1) % state % u % array(:,:)
+         end if
+
+         if (config_prescribe_thickness) then
+            block % state % time_levs(2) % state % h % array(:,:) = block % state % time_levs(1) % state % h % array(:,:)
+         end if
+
          call ocn_diagnostic_solve(dt, block % state % time_levs(2) % state, block % mesh)
          call mpas_reconstruct(block % mesh, block % state % time_levs(2) % state % u % array,          &amp;
             block % state % time_levs(2) % state % uReconstructX % array,            &amp;


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_time_integration_split.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_time_integration_split.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_time_integration_split.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_time_integration_split.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_time_integration_split.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_time_integration_split.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_time_integration_split.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_time_integration_split.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_time_integration_split.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_time_integration_split.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_time_integration_split.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_time_integration_split.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_time_integration_split.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_time_integration_split.F:924-962

Copied: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_advection.F (from rev 1679, trunk/mpas/src/core_ocean/mpas_ocn_tracer_advection.F)
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_advection.F                                (rev 0)
+++ branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_advection.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -0,0 +1,316 @@
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  ocn_tracer_advection
+!
+!&gt; \brief MPAS ocean tracer advection driver
+!&gt; \author Doug Jacobsen
+!&gt; \date   03/09/12
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This module contains driver routine for tracer advection tendencys
+!&gt;  as well as the routines for setting up advection coefficients and 
+!&gt;  initialization of the advection routines.
+!
+!-----------------------------------------------------------------------
+
+module mpas_ocn_tracer_advection
+
+   use mpas_kind_types
+   use mpas_grid_types
+   use mpas_configure
+
+   use mpas_ocn_tracer_advection_std
+   use mpas_ocn_tracer_advection_mono
+     
+   implicit none
+   private
+   save
+
+   public :: mpas_ocn_tracer_advection_init,         &amp;
+             mpas_ocn_tracer_advection_coefficients, &amp;
+             mpas_ocn_tracer_advection_tend
+
+   logical :: monotonicOn
+
+   contains
+
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  routine mpas_ocn_tracer_advection_coefficients
+!
+!&gt; \brief MPAS ocean tracer advection coefficients
+!&gt; \author Doug Jacobsen
+!&gt; \date   03/09/12
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This routine precomputes the advection coefficients for horizontal
+!&gt;  advection of tracers.
+!
+!-----------------------------------------------------------------------
+   subroutine mpas_ocn_tracer_advection_coefficients( grid, err )!{{{
+
+      implicit none
+      type (mesh_type) :: grid !&lt; Input: Grid information
+      integer, intent(out) :: err
+
+      real (kind=RKIND), dimension(:,:,:), pointer :: deriv_two
+      real (kind=RKIND), dimension(:,:), pointer :: adv_coefs, adv_coefs_2nd, adv_coefs_3rd
+      integer, dimension(:,:), pointer :: cellsOnCell, cellsOnEdge, advCellsForEdge, highOrderAdvectionMask, lowOrderAdvectionMask, boundaryCell
+      integer, dimension(:), pointer :: nEdgesOnCell, nAdvCellsForEdge, maxLevelCell
+
+      integer, dimension(:), pointer :: cell_list, ordered_cell_list
+      integer :: cell1, cell2, iEdge, n, i, j, j_in, iCell, k, nVertLevels
+      logical :: addcell, highOrderAdvection
+
+      deriv_two =&gt; grid % deriv_two % array
+      adv_coefs =&gt; grid % adv_coefs % array
+      adv_coefs_2nd =&gt; grid % adv_coefs_2nd % array
+      adv_coefs_3rd =&gt; grid % adv_coefs_3rd % array
+      cellsOnCell =&gt; grid % cellsOnCell % array
+      cellsOnEdge =&gt; grid % cellsOnEdge % array
+      advCellsForEdge =&gt; grid % advCellsForEdge % array
+      boundaryCell =&gt; grid % boundaryCell % array
+      highOrderAdvectionMask =&gt; grid % highOrderAdvectionMask % array
+      lowOrderAdvectionMask =&gt; grid % lowOrderAdvectionMask % array
+      nEdgesOnCell =&gt; grid % nEdgesOnCell % array
+      maxLevelCell =&gt; grid % maxLevelCell % array
+      nAdvCellsForEdge =&gt; grid % nAdvCellsForEdge % array
+
+      nVertLevels = grid % nVertLevels
+
+      allocate(cell_list(grid % maxEdges2 + 2))
+      allocate(ordered_cell_list(grid % maxEdges2 + 2))
+
+      err = 0
+
+      highOrderAdvectionMask = 0
+      lowOrderAdvectionMask = 0
+      if(config_horiz_tracer_adv_order == 2) then
+        
+      end if
+
+      do iEdge = 1, grid % nEdges
+        nAdvCellsForEdge(iEdge) = 0
+        cell1 = cellsOnEdge(1,iEdge)
+        cell2 = cellsOnEdge(2,iEdge)
+        
+
+        do k = 1, nVertLevels
+          if (boundaryCell(k, cell1) == 1 .or. boundaryCell(k, cell2) == 1) then
+            highOrderAdvectionMask(k, iEdge) = 0
+            lowOrderAdvectionMask(k, iEdge) = 1
+          else
+            highOrderAdvectionMask(k, iEdge) = 1
+            lowOrderAdvectionMask(k, iEdge) = 0
+          end if
+        end do
+
+        !
+        ! do only if this edge flux is needed to update owned cells
+        !
+        if (cell1 &lt;= grid%nCells .or. cell2 &lt;= grid%nCells) then
+
+          cell_list(1) = cell1
+          cell_list(2) = cell2
+          n = 2 
+
+        !  add cells surrounding cell 1.  n is number of cells currently in list
+          do i = 1, nEdgesOnCell(cell1)
+            if(cellsOnCell(i,cell1) /= cell2) then
+              n = n + 1
+              cell_list(n) = cellsOnCell(i,cell1)
+            end if
+          end do
+
+        !  add cells surrounding cell 2 (brute force approach)
+          do iCell = 1, nEdgesOnCell(cell2)
+            addcell = .true.
+            do i=1,n
+              if(cell_list(i) == cellsOnCell(iCell,cell2)) addcell = .false.
+            end do
+            if(addcell) then
+              n = n+1
+              cell_list(n) = cellsOnCell(iCell,cell2)
+            end if
+          end do
+
+        ! order the list by increasing cell number (brute force approach)
+
+          do i=1,n
+            ordered_cell_list(i) = grid % nCells + 2
+            j_in = 1
+            do j=1,n
+              if(ordered_cell_list(i) &gt; cell_list(j) ) then
+                j_in = j
+                ordered_cell_list(i) = cell_list(j)
+              end if
+            end do
+!           ordered_cell_list(i) = cell_list(j_in)
+            cell_list(j_in) = grid % nCells + 3
+          end do
+
+          nAdvCellsForEdge(iEdge) = n
+          do iCell = 1, nAdvCellsForEdge(iEdge)
+            advCellsForEdge(iCell,iEdge) = ordered_cell_list(iCell)
+          end do
+
+        ! we have the ordered list, now construct coefficients
+
+          adv_coefs(:,iEdge) = 0.
+          adv_coefs_2nd(:,iEdge) = 0.
+          adv_coefs_3rd(:,iEdge) = 0.
+        
+        ! pull together third and fourth order contributions to the flux
+        ! first from cell1
+
+          j_in = 0
+          do j=1, n
+            if( ordered_cell_list(j) == cell1 ) j_in = j
+          end do
+          adv_coefs    (j_in,iEdge) = adv_coefs    (j_in,iEdge) + deriv_two(1,1,iEdge)
+          adv_coefs_3rd(j_in,iEdge) = adv_coefs_3rd(j_in,iEdge) + deriv_two(1,1,iEdge)
+
+          do iCell = 1, nEdgesOnCell(cell1)
+            j_in = 0
+            do j=1, n
+              if( ordered_cell_list(j) == cellsOnCell(iCell,cell1) ) j_in = j
+            end do
+            adv_coefs    (j_in,iEdge) = adv_coefs    (j_in,iEdge) + deriv_two(iCell+1,1,iEdge)
+            adv_coefs_3rd(j_in,iEdge) = adv_coefs_3rd(j_in,iEdge) + deriv_two(iCell+1,1,iEdge)
+          end do
+
+        ! pull together third and fourth order contributions to the flux
+        ! now from cell2
+
+          j_in = 0
+          do j=1, n
+            if( ordered_cell_list(j) == cell2 ) j_in = j
+          enddo
+          adv_coefs    (j_in,iEdge) = adv_coefs    (j_in,iEdge) + deriv_two(1,2,iEdge)
+          adv_coefs_3rd(j_in,iEdge) = adv_coefs_3rd(j_in,iEdge) - deriv_two(1,2,iEdge)
+
+          do iCell = 1, nEdgesOnCell(cell2)
+            j_in = 0
+            do j=1, n
+              if( ordered_cell_list(j) == cellsOnCell(iCell,cell2) ) j_in = j
+            enddo
+            adv_coefs    (j_in,iEdge) = adv_coefs    (j_in,iEdge) + deriv_two(iCell+1,2,iEdge)
+            adv_coefs_3rd(j_in,iEdge) = adv_coefs_3rd(j_in,iEdge) - deriv_two(iCell+1,2,iEdge)
+          end do
+
+          do j = 1,n
+            adv_coefs    (j,iEdge) = - (grid % dcEdge % array (iEdge) **2) * adv_coefs    (j,iEdge) / 12.
+            adv_coefs_3rd(j,iEdge) = - (grid % dcEdge % array (iEdge) **2) * adv_coefs_3rd(j,iEdge) / 12.
+          end do
+
+        ! 2nd order centered contribution - place this in the main flux weights
+
+          j_in = 0
+          do j=1, n
+            if( ordered_cell_list(j) == cell1 ) j_in = j
+          enddo
+          adv_coefs(j_in,iEdge) = adv_coefs(j_in,iEdge) + 0.5
+          adv_coefs_2nd(j_in,iEdge) = adv_coefs_2nd(j_in,iEdge) + 0.5
+
+          j_in = 0
+          do j=1, n
+            if( ordered_cell_list(j) == cell2 ) j_in = j
+          enddo
+          adv_coefs(j_in,iEdge) = adv_coefs(j_in,iEdge) + 0.5
+          adv_coefs_2nd(j_in,iEdge) = adv_coefs_2nd(j_in,iEdge) + 0.5
+
+        !  multiply by edge length - thus the flux is just dt*ru times the results of the vector-vector multiply
+
+          do j=1,n
+            adv_coefs    (j,iEdge) = grid % dvEdge % array(iEdge) * adv_coefs    (j,iEdge)
+            adv_coefs_2nd(j,iEdge) = grid % dvEdge % array(iEdge) * adv_coefs_2nd(j,iEdge)
+            adv_coefs_3rd(j,iEdge) = grid % dvEdge % array(iEdge) * adv_coefs_3rd(j,iEdge)
+          end do
+
+        end if  ! only do for edges of owned-cells
+        
+      end do ! end loop over edges
+
+      deallocate(cell_list)
+      deallocate(ordered_cell_list)
+
+      ! If 2nd order advection, set masks appropriately.
+      if(config_horiz_tracer_adv_order == 2) then
+        lowOrderAdvectionMask = 1
+        highOrderAdvectionMask = 0
+      end if
+
+      if (maxval(highOrderAdvectionMask+lowOrderAdvectionMask) &gt; 1) then
+        write(*,*) &quot;Masks don't sum to 1.&quot;
+        err = 1
+      endif
+
+   end subroutine mpas_ocn_tracer_advection_coefficients!}}}
+
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  routine mpas_ocn_tracer_advection_tend
+!
+!&gt; \brief MPAS ocean tracer advection tendency
+!&gt; \author Doug Jacobsen
+!&gt; \date   03/09/12
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This routine is the driver routine for computing the tendency for
+!&gt;  advection of tracers.
+!
+!-----------------------------------------------------------------------
+   subroutine mpas_ocn_tracer_advection_tend(tracers, uh, w, h, verticalCellSize, dt, grid, tend_h, tend)!{{{
+
+      real (kind=RKIND), dimension(:,:,:), intent(inout) :: tend !&lt; Input/Output: tracer tendency
+      real (kind=RKIND), dimension(:,:,:), intent(in) :: tracers !&lt; Input/Output: tracer values
+      real (kind=RKIND), dimension(:,:), intent(in) :: uh !&lt; Input: Thickness weighted horizontal velocity
+      real (kind=RKIND), dimension(:,:), intent(in) :: w  !&lt; Input: Vertical velocity
+      real (kind=RKIND), dimension(:,:), intent(in) :: h  !&lt; Input: Thickness field
+      real (kind=RKIND), dimension(:,:), intent(in) :: verticalCellSize !&lt; Input: Distance between vertical interfaces of a cell
+      real (kind=RKIND), intent(in) :: dt !&lt; Input: Time step
+      type (mesh_type), intent(in) :: grid !&lt; Input: grid information
+      real (kind=RKIND), dimension(:,:), intent(in) :: tend_h !&lt; Input: Thickness tendency information
+
+      if(monotonicOn) then
+         call mpas_ocn_tracer_advection_mono_tend(tracers, uh, w, h, verticalCellSize, dt, grid, tend_h, tend)
+      else
+         call mpas_ocn_tracer_advection_std_tend(tracers, uh, w, verticalCellSize, grid, tend)
+      endif
+   end subroutine mpas_ocn_tracer_advection_tend!}}}
+
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  routine mpas_ocn_tracer_advection_init
+!
+!&gt; \brief MPAS ocean tracer advection tendency
+!&gt; \author Doug Jacobsen
+!&gt; \date   03/09/12
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This routine is the driver routine for initialization of 
+!&gt;  the tracer advection routines.
+!
+!-----------------------------------------------------------------------
+   subroutine mpas_ocn_tracer_advection_init(err)!{{{
+
+      integer, intent(inout) :: err !&lt; Input/Output: Error flag
+
+      integer :: err_tmp
+
+      err = 0
+
+      call mpas_ocn_tracer_advection_std_init(err_tmp)
+      call mpas_ocn_tracer_advection_mono_init(err_tmp)
+
+      err = ior(err, err_tmp)
+
+      monotonicOn = .false.
+
+      if(config_monotonic) then
+         monotonicOn = .true.
+      endif
+
+   end subroutine mpas_ocn_tracer_advection_init!}}}
+
+end module mpas_ocn_tracer_advection

Copied: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_advection_helpers.F (from rev 1679, trunk/mpas/src/core_ocean/mpas_ocn_tracer_advection_helpers.F)
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_advection_helpers.F                                (rev 0)
+++ branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_advection_helpers.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -0,0 +1,68 @@
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  ocn_tracer_advection_helpers
+!
+!&gt; \brief MPAS ocean tracer advection helper functions
+!&gt; \author Doug Jacobsen
+!&gt; \date   03/09/12
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This module contains helper functions tracer advection.
+!
+!-----------------------------------------------------------------------
+module mpas_ocn_tracer_advection_helpers
+
+   use mpas_kind_types
+
+   implicit none
+   save
+
+   contains
+
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  function mpas_ocn_tracer_advection_vflux4
+!
+!&gt; \brief MPAS ocean 4th order vertical tracer advection stencil
+!&gt; \author Doug Jacobsen
+!&gt; \date   03/09/12
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This function provides the stencil for 4th order vertical advection of tracers.
+!
+!-----------------------------------------------------------------------
+   real function mpas_ocn_tracer_advection_vflux4(q_im2, q_im1, q_i, q_ip1, w)!{{{
+        real (kind=RKIND), intent(in) :: q_im2 !&lt; Input: Tracer value at index i-2
+        real (kind=RKIND), intent(in) :: q_im1 !&lt; Input: Tracer value at index i-1
+        real (kind=RKIND), intent(in) :: q_i !&lt; Input: Tracer value at index i
+        real (kind=RKIND), intent(in) :: q_ip1 !&lt; Input: Tracer value at index i+1
+        real (kind=RKIND), intent(in) :: w !&lt; Input: vertical veloicity
+        mpas_ocn_tracer_advection_vflux4 = w*( 7.*(q_i + q_im1) - (q_ip1 + q_im2) )/12.0
+   end function!}}}
+
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  function mpas_ocn_tracer_advection_vflux3
+!
+!&gt; \brief MPAS ocean 3rd order vertical tracer advection stencil
+!&gt; \author Doug Jacobsen
+!&gt; \date   03/09/12
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This function provides the stencil for 3rd order vertical advection of tracers.
+!
+!-----------------------------------------------------------------------
+   real function mpas_ocn_tracer_advection_vflux3( q_im2, q_im1, q_i, q_ip1, w, coef)!{{{
+        real (kind=RKIND), intent(in) :: q_im2 !&lt; Input: Tracer value at index i-2
+        real (kind=RKIND), intent(in) :: q_im1 !&lt; Input: Tracer value at index i-1
+        real (kind=RKIND), intent(in) :: q_i !&lt; Input: Tracer value at index i
+        real (kind=RKIND), intent(in) :: q_ip1 !&lt; Input: Tracer value at index i+1
+        real (kind=RKIND), intent(in) :: w !&lt; Input: vertical veloicity
+        real (kind=RKIND), intent(in) :: coef !&lt; Input: Advection coefficient
+
+        !dwj 02/21/12 flux3 is different in ocean and atmosphere
+        !flux3 = (u * (7.0 * (q_i + q_im1) - (q_ip1 + q_im2)) + coef * abs(u) * ((q_ip1 - q_im2) - 3.0*(q_i-q_im1)))/12.0
+        mpas_ocn_tracer_advection_vflux3 = (w * (7.0 * (q_i + q_im1) - (q_ip1 + q_im2)) - coef * abs(w) * ((q_ip1 - q_im2) - 3.0*(q_i-q_im1)))/12.0
+   end function!}}}
+
+end module mpas_ocn_tracer_advection_helpers

Copied: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_advection_mono.F (from rev 1679, trunk/mpas/src/core_ocean/mpas_ocn_tracer_advection_mono.F)
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_advection_mono.F                                (rev 0)
+++ branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_advection_mono.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -0,0 +1,382 @@
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  ocn_tracer_advection_mono
+!
+!&gt; \brief MPAS ocean monotonic tracer advection with FCT
+!&gt; \author Doug Jacobsen
+!&gt; \date   03/09/12
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This module contains routines for monotonic advection of tracers using a FCT
+!
+!-----------------------------------------------------------------------
+module mpas_ocn_tracer_advection_mono
+
+   use mpas_kind_types
+   use mpas_grid_types
+   use mpas_configure
+   use mpas_dmpar
+
+   use mpas_ocn_tracer_advection_helpers
+
+   implicit none
+   private
+   save 
+
+   real (kind=RKIND) :: coef_3rd_order
+
+   public :: mpas_ocn_tracer_advection_mono_tend, &amp;
+             mpas_ocn_tracer_advection_mono_init
+
+   contains
+
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  routine mpas_ocn_tracer_advection_mono_tend
+!
+!&gt; \brief MPAS ocean monotonic tracer advection tendency with FCT
+!&gt; \author Doug Jacobsen
+!&gt; \date   03/09/12
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This routine computes the monotonic tracer advection tendencity using a FCT.
+!&gt;  Both horizontal and vertical.
+!
+!-----------------------------------------------------------------------
+   subroutine mpas_ocn_tracer_advection_mono_tend(tracers, uh, w, h, verticalCellSize, dt, grid, tend_h, tend)!{{{
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
+   !
+   ! Input: s - current model state
+   !        grid - grid metadata
+   !
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
+
+      real (kind=RKIND), dimension(:,:,:), intent(in) :: tracers !&lt; Input: current tracer values
+      real (kind=RKIND), dimension(:,:), intent(in) :: uh !&lt; Input: Thichness weighted velocitiy
+      real (kind=RKIND), dimension(:,:), intent(in) :: w !&lt; Input: Vertical velocitiy
+      real (kind=RKIND), dimension(:,:), intent(in) :: h !&lt; Input: Thickness
+      real (kind=RKIND), dimension(:,:), intent(in) :: verticalCellSize !&lt; Input: Distance between vertical interfaces of a cell
+      real (kind=RKIND), dimension(:,:), intent(in) :: tend_h !&lt; Input: Tendency for thickness field
+      real (kind=RKIND), intent(in) :: dt !&lt; Input: Timestep
+      type (mesh_type), intent(in) :: grid !&lt; Input: Grid information
+      real (kind=RKIND), dimension(:,:,:), intent(inout) :: tend !&lt; Input/Output: Tracer tendency
+
+      integer :: i, iCell, iEdge, k, iTracer, cell1, cell2
+      integer :: nVertLevels, num_tracers, nCells, nEdges, nCellsSolve
+      integer, dimension(:), pointer :: nAdvCellsForEdge, maxLevelCell, maxLevelEdgeTop, nEdgesOnCell
+      integer, dimension(:,:), pointer :: cellsOnEdge, cellsOnCell, advCellsForEdge, highOrderAdvectionMask, lowOrderAdvectionMask
+
+      real (kind=RKIND) :: flux_upwind, tracer_min_new, tracer_max_new, tracer_upwind_new, scale_factor
+      real (kind=RKIND) :: flux, tracer_weight, invDvEdge, invAreaCell1, invAreaCell2
+      real (kind=RKIND) :: cur_max, cur_min, new_max, new_min
+      real (kind=RKIND) :: verticalWeightK, verticalWeightKm1
+      real (kind=RKIND), dimension(:), pointer :: dvEdge, areaCell
+      real (kind=RKIND), dimension(:,:), pointer :: adv_coefs, adv_coefs_2nd, adv_coefs_3rd
+      real (kind=RKIND), dimension(:,:), pointer :: tracer_cur, tracer_new, upwind_tendency, inv_h_new, tracer_max, tracer_min
+      real (kind=RKIND), dimension(:,:), pointer :: flux_incoming, flux_outgoing, high_order_horiz_flux, high_order_vert_flux
+
+      real (kind=RKIND), parameter :: eps = 1.e-10
+
+      ! Initialize pointers
+      dvEdge      =&gt; grid % dvEdge % array
+      cellsOnEdge =&gt; grid % cellsOnEdge % array
+      cellsOnCell =&gt; grid % cellsOnCell % array
+      areaCell    =&gt; grid % areaCell % array
+
+      nEdgesOnCell =&gt; grid % nEdgesOnCell % array
+      nAdvCellsForEdge =&gt; grid % nAdvCellsForEdge % array
+      advCellsForEdge =&gt; grid % advCellsForEdge % array
+      adv_coefs =&gt; grid % adv_coefs % array
+      adv_coefs_2nd =&gt; grid % adv_coefs_2nd % array
+      adv_coefs_3rd =&gt; grid % adv_coefs_3rd % array
+      maxLevelCell =&gt; grid % maxLevelCell % array
+      maxLevelEdgeTop =&gt; grid % maxLevelEdgeTop % array
+      highOrderAdvectionMask =&gt; grid % highOrderAdvectionMask % array
+      lowOrderAdvectionMask =&gt; grid % lowOrderAdvectionMask % array
+
+      nCells = grid % nCells
+      nCellsSolve = grid % nCellsSolve
+      nEdges = grid % nEdges
+      nVertLevels = grid % nVertLevels
+      num_tracers = size(tracers,dim=1)
+
+      ! allocate nCells arrays
+
+      allocate(tracer_new(nVertLevels, nCells))
+      allocate(tracer_cur(nVertLevels, nCells))
+      allocate(upwind_tendency(nVertLevels, nCells))
+      allocate(inv_h_new(nVertLevels, nCells))
+      allocate(tracer_max(nVertLevels, nCells))
+      allocate(tracer_min(nVertLevels, nCells))
+      allocate(flux_incoming(nVertLevels, nCells))
+      allocate(flux_outgoing(nVertLevels, nCells))
+
+      ! allocate nEdges arrays
+      allocate(high_order_horiz_flux(nVertLevels, nEdges))
+
+      ! allocate nVertLevels+1 and nCells arrays
+      allocate(high_order_vert_flux(nVertLevels+1, nCells))
+
+      do iCell = 1, nCells
+        do k=1, maxLevelCell(iCell)
+          inv_h_new(k, iCell) = 1.0 / (h(k, iCell) + dt * tend_h(k, iCell))
+        end do
+      end do
+
+      ! Loop over tracers. One tracer is advected at a time. It is copied into a temporary array in order to improve locality
+      do iTracer = 1, num_tracers
+        ! Initialize variables for use in this iTracer iteration
+        do iCell = 1, nCells
+          do k=1, maxLevelCell(iCell)
+            tracer_cur(k,iCell) = tracers(iTracer,k,iCell)
+            upwind_tendency(k, iCell) = 0.0
+
+            !tracer_new is supposed to be the &quot;new&quot; tracer state. This allows bounds checks.
+            if (config_check_monotonicity) then
+              tracer_new(k,iCell) = 0.0
+            end if
+          end do ! k loop
+        end do ! iCell loop
+
+        high_order_vert_flux = 0.0
+        high_order_horiz_flux = 0.0
+
+        !  Compute the high order vertical flux. Also determine bounds on tracer_cur. 
+        do iCell = 1, nCells
+          k = 1
+          tracer_max(k,iCell) = max(tracer_cur(k,iCell),tracer_cur(k+1,iCell))
+          tracer_min(k,iCell) = min(tracer_cur(k,iCell),tracer_cur(k+1,iCell))
+
+          k = 2
+          verticalWeightK = verticalCellSize(k-1, iCell) / (verticalCellSize(k, iCell) + verticalCellSize(k-1, iCell))
+          verticalWeightKm1 = verticalCellSize(k, iCell) / (verticalCellSize(k, iCell) + verticalCellSize(k-1, iCell))
+          high_order_vert_flux(k,iCell) = w(k,iCell)*(verticalWeightK*tracer_cur(k,iCell)+verticalWeightKm1*tracer_cur(k-1,iCell))
+          tracer_max(k,iCell) = max(tracer_cur(k-1,iCell),tracer_cur(k,iCell),tracer_cur(k+1,iCell))
+          tracer_min(k,iCell) = min(tracer_cur(k-1,iCell),tracer_cur(k,iCell),tracer_cur(k+1,iCell))
+             
+          do k=3,maxLevelCell(iCell)-1
+             high_order_vert_flux(k,iCell) = mpas_ocn_tracer_advection_vflux3( tracer_cur(k-2,iCell),tracer_cur(k-1,iCell),  &amp;
+                                    tracer_cur(k  ,iCell),tracer_cur(k+1,iCell),  &amp;
+                                    w(k,iCell), coef_3rd_order )
+             tracer_max(k,iCell) = max(tracer_cur(k-1,iCell),tracer_cur(k,iCell),tracer_cur(k+1,iCell))
+             tracer_min(k,iCell) = min(tracer_cur(k-1,iCell),tracer_cur(k,iCell),tracer_cur(k+1,iCell))
+          end do 

+          k = maxLevelCell(iCell)
+          verticalWeightK = verticalCellSize(k-1, iCell) / (verticalCellSize(k, iCell) + verticalCellSize(k-1, iCell))
+          verticalWeightKm1 = verticalCellSize(k, iCell) / (verticalCellSize(k, iCell) + verticalCellSize(k-1, iCell))
+          high_order_vert_flux(k,iCell) = w(k,iCell)*(verticalWeightK*tracer_cur(k,iCell)+verticalWeightKm1*tracer_cur(k-1,iCell))
+          tracer_max(k,iCell) = max(tracer_cur(k,iCell),tracer_cur(k-1,iCell))
+          tracer_min(k,iCell) = min(tracer_cur(k,iCell),tracer_cur(k-1,iCell))
+
+          ! pull tracer_min and tracer_max from the (horizontal) surrounding cells
+          do i = 1, nEdgesOnCell(iCell)
+            do k=1, maxLevelCell(cellsOnCell(i, iCell))
+              tracer_max(k,iCell) = max(tracer_max(k,iCell),tracer_cur(k, cellsOnCell(i,iCell)))
+              tracer_min(k,iCell) = min(tracer_min(k,iCell),tracer_cur(k, cellsOnCell(i,iCell)))
+            end do ! k loop
+          end do ! i loop over nEdgesOnCell
+        end do ! iCell Loop
+
+        !  Compute the high order horizontal flux
+        do iEdge = 1, nEdges
+          do i = 1, nAdvCellsForEdge(iEdge)
+            iCell = advCellsForEdge(i,iEdge)
+            do k = 1, maxLevelCell(iCell)
+              tracer_weight = lowOrderAdvectionMask(k, iEdge) * adv_coefs_2nd(i,iEdge) &amp; 
+                            + highOrderAdvectionMask(k, iEdge) * (adv_coefs(i,iEdge) + coef_3rd_order*sign(1.,uh(k,iEdge))*adv_coefs_3rd(i,iEdge))
+
+              tracer_weight = uh(k,iEdge)*tracer_weight
+              high_order_horiz_flux(k,iEdge) = high_order_horiz_flux(k,iEdge) + tracer_weight* tracer_cur(k,iCell)
+            end do ! k loop
+          end do ! i loop over nAdvCellsForEdge
+        end do ! iEdge loop
+
+        !  low order upwind vertical flux (monotonic and diffused)
+        !  Remove low order flux from the high order flux.
+        !  Store left over high order flux in high_order_vert_flux array.
+        !  Upwind fluxes are accumulated in upwind_tendency
+        do iCell = 1, nCells
+          do k = 2, maxLevelCell(iCell)
+            ! dwj 02/03/12 Ocean and Atmosphere are different in vertical
+!           flux_upwind = max(0.,w(k,iCell))*tracer_cur(k-1,iCell) + min(0.,w(k,iCell))*tracer_cur(k,iCell)
+            flux_upwind = min(0.,w(k,iCell))*tracer_cur(k-1,iCell) + max(0.,w(k,iCell))*tracer_cur(k,iCell)
+            upwind_tendency(k-1,iCell) = upwind_tendency(k-1,iCell) + flux_upwind
+            upwind_tendency(k  ,iCell) = upwind_tendency(k  ,iCell) - flux_upwind
+            high_order_vert_flux(k,iCell) = high_order_vert_flux(k,iCell) - flux_upwind
+          end do ! k loop
+
+          ! flux_incoming contains the total remaining high order flux into iCell
+          !          it is positive.
+          ! flux_outgoing contains the total remaining high order flux out of iCell
+          !           it is negative
+          do k = 1, maxLevelCell(iCell)
+            ! dwj 02/03/12 Ocean and Atmosphere are different in vertical
+!           flux_incoming (k,iCell) = -(min(0.,high_order_vert_flux(k+1,iCell))-max(0.,high_order_vert_flux(k,iCell)))
+!           flux_outgoing(k,iCell) = -(max(0.,high_order_vert_flux(k+1,iCell))-min(0.,high_order_vert_flux(k,iCell)))
+
+            flux_incoming (k, iCell) = max(0.0, high_order_vert_flux(k+1, iCell)) - min(0.0, high_order_vert_flux(k, iCell))
+            flux_outgoing(k, iCell) = min(0.0, high_order_vert_flux(k+1, iCell)) - max(0.0, high_order_vert_flux(k, iCell))
+          end do ! k Loop
+        end do ! iCell Loop
+
+        !  low order upwind horizontal flux (monotinc and diffused)
+        !  Remove low order flux from the high order flux
+        !  Store left over high order flux in high_order_horiz_flux array
+        !  Upwind fluxes are accumulated in upwind_tendency
+        do iEdge = 1, nEdges
+          cell1 = cellsOnEdge(1,iEdge)
+          cell2 = cellsOnEdge(2,iEdge)
+
+          invAreaCell1 = 1.0 / areaCell(cell1)
+          invAreaCell2 = 1.0 / areaCell(cell2)
+
+          do k = 1, maxLevelEdgeTop(iEdge)
+            flux_upwind = dvEdge(iEdge) * (max(0.,uh(k,iEdge))*tracer_cur(k,cell1) + min(0.,uh(k,iEdge))*tracer_cur(k,cell2))
+            high_order_horiz_flux(k,iEdge) = high_order_horiz_flux(k,iEdge) - flux_upwind
+
+            upwind_tendency(k,cell1) = upwind_tendency(k,cell1) - flux_upwind * invAreaCell1
+            upwind_tendency(k,cell2) = upwind_tendency(k,cell2) + flux_upwind * invAreaCell2
+
+            ! Accumulate remaining high order fluxes
+            flux_outgoing(k,cell1) = flux_outgoing(k,cell1) - max(0.,high_order_horiz_flux(k,iEdge)) * invAreaCell1
+            flux_incoming (k,cell1) = flux_incoming (k,cell1) - min(0.,high_order_horiz_flux(k,iEdge)) * invAreaCell1
+            flux_outgoing(k,cell2) = flux_outgoing(k,cell2) + min(0.,high_order_horiz_flux(k,iEdge)) * invAreaCell2
+            flux_incoming (k,cell2) = flux_incoming (k,cell2) + max(0.,high_order_horiz_flux(k,iEdge)) * invAreaCell2
+          end do ! k loop
+        end do ! iEdge loop
+
+        ! Build the factors for the FCT
+        ! Computed using the bounds that were computed previously, and the bounds on the newly updated value
+        ! Factors are placed in the flux_incoming and flux_outgoing arrays
+        do iCell = 1, nCells
+          do k = 1, maxLevelCell(iCell)
+            tracer_min_new = (tracer_cur(k,iCell)*h(k,iCell) + dt*(upwind_tendency(k,iCell)+flux_outgoing(k,iCell))) * inv_h_new(k,iCell)
+            tracer_max_new = (tracer_cur(k,iCell)*h(k,iCell) + dt*(upwind_tendency(k,iCell)+flux_incoming(k,iCell))) * inv_h_new(k,iCell)
+            tracer_upwind_new = (tracer_cur(k,iCell)*h(k,iCell) + dt*upwind_tendency(k,iCell)) * inv_h_new(k,iCell)
+           
+            scale_factor = (tracer_max(k,iCell)-tracer_upwind_new)/(tracer_max_new-tracer_upwind_new+eps)
+            flux_incoming(k,iCell) = min( 1.0, max( 0.0, scale_factor) )
+
+            scale_factor = (tracer_upwind_new-tracer_min(k,iCell))/(tracer_upwind_new-tracer_min_new+eps)
+            flux_outgoing(k,iCell) = min( 1.0, max( 0.0, scale_factor) )
+          end do ! k loop
+        end do ! iCell loop
+
+        !  rescale the high order horizontal fluxes
+        do iEdge = 1, nEdges
+          cell1 = cellsOnEdge(1,iEdge)
+          cell2 = cellsOnEdge(2,iEdge)
+          do k = 1, maxLevelEdgeTop(iEdge)
+            flux = high_order_horiz_flux(k,iEdge)
+            flux = max(0.,flux) * min(flux_outgoing(k,cell1), flux_incoming(k,cell2)) &amp;
+                 + min(0.,flux) * min(flux_incoming(k,cell1), flux_outgoing(k,cell2))
+            high_order_horiz_flux(k,iEdge) = flux
+          end do ! k loop
+        end do ! iEdge loop
+
+        ! rescale the high order vertical flux
+        do iCell = 1, nCellsSolve
+          do k = 2, maxLevelCell(iCell)
+            flux =  high_order_vert_flux(k,iCell)
+            ! dwj 02/03/12 Ocean and Atmosphere are different in vertical.
+!           flux = max(0.,flux) * min(flux_outgoing(k-1,iCell), flux_incoming(k  ,iCell)) &amp;
+!                + min(0.,flux) * min(flux_outgoing(k  ,iCell), flux_incoming(k-1,iCell))
+            flux = max(0.,flux) * min(flux_outgoing(k  ,iCell), flux_incoming(k-1,iCell)) &amp;
+                 + min(0.,flux) * min(flux_outgoing(k-1,iCell), flux_incoming(k  ,iCell))
+            high_order_vert_flux(k,iCell) = flux
+          end do ! k loop
+        end do ! iCell loop
+
+        ! Accumulate the scaled high order horizontal tendencies
+        do iEdge = 1, nEdges
+          cell1 = cellsOnEdge(1,iEdge)
+          cell2 = cellsOnEdge(2,iEdge)
+
+          invAreaCell1 = 1.0 / areaCell(cell1)
+          invAreaCell2 = 1.0 / areaCell(cell2)
+          do k=1,maxLevelEdgeTop(iEdge)
+            tend(iTracer, k, cell1) = tend(iTracer, k, cell1) - high_order_horiz_flux(k, iEdge) * invAreaCell1
+            tend(iTracer, k, cell2) = tend(iTracer, k, cell2) + high_order_horiz_flux(k, iEdge) * invAreaCell2
+
+            if (config_check_monotonicity) then
+              !tracer_new holds a tendency for now.
+              tracer_new(k, cell1) = tracer_new(k, cell1) - high_order_horiz_flux(k, iEdge) * invAreaCell1
+              tracer_new(k, cell2) = tracer_new(k, cell2) + high_order_horiz_flux(k, iEdge) * invAreaCell2
+            end if
+          end do ! k loop
+        end do ! iEdge loop
+
+        ! Accumulate the scaled high order vertical tendencies, and the upwind tendencies
+        do iCell = 1, nCellsSolve
+          do k = 1,maxLevelCell(iCell)
+            tend(iTracer, k, iCell) = tend(iTracer, k, iCell) + (high_order_vert_flux(k+1, iCell) - high_order_vert_flux(k, iCell)) + upwind_tendency(k,iCell)
+
+            if (config_check_monotonicity) then
+              !tracer_new holds a tendency for now. Only for a check on monotonicity
+              tracer_new(k, iCell) = tracer_new(k, iCell) + (high_order_vert_flux(k+1, iCell) - high_order_vert_flux(k, iCell)) + upwind_tendency(k,iCell)
+
+              !tracer_new is now the new state of the tracer. Only for a check on monotonicity
+              tracer_new(k, iCell) = (tracer_cur(k, iCell)*h(k, iCell) + dt * tracer_new(k, iCell)) * inv_h_new(k, iCell)
+            end if
+          end do ! k loop
+        end do ! iCell loop
+
+        if (config_check_monotonicity) then
+          !build min and max bounds on old and new tracer for check on monotonicity.
+          cur_min = minval(tracer_cur(:,1:nCellsSolve))
+          cur_max = maxval(tracer_cur(:,1:nCellsSolve))
+          new_min = minval(tracer_new(:,1:nCellsSolve))
+          new_max = maxval(tracer_new(:,1:nCellsSolve))
+
+          !check monotonicity
+          if(new_min &lt; cur_min-eps) then
+              write(*,*) 'Minimum out of bounds on tracer ', iTracer, cur_min, new_min
+          end if
+
+          if(new_max &gt; cur_max+eps) then
+              write(*,*) 'Maximum out of bounds on tracer ', iTracer, cur_max, new_max
+          end if
+        end if
+      end do ! iTracer loop
+
+      deallocate(tracer_new)
+      deallocate(tracer_cur)
+      deallocate(upwind_tendency)
+      deallocate(inv_h_new)
+      deallocate(tracer_max)
+      deallocate(tracer_min)
+      deallocate(flux_incoming)
+      deallocate(flux_outgoing)
+      deallocate(high_order_horiz_flux)
+      deallocate(high_order_vert_flux)
+   end subroutine mpas_ocn_tracer_advection_mono_tend!}}}
+
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  routine mpas_ocn_tracer_advection_mono_init
+!
+!&gt; \brief MPAS ocean initialize monotonic tracer advection tendency with FCT
+!&gt; \author Doug Jacobsen
+!&gt; \date   03/09/12
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This routine initializes the monotonic tracer advection tendencity using a FCT.
+!
+!-----------------------------------------------------------------------
+   subroutine mpas_ocn_tracer_advection_mono_init(err)!{{{
+      integer, intent(inout) :: err !&lt; Input: Error Flags
+
+      integer :: err_tmp
+
+      err = 0
+
+      if ( config_horiz_tracer_adv_order == 3) then
+          coef_3rd_order = config_coef_3rd_order
+      else if(config_horiz_tracer_adv_order == 2 .or. config_horiz_tracer_adv_order == 4) then
+          coef_3rd_order = 0.0
+      end if
+
+   end subroutine mpas_ocn_tracer_advection_mono_init!}}}
+
+end module mpas_ocn_tracer_advection_mono

Copied: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_advection_std.F (from rev 1679, trunk/mpas/src/core_ocean/mpas_ocn_tracer_advection_std.F)
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_advection_std.F                                (rev 0)
+++ branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_advection_std.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -0,0 +1,100 @@
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  ocn_tracer_advection_std
+!
+!&gt; \brief MPAS ocean tracer advection driver (non-monotonic/fct)
+!&gt; \author Doug Jacobsen
+!&gt; \date   03/09/12
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This module contains driver routine for tracer advection tendencies
+!&gt;  as well as the routines for setting up advection coefficients and 
+!&gt;  initialization of the advection routines.
+!
+!-----------------------------------------------------------------------
+module mpas_ocn_tracer_advection_std
+
+   use mpas_kind_types
+   use mpas_grid_types
+   use mpas_configure
+   use mpas_dmpar
+   use mpas_timer
+
+   use mpas_ocn_tracer_advection_std_hadv
+   use mpas_ocn_tracer_advection_std_vadv
+
+   implicit none
+   private
+   save
+
+   public :: mpas_ocn_tracer_advection_std_tend, &amp;
+             mpas_ocn_tracer_advection_std_init
+
+   contains
+
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  routine mpas_ocn_tracer_advection_std_tend
+!
+!&gt; \brief MPAS ocean standard tracer advection tendency
+!&gt; \author Doug Jacobsen
+!&gt; \date   03/09/12
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This routine is the driver routine for the standard computation of 
+!&gt;  tracer advection tendencies.
+!
+!-----------------------------------------------------------------------
+   subroutine mpas_ocn_tracer_advection_std_tend(tracers, uh, w, verticalCellSize, grid, tend)!{{{
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
+   !
+   ! Input: s - current model state
+   !        grid - grid metadata
+   !
+   ! Output: tend - computed scalar tendencies
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
+
+      real (kind=RKIND), dimension(:,:,:), intent(inout) :: tend !&lt; Input/Output: Tracer tendency
+      real (kind=RKIND), dimension(:,:,:), intent(in) :: tracers !&lt; Input: Tracer values
+      real (kind=RKIND), dimension(:,:), intent(in) :: uh !&lt; Input: Thickness weighted horizontal velocity
+      real (kind=RKIND), dimension(:,:), intent(in) :: w !&lt; Input: Vertical Velocity
+      real (kind=RKIND), dimension(:,:), intent(in) :: verticalCellSize !&lt; Input: Distance between vertical interfaces of a cell
+      type (mesh_type), intent(in) :: grid !&lt; Input: Grid information
+
+      call mpas_timer_start(&quot;tracer-hadv&quot;, .false.)
+      call mpas_ocn_tracer_advection_std_hadv_tend(tracers, uh, grid, tend)
+      call mpas_timer_stop(&quot;tracer-hadv&quot;)
+      call mpas_timer_start(&quot;tracer-vadv&quot;, .false.)
+      call mpas_ocn_tracer_advection_std_vadv_tend(tracers, w, verticalCellSize, grid, tend)
+      call mpas_timer_stop(&quot;tracer-vadv&quot;)
+
+   end subroutine mpas_ocn_tracer_advection_std_tend!}}}
+
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  routine mpas_ocn_tracer_advection_std_init
+!
+!&gt; \brief MPAS ocean standard tracer advection initialization
+!&gt; \author Doug Jacobsen
+!&gt; \date   03/09/12
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This routine is the driver routine for the initializtion of the standard 
+!&gt;  tracer advection routines.
+!
+!-----------------------------------------------------------------------
+   subroutine mpas_ocn_tracer_advection_std_init(err)!{{{
+      integer, intent(inout) :: err !&lt; Input: Error Flags
+
+      integer :: err_tmp
+
+      err = 0
+
+      call mpas_ocn_tracer_advection_std_hadv_init(err_tmp)
+      err = ior(err, err_tmp)
+      call mpas_ocn_tracer_advection_std_vadv_init(err_tmp)
+      err = ior(err, err_tmp)
+
+   end subroutine mpas_ocn_tracer_advection_std_init!}}}
+
+end module mpas_ocn_tracer_advection_std

Copied: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_advection_std_hadv.F (from rev 1679, trunk/mpas/src/core_ocean/mpas_ocn_tracer_advection_std_hadv.F)
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_advection_std_hadv.F                                (rev 0)
+++ branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_advection_std_hadv.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -0,0 +1,140 @@
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  ocn_tracer_advection_std_hadv
+!
+!&gt; \brief MPAS ocean standard horizontal tracer advection (non-monotonic/fct)
+!&gt; \author Doug Jacobsen
+!&gt; \date   03/09/12
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This module contains routines for horizontal tracer advection tendencies
+!&gt;  and initialization of the horizontal advection routines.
+!
+!-----------------------------------------------------------------------
+module mpas_ocn_tracer_advection_std_hadv
+
+   use mpas_kind_types
+   use mpas_grid_types
+   use mpas_configure
+   use mpas_dmpar
+
+   use mpas_ocn_tracer_advection_helpers
+
+   implicit none
+   private
+   save
+
+   public :: mpas_ocn_tracer_advection_std_hadv_tend, &amp;
+             mpas_ocn_tracer_advection_std_hadv_init
+
+   real (kind=RKIND) :: coef_3rd_order
+
+   logical :: hadvOn
+
+   contains
+
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  routine mpas_ocn_tracer_advection_std_hadv_tend
+!
+!&gt; \brief MPAS ocean standard horizontal tracer advection tendency
+!&gt; \author Doug Jacobsen
+!&gt; \date   03/09/12
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This routine computes the tendency for 3rd order horizontal advection of tracers.
+!
+!-----------------------------------------------------------------------
+   subroutine mpas_ocn_tracer_advection_std_hadv_tend(tracers, uh, grid, tend)!{{{
+      real (kind=RKIND), dimension(:,:,:), intent(inout) :: tend !&lt; Input/output: Tracer tendency
+      real (kind=RKIND), dimension(:,:,:), intent(in) :: tracers !&lt; Input: Tracer values
+      real (kind=RKIND), dimension(:,:), intent(in) :: uh !&lt; Input: Thickness weighted horizontal velocity
+      type (mesh_type), intent(in) :: grid !&lt; Input: Grid information
+
+      integer :: i, iCell, iEdge, k, iTracer, cell1, cell2
+      real (kind=RKIND) :: flux, tracer_weight
+
+      real (kind=RKIND), dimension(:), pointer :: areaCell
+      integer, dimension(:,:), pointer :: cellsOnEdge
+
+      integer, dimension(:,:), pointer :: advCellsForEdge, highOrderAdvectionMask, lowOrderAdvectionMask
+      integer, dimension(:), pointer :: nAdvCellsForEdge
+      real (kind=RKIND), dimension(:,:), pointer :: adv_coefs, adv_coefs_2nd, adv_coefs_3rd
+      real (kind=RKIND), dimension(:,:), allocatable :: flux_arr
+      integer :: nVertLevels, num_tracers
+
+      if (.not. hadvOn) return
+
+      cellsOnEdge =&gt; grid % cellsOnEdge % array
+      areaCell    =&gt; grid % areaCell % array
+
+      nAdvCellsForEdge =&gt; grid % nAdvCellsForEdge % array
+      advCellsForEdge =&gt; grid % advCellsForEdge % array
+      adv_coefs =&gt; grid % adv_coefs % array
+      adv_coefs_2nd =&gt; grid % adv_coefs_2nd % array
+      adv_coefs_3rd =&gt; grid % adv_coefs_3rd % array
+      highOrderAdvectionMask =&gt; grid % highOrderAdvectionMask % array
+      lowOrderAdvectionMask =&gt; grid % lowOrderAdvectionMask % array
+
+      nVertLevels = grid % nVertLevels
+      num_tracers = size(tracers, dim=1)
+
+      allocate(flux_arr(num_tracers, grid % nVertLevels))
+
+      !  horizontal flux divergence, accumulate in tracer_tend
+      do iEdge=1,grid%nEdges
+         cell1 = cellsOnEdge(1,iEdge)
+         cell2 = cellsOnEdge(2,iEdge)
+         if (cell1 &lt;= grid%nCellsSolve .or. cell2 &lt;= grid%nCellsSolve) then  ! only for owned cells
+            flux_arr(:,:) = 0.
+            do i=1,nAdvCellsForEdge(iEdge)
+              iCell = advCellsForEdge(i,iEdge)
+              do k=1,grid % nVertLevels
+              tracer_weight = lowOrderAdvectionMask(k, iEdge) * adv_coefs_2nd(i,iEdge) &amp; 
+                            + highOrderAdvectionMask(k, iEdge) * (adv_coefs(i,iEdge) + coef_3rd_order*sign(1.,uh(k,iEdge))*adv_coefs_3rd(i,iEdge))
+                do iTracer=1,num_tracers
+                  flux_arr(iTracer,k) = flux_arr(iTracer,k) + tracer_weight* tracers(iTracer,k,iCell)
+                end do
+              end do
+            end do
+
+            do k=1,grid % nVertLevels
+               do iTracer=1,num_tracers
+                  tend(iTracer,k,cell1) = tend(iTracer,k,cell1) - uh(k,iEdge)*flux_arr(iTracer,k)/areaCell(cell1)
+                  tend(iTracer,k,cell2) = tend(iTracer,k,cell2) + uh(k,iEdge)*flux_arr(iTracer,k)/areaCell(cell2)
+               end do
+            end do
+         end if
+       end do
+
+       deallocate(flux_arr)
+
+   end subroutine mpas_ocn_tracer_advection_std_hadv_tend!}}}
+
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  routine mpas_ocn_tracer_advection_std_hadv_init
+!
+!&gt; \brief MPAS ocean standard horizontal tracer advection initialization
+!&gt; \author Doug Jacobsen
+!&gt; \date   03/09/12
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This routine initializes the 3rd order standard horizontal advection of tracers
+!
+!-----------------------------------------------------------------------
+   subroutine mpas_ocn_tracer_advection_std_hadv_init(err)!{{{
+      integer, intent(inout) :: err !&lt; Input/Output: Error flag
+
+      err = 0
+
+      hadvOn =.true.
+
+      if ( config_horiz_tracer_adv_order == 3) then
+        coef_3rd_order = config_coef_3rd_order
+      else if ( config_horiz_tracer_adv_order == 2 .or. config_horiz_tracer_adv_order == 4) then
+        coef_3rd_order = 0.0
+      end if
+   end subroutine mpas_ocn_tracer_advection_std_hadv_init!}}}
+
+end module mpas_ocn_tracer_advection_std_hadv

Copied: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_advection_std_vadv.F (from rev 1679, trunk/mpas/src/core_ocean/mpas_ocn_tracer_advection_std_vadv.F)
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_advection_std_vadv.F                                (rev 0)
+++ branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_advection_std_vadv.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -0,0 +1,103 @@
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  ocn_tracer_advection_std_vadv
+!
+!&gt; \brief MPAS ocean vertical tracer advection driver (non-monotonic/fct)
+!&gt; \author Doug Jacobsen
+!&gt; \date   03/09/12
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This module contains driver routines for vertical tracer advection tendencies
+!&gt;  and initialization of the advection routines.
+!
+!-----------------------------------------------------------------------
+module mpas_ocn_tracer_advection_std_vadv
+
+   use mpas_kind_types
+   use mpas_grid_types
+   use mpas_configure
+   use mpas_dmpar
+
+   use mpas_ocn_tracer_advection_std_vadv2
+   use mpas_ocn_tracer_advection_std_vadv3
+   use mpas_ocn_tracer_advection_std_vadv4
+
+   implicit none
+   private
+   save
+
+   public :: mpas_ocn_tracer_advection_std_vadv_tend, &amp;
+             mpas_ocn_tracer_advection_std_vadv_init
+
+   logical :: order2, order3, order4
+
+   contains
+
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  routine mpas_ocn_tracer_advection_std_vadv_tend
+!
+!&gt; \brief MPAS ocean standard vertical tracer advection tendency
+!&gt; \author Doug Jacobsen
+!&gt; \date   03/09/12
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This routine is the driver routine for the standard computation of 
+!&gt;  vertical tracer advection tendencies.
+!
+!-----------------------------------------------------------------------
+   subroutine mpas_ocn_tracer_advection_std_vadv_tend(tracers, w, verticalCellSize, grid, tend)!{{{
+
+      real (kind=RKIND), dimension(:,:,:), intent(inout) :: tend !&lt; Input/Output: Tracer Tendency
+      real (kind=RKIND), dimension(:,:,:), intent(in) :: tracers !&lt; Input: Tracer Values
+      real (kind=RKIND), dimension(:,:), intent(in) :: w !&lt; Input: Vertical Velocity
+      real (kind=RKIND), dimension(:,:), intent(in) :: verticalCellSize !&lt; Input: Distance between vertical interfaces of cell
+      type (mesh_type), intent(in) :: grid !&lt; Input: Grid information
+
+      if(order2) then
+        call mpas_ocn_tracer_advection_std_vadv2_tend(tracers, w, verticalCellSize, grid, tend) 
+      else if(order3) then
+        call mpas_ocn_tracer_advection_std_vadv3_tend(tracers, w, verticalCellSize, grid, tend) 
+      else if(order4) then
+        call mpas_ocn_tracer_advection_std_vadv4_tend(tracers, w, verticalCellSize, grid, tend) 
+      endif
+
+   end subroutine mpas_ocn_tracer_advection_std_vadv_tend!}}}
+
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  routine mpas_ocn_tracer_advection_std_vadv_init
+!
+!&gt; \brief MPAS ocean standard vertical tracer advection tendency
+!&gt; \author Doug Jacobsen
+!&gt; \date   03/09/12
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This routine initializes the vertical tracer advection tendencies.
+!
+!-----------------------------------------------------------------------
+   subroutine mpas_ocn_tracer_advection_std_vadv_init(err)!{{{
+     integer, intent(inout) :: err !&lt; Input/Output: Error flag
+
+     err = 0
+
+     order2 = .false.
+     order3 = .false.
+     order4 = .false.
+
+     if (config_vert_tracer_adv_order == 2) then
+         order2 = .true.
+     else if (config_vert_tracer_adv_order == 3) then
+         order3 = .true.
+     else if (config_vert_tracer_adv_order == 4) then
+         order4 = .true.
+     else
+         print *, 'invalid value for config_tracer_vadv_order'
+         print *, 'options are 2, 3, or 4'
+         err = 1
+     endif
+        
+   end subroutine mpas_ocn_tracer_advection_std_vadv_init!}}}
+
+end module mpas_ocn_tracer_advection_std_vadv
+

Copied: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_advection_std_vadv2.F (from rev 1679, trunk/mpas/src/core_ocean/mpas_ocn_tracer_advection_std_vadv2.F)
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_advection_std_vadv2.F                                (rev 0)
+++ branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_advection_std_vadv2.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -0,0 +1,96 @@
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  ocn_tracer_advection_std_vadv2
+!
+!&gt; \brief MPAS ocean 2nd order vertical tracer advection driver (non-monotonic/fct)
+!&gt; \author Doug Jacobsen
+!&gt; \date   03/09/12
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This module contains routines for 2nd order vertical tracer advection tendencies.
+!
+!-----------------------------------------------------------------------
+module mpas_ocn_tracer_advection_std_vadv2
+
+   use mpas_kind_types
+   use mpas_grid_types
+   use mpas_configure
+   use mpas_dmpar
+
+   use mpas_ocn_tracer_advection_helpers
+
+   implicit none
+   private
+   save
+
+   public :: mpas_ocn_tracer_advection_std_vadv2_tend
+
+   contains
+
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  routine mpas_ocn_tracer_advection_std_vadv2_tend
+!
+!&gt; \brief MPAS ocean 2nd order standard vertical tracer advection tendency
+!&gt; \author Doug Jacobsen
+!&gt; \date   03/09/12
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This routine is the driver routine for the 2nd order standard computation of 
+!&gt;  vertical tracer advection tendencies.
+!
+!-----------------------------------------------------------------------
+   subroutine mpas_ocn_tracer_advection_std_vadv2_tend(tracers, w, verticalCellSize, grid, tend)!{{{
+      real (kind=RKIND), dimension(:,:,:), intent(inout) :: tend !&lt; Input/Output: tracer tendency
+      real (kind=RKIND), dimension(:,:,:), intent(in) :: tracers !&lt; Input: Tracer values
+      real (kind=RKIND), dimension(:,:), intent(in) :: w !&lt; Input: Vertical Velocity
+      real (kind=RKIND), dimension(:,:), intent(in) :: verticalCellSize !&lt; Input: Distance between vertical interfaces of cell
+      type (mesh_type), intent(in) :: grid !&lt; Input: Grid information
+
+      integer :: i, iCell, iEdge, k, iTracer, cell1, cell2
+      real (kind=RKIND) :: flux, tracer_edge, tracer_weight
+      real (kind=RKIND) :: tracer_weight_cell1, tracer_weight_cell2
+
+
+      real (kind=RKIND), dimension(:,:), allocatable :: vert_flux
+      real (kind=RKIND) :: weightK, weightKm1
+      integer :: nVertLevels, num_tracers
+      integer, dimension(:), pointer :: maxLevelCell
+
+      nVertLevels = grid % nVertLevels
+      num_tracers = size(tracers, dim=1)
+      maxLevelCell =&gt; grid % maxLevelCell % array
+
+      allocate(vert_flux(num_tracers, nVertLevels+1))
+
+      !
+      !  vertical flux divergence
+      !
+
+      ! zero fluxes at top and bottom
+
+      vert_flux(:,1) = 0.
+
+      do iCell=1,grid % nCellsSolve
+        do k = 2, maxLevelCell(iCell)
+           do iTracer=1,num_tracers
+             weightK = verticalCellSize(k-1, iCell) / (verticalCellSize(k-1, iCell) + verticalCellSize(k, iCell))
+             weightKm1 = verticalCellSize(k, iCell) / (verticalCellSize(k-1, iCell) + verticalCellSize(k, iCell))
+             vert_flux(iTracer,k) = w(k,iCell)*(weightK*tracers(iTracer,k,iCell)+weightKm1*tracers(iTracer,k-1,iCell))
+           end do
+        end do
+
+        vert_flux(:,maxLevelCell(iCell)+1) = 0
+
+        do k=1,maxLevelCell(iCell)
+           do iTracer=1,num_tracers
+             tend(iTracer, k, iCell) = tend(iTracer, k, iCell) + ( vert_flux(iTracer, k+1) - vert_flux(iTracer, k))
+           end do
+        end do
+      end do
+
+      deallocate(vert_flux)
+      
+   end subroutine mpas_ocn_tracer_advection_std_vadv2_tend!}}}
+
+end module mpas_ocn_tracer_advection_std_vadv2

Copied: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_advection_std_vadv3.F (from rev 1679, trunk/mpas/src/core_ocean/mpas_ocn_tracer_advection_std_vadv3.F)
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_advection_std_vadv3.F                                (rev 0)
+++ branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_advection_std_vadv3.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -0,0 +1,106 @@
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  ocn_tracer_advection_std_vadv3
+!
+!&gt; \brief MPAS ocean 3rd order vertical tracer advection driver (non-monotonic/fct)
+!&gt; \author Doug Jacobsen
+!&gt; \date   03/09/12
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This module contains routines for 3rd order vertical tracer advection tendencies.
+!
+!-----------------------------------------------------------------------
+module mpas_ocn_tracer_advection_std_vadv3
+
+   use mpas_kind_types
+   use mpas_grid_types
+   use mpas_configure
+   use mpas_dmpar
+
+   use mpas_ocn_tracer_advection_helpers
+
+   implicit none
+   private
+   save
+
+   public :: mpas_ocn_tracer_advection_std_vadv3_tend
+
+   real (kind=RKIND) :: coef_3rd_order
+
+   contains
+
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  routine mpas_ocn_tracer_advection_std_vadv3_tend
+!
+!&gt; \brief MPAS ocean 3rd order standard vertical tracer advection tendency
+!&gt; \author Doug Jacobsen
+!&gt; \date   03/09/12
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This routine computes the 3rd order vertical tracer advection tendencies.
+!
+!-----------------------------------------------------------------------
+   subroutine mpas_ocn_tracer_advection_std_vadv3_tend(tracers, w, verticalCellSize, grid, tend)!{{{
+      real (kind=RKIND), dimension(:,:,:), intent(inout) :: tend !&lt; Input/Output: Tracer Tendency
+      real (kind=RKIND), dimension(:,:,:), intent(in) :: tracers !&lt; Input: Tracer Values
+      real (kind=RKIND), dimension(:,:), intent(in) :: w !&lt; Input: Vertical Velocity
+      real (kind=RKIND), dimension(:,:), intent(in) :: verticalCellSize !&lt; Input: Distance between vertical interfaces of cell
+      type (mesh_type), intent(in) :: grid !&lt; Input: Grid information
+
+      integer :: i, iCell, iEdge, k, iTracer, cell1, cell2
+
+      real (kind=RKIND), dimension(:,:), allocatable :: vert_flux
+      real (kind=RKIND) :: weightK, weightKm1
+      integer :: nVertLevels, num_tracers
+      integer, dimension(:), pointer :: maxLevelCell
+
+      coef_3rd_order = config_coef_3rd_order
+
+      nVertLevels = grid % nVertLevels
+      num_tracers = size(tracers, dim=1)
+      maxLevelCell =&gt; grid % maxLevelCell % array
+
+      allocate(vert_flux(num_tracers, nVertLevels+1))
+
+      vert_flux(:,1) = 0.
+
+      do iCell=1,grid % nCellsSolve
+
+        k = 2
+        do iTracer=1,num_tracers
+          weightK = verticalCellSize(k-1, iCell) / (verticalCellSize(k-1, iCell) + verticalCellSize(k, iCell))
+          weightKm1 = verticalCellSize(k, iCell) / (verticalCellSize(k-1, iCell) + verticalCellSize(k, iCell))
+          vert_flux(iTracer,k) = w(k,iCell)*(weightK*tracers(iTracer,k,iCell)+weightKm1*tracers(iTracer,k-1,iCell))
+        enddo
+        
+        do k=3,maxLevelCell(iCell)-1
+          do iTracer=1,num_tracers
+            vert_flux(iTracer,k) = mpas_ocn_tracer_advection_vflux3( tracers(iTracer,k-2,iCell),tracers(iTracer,k-1,iCell),  &amp;
+                                     tracers(iTracer,k  ,iCell),tracers(iTracer,k+1,iCell),  &amp;
+                                     w(k,iCell), coef_3rd_order )
+          end do
+        end do
+
+        k = maxLevelCell(iCell)
+
+        do iTracer=1,num_tracers
+          weightK = verticalCellSize(k-1, iCell) / (verticalCellSize(k-1, iCell) + verticalCellSize(k, iCell))
+          weightKm1 = verticalCellSize(k, iCell) / (verticalCellSize(k-1, iCell) + verticalCellSize(k, iCell))
+          vert_flux(iTracer,k) = w(k,iCell)*(weightK*tracers(iTracer,k,iCell)+weightKm1*tracers(iTracer,k-1,iCell))
+        enddo
+
+        vert_Flux(:, maxLevelCell(iCell)+1) = 0.0
+
+        do k=1,maxLevelCell(iCell)
+           do iTracer=1,num_tracers
+             tend(iTracer, k, iCell) = tend(iTracer, k, iCell) + (vert_flux(iTracer, k+1) - vert_flux(iTracer, k))
+           end do
+        end do
+      end do
+
+      deallocate(vert_flux)
+
+   end subroutine mpas_ocn_tracer_advection_std_vadv3_tend!}}}
+
+end module mpas_ocn_tracer_advection_std_vadv3

Copied: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_advection_std_vadv4.F (from rev 1679, trunk/mpas/src/core_ocean/mpas_ocn_tracer_advection_std_vadv4.F)
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_advection_std_vadv4.F                                (rev 0)
+++ branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_advection_std_vadv4.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -0,0 +1,105 @@
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  ocn_tracer_advection_std_vadv4
+!
+!&gt; \brief MPAS ocean 4th order vertical tracer advection driver (non-monotonic/fct)
+!&gt; \author Doug Jacobsen
+!&gt; \date   03/09/12
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This module contains routines for 4th order vertical tracer advection.
+!
+!-----------------------------------------------------------------------
+module mpas_ocn_tracer_advection_std_vadv4
+
+   use mpas_kind_types
+   use mpas_grid_types
+   use mpas_configure
+   use mpas_dmpar
+
+   use mpas_ocn_tracer_advection_helpers
+
+   implicit none
+   private
+   save
+
+   public :: mpas_ocn_tracer_advection_std_vadv4_tend
+
+   contains
+
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  routine mpas_ocn_tracer_advection_std_vadv4_tend
+!
+!&gt; \brief MPAS ocean 4th order standard vertical tracer advection tendency
+!&gt; \author Doug Jacobsen
+!&gt; \date   03/09/12
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This routine computes the 4th order vertical tracer advection tendencies.
+!
+!-----------------------------------------------------------------------
+   subroutine mpas_ocn_tracer_advection_std_vadv4_tend(tracers, w, verticalCellSize, grid, tend)!{{{
+      real (kind=RKIND), dimension(:,:,:), intent(inout) :: tend !&lt; Input/Output: Tracer tendency
+      real (kind=RKIND), dimension(:,:,:), intent(in) :: tracers !&lt; Input: Tracer Values
+      real (kind=RKIND), dimension(:,:), intent(in) :: w !&lt; Input: Vertical Velocity
+      real (kind=RKIND), dimension(:,:), intent(in) :: verticalCellSize !&lt; Input: Distance between vertical interfaces of cell
+      type (mesh_type), intent(in) :: grid !&lt; Input: Grid information
+
+      integer :: i, iCell, iEdge, k, iTracer, cell1, cell2
+
+      real (kind=RKIND), dimension(:,:), allocatable :: vert_flux
+      real (kind=RKIND) :: weightK, weightKm1
+      integer :: nVertLevels, num_tracers
+      integer, dimension(:), pointer :: maxLevelCell
+
+      nVertLevels = grid % nVertLevels
+      num_tracers = size(tracers, dim=1)
+      maxLevelCell =&gt; grid % maxLevelCell % array
+
+      allocate(vert_flux(num_tracers, nVertLevels+1))
+
+      !  vertical flux divergence
+      !
+
+      ! zero fluxes at top and bottom
+
+      vert_flux(:,1) = 0.
+
+      do iCell=1,grid % nCellsSolve
+
+        k = 2
+        do iTracer=1,num_tracers
+          weightK = verticalCellSize(k-1, iCell) / (verticalCellSize(k-1, iCell) + verticalCellSize(k, iCell))
+          weightKm1 = verticalCellSize(k, iCell) / (verticalCellSize(k-1, iCell) + verticalCellSize(k, iCell))
+          vert_flux(iTracer,k) = w(k,iCell)*(weightK*tracers(iTracer,k,iCell)+weightKm1*tracers(iTracer,k-1,iCell))
+        enddo
+        do k=3,nVertLevels-1
+          do iTracer=1,num_tracers
+            vert_flux(iTracer,k) = mpas_ocn_tracer_advection_vflux4( tracers(iTracer,k-2,iCell),tracers(iTracer,k-1,iCell),  &amp;
+                                     tracers(iTracer,k  ,iCell),tracers(iTracer,k+1,iCell), w(k,iCell) )
+          end do
+        end do
+
+        k = maxLevelCell(iCell)
+        do iTracer=1,num_tracers
+          weightK = verticalCellSize(k-1, iCell) / (verticalCellSize(k-1, iCell) + verticalCellSize(k, iCell))
+          weightKm1 = verticalCellSize(k, iCell) / (verticalCellSize(k-1, iCell) + verticalCellSize(k, iCell))
+          vert_flux(iTracer,k) = w(k,iCell)*(weightK*tracers(iTracer,k,iCell)+weightKm1*tracers(iTracer,k-1,iCell))
+        enddo
+
+        vert_flux(:,maxLevelCell(iCell)+1) = 0.0
+
+        do k=1,maxLevelCell(iCell)
+           do iTracer=1,num_tracers
+             tend(iTracer, k, iCell) = tend(iTracer, k, iCell) + (vert_flux(iTracer, k+1) - vert_flux(iTracer, k))
+           end do
+        end do
+
+      end do
+
+      deallocate(vert_flux)
+                                                                                        
+   end subroutine mpas_ocn_tracer_advection_std_vadv4_tend!}}}
+
+end module mpas_ocn_tracer_advection_std_vadv4


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_hadv.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_tracer_hadv.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_tracer_hadv.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_tracer_hadv.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_tracer_hadv.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_tracer_hadv.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hadv.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_tracer_hadv.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_tracer_hadv.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_tracer_hadv.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_tracer_hadv.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_tracer_hadv.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_tracer_hadv.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_tracer_hadv.F:924-962

Modified: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_hadv2.F
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_hadv2.F        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_hadv2.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -182,7 +182,7 @@
       err = 0
       hadv2On = .false.
 
-      if (config_tracer_adv_order == 2) then
+      if (config_horiz_tracer_adv_order == 2) then
           hadv2On = .true.
       end if
 


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_hadv2.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_tracer_hadv2.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_tracer_hadv2.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_tracer_hadv2.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_tracer_hadv2.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_tracer_hadv2.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hadv2.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_tracer_hadv2.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_tracer_hadv2.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_tracer_hadv2.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_tracer_hadv2.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_tracer_hadv2.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_tracer_hadv2.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_tracer_hadv2.F:924-962

Modified: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_hadv3.F
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_hadv3.F        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_hadv3.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -221,11 +221,10 @@
       err = 0
       hadv3On = .false.
 
-      if (config_tracer_adv_order == 3) then
+      if (config_horiz_tracer_adv_order == 3) then
           hadv3On = .true.
 
-          coef_3rd_order = 1.0
-          if (config_monotonic) coef_3rd_order = 0.25
+          coef_3rd_order = config_coef_3rd_order
       end if
 
    !--------------------------------------------------------------------


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_hadv3.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_tracer_hadv3.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_tracer_hadv3.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_tracer_hadv3.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_tracer_hadv3.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_tracer_hadv3.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hadv3.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_tracer_hadv3.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_tracer_hadv3.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_tracer_hadv3.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_tracer_hadv3.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_tracer_hadv3.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_tracer_hadv3.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_tracer_hadv3.F:924-962

Modified: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_hadv4.F
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_hadv4.F        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_hadv4.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -213,7 +213,7 @@
       err = 0
       hadv4On = .false.
 
-      if (config_tracer_adv_order == 4) then
+      if (config_horiz_tracer_adv_order == 4) then
           hadv4On = .true.
       end if
 


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_hadv4.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_tracer_hadv4.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_tracer_hadv4.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_tracer_hadv4.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_tracer_hadv4.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_tracer_hadv4.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hadv4.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_tracer_hadv4.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_tracer_hadv4.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_tracer_hadv4.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_tracer_hadv4.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_tracer_hadv4.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_tracer_hadv4.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_tracer_hadv4.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_hmix.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_tracer_hmix.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_tracer_hmix.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_tracer_hmix.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_tracer_hmix.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_tracer_hmix.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hmix.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_tracer_hmix.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_tracer_hmix.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_tracer_hmix.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_tracer_hmix.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_tracer_hmix.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_tracer_hmix.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_tracer_hmix.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_hmix_del2.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_tracer_hmix_del2.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_tracer_hmix_del2.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_tracer_hmix_del2.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_tracer_hmix_del2.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_tracer_hmix_del2.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hmix_del2.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_tracer_hmix_del2.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_tracer_hmix_del2.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_tracer_hmix_del2.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_tracer_hmix_del2.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_tracer_hmix_del2.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_tracer_hmix_del2.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_tracer_hmix_del2.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_hmix_del4.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_tracer_hmix_del4.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_tracer_hmix_del4.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_tracer_hmix_del4.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_tracer_hmix_del4.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_tracer_hmix_del4.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hmix_del4.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_tracer_hmix_del4.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_tracer_hmix_del4.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_tracer_hmix_del4.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_tracer_hmix_del4.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_tracer_hmix_del4.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_tracer_hmix_del4.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_tracer_hmix_del4.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_vadv.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_tracer_vadv.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_tracer_vadv.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_tracer_vadv.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_tracer_vadv.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_tracer_vadv.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_vadv.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_tracer_vadv.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_tracer_vadv.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_tracer_vadv.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_tracer_vadv.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_tracer_vadv.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_tracer_vadv.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_tracer_vadv.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_vadv_spline.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_tracer_vadv_spline.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_tracer_vadv_spline.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_tracer_vadv_spline.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_tracer_vadv_spline.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_tracer_vadv_spline.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_vadv_spline.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_tracer_vadv_spline.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_tracer_vadv_spline.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_tracer_vadv_spline.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_tracer_vadv_spline.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_tracer_vadv_spline.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_tracer_vadv_spline.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_tracer_vadv_spline.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_vadv_spline2.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_tracer_vadv_spline2.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_tracer_vadv_spline2.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_tracer_vadv_spline2.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_tracer_vadv_spline2.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_tracer_vadv_spline2.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_vadv_spline2.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_tracer_vadv_spline2.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_tracer_vadv_spline2.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_tracer_vadv_spline2.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_tracer_vadv_spline2.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_tracer_vadv_spline2.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_tracer_vadv_spline2.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_tracer_vadv_spline2.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_vadv_spline3.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_tracer_vadv_spline3.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_tracer_vadv_spline3.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_tracer_vadv_spline3.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_tracer_vadv_spline3.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_tracer_vadv_spline3.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_vadv_spline3.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_tracer_vadv_spline3.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_tracer_vadv_spline3.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_tracer_vadv_spline3.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_tracer_vadv_spline3.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_tracer_vadv_spline3.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_tracer_vadv_spline3.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_tracer_vadv_spline3.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_vadv_stencil.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_tracer_vadv_stencil.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_tracer_vadv_stencil.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_tracer_vadv_stencil.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_tracer_vadv_stencil.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_tracer_vadv_stencil.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_vadv_stencil.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_tracer_vadv_stencil.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_tracer_vadv_stencil.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_tracer_vadv_stencil.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_tracer_vadv_stencil.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_tracer_vadv_stencil.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_tracer_vadv_stencil.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_tracer_vadv_stencil.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_vadv_stencil2.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_tracer_vadv_stencil2.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_tracer_vadv_stencil2.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_tracer_vadv_stencil2.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_tracer_vadv_stencil2.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_tracer_vadv_stencil2.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_vadv_stencil2.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_tracer_vadv_stencil2.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_tracer_vadv_stencil2.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_tracer_vadv_stencil2.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_tracer_vadv_stencil2.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_tracer_vadv_stencil2.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_tracer_vadv_stencil2.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_tracer_vadv_stencil2.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_vadv_stencil3.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_tracer_vadv_stencil3.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_tracer_vadv_stencil3.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_tracer_vadv_stencil3.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_tracer_vadv_stencil3.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_tracer_vadv_stencil3.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_vadv_stencil3.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_tracer_vadv_stencil3.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_tracer_vadv_stencil3.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_tracer_vadv_stencil3.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_tracer_vadv_stencil3.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_tracer_vadv_stencil3.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_tracer_vadv_stencil3.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_tracer_vadv_stencil3.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tracer_vadv_stencil4.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_tracer_vadv_stencil4.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_tracer_vadv_stencil4.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_tracer_vadv_stencil4.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_tracer_vadv_stencil4.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_tracer_vadv_stencil4.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_vadv_stencil4.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_tracer_vadv_stencil4.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_tracer_vadv_stencil4.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_tracer_vadv_stencil4.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_tracer_vadv_stencil4.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_tracer_vadv_stencil4.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_tracer_vadv_stencil4.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_tracer_vadv_stencil4.F:924-962

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-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_vel_coriolis.F        2012-03-20 15:59:44 UTC (rev 1682)
@@ -62,7 +62,7 @@
 !
 !-----------------------------------------------------------------------
 
-   subroutine ocn_vel_coriolis_tend(grid, pv_edge, h_edge, u, ke, tend, err)!{{{
+   subroutine ocn_vel_coriolis_tend(grid, Vor_edge, h_edge, u, ke, tend, err)!{{{
 
       !-----------------------------------------------------------------
       !
@@ -71,7 +71,7 @@
       !-----------------------------------------------------------------
 
       real (kind=RKIND), dimension(:,:), intent(in) :: &amp;
-         pv_edge  !&lt; Input: Potential vorticity on edge
+         Vor_edge  !&lt; Input: Potential vorticity on edge
       real (kind=RKIND), dimension(:,:), intent(in) :: &amp;
          h_edge  !&lt; Input: Thickness on edge
       real (kind=RKIND), dimension(:,:), intent(in) :: &amp;
@@ -138,7 +138,7 @@
             q = 0.0
             do j = 1,nEdgesOnEdge(iEdge)
                eoe = edgesOnEdge(j,iEdge)
-               workpv = 0.5 * (pv_edge(k,iEdge) + pv_edge(k,eoe))
+               workpv = 0.5 * (Vor_edge(k,iEdge) + Vor_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


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_vel_coriolis.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_vel_coriolis.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_vel_coriolis.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_vel_coriolis.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_vel_coriolis.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_vel_coriolis.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_vel_coriolis.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_vel_coriolis.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_vel_coriolis.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_vel_coriolis.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_vel_coriolis.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_vel_coriolis.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_vel_coriolis.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_vel_coriolis.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_vel_forcing.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_vel_forcing.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_vel_forcing.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_vel_forcing.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_vel_forcing.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_vel_forcing.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_vel_forcing.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_vel_forcing.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_vel_forcing.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_vel_forcing.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_vel_forcing.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_vel_forcing.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_vel_forcing.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_vel_forcing.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_vel_forcing_bottomdrag.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_vel_forcing_bottomdrag.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_vel_forcing_bottomdrag.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_vel_forcing_bottomdrag.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_vel_forcing_bottomdrag.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_vel_forcing_bottomdrag.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_vel_forcing_bottomdrag.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_vel_forcing_bottomdrag.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_vel_forcing_bottomdrag.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_vel_forcing_bottomdrag.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_vel_forcing_bottomdrag.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_vel_forcing_bottomdrag.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_vel_forcing_bottomdrag.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_vel_forcing_bottomdrag.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_vel_forcing_windstress.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_vel_forcing_windstress.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_vel_forcing_windstress.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_vel_forcing_windstress.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_vel_forcing_windstress.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_vel_forcing_windstress.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_vel_forcing_windstress.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_vel_forcing_windstress.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_vel_forcing_windstress.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_vel_forcing_windstress.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_vel_forcing_windstress.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_vel_forcing_windstress.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_vel_forcing_windstress.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_vel_forcing_windstress.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_vel_hmix.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_vel_hmix.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_vel_hmix.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_vel_hmix.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_vel_hmix.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_vel_hmix.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_vel_hmix.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_vel_hmix.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_vel_hmix.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_vel_hmix.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_vel_hmix.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_vel_hmix.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_vel_hmix.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_vel_hmix.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_vel_hmix_del2.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_vel_hmix_del2.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_vel_hmix_del2.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_vel_hmix_del2.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_vel_hmix_del2.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_vel_hmix_del2.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_vel_hmix_del2.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_vel_hmix_del2.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_vel_hmix_del2.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_vel_hmix_del2.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_vel_hmix_del2.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_vel_hmix_del2.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_vel_hmix_del2.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_vel_hmix_del2.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_vel_hmix_del4.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_vel_hmix_del4.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_vel_hmix_del4.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_vel_hmix_del4.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_vel_hmix_del4.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_vel_hmix_del4.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_vel_hmix_del4.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_vel_hmix_del4.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_vel_hmix_del4.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_vel_hmix_del4.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_vel_hmix_del4.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_vel_hmix_del4.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_vel_hmix_del4.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_vel_hmix_del4.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_vel_pressure_grad.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_vel_pressure_grad.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_vel_pressure_grad.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_vel_pressure_grad.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_vel_pressure_grad.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_vel_pressure_grad.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_vel_pressure_grad.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_vel_pressure_grad.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_vel_pressure_grad.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_vel_pressure_grad.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_vel_pressure_grad.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_vel_pressure_grad.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_vel_pressure_grad.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_vel_pressure_grad.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_vel_vadv.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_vel_vadv.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_vel_vadv.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_vel_vadv.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_vel_vadv.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_vel_vadv.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_vel_vadv.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_vel_vadv.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_vel_vadv.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_vel_vadv.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_vel_vadv.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_vel_vadv.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_vel_vadv.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_vel_vadv.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_vmix.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_vmix.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_vmix.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_vmix.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_vmix.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_vmix.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_vmix.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_vmix.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_vmix.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_vmix.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_vmix.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_vmix.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_vmix.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_vmix.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_vmix_coefs_const.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_vmix_coefs_const.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_vmix_coefs_const.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_vmix_coefs_const.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_vmix_coefs_const.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_vmix_coefs_const.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_vmix_coefs_const.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_vmix_coefs_const.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_vmix_coefs_const.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_vmix_coefs_const.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_vmix_coefs_const.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_vmix_coefs_const.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_vmix_coefs_const.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_vmix_coefs_const.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_vmix_coefs_rich.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_vmix_coefs_rich.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_vmix_coefs_rich.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_vmix_coefs_rich.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_vmix_coefs_rich.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_vmix_coefs_rich.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_vmix_coefs_rich.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_vmix_coefs_rich.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_vmix_coefs_rich.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_vmix_coefs_rich.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_vmix_coefs_rich.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_vmix_coefs_rich.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_vmix_coefs_rich.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_vmix_coefs_rich.F:924-962


Property changes on: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_vmix_coefs_tanh.F
___________________________________________________________________
Deleted: svn:mergeinfo
   - /branches/cam_mpas_nh/src/core_ocean/mpas_ocn_vmix_coefs_tanh.F:1260-1270
/branches/ocean_projects/ale_split_exp/src/core_ocean/mpas_ocn_vmix_coefs_tanh.F:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean/mpas_ocn_vmix_coefs_tanh.F:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean/mpas_ocn_vmix_coefs_tanh.F:1387-1428
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean/mpas_ocn_vmix_coefs_tanh.F:754-986
/branches/ocean_projects/performance/src/core_ocean/mpas_ocn_vmix_coefs_tanh.F:1120-1371
/branches/ocean_projects/rayleigh/src/core_ocean/mpas_ocn_vmix_coefs_tanh.F:1298-1311
/branches/ocean_projects/split_explicit_mrp/src/core_ocean/mpas_ocn_vmix_coefs_tanh.F:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean/mpas_ocn_vmix_coefs_tanh.F:1044-1097
/branches/ocean_projects/time_averaging/src/core_ocean/mpas_ocn_vmix_coefs_tanh.F:1271-1305
/branches/ocean_projects/vert_adv_mrp/src/core_ocean/mpas_ocn_vmix_coefs_tanh.F:704-745
/branches/source_renaming/src/core_ocean/mpas_ocn_vmix_coefs_tanh.F:1082-1113
/branches/time_manager/src/core_ocean/mpas_ocn_vmix_coefs_tanh.F:924-962

Modified: branches/ocean_projects/accgm/src/external/Makefile
===================================================================
--- branches/ocean_projects/accgm/src/external/Makefile        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/external/Makefile        2012-03-20 15:59:44 UTC (rev 1682)
@@ -3,7 +3,7 @@
 all: esmf_time
 
 esmf_time:
-        ( cd esmf_time_f90; make FC=&quot;$(FC) $(FFLAGS)&quot; CPP=&quot;$(CPP)&quot; )
+        ( cd esmf_time_f90; $(MAKE) FC=&quot;$(FC) $(FFLAGS)&quot; CPP=&quot;$(CPP)&quot; )
 
 clean:
-        ( cd esmf_time_f90; make clean )
+        ( cd esmf_time_f90; $(MAKE) clean )

Modified: branches/ocean_projects/accgm/src/framework/streams.c
===================================================================
--- branches/ocean_projects/accgm/src/framework/streams.c        2012-03-20 15:59:44 UTC (rev 1681)
+++ branches/ocean_projects/accgm/src/framework/streams.c        2012-03-20 15:59:44 UTC (rev 1682)
@@ -18,6 +18,37 @@
 {
    char fname[128];
 
+#ifndef MPAS_DEBUG
+   if(*id == 0){
+           sprintf(fname, &quot;log.%4.4i.err&quot;, *id);
+           fd_err = open(fname,O_CREAT|O_WRONLY|O_TRUNC,0644);
+           if (dup2(fd_err, 2) &lt; 0) {
+                   printf(&quot;Error duplicating STDERR</font>
<font color="blue">&quot;);
+                   return;
+           }
+
+           sprintf(fname, &quot;log.%4.4i.out&quot;, *id);
+           fd_out = open(fname,O_CREAT|O_WRONLY|O_TRUNC,0644);
+           if (dup2(fd_out, 1) &lt; 0) {
+                   printf(&quot;Error duplicating STDOUT</font>
<font color="blue">&quot;);
+                   return;
+           }
+   } else {
+           sprintf(fname, &quot;/dev/null&quot;, *id);
+           fd_err = open(fname,O_CREAT|O_WRONLY|O_TRUNC,0644);
+           if (dup2(fd_err, 2) &lt; 0) {
+                   printf(&quot;Error duplicating STDERR</font>
<font color="blue">&quot;);
+                   return;
+           }
+
+           sprintf(fname, &quot;/dev/null&quot;, *id);
+           fd_out = open(fname,O_CREAT|O_WRONLY|O_TRUNC,0644);
+           if (dup2(fd_out, 1) &lt; 0) {
+                   printf(&quot;Error duplicating STDOUT</font>
<font color="gray">&quot;);
+                   return;
+           }
+   }
+#else
    sprintf(fname, &quot;log.%4.4i.err&quot;, *id);
    fd_err = open(fname,O_CREAT|O_WRONLY|O_TRUNC,0644);
    if (dup2(fd_err, 2) &lt; 0) {
@@ -31,6 +62,7 @@
       printf(&quot;Error duplicating STDOUT</font>
<font color="blue">&quot;);
       return;
    }
+#endif
 }
 
 void close_streams()

</font>
</pre>