<p><b>mpetersen@lanl.gov</b> 2013-04-18 09:33:42 -0600 (Thu, 18 Apr 2013)</p><p>branch commit, tensor_operations: Add new subroutines to compute strain rate and the divergence of a tensor.  Code compiles and runs bit-for-bit with trunk.  Tensor operators are not yet validated.<br>
</p><hr noshade><pre><font color="gray">Index: branches/ocean_projects/tensor_operations
===================================================================
--- branches/ocean_projects/tensor_operations        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations        2013-04-18 15:33:42 UTC (rev 2767)

Property changes on: branches/ocean_projects/tensor_operations
___________________________________________________________________
Modified: svn:mergeinfo
## -1,5 +1,6 ##
 /branches/atmos_physics:1672-1846
 /branches/cam_mpas_nh:1260-1270
+/branches/history_attribute:2698-2745
 /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
## -22,6 +23,7 ##
 /branches/ocean_projects/sea_level_pressure:2488-2528
 /branches/ocean_projects/split_explicit_mrp:1134-1138
 /branches/ocean_projects/split_explicit_timestepping:1044-1097
+/branches/ocean_projects/variable_name_change:2733-2765
 /branches/ocean_projects/vert_adv_mrp:704-745
 /branches/ocean_projects/vol_cons_RK_imp_mix:1965-1992
 /branches/ocean_projects/zstar_restart_new:1762-1770
## -34,3 +36,5 ##
 /branches/source_renaming:1082-1113
 /branches/time_manager:924-962
 /branches/xml_registry:2610-2662
+/branches/zoltan_cleaning:2753-2760
+/trunk/mpas:2689-2764
\ No newline at end of property
Modified: branches/ocean_projects/tensor_operations/Makefile
===================================================================
--- branches/ocean_projects/tensor_operations/Makefile        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/Makefile        2013-04-18 15:33:42 UTC (rev 2767)
@@ -4,15 +4,7 @@
 # This flag must be off for nersc hopper:
 FILE_OFFSET = -DOFFSET64BIT
 
-#########################
-# Section for Zoltan TPL
-#########################
-ifdef ZOLTAN_HOME
-   ZOLTAN_DEFINE = -DHAVE_ZOLTAN
-endif
-#########################
 
-
 dummy:
         ( $(MAKE) error )
 
@@ -32,7 +24,7 @@
         &quot;DEBUG = $(DEBUG)&quot; \
         &quot;SERIAL = $(SERIAL)&quot; \
         &quot;USE_PAPI = $(USE_PAPI)&quot; \
-        &quot;CPPFLAGS = $(MODEL_FORMULATION) $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+        &quot;CPPFLAGS = $(MODEL_FORMULATION) $(FILE_OFFSET)&quot; )
  
 ftn:
         ( $(MAKE) all \
@@ -47,7 +39,7 @@
         &quot;DEBUG = $(DEBUG)&quot; \
         &quot;SERIAL = $(SERIAL)&quot; \
         &quot;USE_PAPI = $(USE_PAPI)&quot; \
-        &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+        &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET)&quot; )
 
 pgi:
         ( $(MAKE) all \
@@ -65,7 +57,7 @@
         &quot;DEBUG = $(DEBUG)&quot; \
         &quot;SERIAL = $(SERIAL)&quot; \
         &quot;USE_PAPI = $(USE_PAPI)&quot; \
-        &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+        &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET)&quot; )
 
 pgi-nersc:
         ( $(MAKE) all \
@@ -80,7 +72,7 @@
         &quot;DEBUG = $(DEBUG)&quot; \
         &quot;SERIAL = $(SERIAL)&quot; \
         &quot;USE_PAPI = $(USE_PAPI)&quot; \
-        &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+        &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET)&quot; )
 
 pgi-llnl:
         ( $(MAKE) all \
@@ -95,7 +87,7 @@
         &quot;DEBUG = $(DEBUG)&quot; \
         &quot;SERIAL = $(SERIAL)&quot; \
         &quot;USE_PAPI = $(USE_PAPI)&quot; \
-        &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+        &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET)&quot; )
 
 ifort:
         ( $(MAKE) all \
@@ -113,7 +105,7 @@
         &quot;DEBUG = $(DEBUG)&quot; \
         &quot;SERIAL = $(SERIAL)&quot; \
         &quot;USE_PAPI = $(USE_PAPI)&quot; \
-        &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE -m64 $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+        &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE -m64 $(FILE_OFFSET)&quot; )
 
 gfortran:
         ( $(MAKE) all \
@@ -131,7 +123,7 @@
         &quot;DEBUG = $(DEBUG)&quot; \
         &quot;SERIAL = $(SERIAL)&quot; \
         &quot;USE_PAPI = $(USE_PAPI)&quot; \
-        &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE -m64 $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+        &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE -m64 $(FILE_OFFSET)&quot; )
 
 g95:
         ( $(MAKE) all \
@@ -146,7 +138,7 @@
         &quot;DEBUG = $(DEBUG)&quot; \
         &quot;SERIAL = $(SERIAL)&quot; \
         &quot;USE_PAPI = $(USE_PAPI)&quot; \
-        &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+        &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET)&quot; )
 
 pathscale-nersc:
         ( $(MAKE) all \
@@ -161,7 +153,7 @@
         &quot;DEBUG = $(DEBUG)&quot; \
         &quot;SERIAL = $(SERIAL)&quot; \
         &quot;USE_PAPI = $(USE_PAPI)&quot; \
-        &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+        &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET)&quot; )
 
 cray-nersc:
         ( $(MAKE) all \
@@ -176,7 +168,7 @@
         &quot;DEBUG = $(DEBUG)&quot; \
         &quot;SERIAL = $(SERIAL)&quot; \
         &quot;USE_PAPI = $(USE_PAPI)&quot; \
-        &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+        &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET)&quot; )
 
 intel-nersc:
         ( $(MAKE) all \
@@ -191,11 +183,20 @@
         &quot;DEBUG = $(DEBUG)&quot; \
         &quot;SERIAL = $(SERIAL)&quot; \
         &quot;USE_PAPI = $(USE_PAPI)&quot; \
-        &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+        &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET)&quot; )
 
-CPPINCLUDES = -I../inc -I$(NETCDF)/include -I$(PIO) -I$(PNETCDF)/include
-FCINCLUDES = -I../inc -I$(NETCDF)/include -I$(PIO) -I$(PNETCDF)/include
-LIBS = -L$(PIO) -L$(PNETCDF)/lib -L$(NETCDF)/lib -lpio -lpnetcdf
+CPPINCLUDES = 
+FCINCLUDES = 
+LIBS = 
+ifneq ($(wildcard $(PIO)/lib), ) # Check for newer PIO version
+        CPPINCLUDES = -I../inc -I$(NETCDF)/include -I$(PIO)/include -I$(PNETCDF)/include
+        FCINCLUDES = -I../inc -I$(NETCDF)/include -I$(PIO)/include -I$(PNETCDF)/include
+        LIBS = -L$(PIO)/lib -L$(PNETCDF)/lib -L$(NETCDF)/lib -lpio -lpnetcdf
+else
+        CPPINCLUDES = -I../inc -I$(NETCDF)/include -I$(PIO) -I$(PNETCDF)/include
+        FCINCLUDES = -I../inc -I$(NETCDF)/include -I$(PIO) -I$(PNETCDF)/include
+        LIBS = -L$(PIO) -L$(PNETCDF)/lib -L$(NETCDF)/lib -lpio -lpnetcdf
+endif
 
 NCLIB = -lnetcdf
 NCLIBF = -lnetcdff
@@ -208,25 +209,7 @@
 CPP = cpp -C -P -traditional
 RANLIB = ranlib
 
-#########################
-# Section for Zoltan TPL
-#########################
-ifdef ZOLTAN_HOME
-   ifdef ZOLTAN_INC_PATH
-      FCINCLUDES += -I$(ZOLTAN_INC_PATH)
-   else
-      FCINCLUDES += -I$(ZOLTAN_HOME)/include
-   endif
 
-   ifdef ZOLTAN_LIB_PATH
-      LIBS += -L$(ZOLTAN_LIB_PATH) -lzoltan
-   else
-      LIBS += -L$(ZOLTAN_HOME)/lib -lzoltan
-   endif
-endif
-#########################
-
-
 ifdef CORE
 
 ifeq &quot;$(DEBUG)&quot; &quot;true&quot;

Modified: branches/ocean_projects/tensor_operations/src/Makefile.in.CESM_OCN
===================================================================
--- branches/ocean_projects/tensor_operations/src/Makefile.in.CESM_OCN        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/Makefile.in.CESM_OCN        2013-04-18 15:33:42 UTC (rev 2767)
@@ -7,7 +7,7 @@
 PNETCDF=$(PNETCDF_PATH)
 PIO=$(EXEROOT)/pio
 FILE_OFFSET = -DOFFSET64BIT
-CPPFLAGS += $(MODEL_FORMULATION) $(FILE_OFFSET) $(ZOLTAN_DEFINE) -DMPAS_CESM -D_MPI# -DUNDERSCORE
+CPPFLAGS += $(MODEL_FORMULATION) $(FILE_OFFSET) -DMPAS_CESM -D_MPI# -DUNDERSCORE
 CPPINCLUDES += -I$(EXEROOT)/ocn/source/inc -I$(NETCDF)/include -I$(PIO) -I$(PNETCDF)/include
 FCINCLUDES += -I$(EXEROOT)/ocn/source/inc -I$(EXEROOT)/csm_share -I$(EXEROOT)/gptl -I$(NETCDF)/include -I$(PIO) -I$(PNETCDF)/include
 LIBS += -L$(PIO) -L$(PNETCDF)/lib -L$(NETCDF)/lib -lpio -lpnetcdf -lnetcdf

Deleted: branches/ocean_projects/tensor_operations/src/core_hyd_atmos/Registry
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_hyd_atmos/Registry        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_hyd_atmos/Registry        2013-04-18 15:33:42 UTC (rev 2767)
@@ -1,191 +0,0 @@
-%
-% namelist  type  namelist_record  name  default_value
-%
-namelist integer   sw_model config_test_case            5
-namelist character sw_model config_time_integration     SRK3
-namelist real      sw_model config_dt                   172.8
-namelist character sw_model config_calendar_type        360day
-namelist character sw_model config_start_time           0000-01-01_00:00:00
-namelist character sw_model config_stop_time            none
-namelist character sw_model config_run_duration         none
-namelist real      sw_model config_h_mom_eddy_visc2     0.0
-namelist real      sw_model config_h_mom_eddy_visc4     0.0
-namelist real      sw_model config_v_mom_eddy_visc2     0.0
-namelist real      sw_model config_h_theta_eddy_visc2   0.0
-namelist real      sw_model config_h_theta_eddy_visc4   0.0
-namelist real      sw_model config_v_theta_eddy_visc2   0.0
-namelist integer   sw_model config_number_of_sub_steps  4
-namelist integer   sw_model config_theta_adv_order      2
-namelist integer   sw_model config_scalar_adv_order     2
-namelist logical   sw_model config_positive_definite    false
-namelist logical   sw_model config_monotonic            true
-namelist integer   sw_model config_mp_physics           0
-namelist real      sw_model config_apvm_upwinding       0.5
-namelist integer   sw_model config_num_halos            2
-namelist integer   dimensions config_nvertlevels        26
-namelist character io       config_input_name           grid.nc
-namelist character io       config_output_name          output.nc
-namelist character io       config_restart_name         restart.nc
-namelist character io       config_output_interval      06:00:00
-namelist integer   io       config_frames_per_outfile   0
-namelist integer   io       config_pio_num_iotasks      0 
-namelist integer   io       config_pio_stride           1
-namelist character decomposition config_block_decomp_file_prefix  graph.info.part.
-namelist integer   decomposition config_number_of_blocks          0
-namelist logical   decomposition config_explicit_proc_decomp      .false.
-namelist character decomposition config_proc_decomp_file_prefix   graph.info.part.
-namelist logical   restart  config_do_restart           false
-namelist character restart  config_restart_interval     none
-
-%
-% dim  type  name_in_file  name_in_code
-%
-dim nCells nCells
-dim nEdges nEdges
-dim maxEdges maxEdges
-dim maxEdges2 maxEdges2
-dim nVertices nVertices
-dim TWO 2
-dim vertexDegree vertexDegree
-dim FIFTEEN 15
-dim TWENTYONE 21
-dim R3 3
-%dim nVertLevels nVertLevels
-dim nVertLevels namelist:config_nvertlevels
-%dim nTracers nTracers
-dim nVertLevelsP1 nVertLevels+1
-
-%
-% var persistence type  name_in_file  ( dims )  time_levs iro-  name_in_code struct super-array array_class
-%
-var persistent text    xtime ( Time ) 2 ro xtime state - -
-
-var persistent real    latCell ( nCells ) 0 iro latCell mesh - -
-var persistent real    lonCell ( nCells ) 0 iro lonCell mesh - -
-var persistent real    xCell ( nCells ) 0 iro xCell mesh - -
-var persistent real    yCell ( nCells ) 0 iro yCell mesh - -
-var persistent real    zCell ( nCells ) 0 iro zCell mesh - -
-var persistent integer indexToCellID ( nCells ) 0 iro indexToCellID mesh - -
-
-var persistent real    latEdge ( nEdges ) 0 iro latEdge mesh - -
-var persistent real    lonEdge ( nEdges ) 0 iro lonEdge mesh - -
-var persistent real    xEdge ( nEdges ) 0 iro xEdge mesh - -
-var persistent real    yEdge ( nEdges ) 0 iro yEdge mesh - -
-var persistent real    zEdge ( nEdges ) 0 iro zEdge mesh - -
-var persistent integer indexToEdgeID ( nEdges ) 0 iro indexToEdgeID mesh - -
-
-var persistent real    latVertex ( nVertices ) 0 iro latVertex mesh - -
-var persistent real    lonVertex ( nVertices ) 0 iro lonVertex mesh - -
-var persistent real    xVertex ( nVertices ) 0 iro xVertex mesh - -
-var persistent real    yVertex ( nVertices ) 0 iro yVertex mesh - -
-var persistent real    zVertex ( nVertices ) 0 iro zVertex mesh - -
-var persistent integer indexToVertexID ( nVertices ) 0 iro indexToVertexID mesh - -
-
-var persistent integer cellsOnEdge ( TWO nEdges ) 0 iro cellsOnEdge mesh - -
-var persistent integer nEdgesOnCell ( nCells ) 0 iro nEdgesOnCell mesh - -
-var persistent integer nEdgesOnEdge ( nEdges ) 0 iro nEdgesOnEdge mesh - -
-var persistent integer edgesOnCell ( maxEdges nCells ) 0 iro edgesOnCell mesh - -
-var persistent integer edgesOnEdge ( maxEdges2 nEdges ) 0 iro edgesOnEdge mesh - -
-
-var persistent real    weightsOnEdge ( maxEdges2 nEdges ) 0 iro weightsOnEdge mesh - -
-var persistent real    dvEdge ( nEdges ) 0 iro dvEdge mesh - -
-var persistent real    dcEdge ( nEdges ) 0 iro dcEdge mesh - -
-var persistent real    angleEdge ( nEdges ) 0 iro angleEdge mesh - -
-var persistent real    areaCell ( nCells ) 0 iro areaCell mesh - -
-var persistent real    areaTriangle ( nVertices ) 0 iro areaTriangle mesh - -
-
-var persistent real    edgeNormalVectors ( R3 nEdges ) 0 o edgeNormalVectors mesh - -
-var persistent real    localVerticalUnitVectors ( R3 nCells ) 0 o localVerticalUnitVectors mesh - -
-var persistent real    cellTangentPlane ( R3 TWO nCells ) 0 o cellTangentPlane mesh - -
-
-var persistent integer cellsOnCell ( maxEdges nCells ) 0 iro cellsOnCell mesh - -
-var persistent integer verticesOnCell ( maxEdges nCells ) 0 iro verticesOnCell mesh - -
-var persistent integer verticesOnEdge ( TWO nEdges ) 0 iro verticesOnEdge mesh - -
-var persistent integer edgesOnVertex ( vertexDegree nVertices ) 0 iro edgesOnVertex mesh - -
-var persistent integer cellsOnVertex ( vertexDegree nVertices ) 0 iro cellsOnVertex mesh - -
-var persistent real    kiteAreasOnVertex ( vertexDegree nVertices ) 0 iro kiteAreasOnVertex mesh - -
-var persistent real    fEdge ( nEdges ) 0 iro fEdge mesh - -
-var persistent real    fVertex ( nVertices ) 0 iro fVertex mesh - -
-var persistent real    h_s ( nCells ) 0 iro h_s mesh - -
-
-% description of the vertical grid structure
-var persistent real    rdnu ( nVertLevels ) 0 iro rdnu mesh - -
-var persistent real    rdnw ( nVertLevels ) 0 iro rdnw mesh - -
-var persistent real    fnm ( nVertLevels ) 0 iro fnm mesh - -
-var persistent real    fnp ( nVertLevels ) 0 iro fnp mesh - -
-var persistent real    dbn ( nVertLevels ) 0 iro dbn mesh - -
-var persistent real    dnu ( nVertLevels ) 0 iro dnu mesh - -
-var persistent real    dnw ( nVertLevels ) 0 iro dnw mesh - -
-
-% Prognostic variables: read from input, saved in restart, and written to output
-var persistent real    u ( nVertLevels nEdges Time ) 2 iro u state - -
-var persistent real    theta ( nVertLevels nCells Time ) 2 iro theta state - -
-var persistent real    surface_pressure ( nCells Time ) 2 iro surface_pressure state - -
-var persistent real    qv ( nVertLevels nCells Time ) 2 iro qv state scalars moist
-var persistent real    qc ( nVertLevels nCells Time ) 2 iro qc state scalars moist
-var persistent real    qr ( nVertLevels nCells Time ) 2 iro qr state scalars moist
-%var persistent real    tracers ( nTracers nVertLevels nCells Time ) 2 iro state tracers - -
-
-% state variables diagnosed from prognostic state
-var persistent real    h ( nVertLevels nCells Time ) 2 ro h state - -
-var persistent real    ww ( nVertLevelsP1 nCells Time ) 2 ro ww state - -
-var persistent real    w ( nVertLevelsP1 nCells Time ) 2 ro w state - -
-var persistent real    pressure ( nVertLevelsP1 nCells Time ) 2 ro pressure state - -
-var persistent real    geopotential ( nVertLevelsP1 nCells Time ) 2 ro geopotential state - -
-var persistent real    alpha ( nVertLevels nCells Time ) 2 iro alpha state - -
-
-% Diagnostic fields: only written to output
-var persistent real    v ( nVertLevels nEdges Time ) 2 o 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 o pv_edge state - -
-var persistent real    h_edge ( nVertLevels nEdges Time ) 2 o h_edge state - -
-var persistent real    ke ( nVertLevels nCells Time ) 2 o ke state - -
-var persistent real    pv_vertex ( nVertLevels nVertices Time ) 2 o pv_vertex state - -
-var persistent real    pv_cell ( nVertLevels nCells Time ) 2 o pv_cell state - -
-var persistent real    uReconstructX ( nVertLevels nCells Time ) 1 o uReconstructX diag - -
-var persistent real    uReconstructY ( nVertLevels nCells Time ) 1 o uReconstructY diag - -
-var persistent real    uReconstructZ ( nVertLevels nCells Time ) 1 o uReconstructZ diag - -
-var persistent real    uReconstructZonal ( nVertLevels nCells Time ) 1 o uReconstructZonal diag - -
-var persistent real    uReconstructMeridional ( nVertLevels nCells Time ) 1 o uReconstructMeridional diag - -
-
-% Tendency variables
-var persistent real    tend_h ( nVertLevels nCells Time ) 1 - h tend - -
-var persistent real    tend_u ( nVertLevels nEdges Time ) 1 - u tend - -
-var persistent real    tend_vh ( nVertLevels nEdges Time ) 1 - vh tend - -
-var persistent real    tend_theta ( nVertLevels nCells Time ) 1 - theta tend - -
-var persistent real    tend_qv ( nVertLevels nCells Time ) 1 - qv tend scalars moist
-var persistent real    tend_qc ( nVertLevels nCells Time ) 1 - qc tend scalars moist
-var persistent real    tend_qr ( nVertLevels nCells Time ) 1 - qr tend scalars moist
-
-% 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    uhAvg ( nVertLevels nEdges ) 0 - uhAvg mesh - -
-var persistent real    wwAvg ( nVertLevelsP1 nCells ) 0 - wwAvg mesh - -
-var persistent real    qtot ( nVertLevels nCells ) 0 - qtot mesh - -
-var persistent real    cqu  ( nVertLevels nEdges ) 0 - cqu mesh - -
-var persistent real    h_diabatic  ( nVertLevels nCells ) 0 - h_diabatic mesh - -
-var persistent real    dpsdt ( nCells ) 0 - dpsdt mesh - -
-
-var persistent real    u_old ( nVertLevels nEdges ) 0 - u_old mesh - -
-var persistent real    ww_old ( nVertLevelsP1 nCells ) 0 - ww_old mesh - -
-var persistent real    theta_old ( nVertLevels nCells ) 0 - theta_old mesh - -
-var persistent real    h_edge_old ( nVertLevels nEdges ) 0 - h_edge_old mesh - -
-var persistent real    h_old ( nVertLevels nCells ) 0 - h_old mesh - -
-var persistent real    pressure_old ( nVertLevelsP1 nCells ) 0 - pressure_old mesh - -
-var persistent real    qv_old ( nVertLevels nCells ) 0 - qv_old mesh scalars_old moist_old
-var persistent real    qc_old ( nVertLevels nCells ) 0 - qc_old mesh scalars_old moist_old
-var persistent real    qr_old ( nVertLevels nCells ) 0 - qr_old mesh scalars_old moist_old
-%var persistent real    tracers_old ( nTracers nVertLevels nCells ) 0 - tracers_old mesh - -
-
-% Space needed for advection
-var persistent real    deriv_two ( FIFTEEN TWO nEdges ) 0 o deriv_two mesh - -
-var persistent integer advCells ( TWENTYONE nCells ) 0 - advCells mesh - -
-
-% Arrays required for reconstruction of velocity field
-var persistent real    coeffs_reconstruct ( R3 maxEdges nCells ) 0 - coeffs_reconstruct mesh - -
-

Modified: branches/ocean_projects/tensor_operations/src/core_hyd_atmos/Registry.xml
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_hyd_atmos/Registry.xml        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_hyd_atmos/Registry.xml        2013-04-18 15:33:42 UTC (rev 2767)
@@ -1,5 +1,5 @@
 &lt;?xml version=&quot;1.0&quot;?&gt;
-&lt;registry&gt;
+&lt;registry model=&quot;mpas&quot; core=&quot;hyd_atmos&quot; version=&quot;0.0.0&quot;&gt;
         &lt;dims&gt;
                 &lt;dim name=&quot;nCells&quot;/&gt;
                 &lt;dim name=&quot;nEdges&quot;/&gt;

Deleted: branches/ocean_projects/tensor_operations/src/core_init_nhyd_atmos/Registry
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_init_nhyd_atmos/Registry        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_init_nhyd_atmos/Registry        2013-04-18 15:33:42 UTC (rev 2767)
@@ -1,269 +0,0 @@
-%
-% namelist  type  namelist_record  name  default_value
-%
-namelist integer   nhyd_model config_test_case            7
-namelist character nhyd_model config_calendar_type        gregorian
-namelist character nhyd_model config_start_time           none
-namelist character nhyd_model config_stop_time            none
-namelist integer   nhyd_model config_theta_adv_order      3
-namelist real      nhyd_model config_coef_3rd_order       0.25
-namelist integer   nhyd_model config_num_halos            2
-namelist character dcmip      config_dcmip_case           2-0-0
-namelist real      dcmip      config_planet_scale         1.0
-namelist real      dcmip      config_rotation_rate_scale  1.0
-namelist integer   dimensions config_nvertlevels          26
-namelist integer   dimensions config_nsoillevels          4
-namelist integer   dimensions config_nfglevels            27
-namelist integer   dimensions config_nfgsoillevels        4
-namelist integer   dimensions config_months               12
-namelist character data_sources config_geog_data_path     /mmm/users/wrfhelp/WPS_GEOG/
-namelist character data_sources config_met_prefix         FILE
-namelist character data_sources config_sfc_prefix         FILE
-namelist integer   data_sources config_fg_interval        21600
-namelist real      vertical_grid  config_ztop             28000.0
-namelist integer   vertical_grid  config_nsmterrain       2
-namelist logical   vertical_grid  config_smooth_surfaces  false
-namelist logical   preproc_stages config_static_interp    true
-namelist logical   preproc_stages config_vertical_grid    true
-namelist logical   preproc_stages config_met_interp       true
-namelist logical   preproc_stages config_input_sst        false
-namelist logical   preproc_stages config_frac_seaice      false
-namelist character io         config_input_name           grid.nc
-namelist character io         config_sfc_update_name      sfc_update.nc
-namelist character io         config_output_name          init.nc
-namelist character io         config_restart_name         restart.nc
-namelist integer   io         config_frames_per_outfile   0
-namelist integer   io         config_pio_num_iotasks      0 
-namelist integer   io         config_pio_stride           1
-namelist character decomposition config_block_decomp_file_prefix  graph.info.part.
-namelist integer   decomposition config_number_of_blocks          0
-namelist logical   decomposition config_explicit_proc_decomp      .false.
-namelist character decomposition config_proc_decomp_file_prefix   graph.info.part.
-namelist integer   restart    config_restart_interval     0
-namelist logical   restart    config_do_restart           false
-namelist real      restart    config_restart_time         172800.0
-
-
-%
-% dim  type  name_in_file  name_in_code
-%
-dim nCells nCells
-dim nEdges nEdges
-dim maxEdges maxEdges
-dim maxEdges2 maxEdges2
-dim nVertices nVertices
-dim TWO 2
-dim THREE 3
-dim vertexDegree vertexDegree
-dim FIFTEEN 15
-dim TWENTYONE 21
-dim R3 3
-dim nVertLevels namelist:config_nvertlevels
-dim nSoilLevels namelist:config_nsoillevels
-dim nFGLevels namelist:config_nfglevels
-dim nFGSoilLevels namelist:config_nfgsoillevels
-dim nVertLevelsP1 nVertLevels+1
-dim nMonths namelist:config_months
-
-%
-% var  type  name_in_file  ( dims )  iro-  name_in_code super-array array_class
-%
-var persistent text    xtime ( Time ) 2 so xtime state - -
-
-%  horizontal grid structure
-
-var persistent real    latCell ( nCells ) 0 io latCell mesh - -
-var persistent real    lonCell ( nCells ) 0 io lonCell mesh - -
-var persistent real    xCell ( nCells ) 0 io xCell mesh - -
-var persistent real    yCell ( nCells ) 0 io yCell mesh - -
-var persistent real    zCell ( nCells ) 0 io zCell mesh - -
-var persistent integer indexToCellID ( nCells ) 0 io indexToCellID mesh - -
-
-var persistent real    latEdge ( nEdges ) 0 io latEdge mesh - -
-var persistent real    lonEdge ( nEdges ) 0 io lonEdge mesh - -
-var persistent real    xEdge ( nEdges ) 0 io xEdge mesh - -
-var persistent real    yEdge ( nEdges ) 0 io yEdge mesh - -
-var persistent real    zEdge ( nEdges ) 0 io zEdge mesh - -
-var persistent integer indexToEdgeID ( nEdges ) 0 io indexToEdgeID mesh - -
-
-var persistent real    latVertex ( nVertices ) 0 io latVertex mesh - -
-var persistent real    lonVertex ( nVertices ) 0 io lonVertex mesh - -
-var persistent real    xVertex ( nVertices ) 0 io xVertex mesh - -
-var persistent real    yVertex ( nVertices ) 0 io yVertex mesh - -
-var persistent real    zVertex ( nVertices ) 0 io zVertex mesh - -
-var persistent integer indexToVertexID ( nVertices ) 0 io indexToVertexID mesh - -
-
-var persistent integer cellsOnEdge ( TWO nEdges ) 0 io cellsOnEdge mesh - -
-var persistent integer nEdgesOnCell ( nCells ) 0 io nEdgesOnCell mesh - -
-var persistent integer nEdgesOnEdge ( nEdges ) 0 io nEdgesOnEdge mesh - -
-var persistent integer edgesOnCell ( maxEdges nCells ) 0 io edgesOnCell mesh - -
-var persistent integer edgesOnEdge ( maxEdges2 nEdges ) 0 io edgesOnEdge mesh - -
-
-var persistent real    weightsOnEdge ( maxEdges2 nEdges ) 0 io weightsOnEdge mesh - -
-var persistent real    dvEdge ( nEdges ) 0 io dvEdge mesh - -
-var persistent real    dcEdge ( nEdges ) 0 io dcEdge mesh - -
-var persistent real    angleEdge ( nEdges ) 0 io angleEdge mesh - -
-var persistent real    areaCell ( nCells ) 0 io areaCell mesh - -
-var persistent real    areaTriangle ( nVertices ) 0 io areaTriangle mesh - -
-
-var persistent real    edgeNormalVectors ( R3 nEdges ) 0 io edgeNormalVectors mesh - -
-var persistent real    localVerticalUnitVectors ( R3 nCells ) 0 io localVerticalUnitVectors mesh - -
-var persistent real    cellTangentPlane ( R3 TWO nCells ) 0 io cellTangentPlane mesh - -
-
-var persistent integer cellsOnCell ( maxEdges nCells ) 0 io cellsOnCell mesh - -
-var persistent integer verticesOnCell ( maxEdges nCells ) 0 io verticesOnCell mesh - -
-var persistent integer verticesOnEdge ( TWO nEdges ) 0 io verticesOnEdge mesh - -
-var persistent integer edgesOnVertex ( vertexDegree nVertices ) 0 io edgesOnVertex mesh - -
-var persistent integer cellsOnVertex ( vertexDegree nVertices ) 0 io cellsOnVertex mesh - -
-var persistent real    kiteAreasOnVertex ( vertexDegree nVertices ) 0 io kiteAreasOnVertex mesh - -
-var persistent real    fEdge ( nEdges ) 0 io fEdge mesh - -
-var persistent real    fVertex ( nVertices ) 0 io fVertex mesh - -

-var persistent real    meshDensity ( nCells ) 0 iro meshDensity mesh - -
-
-% some solver scalar coefficients
-
-% coefficients for vertical extrapolation to the surface
-var persistent real    cf1 ( ) 0 io cf1 mesh - -
-var persistent real    cf2 ( ) 0 io cf2 mesh - -
-var persistent real    cf3 ( ) 0 io cf3 mesh - -
-
-% static terrestrial fields
-var persistent real    ter         ( nCells ) 0 io ter      mesh - -
-var persistent integer landmask    ( nCells ) 0 io landmask mesh - -
-var persistent integer ivgtyp      ( nCells ) 0 io lu_index mesh - -
-var persistent integer isltyp      ( nCells ) 0 io soilcat_top mesh - -
-var persistent integer soilcat_bot ( nCells ) 0 io soilcat_bot mesh - -
-var persistent real    snoalb      ( nCells ) 0 io snoalb mesh - -
-var persistent real    soiltemp    ( nCells ) 0 io soiltemp mesh - -
-var persistent real    greenfrac   ( nMonths nCells ) 0 io greenfrac mesh - -
-var persistent real    shdmin      ( nCells ) 0 io shdmin mesh - -
-var persistent real    shdmax      ( nCells ) 0 io shdmax mesh - -
-var persistent real    albedo12m   ( nMonths nCells ) 0 io albedo12m mesh - -
-var persistent real    varsso      ( nCells ) 0 io varsso  mesh - -
-var persistent real    var2d       ( nCells ) 0 io var2d   mesh - -
-var persistent real    con         ( nCells ) 0 io con     mesh - -
-var persistent real    oa1         ( nCells ) 0 io oa1     mesh - -
-var persistent real    oa2         ( nCells ) 0 io oa2     mesh - -
-var persistent real    oa3         ( nCells ) 0 io oa3     mesh - -
-var persistent real    oa4         ( nCells ) 0 io oa4     mesh - -
-var persistent real    ol1         ( nCells ) 0 io ol1     mesh - -
-var persistent real    ol2         ( nCells ) 0 io ol2     mesh - -
-var persistent real    ol3         ( nCells ) 0 io ol3     mesh - -
-var persistent real    ol4         ( nCells ) 0 io ol4     mesh - -
-
-% description of the vertical grid structure
-
-var persistent real    hx ( nVertLevelsP1 nCells ) 0 io hx mesh - -
-var persistent real    zgrid ( nVertLevelsP1 nCells ) 0 io zgrid mesh - -
-var persistent real    rdzw ( nVertLevels ) 0 io rdzw mesh - -
-var persistent real    dzu ( nVertLevels ) 0 io dzu mesh - -
-var persistent real    rdzu ( nVertLevels ) 0 io rdzu mesh - -
-var persistent real    fzm ( nVertLevels ) 0 io fzm mesh - -
-var persistent real    fzp ( nVertLevels ) 0 io fzp mesh - -
-var persistent real    zx ( nVertLevelsP1 nEdges ) 0 io zx mesh - -
-var persistent real    zz ( nVertLevelsP1 nCells ) 0 io zz mesh - -
-var persistent real    zb ( nVertLevelsP1 TWO nEdges ) 0 io zb mesh - -
-var persistent real    zb3 ( nVertLevelsP1 TWO nEdges ) 0 io zb3 mesh - -
-
-%  W-Rayleigh-damping coefficient
-
-var persistent real    dss ( nVertLevels nCells ) 0 io dss mesh - -
-
-% Horizontally interpolated from first-guess data
-var persistent real    u_fg ( nFGLevels nEdges Time ) 1 - u fg - -
-var persistent real    v_fg ( nFGLevels nEdges Time ) 1 - v fg - -
-var persistent real    t_fg ( nFGLevels nCells Time ) 1 o t fg - -
-var persistent real    p_fg ( nFGLevels nCells Time ) 1 o p fg - -
-var persistent real    z_fg ( nFGLevels nCells Time ) 1 o z fg - -
-var persistent real    rh_fg ( nFGLevels nCells Time ) 1 o rh fg - -
-var persistent real    soilz_fg ( nCells Time ) 1 io soilz fg - -
-var persistent real    psfc_fg ( nCells Time ) 1 - psfc fg - -
-var persistent real    pmsl_fg ( nCells Time ) 1 - pmsl fg - -
-
-% Horizontally interpolated from first-guess data
-var persistent real    dz_fg  ( nFGSoilLevels nCells Time ) 1 io dz_fg  fg - -
-var persistent real    dzs_fg ( nFGSoilLevels nCells Time ) 1 io dzs_fg fg - -
-var persistent real    zs_fg  ( nFGSoilLevels nCells Time ) 1 io zs_fg  fg - -
-var persistent real    st_fg  ( nFGSoilLevels nCells Time ) 1 io st_fg  fg - -
-var persistent real    sm_fg  ( nFGSoilLevels nCells Time ) 1 io sm_fg  fg - -
-
-% Horizontally interpolated from first-guess data
-%    and should be read in by model
-var persistent real    dz ( nSoilLevels nCells Time ) 1 io dz fg - -
-var persistent real    dzs ( nSoilLevels nCells Time ) 1 io dzs fg - -
-var persistent real    zs ( nSoilLevels nCells Time ) 1 io zs fg - -
-var persistent real    sh2o ( nSoilLevels nCells Time ) 1 io sh2o fg - -
-var persistent real    smois ( nSoilLevels nCells Time ) 1 io smois fg - -
-var persistent real    tslb ( nSoilLevels nCells Time ) 1 io tslb fg - -
-var persistent real    smcrel ( nSoilLevels nCells Time ) 1 io smcrel fg - -
-var persistent real    tmn ( nCells Time ) 1 io tmn fg - -
-var persistent real    skintemp ( nCells Time ) 1 io skintemp fg - -
-var persistent real    sst ( nCells Time ) 1 iso sst fg - -
-var persistent real    snow ( nCells Time ) 1 io snow fg - -
-var persistent real    snowc ( nCells Time ) 1 io snowc fg - -
-var persistent real    snowh ( nCells Time ) 1 io snowh fg - -
-var persistent real    xice ( nCells Time ) 1 iso xice fg - -
-var persistent real    seaice ( nCells Time ) 1 io seaice fg - -
-var persistent real    gfs_z ( nVertLevels nCells Time ) 1 - gfs_z fg - -
-var persistent real    vegfra ( nCells Time ) 1 io vegfra fg - -
-var persistent real    sfc_albbck ( nCells Time ) 1 io sfc_albbck fg - -
-var persistent real    xland ( nCells Time ) 1 io xland fg - - 
-
-% Prognostic variables: read from input, saved in restart, and written to output
-var persistent real    u ( nVertLevels nEdges Time ) 2 o u state - -
-var persistent real    w ( nVertLevelsP1 nCells Time ) 2 o w state - -
-var persistent real    rho_zz ( nVertLevels nCells Time ) 2 o rho_zz state - -
-var persistent real    theta_m ( nVertLevels nCells Time ) 2 o theta_m state - -
-var persistent real    qv ( nVertLevels nCells Time ) 2 o qv state scalars moist
-var persistent real    qc ( nVertLevels nCells Time ) 2 o qc state scalars moist
-var persistent real    qr ( nVertLevels nCells Time ) 2 o qr state scalars moist
-
-% state variables diagnosed from prognostic state
-var persistent real    pressure_p ( nVertLevels nCells Time ) 1 - pressure_p diag - -
-
-var persistent real    u_init ( nVertLevels ) 0 io u_init mesh - -
-var persistent real    t_init ( nVertLevels nCells ) 0 io t_init mesh - -
-var persistent real    qv_init ( nVertLevels ) 0 io qv_init mesh - -
-
-% Diagnostic fields: only written to output
-var persistent real    precipw ( nCells Time ) 1 o precipw diag_physics - -
-var persistent real    rh ( nVertLevels nCells Time ) 1 o rh diag - -
-var persistent real    rho ( nVertLevels nCells Time ) 1 o rho diag - -
-var persistent real    theta ( nVertLevels nCells Time ) 1 o theta diag - -
-var persistent real    v ( nVertLevels nEdges Time ) 1 o v diag - -
-var persistent real    uReconstructX ( nVertLevels nCells Time ) 1 o uReconstructX diag - -
-var persistent real    uReconstructY ( nVertLevels nCells Time ) 1 o uReconstructY diag - -
-var persistent real    uReconstructZ ( nVertLevels nCells Time ) 1 o uReconstructZ diag - -
-var persistent real    uReconstructZonal ( nVertLevels nCells Time ) 1 o uReconstructZonal diag - -
-var persistent real    uReconstructMeridional ( nVertLevels nCells Time ) 1 o uReconstructMeridional diag - -
-
-var persistent real    exner ( nVertLevels nCells Time ) 1 - exner diag - -
-var persistent real    exner_base ( nVertLevels nCells Time ) 1 io exner_base diag - -
-var persistent real    rtheta_base ( nVertLevels nCells Time ) 1 - rtheta_base diag - -
-var persistent real    pressure ( nVertLevels nCells Time ) 1 - pressure diag - -
-var persistent real    pressure_base ( nVertLevels nCells Time ) 1 io pressure_base diag - -
-var persistent real    rho_base ( nVertLevels nCells Time ) 1 io rho_base diag - -
-var persistent real    theta_base ( nVertLevels nCells Time ) 1 io theta_base diag - -
-
-var persistent real    cqw  ( nVertLevels nCells Time ) 1 - cqw diag - -
-
-var persistent real    surface_pressure    ( nCells Time    ) 1  io surface_pressure    diag - -
-
-%  coupled variables needed by the solver, but not output...
-var persistent real    ru ( nVertLevels nEdges Time ) 1 - ru diag - -
-var persistent real    rw ( nVertLevelsP1 nCells Time ) 1 - rw diag - -
-var persistent real    rtheta_p ( nVertLevels nCells Time ) 1 - rtheta_p diag - -
-var persistent real    rho_p ( nVertLevels nCells Time ) 1 - rho_p diag - -
-
-% Space needed for advection
-var persistent real    deriv_two ( FIFTEEN TWO nEdges ) 0 io deriv_two mesh - -
-var persistent integer advCells ( TWENTYONE nCells ) 0 io advCells mesh - -
-
-% Space needed for deformation calculation weights
-var persistent real    defc_a ( maxEdges nCells ) 0 io defc_a mesh - -
-var persistent real    defc_b ( maxEdges nCells ) 0 io defc_b mesh - -
-
-% Arrays required for reconstruction of velocity field
-var persistent real    coeffs_reconstruct ( R3 maxEdges nCells ) 0 io coeffs_reconstruct mesh - -
-

Modified: branches/ocean_projects/tensor_operations/src/core_init_nhyd_atmos/Registry.xml
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_init_nhyd_atmos/Registry.xml        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_init_nhyd_atmos/Registry.xml        2013-04-18 15:33:42 UTC (rev 2767)
@@ -1,5 +1,5 @@
 &lt;?xml version=&quot;1.0&quot;?&gt;
-&lt;registry&gt;
+&lt;registry model=&quot;mpas&quot; core=&quot;init_nhyd_atmos&quot; version=&quot;0.0.0&quot;&gt;
 
 &lt;!-- **************************************************************************************** --&gt;
 &lt;!-- ************************************** Dimensions ************************************** --&gt;

Deleted: branches/ocean_projects/tensor_operations/src/core_nhyd_atmos/Registry
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_nhyd_atmos/Registry        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_nhyd_atmos/Registry        2013-04-18 15:33:42 UTC (rev 2767)
@@ -1,947 +0,0 @@
-%
-% namelist  type  namelist_record  name  default_value
-%
-namelist character nhyd_model config_time_integration     SRK3
-namelist real      nhyd_model config_dt                   600.0
-namelist character nhyd_model config_calendar_type        gregorian
-namelist character nhyd_model config_start_time           0000-01-01_00:00:00
-namelist character nhyd_model config_stop_time            none
-namelist character nhyd_model config_run_duration         none
-namelist character nhyd_model config_sfc_update_interval  none
-namelist character nhyd_model config_horiz_mixing         2d_smagorinsky
-namelist real      nhyd_model config_h_mom_eddy_visc2     0.0
-namelist real      nhyd_model config_h_mom_eddy_visc4     0.0
-namelist real      nhyd_model config_v_mom_eddy_visc2     0.0
-namelist real      nhyd_model config_h_theta_eddy_visc2   0.0
-namelist real      nhyd_model config_h_theta_eddy_visc4   0.0
-namelist real      nhyd_model config_v_theta_eddy_visc2   0.0
-namelist real      nhyd_model config_visc4_2dsmag         0.0
-namelist integer   nhyd_model config_number_of_sub_steps  4
-namelist integer   nhyd_model config_w_adv_order          3
-namelist integer   nhyd_model config_theta_adv_order      3
-namelist integer   nhyd_model config_scalar_adv_order     3
-namelist integer   nhyd_model config_u_vadv_order         3
-namelist integer   nhyd_model config_w_vadv_order         3
-namelist integer   nhyd_model config_theta_vadv_order     3
-namelist integer   nhyd_model config_scalar_vadv_order    3
-namelist real      nhyd_model config_coef_3rd_order       0.25
-namelist logical   nhyd_model config_scalar_advection     true
-namelist logical   nhyd_model config_positive_definite    false
-namelist logical   nhyd_model config_monotonic            true
-namelist logical   nhyd_model config_mix_full             true
-namelist real      nhyd_model config_len_disp             120000.0
-namelist real      nhyd_model config_epssm                0.1
-namelist real      nhyd_model config_smdiv                0.1
-namelist logical   nhyd_model config_newpx                false
-namelist real      nhyd_model config_apvm_upwinding       0.5
-namelist logical   nhyd_model config_h_ScaleWithMesh      true
-namelist integer   nhyd_model config_num_halos            2
-namelist real      damping    config_zd                   22000.0
-namelist real      damping    config_xnutr                0.0
-namelist character io         config_input_name           init.nc
-namelist character io         config_sfc_update_name      sfc_update.nc
-namelist character io         config_output_name          output.nc
-namelist character io         config_restart_name         restart.nc
-namelist character io         config_output_interval      06:00:00
-namelist integer   io         config_frames_per_outfile   0
-namelist integer   io         config_pio_num_iotasks      0 
-namelist integer   io         config_pio_stride           1
-namelist character io         config_pio_format           pnetcdf
-namelist character decomposition config_block_decomp_file_prefix  graph.info.part.
-namelist integer   decomposition config_number_of_blocks          0
-namelist logical   decomposition config_explicit_proc_decomp      .false.
-namelist character decomposition config_proc_decomp_file_prefix   graph.info.part.
-namelist logical   restart    config_do_restart           false
-namelist logical   restart    config_do_DAcycling         false
-namelist character restart    config_restart_interval     none
-
-%
-% dim  type  name_in_file  name_in_code
-%
-dim nCells nCells
-dim nEdges nEdges
-dim maxEdges maxEdges
-dim maxEdges2 maxEdges2
-dim nVertices nVertices
-dim TWO 2
-dim THREE 3
-dim vertexDegree vertexDegree
-dim FIFTEEN 15
-dim TWENTYONE 21
-dim R3 3
-dim nVertLevels nVertLevels
-dim nVertLevelsP1 nVertLevels+1
-
-%
-% var  type  name_in_file  ( dims )  iro-  name_in_code super-array array_class
-%
-var persistent text    xtime ( Time ) 2 iro xtime state - -
-
-%  horizontal grid structure
-
-var persistent real    latCell ( nCells ) 0 iro latCell mesh - -
-var persistent real    lonCell ( nCells ) 0 iro lonCell mesh - -
-var persistent real    xCell ( nCells ) 0 iro xCell mesh - -
-var persistent real    yCell ( nCells ) 0 iro yCell mesh - -
-var persistent real    zCell ( nCells ) 0 iro zCell mesh - -
-var persistent integer indexToCellID ( nCells ) 0 iro indexToCellID mesh - -
-
-var persistent real    latEdge ( nEdges ) 0 iro latEdge mesh - -
-var persistent real    lonEdge ( nEdges ) 0 iro lonEdge mesh - -
-var persistent real    xEdge ( nEdges ) 0 iro xEdge mesh - -
-var persistent real    yEdge ( nEdges ) 0 iro yEdge mesh - -
-var persistent real    zEdge ( nEdges ) 0 iro zEdge mesh - -
-var persistent integer indexToEdgeID ( nEdges ) 0 iro indexToEdgeID mesh - -
-
-var persistent real    latVertex ( nVertices ) 0 iro latVertex mesh - -
-var persistent real    lonVertex ( nVertices ) 0 iro lonVertex mesh - -
-var persistent real    xVertex ( nVertices ) 0 iro xVertex mesh - -
-var persistent real    yVertex ( nVertices ) 0 iro yVertex mesh - -
-var persistent real    zVertex ( nVertices ) 0 iro zVertex mesh - -
-var persistent integer indexToVertexID ( nVertices ) 0 iro indexToVertexID mesh - -
-
-var persistent integer cellsOnEdge ( TWO nEdges ) 0 iro cellsOnEdge mesh - -
-var persistent integer nEdgesOnCell ( nCells ) 0 iro nEdgesOnCell mesh - -
-var persistent integer nEdgesOnEdge ( nEdges ) 0 iro nEdgesOnEdge mesh - -
-var persistent integer edgesOnCell ( maxEdges nCells ) 0 iro edgesOnCell mesh - -
-var persistent integer edgesOnEdge ( maxEdges2 nEdges ) 0 iro edgesOnEdge mesh - -
-
-var persistent real    weightsOnEdge ( maxEdges2 nEdges ) 0 iro weightsOnEdge mesh - -
-var persistent real    dvEdge ( nEdges ) 0 iro dvEdge mesh - -
-var persistent real    dcEdge ( nEdges ) 0 iro dcEdge mesh - -
-var persistent real    angleEdge ( nEdges ) 0 iro angleEdge mesh - -
-var persistent real    areaCell ( nCells ) 0 iro areaCell mesh - -
-var persistent real    areaTriangle ( nVertices ) 0 iro areaTriangle mesh - -
-
-var persistent real    edgeNormalVectors ( R3 nEdges ) 0 iro edgeNormalVectors mesh - -
-var persistent real    localVerticalUnitVectors ( R3 nCells ) 0 iro localVerticalUnitVectors mesh - -
-var persistent real    cellTangentPlane ( R3 TWO nCells ) 0 iro cellTangentPlane mesh - -
-
-var persistent integer cellsOnCell ( maxEdges nCells ) 0 iro cellsOnCell mesh - -
-var persistent integer verticesOnCell ( maxEdges nCells ) 0 iro verticesOnCell mesh - -
-var persistent integer verticesOnEdge ( TWO nEdges ) 0 iro verticesOnEdge mesh - -
-var persistent integer edgesOnVertex ( vertexDegree nVertices ) 0 iro edgesOnVertex mesh - -
-var persistent integer cellsOnVertex ( vertexDegree nVertices ) 0 iro cellsOnVertex mesh - -
-var persistent real    kiteAreasOnVertex ( vertexDegree nVertices ) 0 iro kiteAreasOnVertex mesh - -
-var persistent real    fEdge ( nEdges ) 0 iro fEdge mesh - -
-var persistent real    fVertex ( nVertices ) 0 iro fVertex mesh - -
-
-var persistent real    meshDensity ( nCells ) 0 iro meshDensity mesh - -
-var persistent real    meshScalingDel2 ( nEdges ) 0 ro meshScalingDel2 mesh - -
-var persistent real    meshScalingDel4 ( nEdges ) 0 ro meshScalingDel4 mesh - -
-
-% some solver scalar coefficients
-
-% coefficients for vertical extrapolation to the surface
-var persistent real    cf1 ( ) 0 iro cf1 mesh - -
-var persistent real    cf2 ( ) 0 iro cf2 mesh - -
-var persistent real    cf3 ( ) 0 iro cf3 mesh - -
-
-var persistent real    cpr ( THREE nEdges ) 0 ro cpr mesh - -
-var persistent real    cpl ( THREE nEdges ) 0 ro cpl mesh - -
-
-% description of the vertical grid structure
-
-var persistent real    hx ( nVertLevelsP1 nCells ) 0 iro hx mesh - -
-var persistent real    zgrid ( nVertLevelsP1 nCells ) 0 iro zgrid mesh - -
-var persistent real    rdzw ( nVertLevels ) 0 iro rdzw mesh - -
-var persistent real    dzu ( nVertLevels ) 0 iro dzu mesh - -
-var persistent real    rdzu ( nVertLevels ) 0 iro rdzu mesh - -
-var persistent real    fzm ( nVertLevels ) 0 iro fzm mesh - -
-var persistent real    fzp ( nVertLevels ) 0 iro fzp mesh - -
-var persistent real    zx ( nVertLevelsP1 nEdges ) 0 iro zx mesh - -
-var persistent real    zz ( nVertLevelsP1 nCells ) 0 iro zz mesh - -
-var persistent real    zb ( nVertLevelsP1 TWO nEdges ) 0 iro zb mesh - -
-var persistent real    zb3 ( nVertLevelsP1 TWO nEdges ) 0 iro zb3 mesh - -
-var persistent real    pzm ( nVertLevels nCells ) 0 r pzm mesh - -
-var persistent real    pzp ( nVertLevels nCells ) 0 r pzp mesh - -
-
-% coefficients for the vertical tridiagonal solve
-% Note:  these could be local but...
-
-var persistent real    cofrz ( nVertLevels Time ) 1 - cofrz diag - -
-var persistent real    cofwr ( nVertLevels nCells Time ) 1 - cofwr diag - -
-var persistent real    cofwz ( nVertLevels nCells Time ) 1 - cofwz diag - -
-var persistent real    coftz ( nVertLevelsP1 nCells Time ) 1 - coftz diag - -
-var persistent real    cofwt ( nVertLevels nCells Time ) 1 - cofwt diag - -
-var persistent real    a_tri ( nVertLevels nCells Time ) 1 - a_tri diag - -
-var persistent real    alpha_tri ( nVertLevels nCells Time ) 1 - alpha_tri diag - -
-var persistent real    gamma_tri ( nVertLevels nCells Time ) 1 - gamma_tri diag - -
-
-%  W-Rayleigh-damping coefficient
-
-var persistent real    dss ( nVertLevels nCells ) 0 iro dss mesh - -
-
-% Prognostic variables: read from input, saved in restart, and written to output
-var persistent real    u ( nVertLevels nEdges Time ) 2 iro u state - -
-var persistent real    w ( nVertLevelsP1 nCells Time ) 2 iro w state - -
-var persistent real    rho_zz ( nVertLevels nCells Time ) 2 r rho_zz state - -
-var persistent real    theta_m ( nVertLevels nCells Time ) 2 r theta_m state - -
-var persistent real    qv ( nVertLevels nCells Time ) 2 iro qv state scalars moist
-var persistent real    qc ( nVertLevels nCells Time ) 2 iro qc state scalars moist
-var persistent real    qr ( nVertLevels nCells Time ) 2 iro qr state scalars moist
-var persistent real    qi ( nVertLevels nCells Time ) 2 iro qi state scalars moist
-var persistent real    qs ( nVertLevels nCells Time ) 2 iro qs state scalars moist
-var persistent real    qg ( nVertLevels nCells Time ) 2 iro qg state scalars moist
-var persistent real    qnr ( nVertLevels nCells Time ) 2 iro qnr state scalars number
-var persistent real    qni ( nVertLevels nCells Time ) 2 iro qni state scalars number
-
-% Tendency variables
-var persistent real    tend_u ( nVertLevels nEdges Time ) 1 o u tend - -
-var persistent real    tend_w ( nVertLevelsP1 nCells Time ) 1 o w tend - -
-var persistent real    tend_rho ( nVertLevels nCells Time ) 1 o rho_zz tend - -
-var persistent real    tend_theta ( nVertLevels nCells Time ) 1 o theta_m tend - -
-var persistent real    tend_qv ( nVertLevels nCells Time ) 1 o qv tend scalars moist
-var persistent real    tend_qc ( nVertLevels nCells Time ) 1 o qc tend scalars moist
-var persistent real    tend_qr ( nVertLevels nCells Time ) 1 o qr tend scalars moist
-var persistent real    tend_qi ( nVertLevels nCells Time ) 1 o qi tend scalars moist
-var persistent real    tend_qs ( nVertLevels nCells Time ) 1 o qs tend scalars moist
-var persistent real    tend_qg ( nVertLevels nCells Time ) 1 o qg tend scalars moist
-var persistent real    tend_qnr ( nVertLevels nCells Time ) 1 o qnr tend scalars number
-var persistent real    tend_qni ( nVertLevels nCells Time ) 1 o qni tend scalars number
-var persistent real    rt_diabatic_tend ( nVertLevels nCells Time ) 1 r rt_diabatic_tend tend - -
-
-var persistent real    euler_tend_u ( nVertLevels nEdges Time ) 1 - u_euler tend - -
-var persistent real    euler_tend_w ( nVertLevelsP1 nCells Time ) 1 - w_euler tend - -
-var persistent real    euler_tend_theta ( nVertLevels nCells Time ) 1 - theta_euler tend - -
-
-% state variables diagnosed from prognostic state
-var persistent real    pressure_p ( nVertLevels nCells Time ) 1 ro pressure_p diag - -
-
-var persistent real    u_init ( nVertLevels ) 0 iro u_init mesh - -
-var persistent real    t_init ( nVertLevels nCells ) 0 iro t_init mesh - -
-var persistent real    qv_init ( nVertLevels ) 0 iro qv_init mesh - -
-
-% Diagnostic fields: only written to output
-% NOTE: added the &quot;r&quot; option to rho,theta,uReconstructZonal,and uReconstructMeridional for use of the
-% non-hydrostatic dynamical core in a data assimilation framework. NOTE that the &quot;r&quot; option is not
-% needed for those 4 variables to get bit for bit restart capabilities, otherwise. 
-var persistent real    rho ( nVertLevels nCells Time ) 1 iro rho diag - -
-var persistent real    theta ( nVertLevels nCells Time ) 1 iro theta diag - -
-var persistent real    rh ( nVertLevels nCells Time ) 1 iro rh diag - -
-var persistent real    v ( nVertLevels nEdges Time ) 1 o v diag - -
-var persistent real    divergence ( nVertLevels nCells Time ) 1 o divergence diag - -
-var persistent real    vorticity ( nVertLevels nVertices Time ) 1 o vorticity diag - -
-var persistent real    pv_edge ( nVertLevels nEdges Time ) 1 o pv_edge diag - -
-var persistent real    rho_edge ( nVertLevels nEdges Time ) 1 o rho_edge diag - -
-var persistent real    ke ( nVertLevels nCells Time ) 1 o ke diag - -
-var persistent real    pv_vertex ( nVertLevels nVertices Time ) 1 o pv_vertex diag - -
-var persistent real    pv_cell ( nVertLevels nCells Time ) 1 o pv_cell diag - -
-var persistent real    uReconstructX ( nVertLevels nCells Time ) 1 o uReconstructX diag - -
-var persistent real    uReconstructY ( nVertLevels nCells Time ) 1 o uReconstructY diag - -
-var persistent real    uReconstructZ ( nVertLevels nCells Time ) 1 o uReconstructZ diag - -
-var persistent real    uReconstructZonal ( nVertLevels nCells Time ) 1 ro uReconstructZonal diag - -
-var persistent real    uReconstructMeridional ( nVertLevels nCells Time ) 1 ro uReconstructMeridional diag - -
-
-% Other diagnostic variables: neither read nor written to any files
-var persistent real    rv ( nVertLevels nEdges Time ) 1 r rv diag - -
-var persistent real    circulation ( nVertLevels nVertices Time ) 1 r circulation diag - -
-var persistent real    gradPVt ( nVertLevels nEdges Time ) 1 - gradPVt diag - -
-var persistent real    gradPVn ( nVertLevels nEdges Time ) 1 - gradPVn diag - -
-var persistent real    h_divergence ( nVertLevels nCells Time ) 1 o h_divergence diag - -
-
-var persistent real    exner ( nVertLevels nCells Time ) 1 ro exner diag - -
-var persistent real    exner_base ( nVertLevels nCells Time ) 1 iro exner_base diag - -
-var persistent real    rtheta_base ( nVertLevels nCells Time ) 1 r rtheta_base diag - -
-var persistent real    pressure_base ( nVertLevels nCells Time ) 1 iro pressure_base diag - -
-var persistent real    rho_base ( nVertLevels nCells Time ) 1 iro rho_base diag - -
-var persistent real    theta_base ( nVertLevels nCells Time ) 1 iro theta_base diag - -
-
-
-var persistent real    ruAvg ( nVertLevels nEdges Time ) 1 - ruAvg diag - -
-var persistent real    wwAvg ( nVertLevelsP1 nCells Time ) 1 - wwAvg diag - -
-var persistent real    cqu  ( nVertLevels nEdges Time ) 1 - cqu diag - -
-var persistent real    cqw  ( nVertLevels nCells Time ) 1 - cqw diag - -
-
-%  coupled variables needed by the solver, but not output...
-
-var persistent real    ru ( nVertLevels nEdges Time ) 1 r ru diag - -
-var persistent real    ru_p ( nVertLevels nEdges Time ) 1 r ru_p diag - -
-var persistent real    ru_save ( nVertLevels nEdges Time ) 1 - ru_save diag - -
-
-
-var persistent real    rw ( nVertLevelsP1 nCells Time ) 1 r rw diag - -
-var persistent real    rw_p ( nVertLevelsP1 nCells Time ) 1 r rw_p diag - -
-var persistent real    rw_save ( nVertLevelsP1 nCells Time ) 1 - rw_save diag - -
-
-var persistent real    rtheta_p ( nVertLevels nCells Time ) 1 r rtheta_p diag - -
-var persistent real    rtheta_pp ( nVertLevels nCells Time ) 1 - rtheta_pp diag - -
-var persistent real    rtheta_p_save ( nVertLevels nCells Time ) 1 - rtheta_p_save diag - -
-var persistent real    rtheta_pp_old ( nVertLevels nCells Time ) 1 - rtheta_pp_old diag - -
-
-var persistent real    rho_p ( nVertLevels nCells Time ) 1 r rho_p diag - -
-var persistent real    rho_pp ( nVertLevels nCells Time ) 1 - rho_pp diag - -
-var persistent real    rho_p_save ( nVertLevels nCells Time ) 1 - rho_p_save diag - -
-
-% Space needed for advection
-var persistent real    deriv_two ( FIFTEEN TWO nEdges ) 0 ir deriv_two mesh - -
-var persistent integer advCells ( TWENTYONE nCells ) 0 ir advCells mesh - -
-var persistent real    adv_coefs ( FIFTEEN nEdges ) 0 - adv_coefs mesh - -
-var persistent real    adv_coefs_3rd ( FIFTEEN nEdges ) 0 - adv_coefs_3rd mesh - -
-var persistent integer advCellsForEdge ( FIFTEEN nEdges ) 0 - advCellsForEdge mesh - -
-var persistent integer nAdvCellsForEdge ( nEdges ) 0 - nAdvCellsForEdge mesh - -
-
-
-% Space needed for deformation calculation weights
-var persistent real    defc_a ( maxEdges nCells ) 0 iro defc_a mesh - -
-var persistent real    defc_b ( maxEdges nCells ) 0 iro defc_b mesh - -
-var persistent real    kdiff ( nVertLevels nCells Time ) 1 o kdiff diag - -
-
-% Arrays required for reconstruction of velocity field
-var persistent real    coeffs_reconstruct ( R3 maxEdges nCells ) 0 iro coeffs_reconstruct mesh - -
-
-% ADDED DECLARATIONS MADE BY LDF:
-var persistent real    surface_pressure    ( nCells Time    ) 1 iro surface_pressure       diag - -
-
-var persistent real    temperature_200hPa  ( nCells Time    ) 1   o temperature_200hPa     diag - -
-var persistent real    temperature_500hPa  ( nCells Time    ) 1   o temperature_500hPa     diag - -
-var persistent real    temperature_850hPa  ( nCells Time    ) 1   o temperature_850hPa     diag - -
-var persistent real    height_200hPa       ( nCells Time    ) 1   o height_200hPa          diag - -
-var persistent real    height_500hPa       ( nCells Time    ) 1   o height_500hPa          diag - -
-var persistent real    height_850hPa       ( nCells Time    ) 1   o height_850hPa          diag - -
-var persistent real    uzonal_200hPa       ( nCells Time    ) 1   o uzonal_200hPa          diag - -
-var persistent real    uzonal_500hPa       ( nCells Time    ) 1   o uzonal_500hPa          diag - -
-var persistent real    uzonal_850hPa       ( nCells Time    ) 1   o uzonal_850hPa          diag - -
-var persistent real    umeridional_200hPa  ( nCells Time    ) 1   o umeridional_200hPa     diag - -
-var persistent real    umeridional_500hPa  ( nCells Time    ) 1   o umeridional_500hPa     diag - -
-var persistent real    umeridional_850hPa  ( nCells Time    ) 1   o umeridional_850hPa     diag - -
-var persistent real    w_200hPa            ( nCells Time    ) 1   o w_200hPa               diag - -
-var persistent real    w_500hPa            ( nCells Time    ) 1   o w_500hPa               diag - -
-var persistent real    w_850hPa            ( nCells Time    ) 1   o w_850hPa               diag - -
-
-var persistent real    vorticity_200hPa    ( nVertices Time ) 1   o vorticity_200hPa       diag - -
-var persistent real    vorticity_500hPa    ( nVertices Time ) 1   o vorticity_500hPa       diag - -
-var persistent real    vorticity_850hPa    ( nVertices Time ) 1   o vorticity_850hPa       diag - -
-
-%==================================================================================================
-% DECLARATIONS OF ALL PHYSICS VARIABLES (will need to be moved to a Physics Registry shared by the
-% hydrostatic and non-hydrostatic dynamical cores):
-%==================================================================================================
-
-%... NAMELIST VARIABLES ADDED FOR INITIALIZATION OF SURFACE CHARACTERISTICS:
-namelist character physics  input_landuse_data          USGS
-namelist character physics  input_soil_data             STAS
-namelist integer   physics  input_soil_temperature_lag   140
-namelist integer   physics  num_soil_layers                4
-namelist integer   physics  months                        12
-
-%... NAMELIST VARIABLE NEEDED FOR THE TIME MANAGER:
-dim nMonths namelist:months
-
-%... DIMENSION NEEDED FOR NUMBER OF SOIL LAYERS:
-dim nSoilLevels namelist:num_soil_layers
-
-%... DIMENSION NEEDED FOR UPDATING THE DEEP SOIL TEMPERATURE:
-dim nLags namelist:input_soil_temperature_lag 
-
-%... DIMENSION NEEDED FOR OZONE AND AEROSOLS CONCENTRATIONS IN THE CAM LONGWAVE AND SHORTWAVE
-%... RADIATION PARAMETERIZATIONS.
-% noznlev : number of CAM radiation input ozone levels.
-% naerlev : number of CAM radiation input aerosol levels.
-
-namelist integer   physics  noznlev                       59
-namelist integer   physics  naerlev                       29
-namelist integer   physics  camdim1                       4
-dim nOznLevels     namelist:noznlev
-dim nAerLevels     namelist:naerlev
-dim cam_dim1       namelist:camdim1
-
-%... DIMENSION NEEDED FOR LONGWAVE AND SHORTWAVE RADIATION FLUXES TO INCLUDE AN ADDITIONAL LAYER
-%... BETWEEN THE TOP OF THE MODEL AND THE TOP OF THE ATMOSPHERE
-dim nVertLevelsP2 nVertLevels+2
-
-%... NAMELIST VARIABLES ADDED FOR PHYSICS CONFIGURATION:
-namelist logical   physics  config_frac_seaice          false
-namelist logical   physics  config_sfc_albedo           false
-namelist logical   physics  config_sfc_snowalbedo       false
-namelist logical   physics  config_sst_update           false
-namelist logical   physics  config_sstdiurn_update      false
-namelist logical   physics  config_deepsoiltemp_update  false
-
-namelist integer   physics  config_n_physics            1
-namelist integer   physics  config_n_microp             1
-namelist integer   physics  config_n_conv               1
-namelist integer   physics  config_n_pbl                1
-namelist integer   physics  config_n_lsm                1
-namelist integer   physics  config_n_eddy               1
-namelist integer   physics  config_n_radt_lw            1
-namelist integer   physics  config_n_radt_sw            1
-
-namelist character physics  config_radtlw_interval       none
-namelist character physics  config_radtsw_interval       none
-namelist character physics  config_conv_interval         none
-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
-namelist character physics  config_conv_deep_scheme       off
-namelist character physics  config_eddy_scheme            off 
-namelist character physics  config_lsm_scheme             off
-namelist character physics  config_pbl_scheme             off
-namelist character physics  config_gwdo_scheme            off
-namelist character physics  config_radt_cld_scheme        off
-namelist character physics  config_radt_lw_scheme         off
-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         - -
-
-%--------------------------------------------------------------------------------------------------
-%... ARRAYS AND VARIABLES FOR UPDATING THE DEEP SOIL TEMPERATURE:
-%--------------------------------------------------------------------------------------------------
-
-% nsteps_accum: number of accumulated time-step in a day.
-% ndays_accum : number of accumulated days in a year.
-% tlag        : daily mean surface temperature of prior days                                    [K]
-% tday_accum  : accumulated daily surface temperature for current day                           [K]
-% tyear_mean  : annual mean surface temperature                                                 [K]
-% tyear_accum : accumulated yearly surface temperature for current year                         [K]
-
-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 - -           
-var persistent real    tyear_mean   ( nCells Time           ) 1  r  tyear_mean     diag_physics - -
-var persistent real    tyear_accum  ( nCells Time           ) 1  r  tyear_accum    diag_physics - -
-
-%--------------------------------------------------------------------------------------------------
-%... 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)
-% snowncv   : time-step grid-scale precipitation of snow                                       (mm)
-% graupelnc : accumulated grid-scale precipitation of graupel                                  (mm)
-% graupelncv: time-step grid-scale precipitation of graupel                                    (mm)
-% sr        : time-step ratio of frozen versus total grid-scale precipitation                   (-)
-% precipw   : precipitable water                                                            (kg/m2)
-% refl10cm_max: maximum column reflectivity                                                   (dBz)
-
-var persistent real    refl10cm_max ( nCells Time           ) 1   o refl10cm_max   diag_physics - -
-
-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 - -
-var persistent real    graupelncv ( nCells Time             ) 1   o graupelncv     diag_physics - -
-
-var persistent real    rainnc     ( nCells Time             ) 1  ro rainnc         diag_physics - -
-var persistent real    snownc     ( nCells Time             ) 1  ro snownc         diag_physics - -
-var persistent real    graupelnc  ( nCells Time             ) 1  ro graupelnc      diag_physics - -
-
-var persistent real    precipw    ( nCells Time             ) 1   o precipw        diag_physics - -
-var persistent real    qsat       ( nVertLevels nCells Time ) 1   o  qsat          diag_physics - -
-var persistent real    relhum     ( nVertLevels nCells Time ) 1   o  relhum        diag_physics - -
-
-%--------------------------------------------------------------------------------------------------
-%... 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)
-% rthcuten  : tendency of potential temperature due to cumulus convection                   (K s-1)
-% rqvcuten  : tendency of water vapor mixing ratio due to cumulus convection            (kg/kg s-1)
-% 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 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 - -
-var persistent real   rqccuten  ( nVertLevels nCells Time  ) 1  ro rqccuten        tend_physics - -
-var persistent real   rqicuten  ( nVertLevels nCells Time  ) 1  ro rqicuten        tend_physics - -
-
-%... KAIN_FRITSCH:
-% cubot     : lowest level of convection                                                        (-)
-% cutop     : highest level of convection                                                       (-)
-% nca       : relaxation time for KF parameterization of convection                             (s)
-% wavg0     : average vertical velocity (KF scheme only)                                    (m s-1)
-% rqrcuten  : tendency of rain mixing ratio due to cumulus convection                   (kg/kg s-1)
-% rqscuten  : tendency of snow mixing ratio due to cumulus convection                   (kg/kg s-1)
-
-var persistent real   nca       ( nCells Time              ) 1  ro nca             diag_physics - -
-var persistent real   cubot     ( nCells Time              ) 1  ro cubot           diag_physics - -
-var persistent real   cutop     ( nCells Time              ) 1  ro cutop           diag_physics - -
-var persistent real   w0avg     ( nVertLevels nCells Time  ) 1  ro w0avg           diag_physics - -
-var persistent real   rqrcuten  ( nVertLevels nCells Time  ) 1  ro rqrcuten        tend_physics - -
-var persistent real   rqscuten  ( nVertLevels nCells Time  ) 1  ro rqscuten        tend_physics - -
-
-%... TIEDTKE:
-% rucuten   : tendency of zonal wind due to cumulus convection                              (m/s-1)
-% rvcuten   : tendency of meridional wind due to cumulus convection                         (m/s-1)
-% rqvdynten : tendency of water vapor due to horizontal and vertical advections         (kg/kg/s-1)
-
-var persistent real   rqvdynten ( nVertLevels nCells Time  ) 1  ro rqvdynten       tend_physics - -
-var persistent real   rucuten   ( nVertLevels nCells Time  ) 1  ro rucuten         tend_physics - -
-var persistent real   rvcuten   ( nVertLevels nCells Time  ) 1  ro rvcuten         tend_physics - -
-
-%--------------------------------------------------------------------------------------------------
-%... PARAMETERIZATION OF PLANETARY BOUNDARY LAYER PROCESSES:
-%--------------------------------------------------------------------------------------------------
-
-% kpbl      : index of PBL top                                                                  (-)
-% hpbl      : PBL height                                                                        (m)
-% exch_h    : exchange coefficient                                                              (-)
-% rublten   : tendency of zonal wind due to pbl processes                                   (m s-1)
-% rvblten   : tendency of meridional wind due to pbl processes                              (m s-1)
-% rthblten  : tendency of potential temperature due to pbl processes                        (K s-1)
-% rqvblten  : tendency of water vapor mixing ratio due to pbl processes                 (kg/kg s-1)
-% rqcblten  : tendency of cloud water mixing ratio due to pbl processes                 (kg/kg s-1)
-% rqiblten  : tendency of cloud ice mixing ratio due to pbl processes                   (kg/kg s-1)
-
-var persistent integer kpbl     ( nCells Time               ) 1  ro kpbl           diag_physics - - 
-var persistent real    hpbl     ( nCells Time               ) 1  ro hpbl           diag_physics - - 
-var persistent real    exch_h   ( nVertLevels nCells Time   ) 1   o exch_h         diag_physics - -
-
-%    TENDENCIES:
-var persistent real    rublten  ( nVertLevels nCells Time   ) 1  ro rublten        tend_physics - -
-var persistent real    rvblten  ( nVertLevels nCells Time   ) 1  ro rvblten        tend_physics - -
-var persistent real    rthblten ( nVertLevels nCells Time   ) 1  ro rthblten       tend_physics - -
-var persistent real    rqvblten ( nVertLevels nCells Time   ) 1  ro rqvblten       tend_physics - -
-var persistent real    rqcblten ( nVertLevels nCells Time   ) 1  ro rqcblten       tend_physics - -
-var persistent real    rqiblten ( nVertLevels nCells Time   ) 1  ro rqiblten       tend_physics - -
-
-%    TEMPORARY:
-var persistent real    kzh      ( nVertLevels nCells Time   ) 1   o kzh            diag_physics - -
-var persistent real    kzm      ( nVertLevels nCells Time   ) 1   o kzm            diag_physics - -
-var persistent real    kzq      ( nVertLevels nCells Time   ) 1   o kzq            diag_physics - -
-
-%--------------------------------------------------------------------------------------------------
-%... PARAMETERIZATION OF GRAVITY WAVE DRAG OVER OROGRAPHY:
-%--------------------------------------------------------------------------------------------------
-
-% var2d      : orographic variance                                                             (m2)
-% con        : orographic convexity                                                            (m2)
-% oa1        : orographic direction asymmetry function                                          (-)
-% oa2        : orographic direction asymmetry function                                          (-)
-% oa3        : orographic direction asymmetry function                                          (-)
-% oa4        : orographic direction asymmetry function                                          (-)
-% ol1        : orographic direction asymmetry function                                          (-)
-% ol2        : orographic direction asymmetry function                                          (-)
-% ol3        : orographic direction asymmetry function                                          (-)
-% ol4        : orographic direction asymmetry function                                          (-)
-% dusfcg     : vertically-integrated gravity wave drag over orography u-stress           (Pa m s-1)
-% dvsfcg     : vertically-integrated gravity wave drag over orography v-stress           (Pa m s-1)
-% dtaux3d    : gravity wave drag over orography u-stress                                    (m s-1)
-% dtauy3d    : gravity wave drag over orography v-stress                                    (m s-1)
-
-var persistent real    var2d    ( nCells                    ) 0  iro var2d         sfc_input    - -
-var persistent real    con      ( nCells                    ) 0  iro con           sfc_input    - -
-var persistent real    oa1      ( nCells                    ) 0  iro oa1           sfc_input    - -
-var persistent real    oa2      ( nCells                    ) 0  iro oa2           sfc_input    - -
-var persistent real    oa3      ( nCells                    ) 0  iro oa3           sfc_input    - -
-var persistent real    oa4      ( nCells                    ) 0  iro oa4           sfc_input    - -
-var persistent real    ol1      ( nCells                    ) 0  iro ol1           sfc_input    - -
-var persistent real    ol2      ( nCells                    ) 0  iro ol2           sfc_input    - -
-var persistent real    ol3      ( nCells                    ) 0  iro ol3           sfc_input    - -
-var persistent real    ol4      ( nCells                    ) 0  iro ol4           sfc_input    - -
-
-var persistent real    dusfcg   ( nCells Time               ) 1  ro dusfcg         diag_physics - -
-var persistent real    dvsfcg   ( nCells Time               ) 1  ro dvsfcg         diag_physics - -
-var persistent real    dtaux3d  ( nVertLevels nCells Time   ) 1  ro dtaux3d        diag_physics - -
-var persistent real    dtauy3d  ( nVertLevels nCells Time   ) 1  ro dtauy3d        diag_physics - -
-
-var persistent real    rubldiff ( nVertLevels nCells Time   ) 1  ro rubldiff       diag_physics - -
-var persistent real    rvbldiff ( nVertLevels nCells Time   ) 1  ro rvbldiff       diag_physics - -
-
-%--------------------------------------------------------------------------------------------------
-%... PARAMETERIZATION OF SURFACE LAYER PROCESSES:
-%--------------------------------------------------------------------------------------------------
-
-% br        :bulk richardson number                                                             [-]
-% cd        :drag coefficient at 10m                                                            [-]
-% cda       :drag coefficient at lowest model level                                             [-]
-% chs       :???
-% chs2      :???
-% cqs2      :???
-% ck        :enthalpy exchange coefficient at 10 m                                              [-]
-% cka       :enthalpy exchange coefficient at lowest model level                                [-]
-% cpm       :???
-% flhc      :exchange coefficient for heat                                                      [-]
-% flqc      :exchange coefficient for moisture                                                  [-]
-% gz1oz0    :log of z1 over z0                                                                  [-]
-% hfx       :upward heat flux at the surface                                               [W/m2/s]
-% lh        :latent heat flux at the surface                                                 [W/m2]
-% mavail    :surface moisture availability                                                      [-]
-% mol       :T* in similarity theory                                                            [K]
-% psih      :similarity theory for heat                                                         [-]
-% psim      :similarity theory for momentum                                                     [-]
-% qfx       :upward moisture flux at the surface                                          [kg/m2/s]
-% qgh       :???
-% qsfc      :specific humidity at lower boundary                                            [kg/kg]
-% regime    :flag indicating PBL regime (stable_p,unstable_p,etc...)                            [-]
-% rmol      :1 / Monin Ob length                                                                [-]
-% ust       :u* in similarity theory                                                          [m/s]
-% ustm      :u* in similarity theory without vconv                                            [m/s]
-% zol       :z/L height over Monin-Obukhov length                                               [-]
-% znt       :time-varying roughness length                                                      [m]
-% wspd      :wind speed                                                                       [m/s]
-% DIAGNOSTICS:
-% q2        :specific humidity at 2m                                                        [kg/kg]
-% u10       :u at 10 m                                                                        [m/s]
-% v10       :v at 10 m                                                                        [m/s]
-% t2m       :temperature at 2m                                                                  [K]
-% th2m      :potential temperature at 2m                                                        [K]
-
-var persistent real    hfx      ( nCells Time               ) 1  ro hfx            diag_physics - -
-var persistent real    mavail   ( nCells Time               ) 1  ro mavail         diag_physics - -
-var persistent real    mol      ( nCells Time               ) 1  ro mol            diag_physics - -
-var persistent real    qfx      ( nCells Time               ) 1  ro qfx            diag_physics - -
-var persistent real    qsfc     ( nCells Time               ) 1  ro qsfc           diag_physics - -
-var persistent real    ust      ( nCells Time               ) 1  ro ust            diag_physics - -
-var persistent real    ustm     ( nCells Time               ) 1  ro ustm           diag_physics - -
-var persistent real    zol      ( nCells Time               ) 1  ro zol            diag_physics - -
-var persistent real    znt      ( nCells Time               ) 1  ro znt            diag_physics - -
-
-var persistent real    br       ( nCells Time               ) 1  ro br             diag_physics - -
-var persistent real    cd       ( nCells Time               ) 1  ro cd             diag_physics - -
-var persistent real    cda      ( nCells Time               ) 1  ro cda            diag_physics - -
-var persistent real    chs      ( nCells Time               ) 1  ro chs            diag_physics - -
-var persistent real    chs2     ( nCells Time               ) 1  ro chs2           diag_physics - -
-var persistent real    cqs2     ( nCells Time               ) 1  ro cqs2           diag_physics - -
-var persistent real    ck       ( nCells Time               ) 1  ro ck             diag_physics - -
-var persistent real    cka      ( nCells Time               ) 1  ro cka            diag_physics - -
-var persistent real    cpm      ( nCells Time               ) 1  ro cpm            diag_physics - -
-var persistent real    flhc     ( nCells Time               ) 1  ro flhc           diag_physics - -
-var persistent real    flqc     ( nCells Time               ) 1  ro flqc           diag_physics - -
-var persistent real    gz1oz0   ( nCells Time               ) 1  ro gz1oz0         diag_physics - -
-var persistent real    lh       ( nCells Time               ) 1  ro lh             diag_physics - -
-var persistent real    psim     ( nCells Time               ) 1  ro psim           diag_physics - -
-var persistent real    psih     ( nCells Time               ) 1  ro psih           diag_physics - -
-var persistent real    qgh      ( nCells Time               ) 1  ro qgh            diag_physics - -
-var persistent real    regime   ( nCells Time               ) 1  ro regime         diag_physics - -
-var persistent real    rmol     ( nCells Time               ) 1  ro rmol           diag_physics - -
-var persistent real    wspd     ( nCells Time               ) 1  ro wspd           diag_physics - -
-% DIAGNOSTICS:
-var persistent real    u10      ( nCells Time               ) 1  ro u10            diag_physics - -
-var persistent real    v10      ( nCells Time               ) 1  ro v10            diag_physics - -
-var persistent real    q2       ( nCells Time               ) 1  ro q2             diag_physics - -
-var persistent real    t2m      ( nCells Time               ) 1  ro t2m            diag_physics - -
-var persistent real    th2m     ( nCells Time               ) 1  ro th2m           diag_physics - -
-
-%--------------------------------------------------------------------------------------------------
-%... 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                     [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 - -
-var persistent real    swdnbc     ( nCells Time               ) 1   o swdnbc       diag_physics - -
-var persistent real    swdnt      ( nCells Time               ) 1   o swdnt        diag_physics - -
-var persistent real    swdntc     ( nCells Time               ) 1   o swdntc       diag_physics - -
-var persistent real    swupb      ( nCells Time               ) 1   o swupb        diag_physics - -
-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 - -
-
-%... RRTMG SW ONLY:
-var persistent real    swdnflx    ( nVertLevelsP2 nCells Time ) 1   o swdnflx      diag_physics - -
-var persistent real    swdnflxc   ( nVertLevelsP2 nCells Time ) 1   o swdnflxc     diag_physics - -
-var persistent real    swupflx    ( nVertLevelsP2 nCells Time ) 1   o swupflx      diag_physics - -
-var persistent real    swupflxc   ( nVertLevelsP2 nCells Time ) 1   o swupflxc     diag_physics - -
-
-%--------------------------------------------------------------------------------------------------
-%... PARAMETERIZATION OF LONGWAVE RADIATION:
-%--------------------------------------------------------------------------------------------------
-
-% note: glw is the same diagnostic as lwdnb and is used in the land-surface scheme for the calcula-
-%       tion of the surface budget. glw is always an output argument to the subroutine rrtmg_lwrad.
-%       in contrast,lwdnb is an optional ouput argument to the subroutine rrtmg_lwrad depending on
-%       the presence of lwupt (or not).
-
-% glw       :all-sky downwelling longwave flux at bottom-of-atmosphere                      [W m-2]
-% lwcf      :longwave cloud forcing at top-of-atmosphere                                    [W m-2]
-% lwdnb     :all-sky downwelling longwave flux at bottom-of-atmosphere                      [W m-2]
-% lwdnbc    :clear-sky downwelling longwave flux at bottom-of-atmosphere                    [W m-2]
-% lwdnt     :all-sky downwelling longwave flux at top-of-atmosphere                         [W m-2]
-% lwdntc    :clear-sky downwelling longwave flux at top-of-atmosphere                       [W m-2]
-% lwupb     :all-sky upwelling longwave flux at bottom-of-atmosphere                        [W m-2]
-% 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   :
-% lwupflxc  :
-% 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 - -
-var persistent real    lwdnt      ( nCells Time               ) 1   o lwdnt        diag_physics - -
-var persistent real    lwdntc     ( nCells Time               ) 1   o lwdntc       diag_physics - -
-var persistent real    lwupb      ( nCells Time               ) 1   o lwupb        diag_physics - -
-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 - -
-
-var persistent real    rthratenlw ( nVertLevels nCells Time   ) 1  ro rthratenlw   tend_physics - -
-
-%... RRTMG LW ONLY:
-%var persistent real   lwdnflx    ( nVertLevelsP2 nCells Time ) 1   o lwdnflx      diag_physics - -
-%var persistent real   lwdnflxc   ( nVertLevelsP2 nCells Time ) 1   o lwdnflxc     diag_physics - -
-%var persistent real   lwupflx    ( nVertLevelsP2 nCells Time ) 1   o lwupflx      diag_physics - -
-%var persistent real   lwupflxc   ( nVertLevelsP2 nCells Time ) 1   o lwupflxc     diag_physics - -
-
-%--------------------------------------------------------------------------------------------------
-%... ADDITIONAL &quot;RADIATION&quot; ARRAYS NEEDED ONLY IN THE &quot;CAM&quot; LW AND SW RADIATION CODES:
-%--------------------------------------------------------------------------------------------------
-
-%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  - -
-var persistent real    ozmixm   ( nMonths nOznLevels nCells ) 0 -  ozmixm    mesh  - -
-
-% AEROSOLS:
-var persistent real    m_hybi   ( nAerLevels nCells         ) 0 -  m_hybi    mesh  - -  
-
-var persistent real    m_ps     ( nCells Time               ) 2 -  m_ps      state - -
-%var persistent real   dummy    ( nAerLevels nCells Time    ) 2 -  dummy     state aerosols aer_cam
-var persistent real    sul      ( nAerLevels nCells Time    ) 2 -  sul       state aerosols aer_cam
-var persistent real    sslt     ( nAerLevels nCells Time    ) 2 -  sslt      state aerosols aer_cam
-var persistent real    dust1    ( nAerLevels nCells Time    ) 2 -  dust1     state aerosols aer_cam
-var persistent real    dust2    ( nAerLevels nCells Time    ) 2 -  dust2     state aerosols aer_cam
-var persistent real    dust3    ( nAerLevels nCells Time    ) 2 -  dust3     state aerosols aer_cam
-var persistent real    dust4    ( nAerLevels nCells Time    ) 2 -  dust4     state aerosols aer_cam
-var persistent real    ocpho    ( nAerLevels nCells Time    ) 2 -  ocpho     state aerosols aer_cam
-var persistent real    bcpho    ( nAerLevels nCells Time    ) 2 -  bcpho     state aerosols aer_cam
-var persistent real    ocphi    ( nAerLevels nCells Time    ) 2 -  ocphi     state aerosols aer_cam
-var persistent real    bcphi    ( nAerLevels nCells Time    ) 2 -  bcphi     state aerosols aer_cam
-var persistent real    bg       ( nAerLevels nCells Time    ) 2 -  bg        state aerosols aer_cam
-var persistent real    volc     ( nAerLevels nCells Time    ) 2 -  volc      state aerosols aer_cam
-
-%--------------------------------------------------------------------------------------------------
-%... PARAMERIZATION OF CLOUDINESS:
-%--------------------------------------------------------------------------------------------------
-
-% cldfrac   :cloud fraction                                                                     [-]
-
-var persistent real    cldfrac    ( nVertLevels nCells Time ) 1   o cldfrac        diag_physics - -
-
-%--------------------------------------------------------------------------------------------------
-%... PARAMETERIZATION OF LAND-SURFACE SCHEME:
-%--------------------------------------------------------------------------------------------------
-
-% acsnom         :accumulated melted snow                                                  [kg m-2]
-% acsnow         :accumulated snow                                                         [kg m-2]
-% canwat         :canopy water                                                             [kg m-2]
-% chklowq        :surface saturation flag                                                       [-]
-% grdflx         :ground heat flux                                                          [W m-2]
-% lai            :leaf area index                                                               [-]
-% noahres        :residual of the noah land-surface scheme energy budget                    [W m-2]
-% potevp         :potential evaporation                                                     [W m-2]
-% qz0            :specific humidity at znt                                                [kg kg-1]
-% sfc_albedo     :surface albedo                                                                [-]
-% sfc_embck      :background emissivity                                                         [-]
-% sfc_emiss      :surface emissivity                                                            [-]
-% sfcrunoff      :surface runoff                                                            [m s-1]
-% smstav         :moisture availability                                                         [-]
-% smstot         :total moisture                                                           [m3 m-3]
-% snopcx         :snow phase change heat flux                                               [W m-2]
-% snotime        :??
-% sstsk          : skin sea-surface temperature                                                 [K]
-% sstsk_dtc      : skin sea-surface temperature cooling                                         [K]
-% sstsk_dtw      : skin sea-surface temperature warming                                         [K]
-% thc            :thermal inertia                                              [Cal cm-1 K-1 s-0.5]
-% udrunoff       :sub-surface runoff                                                        [m s-1]
-% xicem          :ice mask from previous time-step                                              [-]
-% z0             :background roughness length                                                   [m]
-% zs             :depth of centers of soil layers                                               [m]
-
-var persistent real    acsnom     ( nCells Time             ) 1  ro acsnom         diag_physics - -
-var persistent real    acsnow     ( nCells Time             ) 1  ro acsnow         diag_physics - -
-var persistent real    canwat     ( nCells Time             ) 1  ro canwat         diag_physics - -
-var persistent real    chklowq    ( nCells Time             ) 1  ro chklowq        diag_physics - -
-var persistent real    grdflx     ( nCells Time             ) 1  ro grdflx         diag_physics - -
-var persistent real    lai        ( nCells Time             ) 1  ro lai            diag_physics - -
-var persistent real    noahres    ( nCells Time             ) 1  ro noahres        diag_physics - -
-var persistent real    potevp     ( nCells Time             ) 1  ro potevp         diag_physics - -
-var persistent real    qz0        ( nCells Time             ) 1  ro qz0            diag_physics - -
-var persistent real    sfc_albedo ( nCells Time             ) 1  ro sfc_albedo     diag_physics - -
-var persistent real    sfc_emiss  ( nCells Time             ) 1  ro sfc_emiss      diag_physics - -
-var persistent real    sfc_emibck ( nCells Time             ) 1  ro sfc_emibck     diag_physics - -
-var persistent real    sfcrunoff  ( nCells Time             ) 1  ro sfcrunoff      diag_physics - -   
-var persistent real    smstav     ( nCells Time             ) 1  ro smstav         diag_physics - -   
-var persistent real    smstot     ( nCells Time             ) 1  ro smstot         diag_physics - -   
-var persistent real    snopcx     ( nCells Time             ) 1  ro snopcx         diag_physics - -
-var persistent real    snotime    ( nCells Time             ) 1  ro snotime        diag_physics - -
-var persistent real    sstsk      ( nCells Time             ) 1  ro sstsk          diag_physics - -
-var persistent real    sstsk_dtc  ( nCells Time             ) 1  ro sstsk_dtc      diag_physics - -
-var persistent real    sstsk_dtw  ( nCells Time             ) 1  ro sstsk_dtw      diag_physics - -
-var persistent real    thc        ( nCells Time             ) 1  ro thc            diag_physics - - 
-var persistent real    udrunoff   ( nCells Time             ) 1  ro udrunoff       diag_physics - -   
-var persistent real    xicem      ( nCells Time             ) 1  ro xicem          diag_physics - -
-var persistent real    z0         ( nCells Time             ) 1  ro z0             diag_physics - -   
-var persistent real    zs         ( nCells Time             ) 1  ro zs             diag_physics - -   
-
-%--------------------------------------------------------------------------------------------------
-%... SURFACE CHARACTERISTICS THAT NEED TO BE READ FROM GRID.NC:
-%--------------------------------------------------------------------------------------------------
-
-% albedo12m      :monthly climatological albedo                                                 [-]
-% greenfrac      :monthly climatological greeness fraction                                      [-]                             
-% isltyp         :dominant soil category                                                        [-]
-% ivgtyp         :dominant vegetation category                                                  [-]
-% landmask       :=0 for ocean;=1 for land                                                      [-]
-% sfc_albbck     :background albedo                                                             [-]
-% shdmin         :minimum areal fractional coverage of annual green vegetation                  [-]
-% shdmax         :maximum areal fractional coverage of annual green vegetation                  [-]
-% skintemp       :skin temperature                                                              [K]
-% snoalb         :annual max snow albedo                                                        [-]
-% snow           :snow water equivalent                                                    [kg m-2]
-% sst            :sea-surface temperature                                                       [K]
-% snowc          :flag indicating snow coverage (1 for snow cover)                              [-]
-% snowh          :physical snow depth                                                           [m]
-% ter            :terrain height                                                                [-]
-% tmn            :soil temperature at lower boundary                                            [K]
-% vegfra         :vegetation fraction                                                           [-]
-% seaice         :sea-ice mask (=1 when xice is greater than 0; =0 otherwise)                   [-]
-% xice           :fractional sea-ice coverage                                                   [-]
-% xland          :land mask    (1 for land; 2 for water)                                        [-]
-
-% dzs            :thickness of soil layers                                                      [m]
-% smcrel         :soil moisture threshold below which transpiration begins to stress            [-]
-% sh2o           :soil liquid water                                                        [m3 m-3]
-% smois          :soil moisture                                                            [m3 m-3]
-% tslb           :soil temperature                                                              [K]
-
-var persistent integer isltyp     ( nCells                   ) 0 iro isltyp        sfc_input    - -
-var persistent integer ivgtyp     ( nCells                   ) 0 iro ivgtyp        sfc_input    - -
-var persistent integer landmask   ( nCells                   ) 0 iro landmask      sfc_input    - -
-var persistent real    shdmin     ( nCells                   ) 0 iro shdmin        sfc_input    - -
-var persistent real    shdmax     ( nCells                   ) 0 iro shdmax        sfc_input    - -
-var persistent real    snoalb     ( nCells                   ) 0 iro snoalb        sfc_input    - -
-var persistent real    ter        ( nCells                   ) 0 io  ter           sfc_input    - -
-var persistent real    albedo12m  ( nMonths nCells           ) 0 iro albedo12m     sfc_input    - -
-var persistent real    greenfrac  ( nMonths nCells           ) 0 iro greenfrac     sfc_input    - -
-
-var persistent real    sfc_albbck ( nCells Time              ) 1 iro sfc_albbck    sfc_input    - -
-var persistent real    skintemp   ( nCells Time              ) 1 iro skintemp      sfc_input    - -
-var persistent real    snow       ( nCells Time              ) 1 iro snow          sfc_input    - -
-var persistent real    snowc      ( nCells Time              ) 1 iro snowc         sfc_input    - -
-var persistent real    snowh      ( nCells Time              ) 1 iro snowh         sfc_input    - -
-var persistent real    sst        ( nCells Time              ) 1 isro sst          sfc_input    - -
-var persistent real    tmn        ( nCells Time              ) 1 iro tmn           sfc_input    - -
-var persistent real    vegfra     ( nCells Time              ) 1 iro vegfra        sfc_input    - -   
-var persistent real    seaice     ( nCells Time              ) 1 iro seaice        sfc_input    - -
-var persistent real    xice       ( nCells Time              ) 1 isro xice         sfc_input    - -
-var persistent real    xland      ( nCells Time              ) 1 iro xland         sfc_input    - -
-
-var persistent real    dzs        ( nSoilLevels nCells Time  ) 1 iro dzs           sfc_input    - -
-var persistent real    smcrel     ( nSoilLevels nCells Time  ) 1  ro smcrel        sfc_input    - -
-var persistent real    sh2o       ( nSoilLevels nCells Time  ) 1 iro sh2o          sfc_input    - -
-var persistent real    smois      ( nSoilLevels nCells Time  ) 1 iro smois         sfc_input    - -
-var persistent real    tslb       ( nSoilLevels nCells Time  ) 1 iro tslb          sfc_input    - -
-
-%==================================================================================================

Modified: branches/ocean_projects/tensor_operations/src/core_nhyd_atmos/Registry.xml
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_nhyd_atmos/Registry.xml        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_nhyd_atmos/Registry.xml        2013-04-18 15:33:42 UTC (rev 2767)
@@ -1,5 +1,5 @@
 &lt;?xml version=&quot;1.0&quot;?&gt;
-&lt;registry&gt;
+&lt;registry model=&quot;mpas&quot; core=&quot;nhyd_atmos&quot; version=&quot;0.0.0&quot;&gt;
 
 &lt;!-- **************************************************************************************** --&gt;
 &lt;!-- ************************************** Dimensions ************************************** --&gt;

Index: branches/ocean_projects/tensor_operations/src/core_ocean
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_ocean        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_ocean        2013-04-18 15:33:42 UTC (rev 2767)

Property changes on: branches/ocean_projects/tensor_operations/src/core_ocean
___________________________________________________________________
Modified: svn:mergeinfo
## -1,5 +1,6 ##
 /branches/atmos_physics/src/core_ocean:1672-1846
 /branches/cam_mpas_nh/src/core_ocean:1260-1270
+/branches/history_attribute/src/core_ocean:2698-2745
 /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
## -22,6 +23,7 ##
 /branches/ocean_projects/sea_level_pressure/src/core_ocean:2488-2528
 /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/variable_name_change/src/core_ocean:2733-2765
 /branches/ocean_projects/vert_adv_mrp/src/core_ocean:704-745
 /branches/ocean_projects/vol_cons_RK_imp_mix/src/core_ocean:1965-1992
 /branches/ocean_projects/zstar_restart_new/src/core_ocean:1762-1770
## -36,3 +38,4 ##
 /branches/source_renaming/src/core_ocean:1082-1113
 /branches/time_manager/src/core_ocean:924-962
 /branches/xml_registry/src/core_ocean:2610-2662
+/trunk/mpas/src/core_ocean:2689-2754
\ No newline at end of property
Modified: branches/ocean_projects/tensor_operations/src/core_ocean/Makefile
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_ocean/Makefile        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_ocean/Makefile        2013-04-18 15:33:42 UTC (rev 2767)
@@ -15,21 +15,6 @@
        mpas_ocn_vel_forcing_windstress.o \
        mpas_ocn_vel_forcing_rayleigh.o \
        mpas_ocn_vel_pressure_grad.o \
-       mpas_ocn_tracer_vadv.o \
-       mpas_ocn_tracer_vadv_spline.o \
-       mpas_ocn_tracer_vadv_spline2.o \
-       mpas_ocn_tracer_vadv_spline3.o \
-       mpas_ocn_tracer_vadv_stencil.o \
-       mpas_ocn_tracer_vadv_stencil2.o \
-       mpas_ocn_tracer_vadv_stencil3.o \
-       mpas_ocn_tracer_vadv_stencil4.o \
-       mpas_ocn_tracer_hadv.o \
-       mpas_ocn_tracer_hadv2.o \
-       mpas_ocn_tracer_hadv3.o \
-       mpas_ocn_tracer_hadv4.o \
-       mpas_ocn_tracer_hmix.o \
-       mpas_ocn_tracer_hmix_del2.o \
-       mpas_ocn_tracer_hmix_del4.o \
        mpas_ocn_vmix.o \
        mpas_ocn_vmix_coefs_const.o \
        mpas_ocn_vmix_coefs_rich.o \
@@ -37,6 +22,9 @@
        mpas_ocn_restoring.o \
        mpas_ocn_tendency.o \
        mpas_ocn_diagnostics.o \
+           mpas_ocn_tracer_hmix.o \
+           mpas_ocn_tracer_hmix_del2.o \
+           mpas_ocn_tracer_hmix_del4.o \
        mpas_ocn_tracer_advection.o \
        mpas_ocn_tracer_advection_std.o \
        mpas_ocn_tracer_advection_std_hadv.o \
@@ -104,30 +92,6 @@
 
 mpas_ocn_vel_coriolis.o:
 
-mpas_ocn_tracer_hadv.o:  mpas_ocn_tracer_hadv2.o  mpas_ocn_tracer_hadv3.o  mpas_ocn_tracer_hadv4.o
-
-mpas_ocn_tracer_hadv2.o:
-
-mpas_ocn_tracer_hadv3.o:
-
-mpas_ocn_tracer_hadv4.o:
-
-mpas_ocn_tracer_vadv.o: mpas_ocn_tracer_vadv_spline.o mpas_ocn_tracer_vadv_stencil.o
-
-mpas_ocn_tracer_vadv_spline.o: mpas_ocn_tracer_vadv_spline2.o  mpas_ocn_tracer_vadv_spline3.o
-
-mpas_ocn_tracer_vadv_spline2.o:
-
-mpas_ocn_tracer_vadv_spline3.o:
-
-mpas_ocn_tracer_vadv_stencil.o: mpas_ocn_tracer_vadv_stencil2.o mpas_ocn_tracer_vadv_stencil3.o  mpas_ocn_tracer_vadv_stencil4.o 
-
-mpas_ocn_tracer_vadv_stencil2.o:
-
-mpas_ocn_tracer_vadv_stencil3.o:
-
-mpas_ocn_tracer_vadv_stencil4.o:
-
 mpas_ocn_tracer_hmix.o: mpas_ocn_tracer_hmix_del2.o mpas_ocn_tracer_hmix_del4.o
 
 mpas_ocn_tracer_hmix_del2.o:
@@ -183,18 +147,6 @@
                       mpas_ocn_vel_forcing.o \
                       mpas_ocn_vel_forcing_windstress.o \
                       mpas_ocn_vel_pressure_grad.o \
-                      mpas_ocn_tracer_vadv.o \
-                      mpas_ocn_tracer_vadv_spline.o \
-                      mpas_ocn_tracer_vadv_spline2.o \
-                      mpas_ocn_tracer_vadv_spline3.o \
-                      mpas_ocn_tracer_vadv_stencil.o \
-                      mpas_ocn_tracer_vadv_stencil2.o \
-                      mpas_ocn_tracer_vadv_stencil3.o \
-                      mpas_ocn_tracer_vadv_stencil4.o \
-                      mpas_ocn_tracer_hadv.o \
-                      mpas_ocn_tracer_hadv2.o \
-                      mpas_ocn_tracer_hadv3.o \
-                      mpas_ocn_tracer_hadv4.o \
                       mpas_ocn_tracer_hmix.o \
                       mpas_ocn_tracer_hmix_del2.o \
                       mpas_ocn_tracer_hmix_del4.o \

Deleted: branches/ocean_projects/tensor_operations/src/core_ocean/Registry
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_ocean/Registry        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_ocean/Registry        2013-04-18 15:33:42 UTC (rev 2767)
@@ -1,374 +0,0 @@
-%
-% namelist  type  namelist_record  name  default_value
-%
-namelist logical   time_management config_do_restart          .false.
-namelist character time_management config_start_time          '0000-01-01_00:00:00'
-namelist character time_management config_stop_time           'none'
-namelist character time_management config_run_duration        '0_06:00:00'
-namelist character time_management config_calendar_type       '360day'
-
-namelist character io       config_input_name          'grid.nc'
-namelist character io       config_output_name         'output.nc'
-namelist character io       config_restart_name        'restart.nc'
-namelist character io       config_restart_interval    '0_06:00:00'
-namelist character io       config_output_interval     '0_06:00:00'
-namelist character io       config_stats_interval      '0_01:00:00'
-namelist logical   io       config_write_stats_on_startup   .true.
-namelist logical   io       config_write_output_on_startup  .true.
-namelist integer   io       config_frames_per_outfile  1000
-namelist integer   io       config_pio_num_iotasks     0 
-namelist integer   io       config_pio_stride          1
-
-namelist real      time_integration config_dt                  3000.0
-namelist character time_integration config_time_integrator    'split_explicit'
-
-namelist integer   grid config_num_halos                3
-namelist character grid config_vert_coord_movement      'uniform_stretching'
-namelist character grid config_alter_ICs_for_pbcs       'zlevel_pbcs_off'
-namelist real      grid config_min_pbc_fraction         0.10
-namelist logical   grid config_check_ssh_consistency    .true.
-
-namelist character decomposition config_block_decomp_file_prefix  'graph.info.part.'
-namelist integer   decomposition config_number_of_blocks          0
-namelist logical   decomposition config_explicit_proc_decomp      .false.
-namelist character decomposition config_proc_decomp_file_prefix   'graph.info.part.'
-
-namelist logical   hmix          config_hmix_ScaleWithMesh  .false.
-namelist logical   hmix          config_visc_vorticity_term .true.
-namelist real      hmix          config_apvm_scale_factor      0.0
-
-namelist logical   hmix_del2     config_use_mom_del2        .false.
-namelist logical   hmix_del2     config_use_tracer_del2     .false.
-namelist real      hmix_del2     config_mom_del2             0.0
-namelist real      hmix_del2     config_tracer_del2          0.0
-namelist real      hmix_del2     config_vorticity_del2_scale 1.0
-
-namelist logical   hmix_del4     config_use_mom_del4        .true.
-namelist logical   hmix_del4     config_use_tracer_del4     .false.
-namelist real      hmix_del4     config_mom_del4             5.0e13
-namelist real      hmix_del4     config_tracer_del4          0.0
-namelist real      hmix_del4     config_vorticity_del4_scale 1.0
-
-namelist logical   hmix_Leith    config_use_Leith_del2      .false.
-namelist real      hmix_Leith    config_Leith_parameter      1.0
-namelist real      hmix_Leith    config_Leith_dx             15000.0
-namelist real      hmix_Leith    config_Leith_visc2_max      2.5e3
-
-namelist real      standard_GM     config_h_kappa              0.0
-namelist real      standard_GM     config_h_kappa_q            0.0
-
-namelist logical   Rayleigh_damping     config_Rayleigh_friction    .false.
-namelist real      Rayleigh_damping     config_Rayleigh_damping_coeff 0.0
-
-namelist real      vmix     config_convective_visc      1.0
-namelist real      vmix     config_convective_diff      1.0
-
-namelist logical   vmix_const   config_use_const_visc   .false.
-namelist logical   vmix_const   config_use_const_diff   .false.
-namelist real      vmix_const   config_vert_visc        2.5e-4
-namelist real      vmix_const   config_vert_diff        2.5e-5
-
-namelist logical   vmix_rich    config_use_rich_visc    .true.
-namelist logical   vmix_rich    config_use_rich_diff    .true.
-namelist real      vmix_rich    config_bkrd_vert_visc   1.0e-4
-namelist real      vmix_rich    config_bkrd_vert_diff   1.0e-5
-namelist real      vmix_rich    config_rich_mix         0.005
-
-namelist logical   vmix_tanh    config_use_tanh_visc    .false.
-namelist logical   vmix_tanh    config_use_tanh_diff    .false.
-namelist real      vmix_tanh    config_max_visc_tanh    2.5e-1
-namelist real      vmix_tanh    config_min_visc_tanh    1.0e-4
-namelist real      vmix_tanh    config_max_diff_tanh    2.5e-2
-namelist real      vmix_tanh    config_min_diff_tanh    1.0e-5
-namelist real      vmix_tanh    config_zMid_tanh        -100
-namelist real      vmix_tanh    config_zWidth_tanh      100
-
-namelist logical   forcing   config_use_monthly_forcing .false.
-namelist logical   forcing   config_restoreTS           .false.
-namelist real      forcing   config_restoreT_timescale  90.0
-namelist real      forcing   config_restoreS_timescale  90.0
-
-namelist character advection config_vert_tracer_adv     'stencil'
-namelist integer   advection config_vert_tracer_adv_order  3
-namelist integer   advection config_horiz_tracer_adv_order 3
-namelist real      advection config_coef_3rd_order      0.25
-namelist logical   advection config_monotonic           .true.
-
-namelist real      bottom_drag config_bottom_drag_coeff    1.0e-3
-
-namelist character pressure_gradient     config_pressure_gradient_type       'pressure_and_zmid'
-namelist real      pressure_gradient     config_rho0                1014.65
-
-namelist character eos       config_eos_type            'jm'
-
-namelist real      eos_linear config_eos_linear_alpha    2.55e-1
-namelist real      eos_linear config_eos_linear_beta     7.64e-1
-namelist real      eos_linear config_eos_linear_Tref     19.0
-namelist real      eos_linear config_eos_linear_Sref     35.0
-namelist real      eos_linear config_eos_linear_rhoref   1025.022
-
-namelist integer   split_explicit_ts config_n_ts_iter     2
-namelist integer   split_explicit_ts config_n_bcl_iter_beg   1
-namelist integer   split_explicit_ts config_n_bcl_iter_mid   2
-namelist integer   split_explicit_ts config_n_bcl_iter_end   2
-namelist integer   split_explicit_ts config_n_btr_subcycles  20
-namelist integer   split_explicit_ts config_n_btr_cor_iter  2
-namelist logical   split_explicit_ts config_u_correction .true.
-namelist integer   split_explicit_ts config_btr_subcycle_loop_factor  2
-namelist real      split_explicit_ts config_btr_gam1_uWt1    0.5
-namelist real      split_explicit_ts config_btr_gam2_SSHWt1  1.0
-namelist real      split_explicit_ts config_btr_gam3_uWt2    1.0
-namelist logical   split_explicit_ts config_btr_solve_SSH2   .false.
-
-namelist logical   debug config_check_zlevel_consistency .false.
-namelist logical   debug config_filter_btr_mode .false.
-namelist logical   debug config_prescribe_velocity  .false.
-namelist logical   debug config_prescribe_thickness .false.
-namelist logical   debug config_include_KE_vertex .false.
-namelist logical   debug config_check_tracer_monotonicity  .false.
-namelist logical   debug config_disable_h_all_tend .false.
-namelist logical   debug config_disable_h_hadv .false.
-namelist logical   debug config_disable_h_vadv .false.
-namelist logical   debug config_disable_u_all_tend .false.
-namelist logical   debug config_disable_u_coriolis .false.
-namelist logical   debug config_disable_u_pgrad .false.
-namelist logical   debug config_disable_u_hmix .false.
-namelist logical   debug config_disable_u_windstress .false.
-namelist logical   debug config_disable_u_vmix .false.
-namelist logical   debug config_disable_u_vadv .false.
-namelist logical   debug config_disable_tr_all_tend .false.
-namelist logical   debug config_disable_tr_adv .false.
-namelist logical   debug config_disable_tr_hmix .false.
-namelist logical   debug config_disable_tr_vmix .false.
-
-%
-% dim  type  name_in_file  name_in_code
-%
-dim nCells nCells
-dim nEdges nEdges
-dim maxEdges maxEdges
-dim maxEdges2 maxEdges2
-dim nAdvectionCells maxEdges2+0
-dim nVertices nVertices
-dim TWO 2
-dim R3 3
-dim FIFTEEN 15
-dim TWENTYONE 21
-dim vertexDegree vertexDegree
-dim nVertLevels nVertLevels
-dim nVertLevelsP1 nVertLevels+1
-dim nMonths nMonths
-
-%
-% var persistence type  name_in_file  ( dims )  time_levs iro-  name_in_code struct super-array array_class
-%
-var persistent text    xtime ( Time ) 2 ro xtime state - -
-
-var persistent real    latCell ( nCells ) 0 iro latCell mesh - -
-var persistent real    lonCell ( nCells ) 0 iro lonCell mesh - -
-var persistent real    xCell ( nCells ) 0 iro xCell mesh - -
-var persistent real    yCell ( nCells ) 0 iro yCell mesh - -
-var persistent real    zCell ( nCells ) 0 iro zCell mesh - -
-var persistent integer indexToCellID ( nCells ) 0 iro indexToCellID mesh - -
-
-var persistent real    latEdge ( nEdges ) 0 iro latEdge mesh - -
-var persistent real    lonEdge ( nEdges ) 0 iro lonEdge mesh - -
-var persistent real    xEdge ( nEdges ) 0 iro xEdge mesh - -
-var persistent real    yEdge ( nEdges ) 0 iro yEdge mesh - -
-var persistent real    zEdge ( nEdges ) 0 iro zEdge mesh - -
-var persistent integer indexToEdgeID ( nEdges ) 0 iro indexToEdgeID mesh - -
-
-var persistent real    latVertex ( nVertices ) 0 iro latVertex mesh - -
-var persistent real    lonVertex ( nVertices ) 0 iro lonVertex mesh - -
-var persistent real    xVertex ( nVertices ) 0 iro xVertex mesh - -
-var persistent real    yVertex ( nVertices ) 0 iro yVertex mesh - -
-var persistent real    zVertex ( nVertices ) 0 iro zVertex mesh - -
-var persistent integer indexToVertexID ( nVertices ) 0 iro indexToVertexID mesh - -
-
-var persistent real    meshDensity ( nCells ) 0 iro meshDensity mesh - -
-var persistent real    meshScalingDel2 ( nEdges ) 0 ro meshScalingDel2 mesh - -
-var persistent real    meshScalingDel4 ( nEdges ) 0 ro meshScalingDel4 mesh - -
-var persistent real    meshScaling ( nEdges ) 0 ro meshScaling mesh - -
-
-var persistent integer cellsOnEdge ( TWO nEdges ) 0 iro cellsOnEdge mesh - -
-var persistent integer nEdgesOnCell ( nCells ) 0 iro nEdgesOnCell mesh - -
-var persistent integer nEdgesOnEdge ( nEdges ) 0 iro nEdgesOnEdge mesh - -
-var persistent integer edgesOnCell ( maxEdges nCells ) 0 iro edgesOnCell mesh - -
-var persistent integer edgesOnEdge ( maxEdges2 nEdges ) 0 iro edgesOnEdge mesh - -
-
-var persistent real    weightsOnEdge ( maxEdges2 nEdges ) 0 iro weightsOnEdge mesh - -
-var persistent real    dvEdge ( nEdges ) 0 iro dvEdge mesh - -
-var persistent real    dcEdge ( nEdges ) 0 iro dcEdge mesh - -
-var persistent real    angleEdge ( nEdges ) 0 iro angleEdge mesh - -
-var persistent real    areaCell ( nCells ) 0 iro areaCell mesh - -
-var persistent real    areaTriangle ( nVertices ) 0 iro areaTriangle mesh - -
-
-var persistent real    edgeNormalVectors ( R3 nEdges ) 0 o edgeNormalVectors mesh - -
-var persistent real    localVerticalUnitVectors ( R3 nCells ) 0 o localVerticalUnitVectors mesh - -
-var persistent real    cellTangentPlane ( R3 TWO nCells ) 0 o cellTangentPlane mesh - -
-
-var persistent integer cellsOnCell ( maxEdges nCells ) 0 iro cellsOnCell mesh - -
-var persistent integer verticesOnCell ( maxEdges nCells ) 0 iro verticesOnCell mesh - -
-var persistent integer verticesOnEdge ( TWO nEdges ) 0 iro verticesOnEdge mesh - -
-var persistent integer edgesOnVertex ( vertexDegree nVertices ) 0 iro edgesOnVertex mesh - -
-var persistent integer cellsOnVertex ( vertexDegree nVertices ) 0 iro cellsOnVertex mesh - -
-var persistent real    kiteAreasOnVertex ( vertexDegree nVertices ) 0 iro kiteAreasOnVertex mesh - -
-var persistent real    fEdge ( nEdges ) 0 iro fEdge mesh - -
-var persistent real    fVertex ( nVertices ) 0 iro fVertex mesh - -
-var persistent real    bottomDepth ( nCells ) 0 iro bottomDepth mesh - -
-
-% Space needed for advection
-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
-var persistent real    defc_a ( maxEdges nCells ) 0 - defc_a mesh - -
-var persistent real    defc_b ( maxEdges nCells ) 0 - defc_b mesh - -
-var persistent real    kdiff ( nVertLevels nCells Time ) 0 - kdiff mesh - -
-
-% Arrays required for reconstruction of velocity field
-var persistent real    coeffs_reconstruct ( R3 maxEdges nCells ) 0 - coeffs_reconstruct mesh - -
-
-% Arrays for non-isopycnal version of mpas-ocean
-var persistent integer maxLevelCell ( nCells ) 0 iro maxLevelCell mesh - -
-var persistent integer maxLevelEdgeTop ( nEdges ) 0 - maxLevelEdgeTop mesh - -
-var persistent integer maxLevelEdgeBot ( nEdges ) 0 - maxLevelEdgeBot mesh - -
-var persistent integer maxLevelVertexTop ( nVertices ) 0 - maxLevelVertexTop mesh - -
-var persistent integer maxLevelVertexBot ( nVertices ) 0 - maxLevelVertexBot mesh - -
-var persistent real refBottomDepth ( nVertLevels ) 0 iro refBottomDepth mesh - -
-var persistent real refBottomDepthTopOfCell ( nVertLevelsP1 ) 0 - refBottomDepthTopOfCell mesh - -
-var persistent real hZLevel ( nVertLevels ) 0 iro hZLevel mesh - -
-var persistent real vertCoordMovementWeights ( nVertLevels ) 0 iro vertCoordMovementWeights mesh - -
-
-% Boundary conditions and masks
-var persistent integer boundaryEdge ( nVertLevels nEdges ) 0 - boundaryEdge mesh - -
-var persistent integer boundaryVertex ( nVertLevels nVertices ) 0 - boundaryVertex mesh - -
-var persistent integer boundaryCell ( nVertLevels nCells ) 0 - boundaryCell mesh - -
-var persistent integer edgeMask ( nVertLevels nEdges ) 0 o edgeMask mesh - -
-var persistent integer vertexMask ( nVertLevels nVertices ) 0 o vertexMask mesh - -
-var persistent integer cellMask ( nVertLevels nCells ) 0 o cellMask mesh - -
-
-% Forcing variables.  
-var persistent real    u_src ( nVertLevels nEdges ) 0 ir u_src mesh - -
-var persistent real    temperatureRestore ( nCells ) 0 ir temperatureRestore mesh - -
-var persistent real    salinityRestore ( nCells ) 0 ir salinityRestore mesh - -
-var persistent real    windStressMonthly ( nMonths nEdges ) 0 ir windStressMonthly mesh - -
-var persistent real    temperatureRestoreMonthly ( nMonths nCells ) 0 ir temperatureRestoreMonthly mesh - -
-var persistent real    salinityRestoreMonthly ( nMonths nCells ) 0 ir salinityRestoreMonthly mesh - -
-
-% Prognostic variables: read from input, saved in restart, and written to output
-var persistent real    u ( nVertLevels nEdges Time ) 2 ir u state - -
-var persistent real    h ( nVertLevels nCells Time ) 2 iro h state - -
-var persistent real    rho ( nVertLevels nCells Time ) 2 iro rho state - -
-var persistent real    temperature ( nVertLevels nCells Time ) 2 iro temperature state tracers dynamics
-var persistent real    salinity ( nVertLevels nCells Time ) 2 iro salinity state tracers dynamics
-var persistent real    tracer1 ( nVertLevels nCells Time ) 2 iro tracer1 state tracers testing
-
-% Tendency variables: neither read nor written to any files
-var persistent real    tend_u ( nVertLevels nEdges Time ) 1 - u tend - -
-var persistent real    tend_h ( nVertLevels nCells Time ) 1 - h tend - -
-var persistent real    tend_ssh ( nCells Time ) 1 - ssh tend - -
-var persistent real    tend_temperature ( nVertLevels nCells Time ) 1 - temperature tend tracers dynamics
-var persistent real    tend_salinity ( nVertLevels nCells Time ) 1 - salinity tend tracers dynamics
-var persistent real    tend_tracer1 ( nVertLevels nCells Time ) 1 - tracer1 tend tracers testing
-
-% state variables for Split Explicit timesplitting
-var persistent real   uBtr ( nEdges Time )         2 r  uBtr state - -
-var persistent real   ssh ( nCells Time )          2 o  ssh state - - 
-var persistent real   uBtrSubcycle ( nEdges Time ) 2 -  uBtrSubcycle state - -
-var persistent real   sshSubcycle ( nCells Time )  2 -  sshSubcycle state - - 
-var persistent real   FBtr ( nEdges Time )         2 -  FBtr state - - 
-var persistent real   GBtrForcing ( nEdges Time )  2 -  GBtrForcing state - -
-var persistent real   uBcl ( nVertLevels nEdges Time )  2 - uBcl state - - 
-
-% Diagnostic fields: only written to output
-var persistent real    zMid ( nVertLevels nCells Time ) 2 - zMid state - -
-var persistent real    v ( nVertLevels nEdges Time ) 2 - v state - -
-var persistent real    uTransport ( nVertLevels nEdges Time ) 2 - uTransport state - -
-var persistent real    uBolusGM ( nVertLevels nEdges Time ) 2 - uBolusGM state - -
-var persistent real    uBolusGMX ( nVertLevels nEdges Time ) 2 - uBolusGMX state - -
-var persistent real    uBolusGMY ( nVertLevels nEdges Time ) 2 - uBolusGMY state - -
-var persistent real    uBolusGMZ ( nVertLevels nEdges Time ) 2 - uBolusGMZ state - -
-var persistent real    uBolusGMZonal ( nVertLevels nEdges Time ) 2 o uBolusGMZonal state - -
-var persistent real    uBolusGMMeridional ( nVertLevels nEdges Time ) 2 o uBolusGMMeridional state - -
-var persistent real    hEddyFlux ( nVertLevels nEdges Time ) 2 - hEddyFlux state - -
-var persistent real    h_kappa ( nVertLevels nEdges Time ) 2 - h_kappa state - -
-var persistent real    h_kappa_q ( nVertLevels nEdges Time ) 2 - h_kappa_q state - -
-var persistent real    divergence ( nVertLevels nCells Time ) 2 o divergence state - -
-var persistent real    vorticity ( nVertLevels nVertices Time ) 2 o vorticity state - -
-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 - 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    Vor_vertex ( nVertLevels nVertices Time ) 2 - 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 - -
-var persistent real    uReconstructZonal ( nVertLevels nCells Time ) 2 o uReconstructZonal state - -
-var persistent real    uReconstructMeridional ( nVertLevels nCells Time ) 2 o uReconstructMeridional state - -
-var persistent real    uSrcReconstructX ( nVertLevels nCells Time ) 2 - uSrcReconstructX state - -
-var persistent real    uSrcReconstructY ( nVertLevels nCells Time ) 2 - uSrcReconstructY state - -
-var persistent real    uSrcReconstructZ ( nVertLevels nCells Time ) 2 - uSrcReconstructZ state - -
-var persistent real    uSrcReconstructZonal ( nVertLevels nCells Time ) 2 o uSrcReconstructZonal state - -
-var persistent real    uSrcReconstructMeridional ( nVertLevels nCells Time ) 2 o uSrcReconstructMeridional state - -
-var persistent real    MontPot ( nVertLevels nCells Time ) 2 - MontPot state - -
-var persistent real    pressure ( nVertLevels nCells Time ) 2 - pressure state - -
-var persistent real    wTop ( nVertLevelsP1 nCells Time ) 2 - wTop state - -
-var persistent real    vertVelocityTop ( nVertLevelsP1 nCells Time ) 2 - vertVelocityTop state - -
-var persistent real    rhoDisplaced ( nVertLevels nCells Time ) 2 - rhoDisplaced state - -
-var persistent real    BruntVaisalaFreqTop ( nVertLevels nCells Time ) 2 o BruntVaisalaFreqTop state - -
-var persistent real    viscosity ( nVertLevels nEdges Time ) 2 o viscosity state - -
-
-% 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    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 - -
-var persistent real    areaEdgeGlobal ( Time ) 2 o areaEdgeGlobal state - -
-var persistent real    areaTriangleGlobal ( Time ) 2 o areaTriangleGlobal state - -
-
-var persistent real    volumeCellGlobal ( Time ) 2 o volumeCellGlobal state - -
-var persistent real    volumeEdgeGlobal ( Time ) 2 o volumeEdgeGlobal state - -
-var persistent real    CFLNumberGlobal ( Time ) 2 o CFLNumberGlobal state - -
-
-% Diagnostics fields, only one time level required
-var persistent real    RiTopOfCell ( nVertLevelsP1 nCells Time ) 1 - RiTopOfCell diagnostics - -
-var persistent real    RiTopOfEdge ( nVertLevelsP1 nEdges Time ) 1 - RiTopOfEdge diagnostics - -
-var persistent real    vertViscTopOfEdge ( nVertLevelsP1 nEdges Time ) 1 - vertViscTopOfEdge diagnostics - -
-var persistent real    vertDiffTopOfCell ( nVertLevelsP1 nCells Time ) 1 - vertDiffTopOfCell diagnostics - -
-
-var persistent real    nAccumulate ( Time ) 2 o nAccumulate state - -
-var persistent real    acc_ssh ( nCells Time ) 2 o acc_ssh state - -
-var persistent real    acc_sshVar ( nCells Time ) 2 o acc_sshVar state - -
-var persistent real    acc_uReconstructZonal ( nVertLevels nCells Time ) 2 o acc_uReconstructZonal state - -
-var persistent real    acc_uReconstructMeridional ( nVertLevels nCells Time ) 2 o acc_uReconstructMeridional state - -
-var persistent real    acc_uReconstructZonalVar ( nVertLevels nCells Time ) 2 o acc_uReconstructZonalVar state - -
-var persistent real    acc_uReconstructMeridionalVar ( nVertLevels nCells Time ) 2 o acc_uReconstructMeridionalVar state - -
-var persistent real    acc_u ( nVertLevels nEdges Time ) 2 o acc_u state - -
-var persistent real    acc_uVar ( nVertLevels nEdges Time ) 2 o acc_uVar state - -
-var persistent real    acc_vertVelocityTop ( nVertLevelsP1 nCells Time ) 2 o acc_vertVelocityTop state - -
-
-% Sign fields, for openmp and bit reproducibility without branching statements.
-var persistent integer edgeSignOnCell ( maxEdges nCells ) 0 - edgeSignOnCell mesh - -
-var persistent integer edgeSignOnVertex ( maxEdges nVertices ) 0 - edgeSignOnVertex mesh - -
-var persistent integer kiteIndexOnCell ( maxEdges nCells ) 0 - kiteIndexOnCell mesh - -
-
-% Sea surface pressure, for coupling
-var persistent real    seaSurfacePressure ( nCells Time ) 0 ir seaSurfacePressure mesh - -

Modified: branches/ocean_projects/tensor_operations/src/core_ocean/Registry.xml
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_ocean/Registry.xml        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_ocean/Registry.xml        2013-04-18 15:33:42 UTC (rev 2767)
@@ -1,5 +1,5 @@
 &lt;?xml version=&quot;1.0&quot;?&gt;
-&lt;registry&gt;
+&lt;registry model=&quot;mpas&quot; core=&quot;ocean&quot; version=&quot;0.0.0&quot;&gt;
         &lt;dims&gt;
                 &lt;dim name=&quot;nCells&quot; units=&quot;unitless&quot;
                      description=&quot;The number of polygons in the primary grid.&quot;
@@ -25,6 +25,9 @@
                 &lt;dim name=&quot;R3&quot; definition=&quot;3&quot; units=&quot;unitless&quot;
                      description=&quot;The number three as a dimension.&quot;
                 /&gt;
+                &lt;dim name=&quot;SIX&quot; definition=&quot;6&quot; units=&quot;unitless&quot;
+                     description=&quot;The number six as a dimension.&quot;
+                /&gt;
                 &lt;dim name=&quot;FIFTEEN&quot; definition=&quot;15&quot; units=&quot;unitless&quot;
                      description=&quot;The number 15 as a dimension.&quot;
                 /&gt;
@@ -221,21 +224,21 @@
                 /&gt;
         &lt;/nml_record&gt;
         &lt;nml_record name=&quot;hmix_Leith&quot;&gt;
-                &lt;nml_option name=&quot;config_use_Leith_del2&quot; type=&quot;logical&quot; default_value=&quot;.false.&quot; units=&quot;&quot;
-                            description=&quot;&quot;
-                            possible_values=&quot;&quot;
+                &lt;nml_option name=&quot;config_use_Leith_del2&quot; type=&quot;logical&quot; default_value=&quot;.false.&quot; units=&quot;unitless&quot;
+                            description=&quot;If true, the Leith enstrophy-cascade closure is turned on&quot;
+                            possible_values=&quot;.true. or .false.&quot;
                 /&gt;
-                &lt;nml_option name=&quot;config_Leith_parameter&quot; type=&quot;real&quot; default_value=&quot;1.0&quot; units=&quot;&quot;
-                            description=&quot;&quot;
-                            possible_values=&quot;&quot;
+                &lt;nml_option name=&quot;config_Leith_parameter&quot; type=&quot;real&quot; default_value=&quot;1.0&quot; units=&quot;non-dimensional&quot;
+                            description=&quot;Non-dimensional Leith closure parameter&quot;
+                            possible_values=&quot;any positive real&quot;
                 /&gt;
-                &lt;nml_option name=&quot;config_Leith_dx&quot; type=&quot;real&quot; default_value=&quot;15000.0&quot; units=&quot;&quot;
-                            description=&quot;&quot;
-                            possible_values=&quot;&quot;
+                &lt;nml_option name=&quot;config_Leith_dx&quot; type=&quot;real&quot; default_value=&quot;15000.0&quot; units=&quot;m&quot;
+                            description=&quot;Characteristic length scale, usually the smallest dx in the mesh&quot;
+                            possible_values=&quot;any positive real&quot;
                 /&gt;
-                &lt;nml_option name=&quot;config_Leith_visc2_max&quot; type=&quot;real&quot; default_value=&quot;2.5e3&quot; units=&quot;&quot;
-                            description=&quot;&quot;
-                            possible_values=&quot;&quot;
+                &lt;nml_option name=&quot;config_Leith_visc2_max&quot; type=&quot;real&quot; default_value=&quot;2.5e3&quot; units=&quot;m^2 s^{-1}&quot;
+                            description=&quot;Upper bound on the allowable value of Leith-computed viscosity&quot;
+                            possible_values=&quot;any positive real&quot;
                 /&gt;
         &lt;/nml_record&gt;
         &lt;nml_record name=&quot;standard_GM&quot;&gt;
@@ -361,25 +364,25 @@
                 /&gt;
         &lt;/nml_record&gt;
         &lt;nml_record name=&quot;advection&quot;&gt;
-                &lt;nml_option name=&quot;config_vert_tracer_adv&quot; type=&quot;character&quot; default_value=&quot;'stencil'&quot; units=&quot;&quot;
-                            description=&quot;&quot;
-                            possible_values=&quot;&quot;
+                &lt;nml_option name=&quot;config_vert_tracer_adv&quot; type=&quot;character&quot; default_value=&quot;'stencil'&quot; units=&quot;unitless&quot;
+                            description=&quot;Method for interpolating tracer values from layer centers to layer edges&quot;
+                            possible_values=&quot;'spline' and 'stencil'&quot;
                 /&gt;
-                &lt;nml_option name=&quot;config_vert_tracer_adv_order&quot; type=&quot;integer&quot; default_value=&quot;3&quot; units=&quot;&quot;
-                            description=&quot;&quot;
-                            possible_values=&quot;&quot;
+                &lt;nml_option name=&quot;config_vert_tracer_adv_order&quot; type=&quot;integer&quot; default_value=&quot;3&quot; units=&quot;unitless&quot;
+                            description=&quot;Order of polynomial used for tracer reconstruction at layer edges&quot;
+                            possible_values=&quot;2, 3 and 4&quot;
                 /&gt;
-                &lt;nml_option name=&quot;config_horiz_tracer_adv_order&quot; type=&quot;integer&quot; default_value=&quot;3&quot; units=&quot;&quot;
-                            description=&quot;&quot;
-                            possible_values=&quot;&quot;
+                &lt;nml_option name=&quot;config_horiz_tracer_adv_order&quot; type=&quot;integer&quot; default_value=&quot;3&quot; units=&quot;unitless&quot;
+                            description=&quot;Order of polynomial used for tracer reconstruction at cell edges&quot;
+                            possible_values=&quot;2, 3 and 4&quot;
                 /&gt;
-                &lt;nml_option name=&quot;config_coef_3rd_order&quot; type=&quot;real&quot; default_value=&quot;0.25&quot; units=&quot;&quot;
-                            description=&quot;&quot;
-                            possible_values=&quot;&quot;
+                &lt;nml_option name=&quot;config_coef_3rd_order&quot; type=&quot;real&quot; default_value=&quot;0.25&quot; units=&quot;non-dimensional&quot;
+                            description=&quot;Reconstruction of 3rd-order reconstruction to blend with 4th-order reconstuction&quot;
+                            possible_values=&quot;any real between 0 and 1&quot;
                 /&gt;
-                &lt;nml_option name=&quot;config_monotonic&quot; type=&quot;logical&quot; default_value=&quot;.true.&quot; units=&quot;&quot;
-                            description=&quot;&quot;
-                            possible_values=&quot;&quot;
+                &lt;nml_option name=&quot;config_monotonic&quot; type=&quot;logical&quot; default_value=&quot;.true.&quot; units=&quot;unitless&quot;
+                            description=&quot;If .true. then fluxes are limited to produce a monotonic advection scheme&quot;
+                            possible_values=&quot;.true. and .false.&quot;
                 /&gt;
         &lt;/nml_record&gt;
         &lt;nml_record name=&quot;bottom_drag&quot;&gt;
@@ -399,31 +402,31 @@
                 /&gt;
         &lt;/nml_record&gt;
         &lt;nml_record name=&quot;eos&quot;&gt;
-                &lt;nml_option name=&quot;config_eos_type&quot; type=&quot;character&quot; default_value=&quot;'jm'&quot; units=&quot;&quot;
-                            description=&quot;&quot;
-                            possible_values=&quot;&quot;
+                &lt;nml_option name=&quot;config_eos_type&quot; type=&quot;character&quot; default_value=&quot;'jm'&quot; units=&quot;unitless&quot;
+                            description=&quot;Character string to choose EOS formulation&quot;
+                            possible_values=&quot;Jackett McDougall EOS = 'jm' and Linear EOS = 'linear'&quot;
                 /&gt;
         &lt;/nml_record&gt;
         &lt;nml_record name=&quot;eos_linear&quot;&gt;
-                &lt;nml_option name=&quot;config_eos_linear_alpha&quot; type=&quot;real&quot; default_value=&quot;2.55e-1&quot; units=&quot;&quot;
-                            description=&quot;&quot;
-                            possible_values=&quot;&quot;
+                &lt;nml_option name=&quot;config_eos_linear_alpha&quot; type=&quot;real&quot; default_value=&quot;2.55e-1&quot; units=&quot;kg m^{-3} C^{-1}&quot;
+                            description=&quot;Linear thermal expansion coefficient&quot;
+                            possible_values=&quot;any positive real&quot;
                 /&gt;
-                &lt;nml_option name=&quot;config_eos_linear_beta&quot; type=&quot;real&quot; default_value=&quot;7.64e-1&quot; units=&quot;&quot;
-                            description=&quot;&quot;
-                            possible_values=&quot;&quot;
+                &lt;nml_option name=&quot;config_eos_linear_beta&quot; type=&quot;real&quot; default_value=&quot;7.64e-1&quot; units=&quot;kg m^{-3} PSU^{-1}&quot;
+                            description=&quot;Linear haline contraction coefficient&quot;
+                            possible_values=&quot;any positive real&quot;
                 /&gt;
-                &lt;nml_option name=&quot;config_eos_linear_Tref&quot; type=&quot;real&quot; default_value=&quot;19.0&quot; units=&quot;&quot;
-                            description=&quot;&quot;
-                            possible_values=&quot;&quot;
+                &lt;nml_option name=&quot;config_eos_linear_Tref&quot; type=&quot;real&quot; default_value=&quot;19.0&quot; units=&quot;C&quot;
+                            description=&quot;Reference temperature&quot;
+                            possible_values=&quot;any real&quot;
                 /&gt;
-                &lt;nml_option name=&quot;config_eos_linear_Sref&quot; type=&quot;real&quot; default_value=&quot;35.0&quot; units=&quot;&quot;
-                            description=&quot;&quot;
-                            possible_values=&quot;&quot;
+                &lt;nml_option name=&quot;config_eos_linear_Sref&quot; type=&quot;real&quot; default_value=&quot;35.0&quot; units=&quot;PSU&quot;
+                            description=&quot;Reference salinity&quot;
+                            possible_values=&quot;any real&quot;
                 /&gt;
-                &lt;nml_option name=&quot;config_eos_linear_densityref&quot; type=&quot;real&quot; default_value=&quot;1025.022&quot; units=&quot;&quot;
-                            description=&quot;&quot;
-                            possible_values=&quot;&quot;
+                &lt;nml_option name=&quot;config_eos_linear_densityref&quot; type=&quot;real&quot; default_value=&quot;1025.022&quot; units=&quot;kg m^{-3}&quot;
+                            description=&quot;Reference density, i.e. density when T=Tref and S=Sref&quot;
+                            possible_values=&quot;any positive real&quot;
                 /&gt;
         &lt;/nml_record&gt;
         &lt;nml_record name=&quot;split_explicit_ts&quot;&gt;
@@ -594,10 +597,10 @@
                 &lt;var name=&quot;sshSubcycle&quot; type=&quot;real&quot; dimensions=&quot;nCells Time&quot; units=&quot;m&quot;
                      description=&quot;sea surface height, used in subcycling in stage 2 of split-explicit time-stepping&quot;
                 /&gt;
-                &lt;var name=&quot;FBtr&quot; type=&quot;real&quot; dimensions=&quot;nEdges Time&quot; units=&quot;m^2 s^{-1}&quot;
+                &lt;var name=&quot;barotropicThicknessFlux&quot; type=&quot;real&quot; dimensions=&quot;nEdges Time&quot; units=&quot;m^2 s^{-1}&quot;
                      description=&quot;Barotropic thickness flux at each edge, used to advance sea surface height in each subcycle of stage 2 of the split-explicit algorithm.&quot;
                 /&gt;
-                &lt;var name=&quot;GBtrForcing&quot; type=&quot;real&quot; dimensions=&quot;nEdges Time&quot; units=&quot;m s^{-2}&quot;
+                &lt;var name=&quot;barotropicForcing&quot; type=&quot;real&quot; dimensions=&quot;nEdges Time&quot; units=&quot;m s^{-2}&quot;
                      description=&quot;Barotropic tendency computed from the baroclinic equations in stage 1 of the split-explicit algorithm.&quot;
                 /&gt;
                 &lt;var name=&quot;normalBaroclinicVelocity&quot; type=&quot;real&quot; dimensions=&quot;nVertLevels nEdges Time&quot; units=&quot;m s^{-1}&quot;
@@ -672,19 +675,19 @@
                 &lt;var name=&quot;kineticEnergyEdge&quot; type=&quot;real&quot; dimensions=&quot;nVertLevels nEdges Time&quot; units=&quot;m^2 s^{-2}&quot;
                      description=&quot;kinetic energy of horizonal velocity defined at edges&quot;
                 /&gt;
-                &lt;var name=&quot;normalVelocityReconstructX&quot; type=&quot;real&quot; dimensions=&quot;nVertLevels nCells Time&quot; units=&quot;m s^{-1}&quot;
+                &lt;var name=&quot;normalVelocityX&quot; type=&quot;real&quot; dimensions=&quot;nVertLevels nCells Time&quot; units=&quot;m s^{-1}&quot;
                      description=&quot;component of horizontal velocity in the x-direction (cartesian)&quot;
                 /&gt;
-                &lt;var name=&quot;normalVelocityReconstructY&quot; type=&quot;real&quot; dimensions=&quot;nVertLevels nCells Time&quot; units=&quot;m s^{-1}&quot;
+                &lt;var name=&quot;normalVelocityY&quot; type=&quot;real&quot; dimensions=&quot;nVertLevels nCells Time&quot; units=&quot;m s^{-1}&quot;
                      description=&quot;component of horizontal velocity in the y-direction (cartesian)&quot;
                 /&gt;
-                &lt;var name=&quot;normalVelocityReconstructZ&quot; type=&quot;real&quot; dimensions=&quot;nVertLevels nCells Time&quot; units=&quot;m s^{-1}&quot;
+                &lt;var name=&quot;normalVelocityZ&quot; type=&quot;real&quot; dimensions=&quot;nVertLevels nCells Time&quot; units=&quot;m s^{-1}&quot;
                      description=&quot;component of horizontal velocity in the z-direction (cartesian)&quot;
                 /&gt;
-                &lt;var name=&quot;normalVelocityReconstructZonal&quot; type=&quot;real&quot; dimensions=&quot;nVertLevels nCells Time&quot; streams=&quot;o&quot; units=&quot;m s^{-1}&quot;
+                &lt;var name=&quot;normalVelocityZonal&quot; type=&quot;real&quot; dimensions=&quot;nVertLevels nCells Time&quot; streams=&quot;o&quot; units=&quot;m s^{-1}&quot;
                      description=&quot;component of horizontal velocity in the eastward direction&quot;
                 /&gt;
-                &lt;var name=&quot;normalVelocityReconstructMeridional&quot; type=&quot;real&quot; dimensions=&quot;nVertLevels nCells Time&quot; streams=&quot;o&quot; units=&quot;m s^{-1}&quot;
+                &lt;var name=&quot;normalVelocityMeridional&quot; type=&quot;real&quot; dimensions=&quot;nVertLevels nCells Time&quot; streams=&quot;o&quot; units=&quot;m s^{-1}&quot;
                      description=&quot;component of horizontal velocity in the northward&quot;
                 /&gt;
                 &lt;var name=&quot;normalVelocityForcingReconstructX&quot; type=&quot;real&quot; dimensions=&quot;nVertLevels nCells Time&quot; units=&quot;N m^{-2}&quot;
@@ -702,13 +705,13 @@
                 &lt;var name=&quot;normalVelocityForcingReconstructMeridional&quot; type=&quot;real&quot; dimensions=&quot;nVertLevels nCells Time&quot; streams=&quot;o&quot; units=&quot;N m^{-2}&quot;
                      description=&quot;wind stress in the northward direction&quot;
                 /&gt;
-                &lt;var name=&quot;MontPot&quot; type=&quot;real&quot; dimensions=&quot;nVertLevels nCells Time&quot; units=&quot;m^2 s^{-2}&quot;
+                &lt;var name=&quot;montgomeryPotential&quot; type=&quot;real&quot; dimensions=&quot;nVertLevels nCells Time&quot; units=&quot;m^2 s^{-2}&quot;
                      description=&quot;Montgomery potential, may be used as the pressure for isopycnal coordinates.&quot;
                 /&gt;
                 &lt;var name=&quot;pressure&quot; type=&quot;real&quot; dimensions=&quot;nVertLevels nCells Time&quot; units=&quot;N m^{-2}&quot;
                      description=&quot;pressure used in the momentum equation&quot;
                 /&gt;
-                &lt;var name=&quot;wTop&quot; type=&quot;real&quot; dimensions=&quot;nVertLevelsP1 nCells Time&quot; units=&quot;m s^{-1}&quot;
+                &lt;var name=&quot;vertTransportVelocityTop&quot; type=&quot;real&quot; dimensions=&quot;nVertLevelsP1 nCells Time&quot; units=&quot;m s^{-1}&quot;
                      description=&quot;vertical transport through the layer interface at the top of the cell&quot;
                 /&gt;
                 &lt;var name=&quot;vertVelocityTop&quot; type=&quot;real&quot; dimensions=&quot;nVertLevelsP1 nCells Time&quot; units=&quot;m s^{-1}&quot;
@@ -762,16 +765,16 @@
                 &lt;var name=&quot;varSsh&quot; type=&quot;real&quot; dimensions=&quot;nCells Time&quot; streams=&quot;o&quot; units=&quot;m&quot;
                      description=&quot;variance of sea surface height&quot;
                 /&gt;
-                &lt;var name=&quot;avgNormalVelocityReconstructZonal&quot; type=&quot;real&quot; dimensions=&quot;nVertLevels nCells Time&quot; streams=&quot;o&quot; units=&quot;m s^{-1}&quot;
+                &lt;var name=&quot;avgNormalVelocityZonal&quot; type=&quot;real&quot; dimensions=&quot;nVertLevels nCells Time&quot; streams=&quot;o&quot; units=&quot;m s^{-1}&quot;
                      description=&quot;time-averaged velocity in the eastward direction&quot;
                 /&gt;
-                &lt;var name=&quot;avgNormalVelocityReconstructMeridional&quot; type=&quot;real&quot; dimensions=&quot;nVertLevels nCells Time&quot; streams=&quot;o&quot; units=&quot;m s^{-1}&quot;
+                &lt;var name=&quot;avgNormalVelocityMeridional&quot; type=&quot;real&quot; dimensions=&quot;nVertLevels nCells Time&quot; streams=&quot;o&quot; units=&quot;m s^{-1}&quot;
                      description=&quot;time-averaged velocity in the northward direction&quot;
                 /&gt;
-                &lt;var name=&quot;varNormalVelocityReconstructZonal&quot; type=&quot;real&quot; dimensions=&quot;nVertLevels nCells Time&quot; streams=&quot;o&quot; units=&quot;m s^{-1}&quot;
+                &lt;var name=&quot;varNormalVelocityZonal&quot; type=&quot;real&quot; dimensions=&quot;nVertLevels nCells Time&quot; streams=&quot;o&quot; units=&quot;m s^{-1}&quot;
                      description=&quot;variance of velocity in the eastward direction&quot;
                 /&gt;
-                &lt;var name=&quot;varNormalVelocityReconstructMeridional&quot; type=&quot;real&quot; dimensions=&quot;nVertLevels nCells Time&quot; streams=&quot;o&quot; units=&quot;m s^{-1}&quot;
+                &lt;var name=&quot;varNormalVelocityMeridional&quot; type=&quot;real&quot; dimensions=&quot;nVertLevels nCells Time&quot; streams=&quot;o&quot; units=&quot;m s^{-1}&quot;
                      description=&quot;variance of velocity in the northward direction&quot;
                 /&gt;
                 &lt;var name=&quot;avgNormalVelocity&quot; type=&quot;real&quot; dimensions=&quot;nVertLevels nEdges Time&quot; streams=&quot;o&quot; units=&quot;m s^{-1}&quot;
@@ -783,6 +786,15 @@
                 &lt;var name=&quot;avgVertVelocityTop&quot; type=&quot;real&quot; dimensions=&quot;nVertLevelsP1 nCells Time&quot; streams=&quot;o&quot; units=&quot;m s^{-1}&quot;
                      description=&quot;time-averaged vertical velocity at top of cell&quot;
                 /&gt;
+                &lt;var name=&quot;strainRate3DCell&quot; type=&quot;real&quot; dimensions=&quot;SIX nVertLevels nCells Time&quot; streams=&quot;o&quot; units=&quot;s^{-1}&quot;
+                     description=&quot;strain rate tensor at cell center, 3D, in symmetric 6-index form&quot;
+                /&gt;
+                &lt;var name=&quot;strainRate3DEdge&quot; type=&quot;real&quot; dimensions=&quot;SIX nVertLevels nEdges Time&quot; streams=&quot;o&quot; units=&quot;s^{-1}&quot;
+                     description=&quot;strain rate tensor at edge, 3D, in symmetric 6-index form&quot;
+                /&gt;
+                &lt;var name=&quot;divTensor3DCell&quot; type=&quot;real&quot; dimensions=&quot;R3 nVertLevels nEdges Time&quot; streams=&quot;o&quot; units=&quot;s^{-2}&quot;
+                     description=&quot;divergence of the tensor at cell center, as a 3-vector in x,y,z space&quot;
+                /&gt;
         &lt;/var_struct&gt;
         &lt;var_struct name=&quot;mesh&quot; time_levs=&quot;0&quot;&gt;
                 &lt;var name=&quot;latCell&quot; type=&quot;real&quot; dimensions=&quot;nCells&quot; streams=&quot;iro&quot; units=&quot;radians&quot;
@@ -887,12 +899,18 @@
                 &lt;var name=&quot;edgeNormalVectors&quot; type=&quot;real&quot; dimensions=&quot;R3 nEdges&quot; streams=&quot;o&quot; units=&quot;unitless&quot;
                      description=&quot;Normal vector defined at an edge.&quot;
                 /&gt;
+                &lt;var name=&quot;edgeTangentVectors&quot; type=&quot;real&quot; dimensions=&quot;R3 nEdges&quot; streams=&quot;o&quot; units=&quot;unitless&quot;
+                     description=&quot;Tangent vector defined at an edge.&quot;
+                /&gt;
                 &lt;var name=&quot;localVerticalUnitVectors&quot; type=&quot;real&quot; dimensions=&quot;R3 nCells&quot; streams=&quot;o&quot; units=&quot;unitless&quot;
                      description=&quot;Unit surface normal vectors defined at cell centers.&quot;
                 /&gt;
                 &lt;var name=&quot;cellTangentPlane&quot; type=&quot;real&quot; dimensions=&quot;R3 TWO nCells&quot; streams=&quot;o&quot; units=&quot;unitless&quot;
                      description=&quot;The two vectors that define a tangent plane at a cell center.&quot;
                 /&gt;
+                &lt;var name=&quot;outerProductEdgeSym6&quot; type=&quot;real&quot; dimensions=&quot;SIX nVertLevels nEdges&quot; streams=&quot;o&quot; units=&quot;m^2 s^{-1}&quot;
+                     description=&quot;Outer produce, u_e \cross n_e, at each edge. {\color{red} change to scratch}&quot;
+                /&gt;
                 &lt;var name=&quot;cellsOnCell&quot; type=&quot;integer&quot; dimensions=&quot;maxEdges nCells&quot; streams=&quot;iro&quot; units=&quot;unitless&quot;
                      description=&quot;List of cells that neighbor each cell.&quot;
                 /&gt;

Modified: branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_diagnostics.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_diagnostics.F        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_diagnostics.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -8,7 +8,7 @@
 !&gt; \version SVN:$Id:$
 !&gt; \details
 !&gt;  This module contains the routines for computing
-!&gt;  diagnostic variables, and other quantities such as wTop.
+!&gt;  diagnostic variables, and other quantities such as vertTransportVelocityTop.
 !
 !-----------------------------------------------------------------------
 
@@ -41,7 +41,7 @@
    !--------------------------------------------------------------------
 
    public :: ocn_diagnostic_solve, &amp;
-             ocn_wtop, &amp;
+             ocn_vert_transport_velocity_top, &amp;
              ocn_fuperp, &amp;
              ocn_filter_btr_mode_vel, &amp;
              ocn_filter_btr_mode_tend_vel, &amp;
@@ -100,7 +100,7 @@
         bottomDepth, fVertex, dvEdge, dcEdge, areaCell, areaTriangle, ssh, seaSurfacePressure
       real (kind=RKIND), dimension(:,:), pointer :: &amp;
         weightsOnEdge, kiteAreasOnVertex, layerThicknessEdge, layerThickness, normalVelocity, tangentialVelocity, pressure,&amp;
-        circulation, relativeVorticity, kineticEnergy, kineticEnergyEdge, MontPot, wTop, zMid, &amp;
+        circulation, relativeVorticity, kineticEnergy, kineticEnergyEdge, montgomeryPotential, vertTransportVelocityTop, zMid, &amp;
         potentialVorticityEdge, potentialVorticityVertex, potentialVorticityCell, gradVor_n, gradVor_t, divergence, &amp;
         density, displacedDensity, temperature, salinity, kineticEnergyVertex, kineticEnergyVertexOnCells, uBolusGM, uTransport, &amp;
         vertVelocityTop, BruntVaisalaFreqTop
@@ -127,7 +127,7 @@
       gradVor_t   =&gt; s % gradVor_t % array
       density         =&gt; s % density % array
       displacedDensity=&gt; s % displacedDensity % array
-      MontPot     =&gt; s % MontPot % array
+      montgomeryPotential     =&gt; s % montgomeryPotential % array
       pressure    =&gt; s % pressure % array
       zMid        =&gt; s % zMid % array
       ssh         =&gt; s % ssh % array
@@ -399,14 +399,14 @@
            ! For isopycnal mode, p is the Montgomery Potential.
            ! At top layer it is g*SSH, where SSH may be off by a 
            ! constant (ie, bottomDepth can be relative to top or bottom)
-           MontPot(1,iCell) = gravity &amp;
+           montgomeryPotential(1,iCell) = gravity &amp;
               * (bottomDepth(iCell) + sum(layerThickness(1:nVertLevels,iCell)))
 
            do k=2,nVertLevels
               pTop(k) = pTop(k-1) + density(k-1,iCell)*gravity* layerThickness(k-1,iCell)
 
               ! from delta M = p delta / density
-              MontPot(k,iCell) = MontPot(k-1,iCell) &amp;
+              montgomeryPotential(k,iCell) = montgomeryPotential(k-1,iCell) &amp;
                  + pTop(k)*(1.0/density(k,iCell) - 1.0/density(k-1,iCell)) 
            end do
 
@@ -483,7 +483,7 @@
 
 !***********************************************************************
 !
-!  routine ocn_wtop
+!  routine ocn_vert_transport_velocity_top
 !
 !&gt; \brief   Computes vertical transport
 !&gt; \author  Mark Petersen
@@ -494,7 +494,7 @@
 !&gt;  cell.
 !
 !-----------------------------------------------------------------------
-   subroutine ocn_wtop(grid,layerThickness,layerThicknessEdge,normalVelocity,wTop, err)!{{{
+   subroutine ocn_vert_transport_velocity_top(grid,layerThickness,layerThicknessEdge,normalVelocity,vertTransportVelocityTop, err)!{{{
 
       !-----------------------------------------------------------------
       !
@@ -521,7 +521,7 @@
       !-----------------------------------------------------------------
 
       real (kind=RKIND), dimension(:,:), intent(out) :: &amp;
-         wTop     !&lt; Output: vertical transport at top of cell
+         vertTransportVelocityTop     !&lt; Output: vertical transport at top of cell
 
       integer, intent(out) :: err !&lt; Output: error flag
 
@@ -568,7 +568,7 @@
 
       if (config_vert_coord_movement.eq.'isopycnal') then
         ! set vertical transport to zero in isopycnal case
-        wTop=0.0
+        vertTransportVelocityTop=0.0
         return
       end if
 
@@ -605,16 +605,16 @@
         end if
 
         ! Vertical transport through layer interface at top and bottom is zero.
-        wTop(1,iCell) = 0.0
-        wTop(maxLevelCell(iCell)+1,iCell) = 0.0
+        vertTransportVelocityTop(1,iCell) = 0.0
+        vertTransportVelocityTop(maxLevelCell(iCell)+1,iCell) = 0.0
         do k=maxLevelCell(iCell),2,-1
-           wTop(k,iCell) = wTop(k+1,iCell) - div_hu(k) - h_tend_col(k)
+           vertTransportVelocityTop(k,iCell) = vertTransportVelocityTop(k+1,iCell) - div_hu(k) - h_tend_col(k)
         end do
       end do
 
       deallocate(div_hu, h_tend_col)
 
-   end subroutine ocn_wtop!}}}
+   end subroutine ocn_vert_transport_velocity_top!}}}
 
 !***********************************************************************
 !

Modified: branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_global_diagnostics.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_global_diagnostics.F        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_global_diagnostics.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -47,7 +47,7 @@
       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 :: layerThickness, normalVelocity, tangentialVelocity, layerThicknessEdge, relativeVorticity, kineticEnergy, potentialVorticityEdge, potentialVorticityVertex, &amp;
-         potentialVorticityCell, gradVor_n, gradVor_t, pressure, MontPot, wTop, density, tracerTemp
+         potentialVorticityCell, gradVor_n, gradVor_t, pressure, montgomeryPotential, vertTransportVelocityTop, density, tracerTemp
       real (kind=RKIND), dimension(:,:,:), pointer :: tracers
       
       real (kind=RKIND), dimension(kMaxVariables) :: sums, mins, maxes, averages, verticalSumMins, verticalSumMaxes, reductions
@@ -90,7 +90,7 @@
          density =&gt; state % density % array
          tracers =&gt; state % tracers % array
          tangentialVelocity =&gt; state % tangentialVelocity % array
-         wTop =&gt; state % wTop % array
+         vertTransportVelocityTop =&gt; state % vertTransportVelocityTop % array
          layerThicknessEdge =&gt; state % layerThicknessEdge % array
          relativeVorticity =&gt; state % relativeVorticity % array
          kineticEnergy =&gt; state % kineticEnergy % array
@@ -99,7 +99,7 @@
          potentialVorticityCell =&gt; state % potentialVorticityCell % array
          gradVor_n =&gt; state % gradVor_n % array
          gradVor_t =&gt; state % gradVor_t % array
-         MontPot =&gt; state % MontPot % array
+         montgomeryPotential =&gt; state % montgomeryPotential % array
          pressure =&gt; state % pressure % array
 
          variableIndex = 0
@@ -246,10 +246,10 @@
          verticalSumMins(variableIndex) = min(verticalSumMins(variableIndex), verticalSumMins_tmp(variableIndex))
          verticalSumMaxes(variableIndex) = max(verticalSumMaxes(variableIndex), verticalSumMaxes_tmp(variableIndex))
 
-         ! MontPot
+         ! montgomeryPotential
          variableIndex = variableIndex + 1
          call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels, nCellsSolve, areaCell(1:nCellsSolve), layerThickness(:,1:nCellsSolve), &amp;
-            MontPot(:,1:nCellsSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &amp;
+            montgomeryPotential(:,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))
@@ -257,10 +257,10 @@
          verticalSumMins(variableIndex) = min(verticalSumMins(variableIndex), verticalSumMins_tmp(variableIndex))
          verticalSumMaxes(variableIndex) = max(verticalSumMaxes(variableIndex), verticalSumMaxes_tmp(variableIndex))
 
-         ! wTop vertical velocity
+         ! vertTransportVelocityTop vertical velocity
          variableIndex = variableIndex + 1
          call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels+1, nCellsSolve, areaCell(1:nCellsSolve), layerThickness(:,1:nCellsSolve), &amp;
-            wTop(:,1:nCellsSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &amp;
+            vertTransportVelocityTop(:,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))
@@ -402,11 +402,11 @@
       variableIndex = variableIndex + 1
       averages(variableIndex) = sums(variableIndex)/volumeCellGlobal
 
-      ! MontPot
+      ! montgomeryPotential
       variableIndex = variableIndex + 1
       averages(variableIndex) = sums(variableIndex)/volumeCellGlobal
 
-      ! wTop vertical velocity
+      ! vertTransportVelocityTop vertical velocity
       variableIndex = variableIndex + 1
       averages(variableIndex) = sums(variableIndex)/volumeCellGlobal
 

Modified: branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_mpas_core.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_mpas_core.F        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_mpas_core.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -22,8 +22,6 @@
    use ocn_vel_forcing
    use ocn_vel_coriolis
 
-   use ocn_tracer_hadv
-   use ocn_tracer_vadv
    use ocn_tracer_hmix
    use ocn_gm
    use ocn_restoring
@@ -85,10 +83,6 @@
       call ocn_vel_forcing_init(err_tmp)
       err = ior(err, err_tmp)
 
-      call ocn_tracer_hadv_init(err_tmp)
-      err = ior(err, err_tmp)
-      call ocn_tracer_vadv_init(err_tmp)
-      err = ior(err, err_tmp)
       call ocn_tracer_hmix_init(err_tmp)
       err = ior(err, err_tmp)
       call ocn_restoring_init(err_tmp)
@@ -283,11 +277,11 @@
       call mpas_rbf_interp_initialize(mesh)
       call mpas_init_reconstruct(mesh)
       call mpas_reconstruct(mesh, block % state % time_levs(1) % state % normalVelocity % array,                  &amp;
-                       block % state % time_levs(1) % state % normalVelocityReconstructX % array,            &amp;
-                       block % state % time_levs(1) % state % normalVelocityReconstructY % array,            &amp;
-                       block % state % time_levs(1) % state % normalVelocityReconstructZ % array,            &amp;
-                       block % state % time_levs(1) % state % normalVelocityReconstructZonal % array,        &amp;
-                       block % state % time_levs(1) % state % normalVelocityReconstructMeridional % array    &amp;
+                       block % state % time_levs(1) % state % normalVelocityX % array,            &amp;
+                       block % state % time_levs(1) % state % normalVelocityY % array,            &amp;
+                       block % state % time_levs(1) % state % normalVelocityZ % array,            &amp;
+                       block % state % time_levs(1) % state % normalVelocityZonal % array,        &amp;
+                       block % state % time_levs(1) % state % normalVelocityMeridional % array    &amp;
                       )
 
       call mpas_reconstruct(mesh, mesh % normalVelocityForcing % array,                  &amp;

Modified: branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tendency.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tendency.F        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tendency.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -31,8 +31,6 @@
    use ocn_vel_forcing
    use ocn_vmix
 
-   use ocn_tracer_hadv
-   use ocn_tracer_vadv
    use ocn_tracer_hmix
    use ocn_restoring
 
@@ -56,7 +54,7 @@
    !
    !--------------------------------------------------------------------
 
-   public :: ocn_tend_h, &amp;
+   public :: ocn_tend_thick, &amp;
              ocn_tend_vel, &amp;
              ocn_tend_tracer, &amp;
              ocn_tendency_init
@@ -73,7 +71,7 @@
 
 !***********************************************************************
 !
-!  routine ocn_tend_h
+!  routine ocn_tend_thick
 !
 !&gt; \brief   Computes thickness tendency
 !&gt; \author  Doug Jacobsen
@@ -84,21 +82,21 @@
 !
 !-----------------------------------------------------------------------
 
-   subroutine ocn_tend_h(tend, s, grid)!{{{
+   subroutine ocn_tend_thick(tend, s, grid)!{{{
       implicit none
 
       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 :: layerThicknessEdge, wTop, tend_layerThickness, uTransport
+      real (kind=RKIND), dimension(:,:), pointer :: layerThicknessEdge, vertTransportVelocityTop, tend_layerThickness, uTransport
 
       integer :: err
 
-      call mpas_timer_start(&quot;ocn_tend_h&quot;)
+      call mpas_timer_start(&quot;ocn_tend_thick&quot;)
 
       uTransport  =&gt; s % uTransport % array
-      wTop        =&gt; s % wTop % array
+      vertTransportVelocityTop        =&gt; s % vertTransportVelocityTop % array
       layerThicknessEdge      =&gt; s % layerThicknessEdge % array
 
       tend_layerThickness      =&gt; tend % layerThickness % array
@@ -126,12 +124,12 @@
       ! height tendency: vertical advection term -d/dz(hw)
       !
       call mpas_timer_start(&quot;vadv&quot;, .false., thickVadvTimer)
-      call ocn_thick_vadv_tend(grid, wtop, tend_layerThickness, err)
+      call ocn_thick_vadv_tend(grid, vertTransportVelocityTop, tend_layerThickness, err)
       call mpas_timer_stop(&quot;vadv&quot;, thickVadvTimer)
 
-      call mpas_timer_stop(&quot;ocn_tend_h&quot;)
+      call mpas_timer_stop(&quot;ocn_tend_thick&quot;)
    
-   end subroutine ocn_tend_h!}}}
+   end subroutine ocn_tend_thick!}}}
 
 !***********************************************************************
 !
@@ -157,7 +155,7 @@
       real (kind=RKIND), dimension(:,:), pointer :: &amp;
         layerThicknessEdge, h, normalVelocity, density, zMid, pressure, &amp;
         tend_normalVelocity, circulation, relativeVorticity, viscosity, kineticEnergy, kineticEnergyEdge, potentialVorticityEdge, &amp;
-        MontPot, wTop, divergence, vertViscTopOfEdge
+        montgomeryPotential, vertTransportVelocityTop, divergence, vertViscTopOfEdge
 
       real (kind=RKIND), dimension(:,:), pointer :: normalVelocityForcing
 
@@ -167,7 +165,7 @@
 
       normalVelocity =&gt; s % normalVelocity % array
       density         =&gt; s % density % array
-      wTop        =&gt; s % wTop % array
+      vertTransportVelocityTop        =&gt; s % vertTransportVelocityTop % array
       zMid        =&gt; s % zMid % array
       layerThicknessEdge      =&gt; s % layerThicknessEdge % array
       viscosity   =&gt; s % viscosity % array
@@ -176,7 +174,7 @@
       kineticEnergy          =&gt; s % kineticEnergy % array
       kineticEnergyEdge     =&gt; s % kineticEnergyEdge % array
       potentialVorticityEdge     =&gt; s % potentialVorticityEdge % array
-      MontPot     =&gt; s % MontPot % array
+      montgomeryPotential     =&gt; s % montgomeryPotential % array
       pressure    =&gt; s % pressure % array
       vertViscTopOfEdge =&gt; d % vertViscTopOfEdge % array
 
@@ -203,7 +201,7 @@
       ! velocity tendency: vertical advection term -w du/dz
       !
       call mpas_timer_start(&quot;vadv&quot;, .false., velVadvTimer)
-      call ocn_vel_vadv_tend(grid, normalVelocity, layerThicknessEdge, wtop, tend_normalVelocity, err)
+      call ocn_vel_vadv_tend(grid, normalVelocity, layerThicknessEdge, vertTransportVelocityTop, tend_normalVelocity, err)
       call mpas_timer_stop(&quot;vadv&quot;, velVadvTimer)
 
       !
@@ -211,7 +209,7 @@
       !
       call mpas_timer_start(&quot;pressure grad&quot;, .false., velPgradTimer)
       if (config_pressure_gradient_type.eq.'MontgomeryPotential') then
-          call ocn_vel_pressure_grad_tend(grid, MontPot,  zMid, density, tend_normalVelocity, err)
+          call ocn_vel_pressure_grad_tend(grid, montgomeryPotential,  zMid, density, tend_normalVelocity, err)
       else
           call ocn_vel_pressure_grad_tend(grid, pressure, zMid, density, tend_normalVelocity, err)
       end if
@@ -263,7 +261,7 @@
       real (kind=RKIND), intent(in) :: dt !&lt; Input: Time step
 
       real (kind=RKIND), dimension(:,:), pointer :: &amp;
-        uTransport, layerThickness,wTop, layerThicknessEdge, vertDiffTopOfCell, tend_layerThickness, normalThicknessFlux
+        uTransport, layerThickness,vertTransportVelocityTop, layerThicknessEdge, vertDiffTopOfCell, tend_layerThickness, normalThicknessFlux
       real (kind=RKIND), dimension(:,:,:), pointer :: &amp;
         tracers, tend_tr
 
@@ -273,7 +271,7 @@
 
       uTransport  =&gt; s % uTransport % array
       layerThickness           =&gt; s % layerThickness % array
-      wTop        =&gt; s % wTop % array
+      vertTransportVelocityTop        =&gt; s % vertTransportVelocityTop % array
       tracers     =&gt; s % tracers % array
       layerThicknessEdge      =&gt; s % layerThicknessEdge % array
       vertDiffTopOfCell =&gt; d % vertDiffTopOfCell % array
@@ -304,7 +302,7 @@
 
       ! Monotonoic Advection, or standard advection
       call mpas_timer_start(&quot;adv&quot;, .false., tracerHadvTimer)
-      call mpas_ocn_tracer_advection_tend(tracers, normalThicknessFlux, wTop, layerThickness, layerThickness, dt, grid, tend_layerThickness, tend_tr)
+      call mpas_ocn_tracer_advection_tend(tracers, normalThicknessFlux, vertTransportVelocityTop, layerThickness, layerThickness, dt, grid, tend_layerThickness, tend_tr)
       call mpas_timer_stop(&quot;adv&quot;, tracerHadvTimer)
 
       !

Modified: branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_thick_vadv.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_thick_vadv.F        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_thick_vadv.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -62,7 +62,7 @@
 !
 !-----------------------------------------------------------------------
 
-   subroutine ocn_thick_vadv_tend(grid, wTop, tend, err)!{{{
+   subroutine ocn_thick_vadv_tend(grid, vertTransportVelocityTop, tend, err)!{{{
 
       !-----------------------------------------------------------------
       !
@@ -71,7 +71,7 @@
       !-----------------------------------------------------------------
 
       real (kind=RKIND), dimension(:,:), intent(in) :: &amp;
-         wTop     !&lt; Input: vertical velocity on top layer
+         vertTransportVelocityTop     !&lt; Input: vertical velocity on top layer
 
       type (mesh_type), intent(in) :: &amp;
          grid          !&lt; Input: grid information
@@ -121,7 +121,7 @@
 
       do iCell=1,nCells
          do k=1,maxLevelCell(iCell)
-            tend(k,iCell) = tend(k,iCell) + wTop(k+1,iCell) - wTop(k,iCell)
+            tend(k,iCell) = tend(k,iCell) + vertTransportVelocityTop(k+1,iCell) - vertTransportVelocityTop(k,iCell)
          end do
       end do
 

Modified: branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_time_average.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_time_average.F        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_time_average.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -14,17 +14,17 @@
         real (kind=RKIND), pointer :: nAverage
 
         real (kind=RKIND), dimension(:), pointer :: avgSSH, varSSH
-        real (kind=RKIND), dimension(:,:), pointer :: avgNormalVelocityReconstructZonal, avgNormalVelocityReconstructMeridional, varNormalVelocityReconstructZonal, varNormalVelocityReconstructMeridional
+        real (kind=RKIND), dimension(:,:), pointer :: avgnormalVelocityZonal, avgnormalVelocityMeridional, varnormalVelocityZonal, varnormalVelocityMeridional
         real (kind=RKIND), dimension(:,:), pointer :: avgNormalVelocity, varNormalVelocity, avgVertVelocityTop
 
         nAverage =&gt; state % nAverage % scalar
 
         avgSSH =&gt; state % avgSSH % array
         varSSH =&gt; state % varSSH % array
-        avgNormalVelocityReconstructZonal =&gt; state % avgNormalVelocityReconstructZonal % array
-        avgNormalVelocityReconstructMeridional =&gt; state % avgNormalVelocityReconstructMeridional % array
-        varNormalVelocityReconstructZonal =&gt; state % varNormalVelocityReconstructZonal % array
-        varNormalVelocityReconstructMeridional =&gt; state % varNormalVelocityReconstructMeridional % array
+        avgnormalVelocityZonal =&gt; state % avgnormalVelocityZonal % array
+        avgnormalVelocityMeridional =&gt; state % avgnormalVelocityMeridional % array
+        varnormalVelocityZonal =&gt; state % varnormalVelocityZonal % array
+        varnormalVelocityMeridional =&gt; state % varnormalVelocityMeridional % array
         avgNormalVelocity =&gt; state % avgNormalVelocity % array
         varNormalVelocity =&gt; state % varNormalVelocity % array
         avgVertVelocityTop =&gt; state % avgVertVelocityTop % array
@@ -33,10 +33,10 @@
 
         avgSSH = 0.0
         varSSH = 0.0
-        avgNormalVelocityReconstructZonal = 0.0
-        avgNormalVelocityReconstructMeridional = 0.0
-        varNormalVelocityReconstructZonal = 0.0
-        varNormalVelocityReconstructMeridional = 0.0
+        avgnormalVelocityZonal = 0.0
+        avgnormalVelocityMeridional = 0.0
+        varnormalVelocityZonal = 0.0
+        varnormalVelocityMeridional = 0.0
         avgNormalVelocity = 0.0
         varNormalVelocity = 0.0
         avgVertVelocityTop = 0.0
@@ -50,51 +50,51 @@
         real (kind=RKIND), pointer :: nAverage, old_nAverage
 
         real (kind=RKIND), dimension(:), pointer :: ssh
-        real (kind=RKIND), dimension(:,:), pointer :: normalVelocityReconstructZonal, normalVelocityReconstructMeridional, normalVelocity, vertVelocityTop
+        real (kind=RKIND), dimension(:,:), pointer :: normalVelocityZonal, normalVelocityMeridional, normalVelocity, vertVelocityTop
 
         real (kind=RKIND), dimension(:,:), pointer :: avgNormalVelocity, varNormalVelocity, avgVertVelocityTop
-        real (kind=RKIND), dimension(:,:), pointer :: avgNormalVelocityReconstructZonal, avgNormalVelocityReconstructMeridional, varNormalVelocityReconstructZonal, varNormalVelocityReconstructMeridional
+        real (kind=RKIND), dimension(:,:), pointer :: avgnormalVelocityZonal, avgnormalVelocityMeridional, varnormalVelocityZonal, varnormalVelocityMeridional
         real (kind=RKIND), dimension(:), pointer :: avgSSH, varSSH
 
         real (kind=RKIND), dimension(:,:), pointer :: old_avgNormalVelocity, old_varNormalVelocity, old_avgVertVelocityTop
-        real (kind=RKIND), dimension(:,:), pointer :: old_avgNormalVelocityReconstructZonal, old_avgNormalVelocityReconstructMeridional, old_varNormalVelocityReconstructZonal, old_varNormalVelocityReconstructMeridional
+        real (kind=RKIND), dimension(:,:), pointer :: old_avgnormalVelocityZonal, old_avgnormalVelocityMeridional, old_varnormalVelocityZonal, old_varnormalVelocityMeridional
         real (kind=RKIND), dimension(:), pointer :: old_avgSSH, old_varSSH
 
         old_nAverage =&gt; old_state % nAverage  % scalar
         nAverage =&gt; state % nAverage  % scalar
 
         ssh =&gt; state % ssh % array
-        normalVelocityReconstructZonal =&gt; state % normalVelocityReconstructZonal % array
-        normalVelocityReconstructMeridional =&gt; state % normalVelocityReconstructMeridional % array
+        normalVelocityZonal =&gt; state % normalVelocityZonal % array
+        normalVelocityMeridional =&gt; state % normalVelocityMeridional % array
         normalVelocity =&gt; state % normalVelocity % array
         vertVelocityTop =&gt; state % vertVelocityTop % array
 
         avgSSH =&gt; state % avgSSH % array
         varSSH =&gt; state % varSSH % array
-        avgNormalVelocityReconstructZonal =&gt; state % avgNormalVelocityReconstructZonal % array
-        avgNormalVelocityReconstructMeridional =&gt; state % avgNormalVelocityReconstructMeridional % array
-        varNormalVelocityReconstructZonal =&gt; state % varNormalVelocityReconstructZonal % array
-        varNormalVelocityReconstructMeridional =&gt; state % varNormalVelocityReconstructMeridional % array
+        avgnormalVelocityZonal =&gt; state % avgnormalVelocityZonal % array
+        avgnormalVelocityMeridional =&gt; state % avgnormalVelocityMeridional % array
+        varnormalVelocityZonal =&gt; state % varnormalVelocityZonal % array
+        varnormalVelocityMeridional =&gt; state % varnormalVelocityMeridional % array
         avgNormalVelocity =&gt; state % avgNormalVelocity % array
         varNormalVelocity =&gt; state % varNormalVelocity % array
         avgVertVelocityTop =&gt; state % avgVertVelocityTop % array
 
         old_avgSSH =&gt; old_state % avgSSH % array
         old_varSSH =&gt; old_state % varSSH % array
-        old_avgNormalVelocityReconstructZonal =&gt; old_state % avgNormalVelocityReconstructZonal % array
-        old_avgNormalVelocityReconstructMeridional =&gt; old_state % avgNormalVelocityReconstructMeridional % array
-        old_varNormalVelocityReconstructZonal =&gt; old_state % varNormalVelocityReconstructZonal % array
-        old_varNormalVelocityReconstructMeridional =&gt; old_state % varNormalVelocityReconstructMeridional % array
+        old_avgnormalVelocityZonal =&gt; old_state % avgnormalVelocityZonal % array
+        old_avgnormalVelocityMeridional =&gt; old_state % avgnormalVelocityMeridional % array
+        old_varnormalVelocityZonal =&gt; old_state % varnormalVelocityZonal % array
+        old_varnormalVelocityMeridional =&gt; old_state % varnormalVelocityMeridional % array
         old_avgNormalVelocity =&gt; old_state % avgNormalVelocity % array
         old_varNormalVelocity =&gt; old_state % varNormalVelocity % array
         old_avgVertVelocityTop =&gt; old_state % avgVertVelocityTop % array
 
         avgSSH = old_avgSSH + ssh
         varSSH = old_varSSH + ssh**2
-        avgNormalVelocityReconstructZonal = old_avgNormalVelocityReconstructZonal + normalVelocityReconstructZonal
-        avgNormalVelocityReconstructMeridional = old_avgNormalVelocityReconstructMeridional + normalVelocityReconstructMeridional
-        varNormalVelocityReconstructZonal = old_varNormalVelocityReconstructZonal + normalVelocityReconstructZonal**2
-        varNormalVelocityReconstructMeridional = old_varNormalVelocityReconstructMeridional + normalVelocityReconstructMeridional**2
+        avgnormalVelocityZonal = old_avgnormalVelocityZonal + normalVelocityZonal
+        avgnormalVelocityMeridional = old_avgnormalVelocityMeridional + normalVelocityMeridional
+        varnormalVelocityZonal = old_varnormalVelocityZonal + normalVelocityZonal**2
+        varnormalVelocityMeridional = old_varnormalVelocityMeridional + normalVelocityMeridional**2
         avgNormalVelocity = old_avgNormalVelocity + normalVelocity
         varNormalVelocity = old_varNormalVelocity + normalVelocity**2
         avgVertVelocityTop = old_avgVertVelocityTop + vertVelocityTop
@@ -108,17 +108,17 @@
         real (kind=RKIND), pointer :: nAverage
 
         real (kind=RKIND), dimension(:), pointer :: avgSSH, varSSH
-        real (kind=RKIND), dimension(:,:), pointer :: avgNormalVelocityReconstructZonal, avgNormalVelocityReconstructMeridional, varNormalVelocityReconstructZonal, varNormalVelocityReconstructMeridional
+        real (kind=RKIND), dimension(:,:), pointer :: avgnormalVelocityZonal, avgnormalVelocityMeridional, varnormalVelocityZonal, varnormalVelocityMeridional
         real (kind=RKIND), dimension(:,:), pointer :: avgNormalVelocity, varNormalVelocity, avgVertVelocityTop
 
         nAverage =&gt; state % nAverage  % scalar
 
         avgSSH =&gt; state % avgSSH % array
         varSSH =&gt; state % varSSH % array
-        avgNormalVelocityReconstructZonal =&gt; state % avgNormalVelocityReconstructZonal % array
-        avgNormalVelocityReconstructMeridional =&gt; state % avgNormalVelocityReconstructMeridional % array
-        varNormalVelocityReconstructZonal =&gt; state % varNormalVelocityReconstructZonal % array
-        varNormalVelocityReconstructMeridional =&gt; state % varNormalVelocityReconstructMeridional % array
+        avgnormalVelocityZonal =&gt; state % avgnormalVelocityZonal % array
+        avgnormalVelocityMeridional =&gt; state % avgnormalVelocityMeridional % array
+        varnormalVelocityZonal =&gt; state % varnormalVelocityZonal % array
+        varnormalVelocityMeridional =&gt; state % varnormalVelocityMeridional % array
         avgNormalVelocity =&gt; state % avgNormalVelocity % array
         varNormalVelocity =&gt; state % varNormalVelocity % array
         avgVertVelocityTop =&gt; state % avgVertVelocityTop % array
@@ -126,10 +126,10 @@
         if(nAverage &gt; 0) then
           avgSSH = avgSSH / nAverage
           varSSH = varSSH / nAverage
-          avgNormalVelocityReconstructZonal = avgNormalVelocityReconstructZonal / nAverage
-          avgNormalVelocityReconstructMeridional = avgNormalVelocityReconstructMeridional / nAverage
-          varNormalVelocityReconstructZonal = varNormalVelocityReconstructZonal / nAverage
-          varNormalVelocityReconstructMeridional = varNormalVelocityReconstructMeridional / nAverage
+          avgnormalVelocityZonal = avgnormalVelocityZonal / nAverage
+          avgnormalVelocityMeridional = avgnormalVelocityMeridional / nAverage
+          varnormalVelocityZonal = varnormalVelocityZonal / nAverage
+          varnormalVelocityMeridional = varnormalVelocityMeridional / nAverage
           avgNormalVelocity = avgNormalVelocity / nAverage
           varNormalVelocity = varNormalVelocity / nAverage
           avgVertVelocityTop = avgVertVelocityTop / nAverage

Modified: branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_time_integration_rk4.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_time_integration_rk4.F        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_time_integration_rk4.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -150,13 +150,13 @@
         block =&gt; domain % blocklist
         do while (associated(block))
            ! advection of u uses u, while advection of layerThickness and tracers use uTransport.
-           call ocn_wtop(block % mesh, block % provis % layerThickness % array, block % provis % layerThicknessEdge % array, &amp;
-              block % provis % normalVelocity % array, block % provis % wTop % array, err)
+           call ocn_vert_transport_velocity_top(block % mesh, block % provis % layerThickness % array, block % provis % layerThicknessEdge % array, &amp;
+              block % provis % normalVelocity % array, block % provis % vertTransportVelocityTop % array, err)
            call ocn_tend_vel(block % tend, block % provis, block % diagnostics, block % mesh)
 
-           call ocn_wtop(block % mesh, block % provis % layerThickness % array, block % provis % layerThicknessEdge % array, &amp;
-              block % provis % uTransport % array, block % provis % wTop % array, err)
-           call ocn_tend_h(block % tend, block % provis, block % mesh)
+           call ocn_vert_transport_velocity_top(block % mesh, block % provis % layerThickness % array, block % provis % layerThicknessEdge % array, &amp;
+              block % provis % uTransport % array, block % provis % vertTransportVelocityTop % array, err)
+           call ocn_tend_thick(block % tend, block % provis, block % mesh)
 
            if (config_filter_btr_mode) then
                call ocn_filter_btr_mode_tend_vel(block % tend, block % provis, block % mesh)
@@ -307,11 +307,11 @@
           + block % state % time_levs(2) % state % uBolusGM % array(:,:)
 
          call mpas_reconstruct(block % mesh, block % state % time_levs(2) % state % normalVelocity % array,          &amp;
-                          block % state % time_levs(2) % state % normalVelocityReconstructX % array,            &amp;
-                          block % state % time_levs(2) % state % normalVelocityReconstructY % array,            &amp;
-                          block % state % time_levs(2) % state % normalVelocityReconstructZ % array,            &amp;
-                          block % state % time_levs(2) % state % normalVelocityReconstructZonal % array,        &amp;
-                          block % state % time_levs(2) % state % normalVelocityReconstructMeridional % array    &amp;
+                          block % state % time_levs(2) % state % normalVelocityX % array,            &amp;
+                          block % state % time_levs(2) % state % normalVelocityY % array,            &amp;
+                          block % state % time_levs(2) % state % normalVelocityZ % array,            &amp;
+                          block % state % time_levs(2) % state % normalVelocityZonal % array,        &amp;
+                          block % state % time_levs(2) % state % normalVelocityMeridional % array    &amp;
                          )
 
          call mpas_reconstruct(block % mesh, block % mesh % normalVelocityForcing % array,          &amp;

Modified: branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_time_integration_split.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_time_integration_split.F        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_time_integration_split.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -90,7 +90,7 @@
                  n_bcl_iter(config_n_ts_iter), stage1_tend_time
       type (block_type), pointer :: block
       real (kind=RKIND) :: normalThicknessFluxSum, thicknessSum, flux, sshEdge, hEdge1, &amp;
-                 CoriolisTerm, uCorr, temp, temp_h, coef, FBtr_coeff, sshCell1, sshCell2
+                 CoriolisTerm, uCorr, temp, temp_h, coef, barotropicThicknessFlux_coeff, sshCell1, sshCell2
       integer :: num_tracers, ucorr_coef, err
       real (kind=RKIND), dimension(:,:), pointer :: &amp;
                  u, h, layerThicknessEdge, kineticEnergyEdge, vertViscTopOfEdge, vertDiffTopOfCell
@@ -119,7 +119,7 @@
                ! timestep because the implicit vertical mixing is conducted on the
                ! total u.  We keep normalBarotropicVelocity from the previous timestep.
                ! Note that normalBaroclinicVelocity may now include a barotropic component, because the 
-               ! weights layerThickness have changed.  That is OK, because the GBtrForcing variable
+               ! weights layerThickness have changed.  That is OK, because the barotropicForcing variable
                ! subtracts out the barotropic component from the baroclinic.
                  block % state % time_levs(1) % state % normalBaroclinicVelocity % array(k,iEdge) &amp;
                = block % state % time_levs(1) % state % normalVelocity    % array(k,iEdge) &amp;
@@ -188,12 +188,12 @@
 
             stage1_tend_time = min(split_explicit_step,2)
 
-           ! compute wTop.  Use u (rather than uTransport) for momentum advection.
+           ! compute vertTransportVelocityTop.  Use u (rather than uTransport) for momentum advection.
            ! Use the most recent time level available.
-           call ocn_wtop(block % mesh, block % state % time_levs(stage1_tend_time) % state % layerThickness % array, &amp;
+           call ocn_vert_transport_velocity_top(block % mesh, block % state % time_levs(stage1_tend_time) % state % layerThickness % array, &amp;
               block % state % time_levs(stage1_tend_time) % state % layerThicknessEdge % array, &amp;
               block % state % time_levs(stage1_tend_time) % state % normalVelocity % array, &amp;
-              block % state % time_levs(stage1_tend_time) % state % wTop % array, err)
+              block % state % time_levs(stage1_tend_time) % state % vertTransportVelocityTop % array, err)
 
             call ocn_tend_vel(block % tend, block % state % time_levs(stage1_tend_time) % state, block % diagnostics, block % mesh)
 
@@ -246,7 +246,7 @@
                      normalThicknessFluxSum = normalThicknessFluxSum + block % state % time_levs(2) % state % layerThicknessEdge % array(k,iEdge) * uTemp(k)
                      thicknessSum  =  thicknessSum + block % state % time_levs(2) % state % layerThicknessEdge % array(k,iEdge)
                   enddo
-                  block % state % time_levs(1) % state % GBtrForcing % array(iEdge) = split*normalThicknessFluxSum/thicknessSum/dt
+                  block % state % time_levs(1) % state % barotropicForcing % array(iEdge) = split*normalThicknessFluxSum/thicknessSum/dt
 
 
                   do k=1,block % mesh % maxLevelEdgeTop % array(iEdge)
@@ -257,7 +257,7 @@
                        block % state % time_levs(2) % state % normalBaroclinicVelocity % array(k,iEdge) &amp;
                      = 0.5*( &amp;
                        block % state % time_levs(1) % state % normalBaroclinicVelocity % array(k,iEdge) &amp;
-                     + uTemp(k) - dt * block % state % time_levs(1) % state % GBtrForcing % array(iEdge))
+                     + uTemp(k) - dt * block % state % time_levs(1) % state % barotropicForcing % array(iEdge))
 
                   enddo
  
@@ -325,7 +325,7 @@
             do while (associated(block))
 
                if (config_filter_btr_mode) then
-                  block % state % time_levs(1) % state % GBtrForcing % array(:) = 0.0
+                  block % state % time_levs(1) % state % barotropicForcing % array(:) = 0.0
                endif
 
                do iCell=1,block % mesh % nCells
@@ -344,8 +344,8 @@
                     block % state % time_levs(2) % state % normalBarotropicVelocity % array(iEdge) &amp;
                   = block % state % time_levs(1) % state % normalBarotropicVelocity % array(iEdge) 
 
-                  ! FBtr = 0  
-                  block % state % time_levs(1) % state % FBtr % array(iEdge) = 0.0
+                  ! barotropicThicknessFlux = 0  
+                  block % state % time_levs(1) % state % barotropicThicknessFlux % array(iEdge) = 0.0
                end do
 
                block =&gt; block % next
@@ -387,7 +387,7 @@
                           * (block % state % time_levs(oldBtrSubcycleTime) % state % sshSubcycle % array(cell2) &amp;
                            - block % state % time_levs(oldBtrSubcycleTime) % state % sshSubcycle % array(cell1) ) &amp;
                           / block % mesh % dcEdge % array(iEdge) &amp;
-                          + block % state % time_levs(1) % state % GBtrForcing % array(iEdge))) * block % mesh % edgeMask % array(1, iEdge)
+                          + block % state % time_levs(1) % state % barotropicForcing % array(iEdge))) * block % mesh % edgeMask % array(1, iEdge)
                      end do
 
                      block =&gt; block % next
@@ -408,12 +408,12 @@
                 block % tend % ssh % array(:) = 0.0
       
                 if (config_btr_solve_SSH2) then
-                   ! If config_btr_solve_SSH2=.true., then do NOT accumulate FBtr in this SSH predictor 
+                   ! If config_btr_solve_SSH2=.true., then do NOT accumulate barotropicThicknessFlux in this SSH predictor 
                    ! section, because it will be accumulated in the SSH corrector section.
-                   FBtr_coeff = 0.0
+                   barotropicThicknessFlux_coeff = 0.0
                 else
-                   ! otherwise, DO accumulate FBtr in this SSH predictor section
-                   FBtr_coeff = 1.0
+                   ! otherwise, DO accumulate barotropicThicknessFlux in this SSH predictor section
+                   barotropicThicknessFlux_coeff = 1.0
                 endif
       
                 ! config_btr_gam1_velWt1 sets the forward weighting of velocity in the SSH computation
@@ -477,8 +477,8 @@
                           + config_btr_gam1_velWt1 * block % state % time_levs(newBtrSubcycleTime) % state % normalBarotropicVelocitySubcycle % array(iEdge)) &amp;
                           * thicknessSum 
 
-                   block % state % time_levs(1) % state % FBtr % array(iEdge) = block % state % time_levs(1) % state % FBtr % array(iEdge) &amp;
-                     + FBtr_coeff*flux
+                   block % state % time_levs(1) % state % barotropicThicknessFlux % array(iEdge) = block % state % time_levs(1) % state % barotropicThicknessFlux % array(iEdge) &amp;
+                     + barotropicThicknessFlux_coeff*flux
                 end do
       
                 ! SSHnew = SSHold + dt/J*(-div(Flux))
@@ -533,7 +533,7 @@
                      block % state % time_levs(newBtrSubcycleTime) % state % normalBarotropicVelocitySubcycle % array(iEdge) &amp; 
                          = (block % state % time_levs(oldBtrSubcycleTime) % state % normalBarotropicVelocitySubcycle % array(iEdge) &amp; 
                          + dt/config_n_btr_subcycles *(CoriolisTerm - gravity *(sshCell2 - sshCell1) /block % mesh % dcEdge % array(iEdge) &amp;
-                         + block % state % time_levs(1) % state % GBtrForcing % array(iEdge))) * block % mesh % edgeMask % array(1,iEdge)
+                         + block % state % time_levs(1) % state % barotropicForcing % array(iEdge))) * block % mesh % edgeMask % array(1,iEdge)
                    end do
                    deallocate(uTemp)
       
@@ -625,7 +625,7 @@
                             + config_btr_gam3_velWt2 * block % state % time_levs(newBtrSubcycleTime) % state % normalBarotropicVelocitySubcycle % array(iEdge)) &amp;
                             * thicknessSum
       
-                     block % state % time_levs(1) % state % FBtr % array(iEdge) = block % state % time_levs(1) % state % FBtr % array(iEdge) + flux
+                     block % state % time_levs(1) % state % barotropicThicknessFlux % array(iEdge) = block % state % time_levs(1) % state % barotropicThicknessFlux % array(iEdge) + flux
                   end do
       
                   ! SSHnew = SSHold + dt/J*(-div(Flux))
@@ -679,7 +679,7 @@
             do while (associated(block))
       
                do iEdge=1,block % mesh % nEdges
-                  block % state % time_levs(1) % state % FBtr % array(iEdge) = block % state % time_levs(1) % state % FBtr % array(iEdge) &amp;
+                  block % state % time_levs(1) % state % barotropicThicknessFlux % array(iEdge) = block % state % time_levs(1) % state % barotropicThicknessFlux % array(iEdge) &amp;
                       / (config_n_btr_subcycles*config_btr_subcycle_loop_factor)
       
                   block % state % time_levs(2) % state % normalBarotropicVelocity % array(iEdge) = block % state % time_levs(2) % state % normalBarotropicVelocity % array(iEdge) &amp; 
@@ -692,7 +692,7 @@
       
             ! boundary update on F
             call mpas_timer_start(&quot;se halo F&quot;, .false., timer_halo_f)
-            call mpas_dmpar_exch_halo_field(domain % blocklist % state % time_levs(1) % state % FBtr)
+            call mpas_dmpar_exch_halo_field(domain % blocklist % state % time_levs(1) % state % barotropicThicknessFlux)
             call mpas_timer_stop(&quot;se halo F&quot;, timer_halo_f)
 
 
@@ -736,7 +736,7 @@
                      thicknessSum  =  thicknessSum + block % state % time_levs(2) % state % layerThicknessEdge % array(k,iEdge)
                   enddo
 
-                  uCorr =   ucorr_coef*(( block % state % time_levs(1) % state % FBtr % array(iEdge) - normalThicknessFluxSum)/thicknessSum)
+                  uCorr =   ucorr_coef*(( block % state % time_levs(1) % state % barotropicThicknessFlux % array(iEdge) - normalThicknessFluxSum)/thicknessSum)
 
                   do k=1,block % mesh % nVertLevels
 
@@ -774,14 +774,14 @@
          block =&gt; domain % blocklist
          do while (associated(block))
 
-            ! compute wTop.  Use uTransport for advection of layerThickness and tracers.
+            ! compute vertTransportVelocityTop.  Use uTransport for advection of layerThickness and tracers.
             ! Use time level 1 values of layerThickness and layerThicknessEdge because layerThickness has not yet been computed for time level 2.
-            call ocn_wtop(block % mesh, block % state % time_levs(1) % state % layerThickness % array, &amp;
+            call ocn_vert_transport_velocity_top(block % mesh, block % state % time_levs(1) % state % layerThickness % array, &amp;
                block % state % time_levs(1) % state % layerThicknessEdge % array, &amp;
                block % state % time_levs(2) % state % uTransport % array, &amp;
-               block % state % time_levs(2) % state % wTop % array, err)
+               block % state % time_levs(2) % state % vertTransportVelocityTop % array, err)
 
-            call ocn_tend_h(block % tend, block % state % time_levs(2) % state, block % mesh)
+            call ocn_tend_thick(block % tend, block % state % time_levs(2) % state, block % mesh)
             block =&gt; block % next
          end do
 
@@ -970,11 +970,11 @@
           + block % state % time_levs(2) % state % uBolusGM % array(:,:)
 
          call mpas_reconstruct(block % mesh, block % state % time_levs(2) % state % normalVelocity % array,          &amp;
-                          block % state % time_levs(2) % state % normalVelocityReconstructX % array,            &amp;
-                          block % state % time_levs(2) % state % normalVelocityReconstructY % array,            &amp;
-                          block % state % time_levs(2) % state % normalVelocityReconstructZ % array,            &amp;
-                          block % state % time_levs(2) % state % normalVelocityReconstructZonal % array,        &amp;
-                          block % state % time_levs(2) % state % normalVelocityReconstructMeridional % array    &amp;
+                          block % state % time_levs(2) % state % normalVelocityX % array,            &amp;
+                          block % state % time_levs(2) % state % normalVelocityY % array,            &amp;
+                          block % state % time_levs(2) % state % normalVelocityZ % array,            &amp;
+                          block % state % time_levs(2) % state % normalVelocityZonal % array,        &amp;
+                          block % state % time_levs(2) % state % normalVelocityMeridional % array    &amp;
                          )
 
          call mpas_reconstruct(block % mesh, block % mesh % normalVelocityForcing % array,          &amp;

Deleted: branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_hadv.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_hadv.F        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_hadv.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -1,189 +0,0 @@
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-!
-!  ocn_tracer_hadv
-!
-!&gt; \brief MPAS ocean horizontal tracer advection driver
-!&gt; \author Doug Jacobsen
-!&gt; \date   16 September 2011
-!&gt; \version SVN:$Id:$
-!&gt; \details
-!&gt;  This module contains the main driver routine for computing 
-!&gt;  horizontal advection tendencies.  
-!
-!-----------------------------------------------------------------------
-
-module ocn_tracer_hadv
-
-   use mpas_grid_types
-   use mpas_configure
-   use mpas_timer
-
-   use ocn_tracer_hadv2
-   use ocn_tracer_hadv3
-   use ocn_tracer_hadv4
-
-   implicit none
-   private
-   save
-
-   !--------------------------------------------------------------------
-   !
-   ! Public parameters
-   !
-   !--------------------------------------------------------------------
-
-   !--------------------------------------------------------------------
-   !
-   ! Public member functions
-   !
-   !--------------------------------------------------------------------
-
-   public :: ocn_tracer_hadv_tend, &amp;
-             ocn_tracer_hadv_init
-
-   !--------------------------------------------------------------------
-   !
-   ! Private module variables
-   !
-   !--------------------------------------------------------------------
-
-   type (timer_node), pointer :: hadv2Timer, hadv3Timer, hadv4Timer
-
-
-!***********************************************************************
-
-contains
-
-!***********************************************************************
-!
-!  routine ocn_tracer_hadv_tend
-!
-!&gt; \brief   Computes tendency term for horizontal tracer advection
-!&gt; \author  Phil Jones, Doug Jacobsen
-!&gt; \date    15 September 2011
-!&gt; \version SVN:$Id$
-!&gt; \details 
-!&gt;  This routine computes the horizontal advection tendency for tracer
-!&gt;  based on current state and user choices of advection parameterization.
-!&gt;  Multiple parameterizations may be chosen and added together.  These
-!&gt;  tendencies are generally computed by calling the specific routine
-!&gt;  for the chosen parameterization, so this routine is primarily a
-!&gt;  driver for managing these choices.
-!
-!-----------------------------------------------------------------------
-
-   subroutine ocn_tracer_hadv_tend(grid, u, layerThicknessEdge, tracers, tend, err)!{{{
-
-      !-----------------------------------------------------------------
-      !
-      ! input variables
-      !
-      !-----------------------------------------------------------------
-
-      real (kind=RKIND), dimension(:,:), intent(in) :: &amp;
-         u    !&lt; Input: velocity
-
-      real (kind=RKIND), dimension(:,:), intent(in) :: &amp;
-         layerThicknessEdge     !&lt; Input: thickness at edge
-
-      real (kind=RKIND), dimension(:,:,:), intent(in) :: &amp;
-         tracers     !&lt; Input: tracers
-
-      type (mesh_type), intent(in) :: &amp;
-         grid          !&lt; Input: grid information
-
-      !-----------------------------------------------------------------
-      !
-      ! input/output variables
-      !
-      !-----------------------------------------------------------------
-
-      real (kind=RKIND), dimension(:,:,:), intent(inout) :: &amp;
-         tend          !&lt; Input/Output: velocity tendency
-
-      !-----------------------------------------------------------------
-      !
-      ! output variables
-      !
-      !-----------------------------------------------------------------
-
-      integer, intent(out) :: err !&lt; Output: Error flag
-
-      !-----------------------------------------------------------------
-      !
-      ! local variables
-      !
-      !-----------------------------------------------------------------
-
-      integer :: err1, err2, err3
-
-      !-----------------------------------------------------------------
-      !
-      ! call relevant routines for computing tendencies
-      ! note that the user can choose multiple options and the 
-      !   tendencies will be added together
-      !
-      !-----------------------------------------------------------------
-
-      call mpas_timer_start(&quot;hadv2&quot;, .false., hadv2Timer);
-      call ocn_tracer_hadv2_tend(grid, u, layerThicknessEdge, tracers, tend, err1)
-      call mpas_timer_stop(&quot;hadv2&quot;, hadv2Timer);
-      call mpas_timer_start(&quot;hadv3&quot;, .false., hadv3Timer);
-      call ocn_tracer_hadv3_tend(grid, u, layerThicknessEdge, tracers, tend, err2)
-      call mpas_timer_stop(&quot;hadv3&quot;, hadv3Timer);
-      call mpas_timer_start(&quot;hadv4&quot;, .false., hadv4Timer);
-      call ocn_tracer_hadv4_tend(grid, u, layerThicknessEdge, tracers, tend, err3)
-      call mpas_timer_stop(&quot;hadv4&quot;, hadv4Timer);
-
-      err = ior(err1, ior(err2, err3))
-
-   !--------------------------------------------------------------------
-
-   end subroutine ocn_tracer_hadv_tend!}}}
-
-!***********************************************************************
-!
-!  routine ocn_tracer_hadv_init
-!
-!&gt; \brief   Initializes ocean tracer horizontal advection quantities
-!&gt; \author  Phil Jones, Doug Jacobsen
-!&gt; \date    15 September 2011
-!&gt; \version SVN:$Id$
-!&gt; \details 
-!&gt;  This routine initializes a variety of quantities related to 
-!&gt;  horizontal velocity advection in the ocean. Since a variety of 
-!&gt;  parameterizations are available, this routine primarily calls the
-!&gt;  individual init routines for each parameterization. 
-!
-!-----------------------------------------------------------------------
-
-   subroutine ocn_tracer_hadv_init(err)!{{{
-
-   !--------------------------------------------------------------------
-
-      !-----------------------------------------------------------------
-      !
-      ! call individual init routines for each parameterization
-      !
-      !-----------------------------------------------------------------
-
-      integer, intent(out) :: err !&lt; Output: Error flag
-
-      integer :: err1, err2, err3
-
-      call ocn_tracer_hadv2_init(err1)
-      call ocn_tracer_hadv3_init(err2)
-      call ocn_tracer_hadv4_init(err3)
-
-      err = ior(err1, ior(err2, err3))
-
-   !--------------------------------------------------------------------
-
-   end subroutine ocn_tracer_hadv_init!}}}
-
-!***********************************************************************
-
-end module ocn_tracer_hadv
-
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-! vim: foldmethod=marker

Deleted: branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_hadv2.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_hadv2.F        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_hadv2.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -1,199 +0,0 @@
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-!
-!  ocn_tracer_hadv2
-!
-!&gt; \brief MPAS ocean horizontal tracer advection 2nd order
-!&gt; \author Doug Jacobsen
-!&gt; \date   16 September 2011
-!&gt; \version SVN:$Id:$
-!&gt; \details
-!&gt;  This module contains the main driver routine for computing 
-!&gt;  horizontal advection tendencies.  
-!
-!-----------------------------------------------------------------------
-
-module ocn_tracer_hadv2
-
-   use mpas_grid_types
-   use mpas_configure
-
-   implicit none
-   private
-   save
-
-   !--------------------------------------------------------------------
-   !
-   ! Public parameters
-   !
-   !--------------------------------------------------------------------
-
-   !--------------------------------------------------------------------
-   !
-   ! Public member functions
-   !
-   !--------------------------------------------------------------------
-
-   public :: ocn_tracer_hadv2_tend, &amp;
-             ocn_tracer_hadv2_init
-
-   !--------------------------------------------------------------------
-   !
-   ! Private module variables
-   !
-   !--------------------------------------------------------------------
-
-   logical :: hadv2On !&lt; Flag to turn on/off 2nd order hadv
-
-!***********************************************************************
-
-contains
-
-!***********************************************************************
-!
-!  routine ocn_tracer_hadv2_tend
-!
-!&gt; \brief   Computes tendency term for horizontal tracer advection 2nd order
-!&gt; \author  Phil Jones, Doug Jacobsen
-!&gt; \date    15 September 2011
-!&gt; \version SVN:$Id$
-!&gt; \details 
-!&gt;  This routine computes the horizontal advection tendency for tracer
-!&gt;  based on current state using a 2nd order formulation.
-!
-!-----------------------------------------------------------------------
-
-   subroutine ocn_tracer_hadv2_tend(grid, normalVelocity, layerThicknessEdge, tracers , tend, err)!{{{
-
-      !-----------------------------------------------------------------
-      !
-      ! input variables
-      !
-      !-----------------------------------------------------------------
-
-      real (kind=RKIND), dimension(:,:), intent(in) :: &amp;
-         normalVelocity    !&lt; Input: tracer
-
-      real (kind=RKIND), dimension(:,:), intent(in) :: &amp;
-         layerThicknessEdge     !&lt; Input: thickness at edge
-
-      real (kind=RKIND), dimension(:,:,:), intent(in) :: &amp;
-        tracers     !&lt; Input: tracers
-
-      type (mesh_type), intent(in) :: &amp;
-         grid          !&lt; Input: grid information
-
-      !-----------------------------------------------------------------
-      !
-      ! input/output variables
-      !
-      !-----------------------------------------------------------------
-
-      real (kind=RKIND), dimension(:,:,:), intent(inout) :: &amp;
-         tend          !&lt; Input/Output: tracer tendency
-
-      !-----------------------------------------------------------------
-      !
-      ! output variables
-      !
-      !-----------------------------------------------------------------
-
-      integer, intent(out) :: err !&lt; Output: Error flag
-
-      !-----------------------------------------------------------------
-      !
-      ! local variables
-      !
-      !-----------------------------------------------------------------
-
-      integer :: iEdge, nEdges, cell1, cell2, iTracer, num_tracers, k
-
-      integer, dimension(:), pointer :: maxLevelEdgeTop
-      integer, dimension(:,:), pointer :: cellsOnEdge
-
-      real (kind=RKIND) :: flux, tracer_edge, invAreaCell1, invAreaCell2, r_tmp
-
-      real (kind=RKIND), dimension(:), pointer :: dvEdge, areaCell
-
-      !-----------------------------------------------------------------
-      !
-      ! call relevant routines for computing tendencies
-      ! note that the user can choose multiple options and the 
-      !   tendencies will be added together
-      !
-      !-----------------------------------------------------------------
-
-      err = 0
-
-      if(.not.hadv2On) return
-
-      nEdges = grid % nEdges
-      maxLevelEdgeTop =&gt; grid % maxLevelEdgeTop % array
-      cellsOnEdge =&gt; grid % cellsOnEdge % array
-      dvEdge =&gt; grid % dvEdge % array
-      areaCell =&gt; grid % areaCell % array
-      num_tracers = size(tracers, 1)
-
-      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)
-            r_tmp = normalVelocity(k,iEdge) * dvEdge(iEdge) * layerThicknessEdge(k,iEdge)
-            do iTracer=1,num_tracers
-               tracer_edge = 0.5 * (tracers(iTracer,k,cell1) + tracers(iTracer,k,cell2))
-               flux = r_tmp * tracer_edge
-               tend(iTracer,k,cell1) = tend(iTracer,k,cell1) - flux * invAreaCell1
-               tend(iTracer,k,cell2) = tend(iTracer,k,cell2) + flux * invAreaCell2
-            end do
-         end do
-      end do
-   !--------------------------------------------------------------------
-
-   end subroutine ocn_tracer_hadv2_tend!}}}
-
-!***********************************************************************
-!
-!  routine ocn_tracer_hadv2_init
-!
-!&gt; \brief   Initializes ocean tracer horizontal advection quantities
-!&gt; \author  Phil Jones, Doug Jacobsen
-!&gt; \date    15 September 2011
-!&gt; \version SVN:$Id$
-!&gt; \details 
-!&gt;  This routine initializes a variety of quantities related to 
-!&gt;  2nd order horizontal tracer advection in the ocean.
-!
-!-----------------------------------------------------------------------
-
-   subroutine ocn_tracer_hadv2_init(err)!{{{
-
-   !--------------------------------------------------------------------
-
-      !-----------------------------------------------------------------
-      !
-      ! call individual init routines for each parameterization
-      !
-      !-----------------------------------------------------------------
-
-      integer, intent(out) :: err !&lt; Output: Error flag
-
-      err = 0
-      hadv2On = .false.
-
-      if (config_horiz_tracer_adv_order == 2) then
-          hadv2On = .true.
-      end if
-
-   !--------------------------------------------------------------------
-
-   end subroutine ocn_tracer_hadv2_init!}}}
-
-!***********************************************************************
-
-end module ocn_tracer_hadv2
-
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-
-! vim: foldmethod=marker

Deleted: branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_hadv3.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_hadv3.F        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_hadv3.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -1,239 +0,0 @@
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-!
-!  ocn_tracer_hadv3
-!
-!&gt; \brief MPAS ocean horizontal tracer advection 3rd order
-!&gt; \author Doug Jacobsen
-!&gt; \date   16 September 2011
-!&gt; \version SVN:$Id:$
-!&gt; \details
-!&gt;  This module contains the main driver routine for computing 
-!&gt;  horizontal advection tendencies.  
-!
-!-----------------------------------------------------------------------
-
-module ocn_tracer_hadv3
-
-   use mpas_grid_types
-   use mpas_configure
-
-   implicit none
-   private
-   save
-
-   !--------------------------------------------------------------------
-   !
-   ! Public parameters
-   !
-   !--------------------------------------------------------------------
-
-   !--------------------------------------------------------------------
-   !
-   ! Public member functions
-   !
-   !--------------------------------------------------------------------
-
-   public :: ocn_tracer_hadv3_tend, &amp;
-             ocn_tracer_hadv3_init
-
-   !--------------------------------------------------------------------
-   !
-   ! Private module variables
-   !
-   !--------------------------------------------------------------------
-
-   logical :: hadv3On !&lt; Flag to turn on/off 3rd order hadv
-   real (kind=RKIND) :: coef_3rd_order !&lt; Coefficient for 3rd order hadv
-
-!***********************************************************************
-
-contains
-
-!***********************************************************************
-!
-!  routine ocn_tracer_hadv3_tend
-!
-!&gt; \brief   Computes tendency term for horizontal tracer advection 3rd order
-!&gt; \author  Phil Jones, Doug Jacobsen
-!&gt; \date    15 September 2011
-!&gt; \version SVN:$Id$
-!&gt; \details 
-!&gt;  This routine computes the horizontal advection tendency for tracer
-!&gt;  based on current state using a 3rd order formulation.
-!
-!-----------------------------------------------------------------------
-
-   subroutine ocn_tracer_hadv3_tend(grid, normalVelocity, layerThicknessEdge, tracers , tend, err)!{{{
-
-      !-----------------------------------------------------------------
-      !
-      ! input variables
-      !
-      !-----------------------------------------------------------------
-
-      real (kind=RKIND), dimension(:,:), intent(in) :: &amp;
-         normalVelocity    !&lt; Input: tracer
-
-      real (kind=RKIND), dimension(:,:), intent(in) :: &amp;
-         layerThicknessEdge     !&lt; Input: thickness at edge
-
-      real (kind=RKIND), dimension(:,:,:), intent(in) :: &amp;
-        tracers     !&lt; Input: tracers
-
-      type (mesh_type), intent(in) :: &amp;
-         grid          !&lt; Input: grid information
-
-      !-----------------------------------------------------------------
-      !
-      ! input/output variables
-      !
-      !-----------------------------------------------------------------
-
-      real (kind=RKIND), dimension(:,:,:), intent(inout) :: &amp;
-         tend          !&lt; Input/Output: tracer tendency
-
-      !-----------------------------------------------------------------
-      !
-      ! output variables
-      !
-      !-----------------------------------------------------------------
-
-      integer, intent(out) :: err !&lt; Output: error flag
-
-      !-----------------------------------------------------------------
-      !
-      ! local variables
-      !
-      !-----------------------------------------------------------------
-
-      integer :: iEdge, nEdges, cell1, cell2, iTracer, num_tracers, i, k, &amp;
-                 boundaryMask, velMask
-
-      integer, dimension(:), pointer :: maxLevelEdgeTop, nEdgesOnCell
-      integer, dimension(:,:), pointer :: cellsOnEdge, cellsOnCell, &amp;
-                                          cellMask, edgeMask
-
-      real (kind=RKIND) :: flux, tracer_edge, d2fdx2_cell1, d2fdx2_cell2, &amp;
-                           invAreaCell1, invAreaCell2
-
-      real (kind=RKIND), dimension(:), pointer :: dvEdge, dcEdge, areaCell
-      real (kind=RKIND), dimension(:,:,:), pointer :: deriv_two
-
-      !-----------------------------------------------------------------
-      !
-      ! call relevant routines for computing tendencies
-      ! note that the user can choose multiple options and the 
-      !   tendencies will be added together
-      !
-      !-----------------------------------------------------------------
-
-      err = 0
-
-      if(.not.hadv3On) return
-
-      nEdges = grid % nEdges
-      num_tracers = size(tracers, dim=1)
-      maxLevelEdgeTop =&gt; grid % maxLevelEdgeTop % array
-      nEdgesOnCell =&gt; grid % nEdgesOnCell % array
-      cellMask =&gt; grid % cellMask % array
-      cellsOnEdge =&gt; grid % cellsOnEdge % array
-      cellsOnCell =&gt; grid % cellsOnCell % array
-      dvEdge =&gt; grid % dvEdge % array
-      dcEdge =&gt; grid % dcEdge % array
-      areaCell =&gt; grid % areaCell % array
-      deriv_two =&gt; grid % deriv_two % array
-
-      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)
-
-            d2fdx2_cell1 = 0.0
-            d2fdx2_cell2 = 0.0
-
-            boundaryMask = abs(transfer(cellMask(k,cell1)  == 1 .and. cellMask(k,cell2) == 1,boundaryMask))
-
-            do iTracer=1,num_tracers
-
-               !-- if not a boundary cell
-               d2fdx2_cell1 = deriv_two(1,1,iEdge) * tracers(iTracer,k,cell1) * boundaryMask
-               d2fdx2_cell2 = deriv_two(1,2,iEdge) * tracers(iTracer,k,cell2) * boundaryMask
-
-               !-- all edges of cell 1
-               do i=1,nEdgesOnCell(cell1) * boundaryMask
-                  d2fdx2_cell1 = d2fdx2_cell1 + &amp;
-                  deriv_two(i+1,1,iEdge) * tracers(iTracer,k,cellsOnCell(i,cell1))
-               end do
-
-               !-- all edges of cell 2
-               do i=1,nEdgesOnCell(cell2) * boundaryMask
-                  d2fdx2_cell2 = d2fdx2_cell2 + &amp;
-                  deriv_two(i+1,2,iEdge) * tracers(iTracer,k,cellsOnCell(i,cell2))
-               end do
-
-
-               velMask = 2*(abs(transfer(normalVelocity(k,iEdge) &lt;= 0, velMask))) - 1
-               flux = dvEdge(iEdge) *  normalVelocity(k,iEdge) * layerThicknessEdge(k,iEdge) * (          &amp;
-                    0.5*(tracers(iTracer,k,cell1) + tracers(iTracer,k,cell2))      &amp;
-                    -(dcEdge(iEdge) **2) * (d2fdx2_cell1 + d2fdx2_cell2) / 12.          &amp;
-                    +velMask*(dcEdge(iEdge) **2) * coef_3rd_order*(d2fdx2_cell1 - d2fdx2_cell2) / 12. )
-
-               !-- update tendency
-               tend(iTracer,k,cell1) = tend(iTracer,k,cell1) - flux*invAreaCell1
-               tend(iTracer,k,cell2) = tend(iTracer,k,cell2) + flux*invAreaCell2
-            enddo
-         end do
-      end do
-   !--------------------------------------------------------------------
-
-   end subroutine ocn_tracer_hadv3_tend!}}}
-
-!***********************************************************************
-!
-!  routine ocn_tracer_hadv3_init
-!
-!&gt; \brief   Initializes ocean tracer horizontal advection quantities
-!&gt; \author  Phil Jones, Doug Jacobsen
-!&gt; \date    15 September 2011
-!&gt; \version SVN:$Id$
-!&gt; \details 
-!&gt;  This routine initializes a variety of quantities related to 
-!&gt;  3rd order horizontal tracer advection in the ocean. 
-!
-!-----------------------------------------------------------------------
-
-   subroutine ocn_tracer_hadv3_init(err)!{{{
-
-   !--------------------------------------------------------------------
-
-      !-----------------------------------------------------------------
-      !
-      ! call individual init routines for each parameterization
-      !
-      !-----------------------------------------------------------------
-
-      integer, intent(out) :: err !&lt; Output: error flag
-
-      err = 0
-      hadv3On = .false.
-
-      if (config_horiz_tracer_adv_order == 3) then
-          hadv3On = .true.
-
-          coef_3rd_order = config_coef_3rd_order
-      end if
-
-   !--------------------------------------------------------------------
-
-   end subroutine ocn_tracer_hadv3_init!}}}
-
-!***********************************************************************
-
-end module ocn_tracer_hadv3
-
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-! vim: foldmethod=marker

Deleted: branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_hadv4.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_hadv4.F        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_hadv4.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -1,229 +0,0 @@
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-!
-!  ocn_tracer_hadv4
-!
-!&gt; \brief MPAS ocean horizontal tracer advection 4th order
-!&gt; \author Doug Jacobsen
-!&gt; \date   16 September 2011
-!&gt; \version SVN:$Id:$
-!&gt; \details
-!&gt;  This module contains the main driver routine for computing 
-!&gt;  horizontal advection tendencies.  
-!
-!-----------------------------------------------------------------------
-
-module ocn_tracer_hadv4
-
-   use mpas_grid_types
-   use mpas_configure
-
-   implicit none
-   private
-   save
-
-   !--------------------------------------------------------------------
-   !
-   ! Public parameters
-   !
-   !--------------------------------------------------------------------
-
-   !--------------------------------------------------------------------
-   !
-   ! Public member functions
-   !
-   !--------------------------------------------------------------------
-
-   public :: ocn_tracer_hadv4_tend, &amp;
-             ocn_tracer_hadv4_init
-
-   !--------------------------------------------------------------------
-   !
-   ! Private module variables
-   !
-   !--------------------------------------------------------------------
-
-   logical :: hadv4On !&lt; Flag to turning on/off 4th order hadv
-
-!***********************************************************************
-
-contains
-
-!***********************************************************************
-!
-!  routine ocn_tracer_hadv4_tend
-!
-!&gt; \brief   Computes tendency term for horizontal tracer advection 4th order
-!&gt; \author  Phil Jones, Doug Jacobsen
-!&gt; \date    15 September 2011
-!&gt; \version SVN:$Id$
-!&gt; \details 
-!&gt;  This routine computes the horizontal advection tendency for tracer
-!&gt;  based on current state using a 4th order formulation.
-!
-!-----------------------------------------------------------------------
-
-   subroutine ocn_tracer_hadv4_tend(grid, normalVelocity, layerThicknessEdge, tracers , tend, err)!{{{
-
-      !-----------------------------------------------------------------
-      !
-      ! input variables
-      !
-      !-----------------------------------------------------------------
-
-      real (kind=RKIND), dimension(:,:), intent(in) :: &amp;
-         normalVelocity    !&lt; Input: tracer
-
-      real (kind=RKIND), dimension(:,:), intent(in) :: &amp;
-         layerThicknessEdge     !&lt; Input: thickness at edge
-
-      real (kind=RKIND), dimension(:,:,:), intent(in) :: &amp;
-        tracers     !&lt; Input: tracers
-
-      type (mesh_type), intent(in) :: &amp;
-         grid          !&lt; Input: grid information
-
-      !-----------------------------------------------------------------
-      !
-      ! input/output variables
-      !
-      !-----------------------------------------------------------------
-
-      real (kind=RKIND), dimension(:,:,:), intent(inout) :: &amp;
-         tend          !&lt; Input/Output: tracer tendency
-
-      !-----------------------------------------------------------------
-      !
-      ! output variables
-      !
-      !-----------------------------------------------------------------
-
-      integer, intent(out) :: err !&lt; Output: error flag
-
-      !-----------------------------------------------------------------
-      !
-      ! local variables
-      !
-      !-----------------------------------------------------------------
-
-      integer :: iEdge, nEdges, cell1, cell2, iTracer, num_tracers, i, k, &amp;
-                 boundaryMask
-
-      integer, dimension(:), pointer :: maxLevelEdgeTop, nEdgesOnCell
-      integer, dimension(:,:), pointer :: cellsOnEdge, cellsOnCell, cellMask
-
-      real (kind=RKIND) :: flux, tracer_edge, d2fdx2_cell1, d2fdx2_cell2, invAreaCell1, invAreaCell2
-
-      real (kind=RKIND), dimension(:), pointer :: dvEdge, dcEdge, areaCell
-      real (kind=RKIND), dimension(:,:,:), pointer :: deriv_two
-
-      !-----------------------------------------------------------------
-      !
-      ! call relevant routines for computing tendencies
-      ! note that the user can choose multiple options and the 
-      !   tendencies will be added together
-      !
-      !-----------------------------------------------------------------
-
-      err = 0
-
-      if(.not.hadv4On) return
-
-      nEdges = grid % nEdges
-      num_tracers = size(tracers, dim=1)
-      maxLevelEdgeTop =&gt; grid % maxLevelEdgeTop % array
-      nEdgesOnCell =&gt; grid % nEdgesOnCell % array
-      cellMask =&gt; grid % cellMask % array
-      cellsOnEdge =&gt; grid % cellsOnEdge % array
-      cellsOnCell =&gt; grid % cellsOnCell % array
-      dvEdge =&gt; grid % dvEdge % array
-      dcEdge =&gt; grid % dcEdge % array
-      areaCell =&gt; grid % areaCell % array
-      deriv_two =&gt; grid % deriv_two % array
-
-      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)
-
-            d2fdx2_cell1 = 0.0
-            d2fdx2_cell2 = 0.0
-
-            boundaryMask = abs(transfer(cellMask(k,cell1) == 1 .and. cellMask(k, cell2) == 1, boundaryMask))
-
-            do iTracer=1,num_tracers
-               d2fdx2_cell1 = deriv_two(1,1,iEdge) * tracers(iTracer,k,cell1) * boundaryMask
-               d2fdx2_cell2 = deriv_two(1,2,iEdge) * tracers(iTracer,k,cell2) * boundaryMask
-
-               !-- all edges of cell 1
-               do i=1,nEdgesOnCell(cell1) * boundaryMask
-                  d2fdx2_cell1 = d2fdx2_cell1 + &amp;
-                  deriv_two(i+1,1,iEdge) * tracers(iTracer,k,cellsOnCell(i,cell1))
-               end do
-
-               !-- all edges of cell 2
-               do i=1,nEdgesOnCell(cell2) * boundaryMask
-                   d2fdx2_cell2 = d2fdx2_cell2 + &amp;
-                   deriv_two(i+1,2,iEdge) * tracers(iTracer,k,cellsOnCell(i,cell2))
-               end do
-
-               flux = dvEdge(iEdge) *  normalVelocity(k,iEdge) * layerThicknessEdge(k,iEdge) * (          &amp;
-                    0.5*(tracers(iTracer,k,cell1) + tracers(iTracer,k,cell2))      &amp;
-                       -(dcEdge(iEdge) **2) * (d2fdx2_cell1 + d2fdx2_cell2) / 12. )
-
-               !-- update tendency
-               tend(iTracer,k,cell1) = tend(iTracer,k,cell1) - flux * invAreaCell1
-               tend(iTracer,k,cell2) = tend(iTracer,k,cell2) + flux * invAreaCell2
-            enddo
-         end do
-      end do
-   !--------------------------------------------------------------------
-
-   end subroutine ocn_tracer_hadv4_tend!}}}
-
-!***********************************************************************
-!
-!  routine ocn_tracer_hadv4_init
-!
-!&gt; \brief   Initializes ocean tracer horizontal advection quantities
-!&gt; \author  Phil Jones, Doug Jacobsen
-!&gt; \date    15 September 2011
-!&gt; \version SVN:$Id$
-!&gt; \details 
-!&gt;  This routine initializes the 4th order formulation for 
-!&gt;  horizontal tracer advection in the ocean. 
-!
-!-----------------------------------------------------------------------
-
-   subroutine ocn_tracer_hadv4_init(err)!{{{
-
-   !--------------------------------------------------------------------
-
-      !-----------------------------------------------------------------
-      !
-      ! call individual init routines for each parameterization
-      !
-      !-----------------------------------------------------------------
-
-      integer, intent(out) :: err !&lt; Output: Error flag
-
-      err = 0
-      hadv4On = .false.
-
-      if (config_horiz_tracer_adv_order == 4) then
-          hadv4On = .true.
-      end if
-
-   !--------------------------------------------------------------------
-
-   end subroutine ocn_tracer_hadv4_init!}}}
-
-!***********************************************************************
-
-end module ocn_tracer_hadv4
-
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-! vim: foldmethod=marker

Deleted: branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_vadv.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_vadv.F        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_vadv.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -1,187 +0,0 @@
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-!
-!  ocn_tracer_vadv
-!
-!&gt; \brief MPAS ocean vertical tracer advection driver
-!&gt; \author Doug Jacobsen
-!&gt; \date   16 September 2011
-!&gt; \version SVN:$Id:$
-!&gt; \details
-!&gt;  This module contains the main driver routine for computing 
-!&gt;  vertical advection tendencies.  
-!
-!-----------------------------------------------------------------------
-
-module ocn_tracer_vadv
-
-   use mpas_grid_types
-   use mpas_configure
-
-   use ocn_tracer_vadv_stencil
-   use ocn_tracer_vadv_spline
-
-   implicit none
-   private
-   save
-
-   !--------------------------------------------------------------------
-   !
-   ! Public parameters
-   !
-   !--------------------------------------------------------------------
-
-   !--------------------------------------------------------------------
-   !
-   ! Public member functions
-   !
-   !--------------------------------------------------------------------
-
-   public :: ocn_tracer_vadv_tend, &amp;
-             ocn_tracer_vadv_init
-
-   !--------------------------------------------------------------------
-   !
-   ! Private module variables
-   !
-   !--------------------------------------------------------------------
-
-   logical :: vadvOn
-
-
-!***********************************************************************
-
-contains
-
-!***********************************************************************
-!
-!  routine ocn_tracer_vadv_tend
-!
-!&gt; \brief   Computes tendency term for vertical tracer advection
-!&gt; \author  Phil Jones, Doug Jacobsen
-!&gt; \date    15 September 2011
-!&gt; \version SVN:$Id$
-!&gt; \details 
-!&gt;  This routine computes the vertical advection tendency for tracer
-!&gt;  based on current state and user choices of advection parameterization.
-!&gt;  Multiple parameterizations may be chosen and added together.  These
-!&gt;  tendencies are generally computed by calling the specific routine
-!&gt;  for the chosen parameterization, so this routine is primarily a
-!&gt;  driver for managing these choices.
-!
-!-----------------------------------------------------------------------
-
-   subroutine ocn_tracer_vadv_tend(grid, h, wTop, tracers, tend, err)!{{{
-
-      !-----------------------------------------------------------------
-      !
-      ! input variables
-      !
-      !-----------------------------------------------------------------
-
-      real (kind=RKIND), dimension(:,:), intent(in) :: &amp;
-         h, &amp;    !&lt; Input: layer thickness
-         wTop    !&lt; Input: vertical tracer in top layer
-
-      real (kind=RKIND), dimension(:,:,:), intent(in) :: &amp;
-         tracers     !&lt; Input: tracers
-
-      type (mesh_type), intent(in) :: &amp;
-         grid          !&lt; Input: grid information
-
-      !-----------------------------------------------------------------
-      !
-      ! input/output variables
-      !
-      !-----------------------------------------------------------------
-
-      real (kind=RKIND), dimension(:,:,:), intent(inout) :: &amp;
-         tend          !&lt; Input/Output: tracer tendency
-
-      !-----------------------------------------------------------------
-      !
-      ! output variables
-      !
-      !-----------------------------------------------------------------
-
-      integer, intent(out) :: err !&lt; Output: error flag
-
-      !-----------------------------------------------------------------
-      !
-      ! local variables
-      !
-      !-----------------------------------------------------------------
-
-      integer :: err1, err2
-
-      !-----------------------------------------------------------------
-      !
-      ! call relevant routines for computing tendencies
-      ! note that the user can choose multiple options and the 
-      !   tendencies will be added together
-      !
-      !-----------------------------------------------------------------
-
-      err = 0
-
-      if(.not.vadvOn) return
-
-      call ocn_tracer_vadv_stencil_tend(grid, h, wTop, tracers, tend, err1)
-      call ocn_tracer_vadv_spline_tend(grid, h, wTop, tracers, tend, err2)
-
-      err = ior(err1, err2)
-
-   !--------------------------------------------------------------------
-
-   end subroutine ocn_tracer_vadv_tend!}}}
-
-!***********************************************************************
-!
-!  routine ocn_tracer_vadv_init
-!
-!&gt; \brief   Initializes ocean tracer vertical advection quantities
-!&gt; \author  Phil Jones, Doug Jacobsen
-!&gt; \date    15 September 2011
-!&gt; \version SVN:$Id$
-!&gt; \details 
-!&gt;  This routine initializes a variety of quantities related to 
-!&gt;  vertical tracer advection in the ocean. Since a variety of 
-!&gt;  parameterizations are available, this routine primarily calls the
-!&gt;  individual init routines for each parameterization. 
-!
-!-----------------------------------------------------------------------
-
-   subroutine ocn_tracer_vadv_init(err)!{{{
-
-   !--------------------------------------------------------------------
-
-      !-----------------------------------------------------------------
-      !
-      ! call individual init routines for each parameterization
-      !
-      !-----------------------------------------------------------------
-
-      integer, intent(out) :: err !&lt; Output: error flag
-
-      integer :: err1, err2
-
-      err = 0
-      vadvOn = .false.
-
-      if (config_vert_coord_movement.ne.'isopycnal') then
-          vadvOn = .true.
-          call ocn_tracer_vadv_stencil_init(err1)
-          call ocn_tracer_vadv_spline_init(err2)
-
-          err = ior(err1, err2)
-      endif
-
-   !--------------------------------------------------------------------
-
-   end subroutine ocn_tracer_vadv_init!}}}
-
-!***********************************************************************
-
-end module ocn_tracer_vadv
-
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-! vim: foldmethod=marker

Deleted: branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_vadv_spline.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_vadv_spline.F        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_vadv_spline.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -1,196 +0,0 @@
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-!
-!  ocn_tracer_vadv_spline
-!
-!&gt; \brief MPAS ocean vertical tracer advection driver
-!&gt; \author Doug Jacobsen
-!&gt; \date   16 September 2011
-!&gt; \version SVN:$Id:$
-!&gt; \details
-!&gt;  This module contains the main driver routine for computing 
-!&gt;  vertical advection tendencies.  
-!
-!-----------------------------------------------------------------------
-
-module ocn_tracer_vadv_spline
-
-   use mpas_grid_types
-   use mpas_configure
-   use mpas_timer
-
-   use ocn_tracer_vadv_spline2
-   use ocn_tracer_vadv_spline3
-
-   implicit none
-   private
-   save
-
-   !--------------------------------------------------------------------
-   !
-   ! Public parameters
-   !
-   !--------------------------------------------------------------------
-
-   !--------------------------------------------------------------------
-   !
-   ! Public member functions
-   !
-   !--------------------------------------------------------------------
-
-   public :: ocn_tracer_vadv_spline_tend, &amp;
-             ocn_tracer_vadv_spline_init
-
-   !--------------------------------------------------------------------
-   !
-   ! Private module variables
-   !
-   !--------------------------------------------------------------------
-
-   type (timer_node), pointer :: spline2_timer, spline3_timer
-   logical :: splineOn
-
-
-!***********************************************************************
-
-contains
-
-!***********************************************************************
-!
-!  routine ocn_tracer_vadv_spline_tend
-!
-!&gt; \brief   Computes tendency term for vertical tracer advection
-!&gt; \author  Doug Jacobsen
-!&gt; \date    16 September 2011
-!&gt; \version SVN:$Id$
-!&gt; \details 
-!&gt;  This routine computes the vertical advection tendency for tracer
-!&gt;  based on current state and user choices of advection parameterization.
-!&gt;  Multiple parameterizations may be chosen and added together.  These
-!&gt;  tendencies are generally computed by calling the specific routine
-!&gt;  for the chosen parameterization, so this routine is primarily a
-!&gt;  driver for managing these choices.
-!
-!-----------------------------------------------------------------------
-
-   subroutine ocn_tracer_vadv_spline_tend(grid, h, wTop, tracers, tend, err)!{{{
-
-      !-----------------------------------------------------------------
-      !
-      ! input variables
-      !
-      !-----------------------------------------------------------------
-
-      real (kind=RKIND), dimension(:,:), intent(in) :: &amp;
-         h, &amp;    !&lt; Input: layer thickness
-         wTop    !&lt; Input: vertical tracer in top layer
-
-      real (kind=RKIND), dimension(:,:,:), intent(in) :: &amp;
-         tracers     !&lt; Input: tracers
-
-      type (mesh_type), intent(in) :: &amp;
-         grid          !&lt; Input: grid information
-
-      !-----------------------------------------------------------------
-      !
-      ! input/output variables
-      !
-      !-----------------------------------------------------------------
-
-      real (kind=RKIND), dimension(:,:,:), intent(inout) :: &amp;
-         tend          !&lt; Input/Output: tracer tendency
-
-      !-----------------------------------------------------------------
-      !
-      ! output variables
-      !
-      !-----------------------------------------------------------------
-
-      integer, intent(out) :: err !&lt; Output: error flag
-
-      !-----------------------------------------------------------------
-      !
-      ! local variables
-      !
-      !-----------------------------------------------------------------
-
-      integer :: err1, err2
-
-      !-----------------------------------------------------------------
-      !
-      ! call relevant routines for computing tendencies
-      ! note that the user can choose multiple options and the 
-      !   tendencies will be added together
-      !
-      !-----------------------------------------------------------------
-
-      err = 0
-
-      if(.not.splineOn) return
-
-      call mpas_timer_start(&quot;spline 2&quot;, .false., spline2_timer)
-      call ocn_tracer_vadv_spline2_tend(grid, h, wTop, tracers, tend, err1)
-      call mpas_timer_stop(&quot;spline 2&quot;, spline2_timer)
-
-      call mpas_timer_start(&quot;spline 3&quot;, .false., spline3_timer)
-      call ocn_tracer_vadv_spline3_tend(grid, h, wTop, tracers, tend, err2)
-      call mpas_timer_stop(&quot;spline 3&quot;, spline3_timer)
-
-      err = ior(err1, err2)
-
-   !--------------------------------------------------------------------
-
-   end subroutine ocn_tracer_vadv_spline_tend!}}}
-
-!***********************************************************************
-!
-!  routine ocn_tracer_vadv_spline_init
-!
-!&gt; \brief   Initializes ocean tracer vertical advection quantities
-!&gt; \author  Doug Jacobsen
-!&gt; \date    16 September 2011
-!&gt; \version SVN:$Id$
-!&gt; \details 
-!&gt;  This routine initializes a variety of quantities related to 
-!&gt;  vertical tracer advection in the ocean. Since a variety of 
-!&gt;  parameterizations are available, this routine primarily calls the
-!&gt;  individual init routines for each parameterization. 
-!
-!-----------------------------------------------------------------------
-
-   subroutine ocn_tracer_vadv_spline_init(err)!{{{
-
-   !--------------------------------------------------------------------
-
-      !-----------------------------------------------------------------
-      !
-      ! call individual init routines for each parameterization
-      !
-      !-----------------------------------------------------------------
-
-      integer, intent(out) :: err !&lt; Output: error flag
-
-      integer :: err1, err2
-
-      err = 0
-
-      splineOn = .false.
-
-      if(config_vert_tracer_adv.eq.'spline') then
-         splineOn = .true.
-
-         call ocn_tracer_vadv_spline2_init(err1)
-         call ocn_tracer_vadv_spline3_init(err2)
-
-         err = ior(err1, err2)
-      endif
-
-   !--------------------------------------------------------------------
-
-   end subroutine ocn_tracer_vadv_spline_init!}}}
-
-!***********************************************************************
-
-end module ocn_tracer_vadv_spline
-
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-! vim: foldmethod=marker

Deleted: branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_vadv_spline2.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_vadv_spline2.F        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_vadv_spline2.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -1,208 +0,0 @@
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-!
-!  ocn_tracer_vadv_spline2
-!
-!&gt; \brief MPAS ocean vertical tracer advection driver
-!&gt; \author Doug Jacobsen
-!&gt; \date   16 September 2011
-!&gt; \version SVN:$Id:$
-!&gt; \details
-!&gt;  This module contains the main driver routine for computing 
-!&gt;  vertical advection tendencies.  
-!
-!-----------------------------------------------------------------------
-
-module ocn_tracer_vadv_spline2
-
-   use mpas_grid_types
-   use mpas_configure
-
-   implicit none
-   private
-   save
-
-   !--------------------------------------------------------------------
-   !
-   ! Public parameters
-   !
-   !--------------------------------------------------------------------
-
-   !--------------------------------------------------------------------
-   !
-   ! Public member functions
-   !
-   !--------------------------------------------------------------------
-
-   public :: ocn_tracer_vadv_spline2_tend, &amp;
-             ocn_tracer_vadv_spline2_init
-
-   !--------------------------------------------------------------------
-   !
-   ! Private module variables
-   !
-   !--------------------------------------------------------------------
-
-   logical :: spline2On
-
-
-!***********************************************************************
-
-contains
-
-!***********************************************************************
-!
-!  routine ocn_tracer_vadv_spline2_tend
-!
-!&gt; \brief   Computes tendency term for vertical tracer advection 2nd order spline
-!&gt; \author  Doug Jacobsen
-!&gt; \date    16 September 2011
-!&gt; \version SVN:$Id$
-!&gt; \details 
-!&gt;  This routine computes the vertical advection tendency for tracer
-!&gt;  based on current state using a 2nd order spline.
-!
-!-----------------------------------------------------------------------
-
-   subroutine ocn_tracer_vadv_spline2_tend(grid, layerThickness, wTop, tracers, tend, err)!{{{
-
-      !-----------------------------------------------------------------
-      !
-      ! input variables
-      !
-      !-----------------------------------------------------------------
-
-      real (kind=RKIND), dimension(:,:), intent(in) :: &amp;
-         layerThickness, &amp;    !&lt; Input: layer thickness
-         wTop    !&lt; Input: vertical tracer in top layer
-
-      real (kind=RKIND), dimension(:,:,:), intent(in) :: &amp;
-         tracers     !&lt; Input: tracers
-
-      type (mesh_type), intent(in) :: &amp;
-         grid          !&lt; Input: grid information
-
-      !-----------------------------------------------------------------
-      !
-      ! input/output variables
-      !
-      !-----------------------------------------------------------------
-
-      real (kind=RKIND), dimension(:,:,:), intent(inout) :: &amp;
-         tend          !&lt; Input/Output: tracer tendency
-
-      !-----------------------------------------------------------------
-      !
-      ! output variables
-      !
-      !-----------------------------------------------------------------
-
-      integer, intent(out) :: err !&lt; Output: error flag
-
-      !-----------------------------------------------------------------
-      !
-      ! local variables
-      !
-      !-----------------------------------------------------------------
-
-      integer :: iCell, nCells, nCellsSolve, k, iTracer, num_tracers, nVertLevels
-
-      integer, dimension(:), pointer :: maxLevelCell
-
-      real (kind=RKIND), dimension(:,:,:), allocatable :: tracerTop
-
-      !-----------------------------------------------------------------
-      !
-      ! call relevant routines for computing tendencies
-      ! note that the user can choose multiple options and the 
-      !   tendencies will be added together
-      !
-      !-----------------------------------------------------------------
-
-      err = 0
-
-      if(.not.spline2On) return
-      ! Compute tracerTop using linear interpolation.
-
-      nCells = grid % nCells
-      nCellsSolve = grid % nCellsSolve
-      nVertLevels = grid % nVertLevels
-      num_tracers = size(tracers, 1)
-      maxLevelCell =&gt; grid % maxLevelCell % array
-
-      allocate(tracerTop(num_tracers,nVertLevels+1,nCells))
-
-      do iCell=1,nCellsSolve 
-         tracerTop(:,1,iCell) = tracers(:,1,iCell) 
-         do k=2,maxLevelCell(iCell)
-            do iTracer=1,num_tracers
-               ! Note layerThickness on the k side is multiplied by tracer at k-1
-               ! and layerThickness on the Km1 (k-1) side is mult. by tracer at k.
-               tracerTop(iTracer,k,iCell) = &amp;
-                  (  layerThickness(k  ,iCell)*tracers(iTracer,k-1,iCell) &amp;
-                   + layerThickness(k-1,iCell)*tracers(iTracer,k  ,iCell) ) &amp;
-                  / (layerThickness(k-1,iCell) + layerThickness(k,iCell))   
-            end do
-         end do
-         tracerTop(:,maxLevelCell(iCell)+1,iCell) = tracers(:,maxLevelCell(iCell),iCell)
-      end do
-
-      do iCell=1,nCellsSolve 
-         do k=1,maxLevelCell(iCell)  
-            do iTracer=1,num_tracers
-               tend(iTracer,k,iCell) = tend(iTracer,k,iCell) &amp;
-                  - (   wTop(k  ,iCell)*tracerTop(iTracer,k  ,iCell) &amp;
-                      - wTop(k+1,iCell)*tracerTop(iTracer,k+1,iCell))
-            end do
-         end do
-      end do
-
-      deallocate(tracerTop)
-   !--------------------------------------------------------------------
-
-   end subroutine ocn_tracer_vadv_spline2_tend!}}}
-
-!***********************************************************************
-!
-!  routine ocn_tracer_vadv_spline2_init
-!
-!&gt; \brief   Initializes ocean tracer vertical advection quantities
-!&gt; \author  Doug Jacobsen
-!&gt; \date    16 September 2011
-!&gt; \version SVN:$Id$
-!&gt; \details 
-!&gt;  This routine initializes a variety of quantities related to 
-!&gt;  2nd order spline based vertical tracer advection in the ocean.
-!
-!-----------------------------------------------------------------------
-
-   subroutine ocn_tracer_vadv_spline2_init(err)!{{{
-
-   !--------------------------------------------------------------------
-
-      !-----------------------------------------------------------------
-      !
-      ! call individual init routines for each parameterization
-      !
-      !-----------------------------------------------------------------
-
-      integer, intent(out) :: err !&lt; Output: error flag
-
-      err = 0
-
-      spline2On = .false.
-
-      if(config_vert_tracer_adv_order.eq.2) then
-        spline2On = .true.
-      endif
-
-
-   !--------------------------------------------------------------------
-
-   end subroutine ocn_tracer_vadv_spline2_init!}}}
-
-!***********************************************************************
-
-end module ocn_tracer_vadv_spline2
-
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-! vim: foldmethod=marker

Deleted: branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_vadv_spline3.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_vadv_spline3.F        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_vadv_spline3.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -1,233 +0,0 @@
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-!
-!  ocn_tracer_vadv_spline3
-!
-!&gt; \brief MPAS ocean vertical tracer advection driver
-!&gt; \author Doug Jacobsen
-!&gt; \date   16 September 2011
-!&gt; \version SVN:$Id:$
-!&gt; \details
-!&gt;  This module contains the main driver routine for computing 
-!&gt;  vertical advection tendencies.  
-!
-!-----------------------------------------------------------------------
-
-module ocn_tracer_vadv_spline3
-
-   use mpas_grid_types
-   use mpas_configure
-   use mpas_spline_interpolation
-
-   implicit none
-   private
-   save
-
-   !--------------------------------------------------------------------
-   !
-   ! Public parameters
-   !
-   !--------------------------------------------------------------------
-
-   !--------------------------------------------------------------------
-   !
-   ! Public member functions
-   !
-   !--------------------------------------------------------------------
-
-   public :: ocn_tracer_vadv_spline3_tend, &amp;
-             ocn_tracer_vadv_spline3_init
-
-   !--------------------------------------------------------------------
-   !
-   ! Private module variables
-   !
-   !--------------------------------------------------------------------
-
-   logical :: spline3On
-
-
-!***********************************************************************
-
-contains
-
-!***********************************************************************
-!
-!  routine ocn_tracer_vadv_spline3_tend
-!
-!&gt; \brief   Computes tendency term for vertical tracer advection 3rd order spline
-!&gt; \author  Doug Jacobsen
-!&gt; \date    16 September 2011
-!&gt; \version SVN:$Id$
-!&gt; \details 
-!&gt;  This routine computes the vertical advection tendency for tracer
-!&gt;  based on current state using a 3rd order spline.
-!
-!-----------------------------------------------------------------------
-
-   subroutine ocn_tracer_vadv_spline3_tend(grid, layerThickness, wTop, tracers, tend, err)!{{{
-
-      !-----------------------------------------------------------------
-      !
-      ! input variables
-      !
-      !-----------------------------------------------------------------
-
-      real (kind=RKIND), dimension(:,:), intent(in) :: &amp;
-         layerThickness, &amp;    !&lt; Input: layer thickness
-         wTop    !&lt; Input: vertical tracer in top layer
-
-      real (kind=RKIND), dimension(:,:,:), intent(in) :: &amp;
-         tracers     !&lt; Input: tracers
-
-      type (mesh_type), intent(in) :: &amp;
-         grid          !&lt; Input: grid information
-
-      !-----------------------------------------------------------------
-      !
-      ! input/output variables
-      !
-      !-----------------------------------------------------------------
-
-      real (kind=RKIND), dimension(:,:,:), intent(inout) :: &amp;
-         tend          !&lt; Input/Output: tracer tendency
-
-      !-----------------------------------------------------------------
-      !
-      ! output variables
-      !
-      !-----------------------------------------------------------------
-
-      integer, intent(out) :: err !&lt; Output: error flag
-
-      !-----------------------------------------------------------------
-      !
-      ! local variables
-      !
-      !-----------------------------------------------------------------
-
-      integer :: iCell, nCells, nCellsSolve, k, iTracer, num_tracers, nVertLevels
-
-      integer, dimension(:), pointer :: maxLevelCell
-
-      real (kind=RKIND), dimension(:), allocatable :: tracer2ndDer,  &amp;
-            tracersIn, tracersOut, depthTop, depthMid
-      real (kind=RKIND), dimension(:,:,:), allocatable :: tracerTop
-
-      !-----------------------------------------------------------------
-      !
-      ! call relevant routines for computing tendencies
-      ! note that the user can choose multiple options and the 
-      !   tendencies will be added together
-      !
-      !-----------------------------------------------------------------
-
-      err = 0
-
-      if(.not.spline3On) return
-      ! Compute tracerTop using linear interpolation.
-
-      nCells = grid % nCells
-      nCellsSolve = grid % nCellsSolve
-      nVertLevels = grid % nVertLevels
-      num_tracers = size(tracers, 1)
-      maxLevelCell =&gt; grid % maxLevelCell % array
-
-      allocate(tracerTop(num_tracers,nVertLevels+1,nCells))
-
-      ! Compute tracerTop using cubic spline interpolation.
-
-      allocate(tracer2ndDer(nVertLevels))
-      allocate(tracersIn(nVertLevels),tracersOut(nVertLevels), &amp;
-            depthMid(nVertLevels), depthTop(nVertLevels+1))
-
-      do iCell=1,nCellsSolve 
-
-         ! Here depth considers SSH to be depth=0.  We don't need to 
-         ! have true z-coordinate depths because it is just for interpolation.
-         depthTop(1) = 0.0
-         do k=1,maxLevelCell(iCell)
-            depthMid(k  ) = depthTop(k) + 0.5*layerThickness(k,iCell)
-            depthTop(k+1) = depthTop(k) +     layerThickness(k,iCell)
-         enddo
-
-         do iTracer=1,num_tracers
-
-            ! Place data in arrays to avoid creating new temporary arrays for every 
-            ! subroutine call.  
-            tracersIn(1:maxLevelCell(iCell))=tracers(iTracer,1:maxLevelCell(iCell),iCell)
-
-            call mpas_cubic_spline_coefficients(depthMid, &amp;
-               tracersIn, maxLevelCell(iCell), tracer2ndDer)
-
-            call mpas_interpolate_cubic_spline( &amp;
-               depthMid, tracersIn, tracer2ndDer, maxLevelCell(iCell), &amp;
-               depthTop(2:maxLevelCell(iCell)), tracersOut, maxLevelCell(iCell)-1 )
-
-            tracerTop(itracer,1,iCell) = tracers(iTracer,1,iCell)
-            tracerTop(iTracer,2:maxLevelCell(iCell),iCell) = tracersOut(1:maxLevelCell(iCell)-1)
-            tracerTop(itracer,maxLevelCell(iCell)+1,iCell) = tracers(iTracer,maxLevelCell(iCell),iCell)
-         end do
-      end do
-
-      do iCell=1,nCellsSolve 
-         do k=1,maxLevelCell(iCell)  
-            do iTracer=1,num_tracers
-               tend(iTracer,k,iCell) = tend(iTracer,k,iCell) &amp;
-                  - (   wTop(k  ,iCell)*tracerTop(iTracer,k  ,iCell) &amp;
-                      - wTop(k+1,iCell)*tracerTop(iTracer,k+1,iCell))
-            end do
-         end do
-      end do
-
-      deallocate(tracer2ndDer)
-      deallocate(tracersIn,tracersOut, depthMid, depthTop)
-      deallocate(tracerTop)
-   !--------------------------------------------------------------------
-
-   end subroutine ocn_tracer_vadv_spline3_tend!}}}
-
-!***********************************************************************
-!
-!  routine ocn_tracer_vadv_spline3_init
-!
-!&gt; \brief   Initializes ocean tracer vertical advection quantities
-!&gt; \author  Doug Jacobsen
-!&gt; \date    16 September 2011
-!&gt; \version SVN:$Id$
-!&gt; \details 
-!&gt;  This routine initializes a variety of quantities related to 
-!&gt;  3rd order spline based vertical tracer advection in the ocean.
-!
-!-----------------------------------------------------------------------
-
-   subroutine ocn_tracer_vadv_spline3_init(err)!{{{
-
-   !--------------------------------------------------------------------
-
-      !-----------------------------------------------------------------
-      !
-      ! call individual init routines for each parameterization
-      !
-      !-----------------------------------------------------------------
-
-      integer, intent(out) :: err !&lt; Output: error flag
-
-      err = 0
-
-      spline3On = .false.
-
-      if(config_vert_tracer_adv_order.eq.3) then
-        spline3On = .true.
-      endif
-
-
-   !--------------------------------------------------------------------
-
-   end subroutine ocn_tracer_vadv_spline3_init!}}}
-
-!***********************************************************************
-
-end module ocn_tracer_vadv_spline3
-
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-! vim: foldmethod=marker

Deleted: branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_vadv_stencil.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_vadv_stencil.F        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_vadv_stencil.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -1,201 +0,0 @@
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-!
-!  ocn_tracer_vadv_stencil
-!
-!&gt; \brief MPAS ocean vertical tracer advection driver
-!&gt; \author Doug Jacobsen
-!&gt; \date   16 September 2011
-!&gt; \version SVN:$Id:$
-!&gt; \details
-!&gt;  This module contains the main driver routine for computing 
-!&gt;  vertical advection tendencies.  
-!
-!-----------------------------------------------------------------------
-
-module ocn_tracer_vadv_stencil
-
-   use mpas_grid_types
-   use mpas_configure
-   use mpas_timer
-
-   use ocn_tracer_vadv_stencil2
-   use ocn_tracer_vadv_stencil3
-   use ocn_tracer_vadv_stencil4
-
-   implicit none
-   private
-   save
-
-   !--------------------------------------------------------------------
-   !
-   ! Public parameters
-   !
-   !--------------------------------------------------------------------
-
-   !--------------------------------------------------------------------
-   !
-   ! Public member functions
-   !
-   !--------------------------------------------------------------------
-
-   public :: ocn_tracer_vadv_stencil_tend, &amp;
-             ocn_tracer_vadv_stencil_init
-
-   !--------------------------------------------------------------------
-   !
-   ! Private module variables
-   !
-   !--------------------------------------------------------------------
-
-   type (timer_node), pointer :: stencil2_timer, stencil3_timer, stencil4_timer
-
-   logical :: stencilOn
-
-
-!***********************************************************************
-
-contains
-
-!***********************************************************************
-!
-!  routine ocn_tracer_vadv_stencil_tend
-!
-!&gt; \brief   Computes tendency term for vertical tracer advection
-!&gt; \author  Phil Jones, Doug Jacobsen
-!&gt; \date    15 September 2011
-!&gt; \version SVN:$Id$
-!&gt; \details 
-!&gt;  This routine computes the vertical advection tendency for tracers
-!&gt;  based on current state and user choices of stencil based advection parameterization.
-!&gt;  Multiple parameterizations may be chosen and added together.  These
-!&gt;  tendencies are generally computed by calling the specific routine
-!&gt;  for the chosen parameterization, so this routine is primarily a
-!&gt;  driver for managing these choices.
-!
-!-----------------------------------------------------------------------
-
-   subroutine ocn_tracer_vadv_stencil_tend(grid, h, wTop, tracers, tend, err)!{{{
-
-      !-----------------------------------------------------------------
-      !
-      ! input variables
-      !
-      !-----------------------------------------------------------------
-
-      real (kind=RKIND), dimension(:,:), intent(in) :: &amp;
-         h, &amp;    !&lt; Input: layer thickness
-         wTop    !&lt; Input: vertical tracer in top layer
-
-      real (kind=RKIND), dimension(:,:,:), intent(in) :: &amp;
-         tracers     !&lt; Input: tracers
-
-      type (mesh_type), intent(in) :: &amp;
-         grid          !&lt; Input: grid information
-
-      !-----------------------------------------------------------------
-      !
-      ! input/output variables
-      !
-      !-----------------------------------------------------------------
-
-      real (kind=RKIND), dimension(:,:,:), intent(inout) :: &amp;
-         tend          !&lt; Input/Output: tracer tendency
-
-      !-----------------------------------------------------------------
-      !
-      ! output variables
-      !
-      !-----------------------------------------------------------------
-
-      integer, intent(out) :: err !&lt; Output: error flag
-
-      !-----------------------------------------------------------------
-      !
-      ! local variables
-      !
-      !-----------------------------------------------------------------
-
-      integer :: err1, err2, err3
-
-      !-----------------------------------------------------------------
-      !
-      ! call relevant routines for computing tendencies
-      ! note that the user can choose multiple options and the 
-      !   tendencies will be added together
-      !
-      !-----------------------------------------------------------------
-
-      err = 0
-
-      if(.not. stencilOn) return
-
-      call mpas_timer_start(&quot;stencil 2&quot;, .false., stencil2_timer)
-      call ocn_tracer_vadv_stencil2_tend(grid, wTop, tracers, tend, err1)
-      call mpas_timer_stop(&quot;stencil 2&quot;, stencil2_timer)
-      call mpas_timer_start(&quot;stencil 3&quot;, .false., stencil3_timer)
-      call ocn_tracer_vadv_stencil3_tend(grid, h, wTop, tracers, tend, err2)
-      call mpas_timer_stop(&quot;stencil 3&quot;, stencil3_timer)
-      call mpas_timer_start(&quot;stencil 4&quot;, .false., stencil4_timer)
-      call ocn_tracer_vadv_stencil4_tend(grid, h, wTop, tracers, tend, err3)
-      call mpas_timer_stop(&quot;stencil 4&quot;, stencil4_timer)
-
-      err = ior(err1, ior(err2, err3))
-
-   !--------------------------------------------------------------------
-
-   end subroutine ocn_tracer_vadv_stencil_tend!}}}
-
-!***********************************************************************
-!
-!  routine ocn_tracer_vadv_stencil_init
-!
-!&gt; \brief   Initializes ocean tracer vertical advection quantities
-!&gt; \author  Phil Jones, Doug Jacobsen
-!&gt; \date    15 September 2011
-!&gt; \version SVN:$Id$
-!&gt; \details 
-!&gt;  This routine initializes a variety of quantities related to 
-!&gt;  stencil based vertical tracer advection in the ocean. Since a variety of 
-!&gt;  parameterizations are available, this routine primarily calls the
-!&gt;  individual init routines for each parameterization. 
-!
-!-----------------------------------------------------------------------
-
-   subroutine ocn_tracer_vadv_stencil_init(err)!{{{
-
-   !--------------------------------------------------------------------
-
-      !-----------------------------------------------------------------
-      !
-      ! call individual init routines for each parameterization
-      !
-      !-----------------------------------------------------------------
-
-      integer, intent(out) :: err !&lt; Output: error flag
-
-      integer :: err1, err2, err3
-
-      err = 0
-
-      stencilOn = .false.
-
-      if (config_vert_tracer_adv.eq.'stencil') then
-         stencilOn = .true.
-
-         call ocn_tracer_vadv_stencil2_init(err1)
-         call ocn_tracer_vadv_stencil3_init(err2)
-         call ocn_tracer_vadv_stencil4_init(err3)
-
-         err = ior(err1, ior(err2, err3))
-      endif
-
-   !--------------------------------------------------------------------
-
-   end subroutine ocn_tracer_vadv_stencil_init!}}}
-
-!***********************************************************************
-
-end module ocn_tracer_vadv_stencil
-
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-! vim: foldmethod=marker

Deleted: branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_vadv_stencil2.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_vadv_stencil2.F        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_vadv_stencil2.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -1,208 +0,0 @@
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-!
-!  ocn_tracer_vadv_stencil2
-!
-!&gt; \brief MPAS ocean vertical tracer advection driver
-!&gt; \author Doug Jacobsen
-!&gt; \date   16 September 2011
-!&gt; \version SVN:$Id:$
-!&gt; \details
-!&gt;  This module contains the main driver routine for computing 
-!&gt;  vertical advection tendencies.  
-!
-!-----------------------------------------------------------------------
-
-module ocn_tracer_vadv_stencil2
-
-   use mpas_grid_types
-   use mpas_configure
-
-   implicit none
-   private
-   save
-
-   !--------------------------------------------------------------------
-   !
-   ! Public parameters
-   !
-   !--------------------------------------------------------------------
-
-   !--------------------------------------------------------------------
-   !
-   ! Public member functions
-   !
-   !--------------------------------------------------------------------
-
-   public :: ocn_tracer_vadv_stencil2_tend, &amp;
-             ocn_tracer_vadv_stencil2_init
-
-   !--------------------------------------------------------------------
-   !
-   ! Private module variables
-   !
-   !--------------------------------------------------------------------
-
-   logical :: stencil2On
-
-
-!***********************************************************************
-
-contains
-
-!***********************************************************************
-!
-!  routine ocn_tracer_vadv_stencil2_tend
-!
-!&gt; \brief   Computes tendency term for vertical tracer advection 2nd order stencil
-!&gt; \author  Phil Jones, Doug Jacobsen
-!&gt; \date    15 September 2011
-!&gt; \version SVN:$Id$
-!&gt; \details 
-!&gt;  This routine computes the vertical advection tendency for tracer
-!&gt;  based on current state using a 2nd order stencil.
-!
-!-----------------------------------------------------------------------
-
-   subroutine ocn_tracer_vadv_stencil2_tend(grid, wTop, tracers, tend, err)!{{{
-
-      !-----------------------------------------------------------------
-      !
-      ! input variables
-      !
-      !-----------------------------------------------------------------
-
-      real (kind=RKIND), dimension(:,:), intent(in) :: &amp;
-         wTop    !&lt; Input: vertical tracer in top layer
-
-      real (kind=RKIND), dimension(:,:,:), intent(in) :: &amp;
-         tracers     !&lt; Input: tracers
-
-      type (mesh_type), intent(in) :: &amp;
-         grid          !&lt; Input: grid information
-
-      !-----------------------------------------------------------------
-      !
-      ! input/output variables
-      !
-      !-----------------------------------------------------------------
-
-      real (kind=RKIND), dimension(:,:,:), intent(inout) :: &amp;
-         tend          !&lt; Input/Output: tracer tendency
-
-      !-----------------------------------------------------------------
-      !
-      ! output variables
-      !
-      !-----------------------------------------------------------------
-
-      integer, intent(out) :: err !&lt; Output: error flag
-
-      !-----------------------------------------------------------------
-      !
-      ! local variables
-      !
-      !-----------------------------------------------------------------
-
-      integer :: nCellsSolve, iCell, k, iTracer, num_tracers, nVertLevels
-      integer :: nCells
-
-      integer, dimension(:), pointer :: maxLevelCell
-
-      real (kind=RKIND), dimension(:,:,:), allocatable :: tracerTop
-
-
-      !-----------------------------------------------------------------
-      !
-      ! call relevant routines for computing tendencies
-      ! note that the user can choose multiple options and the 
-      !   tendencies will be added together
-      !
-      !-----------------------------------------------------------------
-
-      err = 0
-
-      if(.not.stencil2On) return
-
-      nCells = grid % nCells
-      nCellsSolve = grid % nCellsSolve
-      num_tracers = size(tracers, 1)
-      nVertLevels = grid % nVertLevels
-      maxLevelCell =&gt; grid % maxLevelCell % array
-
-      allocate(tracerTop(num_tracers,nVertLevels+1,nCells))
-
-      ! Compute tracerTop using centered stencil, a simple average.
-
-      do iCell=1,nCellsSolve 
-         tracerTop(:,1,iCell) = tracers(:,1,iCell)
-         do k=2,maxLevelCell(iCell)
-            do iTracer=1,num_tracers
-               tracerTop(iTracer,k,iCell) = &amp;
-                  ( tracers(iTracer,k-1,iCell) &amp;
-                   +tracers(iTracer,k  ,iCell))/2.0
-            end do
-         end do
-        tracerTop(:,maxLevelCell(iCell)+1,iCell) = tracers(:,maxLevelCell(iCell),iCell)
-      end do
-
-      do iCell=1,nCellsSolve 
-         do k=1,maxLevelCell(iCell)  
-            do iTracer=1,num_tracers
-               tend(iTracer,k,iCell) = tend(iTracer,k,iCell) &amp;
-                  - (   wTop(k  ,iCell)*tracerTop(iTracer,k  ,iCell) &amp;
-                      - wTop(k+1,iCell)*tracerTop(iTracer,k+1,iCell))
-            end do
-         end do
-      end do
-
-      deallocate(tracerTop)
-   !--------------------------------------------------------------------
-
-   end subroutine ocn_tracer_vadv_stencil2_tend!}}}
-
-!***********************************************************************
-!
-!  routine ocn_tracer_vadv_stencil2_init
-!
-!&gt; \brief   Initializes ocean tracer vertical advection quantities
-!&gt; \author  Phil Jones, Doug Jacobsen
-!&gt; \date    15 September 2011
-!&gt; \version SVN:$Id$
-!&gt; \details 
-!&gt;  This routine initializes a variety of quantities related to 
-!&gt;  a 2nd order stencil based vertical tracer advection in the ocean.
-!
-!-----------------------------------------------------------------------
-
-   subroutine ocn_tracer_vadv_stencil2_init(err)!{{{
-
-   !--------------------------------------------------------------------
-
-      !-----------------------------------------------------------------
-      !
-      ! call individual init routines for each parameterization
-      !
-      !-----------------------------------------------------------------
-
-      integer, intent(out) :: err !&lt; Output: error flag
-
-      integer :: err1, err2, err3
-
-      err = 0
-      stencil2On = .false.
-
-      if(config_vert_tracer_adv_order.eq.2) then
-          stencil2On = .true.
-      endif
-
-
-   !--------------------------------------------------------------------
-
-   end subroutine ocn_tracer_vadv_stencil2_init!}}}
-
-!***********************************************************************
-
-end module ocn_tracer_vadv_stencil2
-
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-! vim: foldmethod=marker

Deleted: branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_vadv_stencil3.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_vadv_stencil3.F        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_vadv_stencil3.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -1,230 +0,0 @@
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-!
-!  ocn_tracer_vadv_stencil3
-!
-!&gt; \brief MPAS ocean vertical tracer advection driver
-!&gt; \author Doug Jacobsen
-!&gt; \date   16 September 2011
-!&gt; \version SVN:$Id:$
-!&gt; \details
-!&gt;  This module contains the main driver routine for computing 
-!&gt;  vertical advection tendencies.  
-!
-!-----------------------------------------------------------------------
-
-module ocn_tracer_vadv_stencil3
-
-   use mpas_grid_types
-   use mpas_configure
-
-   implicit none
-   private
-   save
-
-   !--------------------------------------------------------------------
-   !
-   ! Public parameters
-   !
-   !--------------------------------------------------------------------
-
-   !--------------------------------------------------------------------
-   !
-   ! Public member functions
-   !
-   !--------------------------------------------------------------------
-
-   public :: ocn_tracer_vadv_stencil3_tend, &amp;
-             ocn_tracer_vadv_stencil3_init
-
-   !--------------------------------------------------------------------
-   !
-   ! Private module variables
-   !
-   !--------------------------------------------------------------------
-
-   logical :: stencil3On
-
-
-!***********************************************************************
-
-contains
-
-!***********************************************************************
-!
-!  routine ocn_tracer_vadv_stencil3_tend
-!
-!&gt; \brief   Computes tendency term for vertical tracer advection 3rd order stencil
-!&gt; \author  Phil Jones, Doug Jacobsen
-!&gt; \date    15 September 2011
-!&gt; \version SVN:$Id$
-!&gt; \details 
-!&gt;  This routine computes the vertical advection tendency for tracer
-!&gt;  based on current state using a 3rd order stencil.
-!
-!-----------------------------------------------------------------------
-
-   subroutine ocn_tracer_vadv_stencil3_tend(grid, layerThickness, wTop, tracers, tend, err)!{{{
-
-      !-----------------------------------------------------------------
-      !
-      ! input variables
-      !
-      !-----------------------------------------------------------------
-
-      real (kind=RKIND), dimension(:,:), intent(in) :: &amp;
-         layerThickness, &amp;    !&lt; Input: layer thickness
-         wTop    !&lt; Input: vertical tracer in top layer
-
-      real (kind=RKIND), dimension(:,:,:), intent(in) :: &amp;
-         tracers     !&lt; Input: tracers
-
-      type (mesh_type), intent(in) :: &amp;
-         grid          !&lt; Input: grid information
-
-      !-----------------------------------------------------------------
-      !
-      ! input/output variables
-      !
-      !-----------------------------------------------------------------
-
-      real (kind=RKIND), dimension(:,:,:), intent(inout) :: &amp;
-         tend          !&lt; Input/Output: tracer tendency
-
-      !-----------------------------------------------------------------
-      !
-      ! output variables
-      !
-      !-----------------------------------------------------------------
-
-      integer, intent(out) :: err !&lt; Output: error flag
-
-      !-----------------------------------------------------------------
-      !
-      ! local variables
-      !
-      !-----------------------------------------------------------------
-
-      integer :: nCellsSolve, iCell, k, iTracer, num_tracers, nVertLevels
-      integer :: nCells
-
-      integer, dimension(:), pointer :: maxLevelCell
-
-      real (kind=RKIND) :: cSignWTop, flux3Coef
-      real (kind=RKIND), dimension(:,:,:), allocatable :: tracerTop
-
-
-      !-----------------------------------------------------------------
-      !
-      ! call relevant routines for computing tendencies
-      ! note that the user can choose multiple options and the 
-      !   tendencies will be added together
-      !
-      !-----------------------------------------------------------------
-
-      err = 0
-
-      if(.not.stencil3On) return
-
-      nCells = grid % nCells
-      nCellsSolve = grid % nCellsSolve
-      num_tracers = size(tracers, 1)
-      nVertLevels = grid % nVertLevels
-      maxLevelCell =&gt; grid % maxLevelCell % array
-
-      allocate(tracerTop(num_tracers,nVertLevels+1,nCells))
-
-      ! Compute tracerTop using 3rd order stencil.  This is the same
-      ! as 4th order, but includes upwinding.
-
-      ! Hardwire flux3Coeff at 1.0 for now.  Could add this to the 
-      ! namelist, if desired.
-      flux3Coef = 1.0
-      do iCell=1,nCellsSolve 
-         tracerTop(:,1,iCell) = tracers(:,1,iCell)
-         k=2
-         do iTracer=1,num_tracers
-            tracerTop(iTracer,k,iCell) = &amp;
-               (  layerThickness(k,iCell)*tracers(iTracer,k-1,iCell) &amp;
-                + layerThickness(k-1,iCell)*tracers(iTracer,k  ,iCell) ) &amp;
-               / (layerThickness(k-1,iCell) + layerThickness(k,iCell))   
-         end do
-         do k=3,maxLevelCell(iCell)-1
-            cSignWTop = sign(flux3Coef,wTop(k,iCell))
-            do iTracer=1,num_tracers
-               tracerTop(iTracer,k,iCell) = &amp;
-                  ( (-1.+   cSignWTop)*tracers(iTracer,k-2,iCell) &amp;
-                   +( 7.-3.*cSignWTop)*tracers(iTracer,k-1,iCell) &amp;
-                   +( 7.+3.*cSignWTop)*tracers(iTracer,k  ,iCell) &amp;
-                   +(-1.-   cSignWTop)*tracers(iTracer,k+1,iCell) &amp;
-                  )/12.
-            end do
-         end do
-         k=maxLevelCell(iCell)
-            do iTracer=1,num_tracers
-            tracerTop(iTracer,k,iCell) = &amp;
-               (  layerThickness(k,iCell)*tracers(iTracer,k-1,iCell) &amp;
-                + layerThickness(k-1,iCell)*tracers(iTracer,k  ,iCell) ) &amp;
-               / (layerThickness(k-1,iCell) + layerThickness(k,iCell))   
-            end do
-        tracerTop(:,maxLevelCell(iCell)+1,iCell) = tracers(:,maxLevelCell(iCell),iCell)
-      end do
-
-      do iCell=1,nCellsSolve 
-         do k=1,maxLevelCell(iCell)  
-            do iTracer=1,num_tracers
-               tend(iTracer,k,iCell) = tend(iTracer,k,iCell) &amp;
-                  - (   wTop(k  ,iCell)*tracerTop(iTracer,k  ,iCell) &amp;
-                      - wTop(k+1,iCell)*tracerTop(iTracer,k+1,iCell))
-            end do
-         end do
-      end do
-
-      deallocate(tracerTop)
-   !--------------------------------------------------------------------
-
-   end subroutine ocn_tracer_vadv_stencil3_tend!}}}
-
-!***********************************************************************
-!
-!  routine ocn_tracer_vadv_stencil3_init
-!
-!&gt; \brief   Initializes ocean tracer vertical advection quantities
-!&gt; \author  Phil Jones, Doug Jacobsen
-!&gt; \date    15 September 2011
-!&gt; \version SVN:$Id$
-!&gt; \details 
-!&gt;  This routine initializes a variety of quantities related to 
-!&gt;  3rd order stencil based vertical tracer advection in the ocean. 
-!
-!-----------------------------------------------------------------------
-
-   subroutine ocn_tracer_vadv_stencil3_init(err)!{{{
-
-   !--------------------------------------------------------------------
-
-      !-----------------------------------------------------------------
-      !
-      ! call individual init routines for each parameterization
-      !
-      !-----------------------------------------------------------------
-
-      integer, intent(out) :: err !&lt; Output: error flag
-
-      err = 0
-      stencil3On = .false.
-
-      if(config_vert_tracer_adv_order.eq.3) then
-          stencil3On = .true.
-      endif
-
-
-   !--------------------------------------------------------------------
-
-   end subroutine ocn_tracer_vadv_stencil3_init!}}}
-
-!***********************************************************************
-
-end module ocn_tracer_vadv_stencil3
-
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-! vim: foldmethod=marker

Deleted: branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_vadv_stencil4.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_vadv_stencil4.F        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_tracer_vadv_stencil4.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -1,225 +0,0 @@
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-!
-!  ocn_tracer_vadv_stencil4
-!
-!&gt; \brief MPAS ocean vertical tracer advection driver
-!&gt; \author Doug Jacobsen
-!&gt; \date   16 September 2011
-!&gt; \version SVN:$Id:$
-!&gt; \details
-!&gt;  This module contains the main driver routine for computing 
-!&gt;  vertical advection tendencies.  
-!
-!-----------------------------------------------------------------------
-
-module ocn_tracer_vadv_stencil4
-
-   use mpas_grid_types
-   use mpas_configure
-
-   implicit none
-   private
-   save
-
-   !--------------------------------------------------------------------
-   !
-   ! Public parameters
-   !
-   !--------------------------------------------------------------------
-
-   !--------------------------------------------------------------------
-   !
-   ! Public member functions
-   !
-   !--------------------------------------------------------------------
-
-   public :: ocn_tracer_vadv_stencil4_tend, &amp;
-             ocn_tracer_vadv_stencil4_init
-
-   !--------------------------------------------------------------------
-   !
-   ! Private module variables
-   !
-   !--------------------------------------------------------------------
-
-   logical :: stencil4On
-
-
-!***********************************************************************
-
-contains
-
-!***********************************************************************
-!
-!  routine ocn_tracer_vadv_stencil4_tend
-!
-!&gt; \brief   Computes tendency term for vertical tracer advection 4th order stencil
-!&gt; \author  Phil Jones, Doug Jacobsen
-!&gt; \date    15 September 2011
-!&gt; \version SVN:$Id$
-!&gt; \details 
-!&gt;  This routine computes the vertical advection tendency for tracer
-!&gt;  based on current state using a 4th order stencil.
-!
-!-----------------------------------------------------------------------
-
-   subroutine ocn_tracer_vadv_stencil4_tend(grid, layerThickness, wTop, tracers, tend, err)!{{{
-
-      !-----------------------------------------------------------------
-      !
-      ! input variables
-      !
-      !-----------------------------------------------------------------
-
-      real (kind=RKIND), dimension(:,:), intent(in) :: &amp;
-         layerThickness, &amp;    !&lt; Input: layer thickness
-         wTop    !&lt; Input: vertical tracer in top layer
-
-      real (kind=RKIND), dimension(:,:,:), intent(in) :: &amp;
-         tracers     !&lt; Input: tracers
-
-      type (mesh_type), intent(in) :: &amp;
-         grid          !&lt; Input: grid information
-
-      !-----------------------------------------------------------------
-      !
-      ! input/output variables
-      !
-      !-----------------------------------------------------------------
-
-      real (kind=RKIND), dimension(:,:,:), intent(inout) :: &amp;
-         tend          !&lt; Input/Output: tracer tendency
-
-      !-----------------------------------------------------------------
-      !
-      ! output variables
-      !
-      !-----------------------------------------------------------------
-
-      integer, intent(out) :: err !&lt; Output: error flag
-
-      !-----------------------------------------------------------------
-      !
-      ! local variables
-      !
-      !-----------------------------------------------------------------
-
-      integer :: nCellsSolve, iCell, k, iTracer, num_tracers, nVertLevels
-      integer :: nCells
-
-      integer, dimension(:), pointer :: maxLevelCell
-
-      real (kind=RKIND) :: cSingWTop, flux3Coef
-      real (kind=RKIND), dimension(:,:,:), allocatable :: tracerTop
-
-
-      !-----------------------------------------------------------------
-      !
-      ! call relevant routines for computing tendencies
-      ! note that the user can choose multiple options and the 
-      !   tendencies will be added together
-      !
-      !-----------------------------------------------------------------
-
-      err = 0
-
-      if(.not.Stencil4On) return
-
-      nCells = grid % nCells
-      nCellsSolve = grid % nCellsSolve
-      num_tracers = size(tracers, 1)
-      nVertLevels = grid % nVertLevels
-      maxLevelCell =&gt; grid % maxLevelCell % array
-
-      allocate(tracerTop(num_tracers,nVertLevels+1,nCells))
-
-      ! Compute tracerTop using 4rd order stencil [-1 7 7 -1]
-
-      do iCell=1,nCellsSolve 
-         tracerTop(:,1,iCell) = tracers(:,1,iCell)
-         k=2
-            do iTracer=1,num_tracers
-               tracerTop(iTracer,k,iCell) = &amp;
-                  (  layerThickness(k  ,iCell)*tracers(iTracer,k-1,iCell) &amp;
-                   + layerThickness(k-1,iCell)*tracers(iTracer,k  ,iCell) ) &amp;
-                  / (layerThickness(k-1,iCell) + layerThickness(k,iCell))   
-            end do
-         do k=3,maxLevelCell(iCell)-1
-            do iTracer=1,num_tracers
-               tracerTop(iTracer,k,iCell) = &amp;
-                  (-   tracers(iTracer,k-2,iCell) &amp;
-                   +7.*tracers(iTracer,k-1,iCell) &amp;
-                   +7.*tracers(iTracer,k  ,iCell) &amp;
-                   -   tracers(iTracer,k+1,iCell) &amp;
-                  )/12.
-            end do
-         end do
-         k=maxLevelCell(iCell)
-            do iTracer=1,num_tracers
-               tracerTop(iTracer,k,iCell) = &amp;
-                  (  layerThickness(k  ,iCell)*tracers(iTracer,k-1,iCell) &amp;
-                   + layerThickness(k-1,iCell)*tracers(iTracer,k  ,iCell) ) &amp;
-                  / (layerThickness(k-1,iCell) + layerThickness(k,iCell))   
-            end do
-        tracerTop(:,maxLevelCell(iCell)+1,iCell) = tracers(:,maxLevelCell(iCell),iCell)
-      end do
-
-      do iCell=1,nCellsSolve 
-         do k=1,maxLevelCell(iCell)  
-            do iTracer=1,num_tracers
-               tend(iTracer,k,iCell) = tend(iTracer,k,iCell) &amp;
-                      - (   wTop(k  ,iCell)*tracerTop(iTracer,k  ,iCell) &amp;
-                      - wTop(k+1,iCell)*tracerTop(iTracer,k+1,iCell))
-            end do
-         end do
-      end do
-
-      deallocate(tracerTop)
-   !--------------------------------------------------------------------
-
-   end subroutine ocn_tracer_vadv_stencil4_tend!}}}
-
-!***********************************************************************
-!
-!  routine ocn_tracer_vadv_stencil4_init
-!
-!&gt; \brief   Initializes ocean tracer vertical advection quantities
-!&gt; \author  Phil Jones, Doug Jacobsen
-!&gt; \date    15 September 2011
-!&gt; \version SVN:$Id$
-!&gt; \details 
-!&gt;  This routine initializes a variety of quantities related to 
-!&gt;  4th order stencil based vertical tracer advection in the ocean.
-!
-!-----------------------------------------------------------------------
-
-   subroutine ocn_tracer_vadv_stencil4_init(err)!{{{
-
-   !--------------------------------------------------------------------
-
-      !-----------------------------------------------------------------
-      !
-      ! call individual init routines for each parameterization
-      !
-      !-----------------------------------------------------------------
-
-      integer, intent(out) :: err !&lt; Output: error flag
-
-      err = 0
-      stencil4On = .false.
-
-      if(config_vert_tracer_adv_order.eq.4) then
-          stencil4On = .true.
-      endif
-
-
-   !--------------------------------------------------------------------
-
-   end subroutine ocn_tracer_vadv_stencil4_init!}}}
-
-!***********************************************************************
-
-end module ocn_tracer_vadv_stencil4
-
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-! vim: foldmethod=marker

Modified: branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_vel_pressure_grad.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_vel_pressure_grad.F        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_vel_pressure_grad.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -128,7 +128,7 @@
       ! For pure isopycnal coordinates, we are still using 
       ! grad(M), the gradient of Montgomery Potential, because
       ! we have set density0Inv=1 and gdensity0Inv=0 in the init routine,
-      ! and pressure is passed in as MontPot.
+      ! and pressure is passed in as montgomeryPotential.
 
       do iEdge=1,nEdgesSolve
          cell1 = cellsOnEdge(1,iEdge)

Modified: branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_vel_vadv.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_vel_vadv.F        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_ocean/mpas_ocn_vel_vadv.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -64,7 +64,7 @@
 !
 !-----------------------------------------------------------------------
 
-   subroutine ocn_vel_vadv_tend(grid, u, layerThicknessEdge, wTop, tend, err)!{{{
+   subroutine ocn_vel_vadv_tend(grid, u, layerThicknessEdge, vertTransportVelocityTop, tend, err)!{{{
 
       !-----------------------------------------------------------------
       !
@@ -76,7 +76,7 @@
          u     !&lt; Input: Horizontal velocity
       real (kind=RKIND), dimension(:,:), intent(in) :: &amp;
          layerThicknessEdge,&amp;!&lt; Input: thickness at edge
-         wTop  !&lt; Input: Vertical velocity on top layer
+         vertTransportVelocityTop  !&lt; Input: Vertical velocity on top layer
 
       type (mesh_type), intent(in) :: &amp;
          grid          !&lt; Input: grid information
@@ -109,7 +109,7 @@
       integer, dimension(:), pointer :: maxLevelEdgeTop
       integer, dimension(:,:), pointer :: cellsOnEdge, edgeMask
 
-      real (kind=RKIND) :: wTopEdge
+      real (kind=RKIND) :: vertTransportVelocityTopEdge
       real (kind=RKIND), dimension(:), allocatable :: w_dudzTopEdge
 
       if(.not.velVadvOn) return
@@ -130,10 +130,10 @@
 
         do k=2,maxLevelEdgeTop(iEdge)
           ! Average w from cell center to edge
-          wTopEdge = 0.5*(wTop(k,cell1)+wTop(k,cell2))
+          vertTransportVelocityTopEdge = 0.5*(vertTransportVelocityTop(k,cell1)+vertTransportVelocityTop(k,cell2))
 
           ! compute dudz at vertical interface with first order derivative.
-          w_dudzTopEdge(k) = wTopEdge * (u(k-1,iEdge)-u(k,iEdge)) &amp;
+          w_dudzTopEdge(k) = vertTransportVelocityTopEdge * (u(k-1,iEdge)-u(k,iEdge)) &amp;
                        / (0.5*(layerThicknessEdge(k-1,iEdge) + layerThicknessEdge(k,iEdge)))
         end do
         w_dudzTopEdge(maxLevelEdgeTop(iEdge)+1) = 0.0

Deleted: branches/ocean_projects/tensor_operations/src/core_sw/Registry
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_sw/Registry        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_sw/Registry        2013-04-18 15:33:42 UTC (rev 2767)
@@ -1,165 +0,0 @@
-%
-% namelist  type  namelist_record  name  default_value
-%
-namelist integer     sw_model  config_test_case             5
-namelist character   sw_model  config_time_integration      RK4
-namelist real        sw_model  config_dt                    172.8
-namelist character   sw_model  config_calendar_type         360day
-namelist character   sw_model  config_start_time            0000-01-01_00:00:00
-namelist character   sw_model  config_stop_time             none
-namelist character   sw_model  config_run_duration          none
-namelist integer     sw_model  config_stats_interval        100
-namelist logical     sw_model  config_h_ScaleWithMesh       false
-namelist real        sw_model  config_h_mom_eddy_visc2      0.0
-namelist real        sw_model  config_h_mom_eddy_visc4      0.0
-namelist real        sw_model  config_h_tracer_eddy_diff2   0.0
-namelist real        sw_model  config_h_tracer_eddy_diff4   0.0
-namelist integer     sw_model  config_thickness_adv_order   2
-namelist integer     sw_model  config_tracer_adv_order      2
-namelist logical     sw_model  config_positive_definite     false
-namelist logical     sw_model  config_monotonic             false
-namelist logical     sw_model  config_wind_stress           false
-namelist logical     sw_model  config_bottom_drag           false
-namelist real        sw_model  config_apvm_upwinding        0.5
-namelist integer     sw_model  config_num_halos             2
-namelist character   io        config_input_name            grid.nc
-namelist character   io        config_output_name           output.nc
-namelist character   io        config_restart_name          restart.nc
-namelist character   io        config_output_interval       06:00:00
-namelist integer     io        config_frames_per_outfile    0
-namelist integer     io        config_pio_num_iotasks       0 
-namelist integer     io        config_pio_stride            1
-namelist character   decomposition config_block_decomp_file_prefix  graph.info.part.
-namelist integer     decomposition config_number_of_blocks          0
-namelist logical     decomposition config_explicit_proc_decomp      .false.
-namelist character   decomposition config_proc_decomp_file_prefix   graph.info.part.
-namelist logical     restart   config_do_restart            false
-namelist character   restart   config_restart_interval      none
-
-%
-% dim  type  name_in_file  name_in_code
-%
-dim nCells nCells
-dim nEdges nEdges
-dim maxEdges maxEdges
-dim maxEdges2 maxEdges2
-dim nVertices nVertices
-dim TWO 2
-dim R3 3
-dim FIFTEEN 15
-dim TWENTYONE 21
-dim vertexDegree vertexDegree
-dim nVertLevels nVertLevels
-dim nTracers nTracers
-
-%
-% var persistence type  name_in_file  ( dims )  time_levs iro-  name_in_code struct super-array array_class
-%
-var persistent text    xtime ( Time ) 2 ro xtime state - -
-
-var persistent real    latCell ( nCells ) 0 iro latCell mesh - -
-var persistent real    lonCell ( nCells ) 0 iro lonCell mesh - -
-var persistent real    xCell ( nCells ) 0 iro xCell mesh - -
-var persistent real    yCell ( nCells ) 0 iro yCell mesh - -
-var persistent real    zCell ( nCells ) 0 iro zCell mesh - -
-var persistent integer indexToCellID ( nCells ) 0 iro indexToCellID mesh - -
-
-var persistent real    latEdge ( nEdges ) 0 iro latEdge mesh - -
-var persistent real    lonEdge ( nEdges ) 0 iro lonEdge mesh - -
-var persistent real    xEdge ( nEdges ) 0 iro xEdge mesh - -
-var persistent real    yEdge ( nEdges ) 0 iro yEdge mesh - -
-var persistent real    zEdge ( nEdges ) 0 iro zEdge mesh - -
-var persistent integer indexToEdgeID ( nEdges ) 0 iro indexToEdgeID mesh - -
-
-var persistent real    latVertex ( nVertices ) 0 iro latVertex mesh - -
-var persistent real    lonVertex ( nVertices ) 0 iro lonVertex mesh - -
-var persistent real    xVertex ( nVertices ) 0 iro xVertex mesh - -
-var persistent real    yVertex ( nVertices ) 0 iro yVertex mesh - -
-var persistent real    zVertex ( nVertices ) 0 iro zVertex mesh - -
-var persistent integer indexToVertexID ( nVertices ) 0 iro indexToVertexID mesh - -
-
-var persistent real    meshDensity ( nCells ) 0 iro meshDensity mesh - -
-var persistent real    meshScalingDel2 ( nEdges ) 0 ro meshScalingDel2 mesh - -
-var persistent real    meshScalingDel4 ( nEdges ) 0 ro meshScalingDel4 mesh - -
-
-var persistent integer cellsOnEdge ( TWO nEdges ) 0 iro cellsOnEdge mesh - -
-var persistent integer nEdgesOnCell ( nCells ) 0 iro nEdgesOnCell mesh - -
-var persistent integer nEdgesOnEdge ( nEdges ) 0 iro nEdgesOnEdge mesh - -
-var persistent integer edgesOnCell ( maxEdges nCells ) 0 iro edgesOnCell mesh - -
-var persistent integer edgesOnEdge ( maxEdges2 nEdges ) 0 iro edgesOnEdge mesh - -
-
-var persistent real    weightsOnEdge ( maxEdges2 nEdges ) 0 iro weightsOnEdge mesh - -
-var persistent real    dvEdge ( nEdges ) 0 iro dvEdge mesh - -
-var persistent real    dcEdge ( nEdges ) 0 iro dcEdge mesh - -
-var persistent real    angleEdge ( nEdges ) 0 iro angleEdge mesh - -
-var persistent real    areaCell ( nCells ) 0 iro areaCell mesh - -
-var persistent real    areaTriangle ( nVertices ) 0 iro areaTriangle mesh - -
-
-var persistent real    edgeNormalVectors ( R3 nEdges ) 0 o edgeNormalVectors mesh - -
-var persistent real    localVerticalUnitVectors ( R3 nCells ) 0 o localVerticalUnitVectors mesh - -
-var persistent real    cellTangentPlane ( R3 TWO nCells ) 0 o cellTangentPlane mesh - -
-
-var persistent integer cellsOnCell ( maxEdges nCells ) 0 iro cellsOnCell mesh - -
-var persistent integer verticesOnCell ( maxEdges nCells ) 0 iro verticesOnCell mesh - -
-var persistent integer verticesOnEdge ( TWO nEdges ) 0 iro verticesOnEdge mesh - -
-var persistent integer edgesOnVertex ( vertexDegree nVertices ) 0 iro edgesOnVertex mesh - -
-var persistent integer cellsOnVertex ( vertexDegree nVertices ) 0 iro cellsOnVertex mesh - -
-var persistent real    kiteAreasOnVertex ( vertexDegree nVertices ) 0 iro kiteAreasOnVertex mesh - -
-var persistent real    fEdge ( nEdges ) 0 iro fEdge mesh - -
-var persistent real    fVertex ( nVertices ) 0 iro fVertex mesh - -
-var persistent real    fCell ( nCells ) 0 iro fCell mesh - -
-var persistent real    h_s ( nCells ) 0 iro h_s mesh - -
-
-% Space needed for advection
-var persistent real    deriv_two ( FIFTEEN TWO nEdges ) 0 o deriv_two mesh - -
-var persistent integer advCells ( TWENTYONE nCells ) 0 - advCells 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
-var persistent real    defc_a ( maxEdges nCells ) 0 - defc_a mesh - -
-var persistent real    defc_b ( maxEdges nCells ) 0 - defc_b mesh - -
-var persistent real    kdiff ( nVertLevels nCells Time ) 0 - kdiff mesh - -
-
-% Arrays required for reconstruction of velocity field
-var persistent real    coeffs_reconstruct ( R3 maxEdges nCells ) 0 - coeffs_reconstruct mesh - -
-
-% Boundary conditions: read from input, saved in restart and written to output
-var persistent integer boundaryEdge ( nVertLevels nEdges ) 0 iro boundaryEdge mesh - -
-var persistent integer boundaryVertex ( nVertLevels nVertices ) 0 iro boundaryVertex mesh - -
-var persistent integer boundaryCell ( nVertLevels nCells ) 0 iro boundaryCell mesh - -
-var persistent real    u_src ( nVertLevels nEdges ) 0 iro u_src mesh - -
-
-% Prognostic variables: read from input, saved in restart, and written to output
-var persistent real    u ( nVertLevels nEdges Time ) 2 iro u state - -
-var persistent real    h ( nVertLevels nCells Time ) 2 iro h state - -
-var persistent real    tracers ( nTracers nVertLevels nCells Time ) 2 iro tracers state - -
-
-% Tendency variables
-var persistent real    tend_u ( nVertLevels nEdges Time ) 1 - u tend - -
-var persistent real    tend_h ( nVertLevels nCells Time ) 1 - h tend - -
-var persistent real    tend_tracers ( nTracers nVertLevels nCells Time ) 1 - tracers tend - -
-
-% Diagnostic fields: only written to output
-var persistent real    v ( nVertLevels nEdges Time ) 2 o 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    vorticity_cell ( nVertLevels nCells Time ) 2 o vorticity_cell state - -
-var persistent real    pv_edge ( nVertLevels nEdges Time ) 2 o pv_edge state - -
-var persistent real    h_edge ( nVertLevels nEdges Time ) 2 o h_edge state - -
-var persistent real    ke ( nVertLevels nCells Time ) 2 o ke state - -
-var persistent real    pv_vertex ( nVertLevels nVertices Time ) 2 o pv_vertex state - -
-var persistent real    pv_cell ( nVertLevels nCells Time ) 2 o pv_cell state - -
-var persistent real    uReconstructX ( nVertLevels nCells Time ) 2 o uReconstructX state - -
-var persistent real    uReconstructY ( nVertLevels nCells Time ) 2 o uReconstructY state - -
-var persistent real    uReconstructZ ( nVertLevels nCells Time ) 2 o uReconstructZ state - -
-var persistent real    uReconstructZonal ( nVertLevels nCells Time ) 2 o uReconstructZonal state - -
-var persistent real    uReconstructMeridional ( nVertLevels nCells Time ) 2 o uReconstructMeridional state - -
-
-% 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    h_vertex ( nVertLevels nVertices Time ) 2 - h_vertex state - -
-

Modified: branches/ocean_projects/tensor_operations/src/core_sw/Registry.xml
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_sw/Registry.xml        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/core_sw/Registry.xml        2013-04-18 15:33:42 UTC (rev 2767)
@@ -1,5 +1,5 @@
 &lt;?xml version=&quot;1.0&quot;?&gt;
-&lt;registry&gt;
+&lt;registry model=&quot;mpas&quot; core=&quot;sw&quot; version=&quot;0.0.0&quot;&gt;
         &lt;dims&gt;
                 &lt;dim name=&quot;nCells&quot;/&gt;
                 &lt;dim name=&quot;nEdges&quot;/&gt;

Modified: branches/ocean_projects/tensor_operations/src/framework/Makefile
===================================================================
--- branches/ocean_projects/tensor_operations/src/framework/Makefile        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/framework/Makefile        2013-04-18 15:33:42 UTC (rev 2767)
@@ -1,9 +1,5 @@
 .SUFFIXES: .F .o
 
-ifdef ZOLTAN_HOME
-   ZOLTANOBJ = mpas_zoltan_interface.o
-endif
-
 OBJS = mpas_kind_types.o \
        mpas_framework.o \
        mpas_timer.o \
@@ -22,7 +18,6 @@
        mpas_io_streams.o \
        mpas_io_input.o \
        mpas_io_output.o \
-       $(ZOLTANOBJ) \
        streams.o
 
 all: framework
@@ -58,7 +53,7 @@
 
 mpas_io_streams.o: mpas_attlist.o mpas_grid_types.o mpas_timekeeping.o mpas_io.o
 
-mpas_io_input.o: mpas_grid_types.o mpas_dmpar.o mpas_block_decomp.o mpas_block_creator.o mpas_sort.o mpas_configure.o mpas_timekeeping.o mpas_io_streams.o $(ZOLTANOBJ)
+mpas_io_input.o: mpas_grid_types.o mpas_dmpar.o mpas_block_decomp.o mpas_block_creator.o mpas_sort.o mpas_configure.o mpas_timekeeping.o mpas_io_streams.o
 
 mpas_io_output.o: mpas_grid_types.o mpas_dmpar.o mpas_sort.o mpas_configure.o mpas_io_streams.o
 

Modified: branches/ocean_projects/tensor_operations/src/framework/mpas_grid_types.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/framework/mpas_grid_types.F        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/framework/mpas_grid_types.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -1,3 +1,16 @@
+!***********************************************************************
+!
+!  mpas_grid_types
+!
+!&gt; \brief   MPAS Grid and field type defintion module
+!&gt; \author  Michael Duda, Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This module defines derived data types related to fields, and variable structures.
+!&gt; It also includes routines for allocating and deallocating these types.
+!
+!-----------------------------------------------------------------------
 module mpas_grid_types
 
    use mpas_kind_types
@@ -428,6 +441,8 @@
    
       ! Also store parallelization info here
       type (dm_info), pointer :: dminfo
+#include &quot;model_variables.inc&quot;
+      character (len=StrKIND*2) :: history !&lt; History attribute, read in from input file.
    end type domain_type
 
    interface mpas_allocate_scratch_field
@@ -472,31 +487,54 @@
 
    contains
 
+!***********************************************************************
+!
+!  routine mpas_allocate_domain
+!
+!&gt; \brief   MPAS Domain allocation routine
+!&gt; \author  Michael Duda
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine allocates a domain structure.
+!
+!-----------------------------------------------------------------------
+   subroutine mpas_allocate_domain(dom, dminfo)!{{{
 
-   subroutine mpas_allocate_domain(dom, dminfo)
-
       implicit none
 
-      type (domain_type), pointer :: dom
-      type (dm_info), pointer :: dminfo
+      type (domain_type), pointer :: dom !&lt; Input/Output: Domain structure
+      type (dm_info), pointer :: dminfo !&lt; Input: Domain Information
 
       allocate(dom)
       nullify(dom % blocklist)
       dom % dminfo =&gt; dminfo
 
-   end subroutine mpas_allocate_domain
+   end subroutine mpas_allocate_domain!}}}
 
-
-   subroutine mpas_allocate_block(nHaloLayers, b, dom, blockID, &amp;
+!***********************************************************************
+!
+!  routine mpas_allocate_block
+!
+!&gt; \brief   MPAS Block allocation routine
+!&gt; \author  Michael Duda
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine allocates a block structure. It calls routines to allocate the variable structures
+!&gt; that are members of the block type.
+!
+!-----------------------------------------------------------------------
+   subroutine mpas_allocate_block(nHaloLayers, b, dom, blockID, &amp;!{{{
 #include &quot;dim_dummy_args.inc&quot;
                             )
 
       implicit none
 
-      integer, intent(in) :: nHaloLayers
-      type (block_type), pointer :: b
-      type (domain_type), pointer :: dom
-      integer, intent(in) :: blockID
+      integer, intent(in) :: nHaloLayers !&lt; Input: Number of halo laters
+      type (block_type), pointer :: b !&lt; Input/Output: Block structure
+      type (domain_type), pointer :: dom !&lt; Input: Domain structure
+      integer, intent(in) :: blockID !&lt; Input: Global ID of block
 #include &quot;dim_dummy_decls.inc&quot;
 
 
@@ -511,19 +549,30 @@
 
 #include &quot;block_allocs.inc&quot;
 
-   end subroutine mpas_allocate_block
+   end subroutine mpas_allocate_block!}}}
 
 
 #include &quot;group_alloc_routines.inc&quot;
 
 #include &quot;provis_alloc_routines.inc&quot;
 
-
+!***********************************************************************
+!
+!  routine mpas_deallocate_domain
+!
+!&gt; \brief   MPAS Domain deallocation routine
+!&gt; \author  Michael Duda
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine deallocates a domain structure. 
+!
+!-----------------------------------------------------------------------
    subroutine mpas_deallocate_domain(dom)!{{{
 
       implicit none
 
-      type (domain_type), pointer :: dom
+      type (domain_type), pointer :: dom !&lt; Input/Output: Domain to deallocate
 
       type (block_type), pointer :: block_ptr
 
@@ -537,9 +586,21 @@
 
    end subroutine mpas_deallocate_domain!}}}
 
+!***********************************************************************
+!
+!  routine mpas_allocate_scratch_field1d_integer
+!
+!&gt; \brief   MPAS 1D Scratch integer allocation routine.
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine allocates a 1D scratch integer field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_allocate_scratch_field1d_integer(f, single_block_in)!{{{
-       type (field1dInteger), pointer :: f
-       logical, intent(in), optional :: single_block_in
+       type (field1dInteger), pointer :: f !&lt; Input: Field to allocate
+       logical, intent(in), optional :: single_block_in !&lt; Input: Logical flag that determines if a single block should be allocated or all blocks.
        logical :: single_block
        type (field1dInteger), pointer :: f_cursor
 
@@ -569,9 +630,21 @@
 
    end subroutine mpas_allocate_scratch_field1d_integer!}}}
 
+!***********************************************************************
+!
+!  routine mpas_allocate_scratch_field2d_integer
+!
+!&gt; \brief   MPAS 2D Scratch integer allocation routine.
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine allocates a 2D scratch integer field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_allocate_scratch_field2d_integer(f, single_block_in)!{{{
-       type (field2dInteger), pointer :: f
-       logical, intent(in), optional :: single_block_in
+       type (field2dInteger), pointer :: f !&lt; Input: Field to allocate
+       logical, intent(in), optional :: single_block_in !&lt; Input: Logical flag that determines if a single block should be allocated, or all blocks.
        logical :: single_block
        type (field2dInteger), pointer :: f_cursor
 
@@ -601,9 +674,21 @@
 
    end subroutine mpas_allocate_scratch_field2d_integer!}}}
 
+!***********************************************************************
+!
+!  routine mpas_allocate_scratch_field3d_integer
+!
+!&gt; \brief   MPAS 3D Scratch integer allocation routine.
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine allocates a 3D scratch integer field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_allocate_scratch_field3d_integer(f, single_block_in)!{{{
-       type (field3dInteger), pointer :: f
-       logical, intent(in), optional :: single_block_in
+       type (field3dInteger), pointer :: f !&lt; Input: Field to allocate
+       logical, intent(in), optional :: single_block_in !&lt; Input: Logical flag that determines if a single block should be allocated, or all blocks.
        logical :: single_block
        type (field3dInteger), pointer :: f_cursor
 
@@ -633,9 +718,21 @@
 
    end subroutine mpas_allocate_scratch_field3d_integer!}}}
 
+!***********************************************************************
+!
+!  routine mpas_allocate_scratch_field1d_real
+!
+!&gt; \brief   MPAS 1D Scratch real allocation routine.
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine allocates a 1D scratch real field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_allocate_scratch_field1d_real(f, single_block_in)!{{{
-       type (field1dReal), pointer :: f
-       logical, intent(in), optional :: single_block_in
+       type (field1dReal), pointer :: f !&lt; Input: Field to allocate
+       logical, intent(in), optional :: single_block_in !&lt; Input: Logical flag that determines if a single block should be allocated, or all blocks.
        logical :: single_block
        type (field1dReal), pointer :: f_cursor
 
@@ -665,9 +762,21 @@
 
    end subroutine mpas_allocate_scratch_field1d_real!}}}
 
+!***********************************************************************
+!
+!  routine mpas_allocate_scratch_field2d_real
+!
+!&gt; \brief   MPAS 2D Scratch real allocation routine.
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine allocates a 2D scratch real field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_allocate_scratch_field2d_real(f, single_block_in)!{{{
-       type (field2dReal), pointer :: f
-       logical, intent(in), optional :: single_block_in
+       type (field2dReal), pointer :: f !&lt; Input: Field to allocate
+       logical, intent(in), optional :: single_block_in !&lt; Input: Logical flag that determines if a single block should be allocated, or all blocks.
        logical :: single_block
        type (field2dReal), pointer :: f_cursor
 
@@ -697,9 +806,21 @@
 
    end subroutine mpas_allocate_scratch_field2d_real!}}}
 
+!***********************************************************************
+!
+!  routine mpas_allocate_scratch_field3d_real
+!
+!&gt; \brief   MPAS 3D Scratch real allocation routine.
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine allocates a 3D scratch real field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_allocate_scratch_field3d_real(f, single_block_in)!{{{
-       type (field3dReal), pointer :: f
-       logical, intent(in), optional :: single_block_in
+       type (field3dReal), pointer :: f !&lt; Input: Field to allocate
+       logical, intent(in), optional :: single_block_in !&lt; Input: Logical flag that determines if a single block should be allocated, or all blocks.
        logical :: single_block
        type (field3dReal), pointer :: f_cursor
 
@@ -729,9 +850,21 @@
 
    end subroutine mpas_allocate_scratch_field3d_real!}}}
 
+!***********************************************************************
+!
+!  routine mpas_allocate_scratch_field4D_real
+!
+!&gt; \brief   MPAS 4D Scratch real allocation routine.
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine allocates a 4D scratch real field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_allocate_scratch_field4d_real(f, single_block_in)!{{{
-       type (field4dReal), pointer :: f
-       logical, intent(in), optional :: single_block_in
+       type (field4dReal), pointer :: f !&lt; Input: Field to allocate
+       logical, intent(in), optional :: single_block_in !&lt; Input: Logical flag that determines if a single block should be allocated, or all blocks.
        logical :: single_block
        type (field4dReal), pointer :: f_cursor
 
@@ -761,9 +894,21 @@
 
    end subroutine mpas_allocate_scratch_field4d_real!}}}
 
+!***********************************************************************
+!
+!  routine mpas_allocate_scratch_field5D_real
+!
+!&gt; \brief   MPAS 5D Scratch real allocation routine.
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine allocates a 5D scratch real field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_allocate_scratch_field5d_real(f, single_block_in)!{{{
-       type (field5dReal), pointer :: f
-       logical, intent(in), optional :: single_block_in
+       type (field5dReal), pointer :: f !&lt; Input: Field to allocate
+       logical, intent(in), optional :: single_block_in !&lt; Input: Logical flag that determines if a single block should be allocated, or all blocks.
        logical :: single_block
        type (field5dReal), pointer :: f_cursor
 
@@ -793,9 +938,21 @@
 
    end subroutine mpas_allocate_scratch_field5d_real!}}}
 
+!***********************************************************************
+!
+!  routine mpas_allocate_scratch_field1D_char
+!
+!&gt; \brief   MPAS 1D Scratch character deallocation rotuine
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine allocates a 1D scratch character field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_allocate_scratch_field1d_char(f, single_block_in)!{{{
-       type (field1dChar), pointer :: f
-       logical, intent(in), optional :: single_block_in
+       type (field1dChar), pointer :: f !&lt; Input: Field to allocate
+       logical, intent(in), optional :: single_block_in !&lt; Input: Logical flag that determines if a single block should be allocated, or all blocks.
        logical :: single_block
        type (field1dChar), pointer :: f_cursor
 
@@ -825,9 +982,21 @@
 
    end subroutine mpas_allocate_scratch_field1d_char!}}}
 
+!***********************************************************************
+!
+!  routine mpas_deallocate_scratch_field1D_integer
+!
+!&gt; \brief   MPAS 1D Scratch integer deallocation rotuine
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine deallocates a 1D scratch integer field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_deallocate_scratch_field1d_integer(f, single_block_in)!{{{
-       type (field1dInteger), pointer :: f
-       logical, intent(in), optional :: single_block_in
+       type (field1dInteger), pointer :: f !&lt; Input: Field to deallocate
+       logical, intent(in), optional :: single_block_in !&lt; Input: Logical that determines if a single block should be deallocated, or all blocks.
        logical :: single_block
        type (field1dInteger), pointer :: f_cursor
 
@@ -858,9 +1027,21 @@
 
    end subroutine mpas_deallocate_scratch_field1d_integer!}}}
 
+!***********************************************************************
+!
+!  routine mpas_deallocate_scratch_field2D_integer
+!
+!&gt; \brief   MPAS 2D Scratch integer deallocation rotuine
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine deallocates a 2D scratch integer field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_deallocate_scratch_field2d_integer(f, single_block_in)!{{{
-       type (field2dInteger), pointer :: f
-       logical, intent(in), optional :: single_block_in
+       type (field2dInteger), pointer :: f !&lt; Input: Field to deallocate
+       logical, intent(in), optional :: single_block_in !&lt; Input: Logical that determines if a single block should be deallocated, or all blocks.
        logical :: single_block
        type (field2dInteger), pointer :: f_cursor
 
@@ -891,9 +1072,21 @@
 
    end subroutine mpas_deallocate_scratch_field2d_integer!}}}
 
+!***********************************************************************
+!
+!  routine mpas_deallocate_scratch_field3D_integer
+!
+!&gt; \brief   MPAS 3D Scratch integer deallocation rotuine
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine deallocates a 3D scratch integer field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_deallocate_scratch_field3d_integer(f, single_block_in)!{{{
-       type (field3dInteger), pointer :: f
-       logical, intent(in), optional :: single_block_in
+       type (field3dInteger), pointer :: f !&lt; Input: Field to deallocate
+       logical, intent(in), optional :: single_block_in !&lt; Input: Logical that determines if a single block should be deallocated, or all blocks.
        logical :: single_block
        type (field3dInteger), pointer :: f_cursor
 
@@ -924,9 +1117,21 @@
 
    end subroutine mpas_deallocate_scratch_field3d_integer!}}}
 
+!***********************************************************************
+!
+!  routine mpas_deallocate_scratch_field1D_real
+!
+!&gt; \brief   MPAS 1D Scratch real deallocation rotuine
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine deallocates a 1D scratch real field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_deallocate_scratch_field1d_real(f, single_block_in)!{{{
-       type (field1dReal), pointer :: f
-       logical, intent(in), optional :: single_block_in
+       type (field1dReal), pointer :: f !&lt; Input: Field to deallocate
+       logical, intent(in), optional :: single_block_in !&lt; Input: Logical that determines if a single block should be deallocated, or all blocks.
        logical :: single_block
        type (field1dReal), pointer :: f_cursor
 
@@ -957,9 +1162,21 @@
 
    end subroutine mpas_deallocate_scratch_field1d_real!}}}
 
+!***********************************************************************
+!
+!  routine mpas_deallocate_scratch_field2D_real
+!
+!&gt; \brief   MPAS 2D Scratch real deallocation rotuine
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine deallocates a 2D scratch real field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_deallocate_scratch_field2d_real(f, single_block_in)!{{{
-       type (field2dReal), pointer :: f
-       logical, intent(in), optional :: single_block_in
+       type (field2dReal), pointer :: f !&lt; Input: Field to deallocate
+       logical, intent(in), optional :: single_block_in !&lt; Input: Logical that determines if a single block should be deallocated, or all blocks.
        logical :: single_block
        type (field2dReal), pointer :: f_cursor
 
@@ -990,9 +1207,21 @@
 
    end subroutine mpas_deallocate_scratch_field2d_real!}}}
 
+!***********************************************************************
+!
+!  routine mpas_deallocate_scratch_field3D_real
+!
+!&gt; \brief   MPAS 3D Scratch real deallocation rotuine
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine deallocates a 3D scratch real field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_deallocate_scratch_field3d_real(f, single_block_in)!{{{
-       type (field3dReal), pointer :: f
-       logical, intent(in), optional :: single_block_in
+       type (field3dReal), pointer :: f !&lt; Input: Field to deallocate
+       logical, intent(in), optional :: single_block_in !&lt; Input: Logical that determines if a single block should be deallocated, or all blocks.
        logical :: single_block
        type (field3dReal), pointer :: f_cursor
 
@@ -1023,9 +1252,21 @@
 
    end subroutine mpas_deallocate_scratch_field3d_real!}}}
 
+!***********************************************************************
+!
+!  routine mpas_deallocate_scratch_field4D_real
+!
+!&gt; \brief   MPAS 4D Scratch real deallocation rotuine
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine deallocates a 4D scratch real field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_deallocate_scratch_field4d_real(f, single_block_in)!{{{
-       type (field4dReal), pointer :: f
-       logical, intent(in), optional :: single_block_in
+       type (field4dReal), pointer :: f !&lt; Input: Field to deallocate
+       logical, intent(in), optional :: single_block_in !&lt; Input: Logical that determines if a single block should be deallocated, or all blocks.
        logical :: single_block
        type (field4dReal), pointer :: f_cursor
 
@@ -1056,9 +1297,21 @@
 
    end subroutine mpas_deallocate_scratch_field4d_real!}}}
 
+!***********************************************************************
+!
+!  routine mpas_deallocate_scratch_field5D_real
+!
+!&gt; \brief   MPAS 5D Scratch real deallocation rotuine
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine deallocates a 5D scratch real field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_deallocate_scratch_field5d_real(f, single_block_in)!{{{
-       type (field5dReal), pointer :: f
-       logical, intent(in), optional :: single_block_in
+       type (field5dReal), pointer :: f !&lt; Input: Field to deallocate
+       logical, intent(in), optional :: single_block_in !&lt; Input: Logical that determines if a single block should be deallocated, or all blocks.
        logical :: single_block
        type (field5dReal), pointer :: f_cursor
 
@@ -1089,9 +1342,21 @@
 
    end subroutine mpas_deallocate_scratch_field5d_real!}}}
 
+!***********************************************************************
+!
+!  routine mpas_deallocate_scratch_field1D_char
+!
+!&gt; \brief   MPAS 1D Scratch character deallocation rotuine
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine deallocates a 1D scratch character field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_deallocate_scratch_field1d_char(f, single_block_in)!{{{
-       type (field1dChar), pointer :: f
-       logical, intent(in), optional :: single_block_in
+       type (field1dChar), pointer :: f !&lt; Input: Field to deallocate
+       logical, intent(in), optional :: single_block_in !&lt; Input: Logical that determines if a single block should be deallocated, or all blocks.
        logical :: single_block
        type (field1dChar), pointer :: f_cursor
 
@@ -1122,9 +1387,20 @@
 
    end subroutine mpas_deallocate_scratch_field1d_char!}}}
 
-
+!***********************************************************************
+!
+!  routine mpas_deallocate_field0d_integer
+!
+!&gt; \brief   MPAS 0D integer deallocation routine.
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine deallocates a 0D integer field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_deallocate_field0d_integer(f)!{{{
-       type (field0dInteger), pointer :: f
+       type (field0dInteger), pointer :: f !&lt; Input: Field to deallocate
        type (field0dInteger), pointer :: f_cursor
 
        f_cursor =&gt; f
@@ -1146,8 +1422,20 @@
 
    end subroutine mpas_deallocate_field0d_integer!}}}
 
+!***********************************************************************
+!
+!  routine mpas_deallocate_field1D_integer
+!
+!&gt; \brief   MPAS 1D integer deallocation routine.
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine deallocates a 1D integer field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_deallocate_field1d_integer(f)!{{{
-       type (field1dInteger), pointer :: f
+       type (field1dInteger), pointer :: f !&lt; Input: Field to deallocate
        type (field1dInteger), pointer :: f_cursor
 
        f_cursor =&gt; f
@@ -1173,8 +1461,20 @@
 
    end subroutine mpas_deallocate_field1d_integer!}}}
 
+!***********************************************************************
+!
+!  routine mpas_deallocate_field2D_integer
+!
+!&gt; \brief   MPAS 2D integer deallocation routine.
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine deallocates a 2D integer field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_deallocate_field2d_integer(f)!{{{
-       type (field2dInteger), pointer :: f
+       type (field2dInteger), pointer :: f !&lt; Input: Field to deallocate
        type (field2dInteger), pointer :: f_cursor
 
        f_cursor =&gt; f
@@ -1200,8 +1500,20 @@
 
    end subroutine mpas_deallocate_field2d_integer!}}}
 
+!***********************************************************************
+!
+!  routine mpas_deallocate_field3D_integer
+!
+!&gt; \brief   MPAS 3D integer deallocation routine.
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine deallocates a 3D integer field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_deallocate_field3d_integer(f)!{{{
-       type (field3dInteger), pointer :: f
+       type (field3dInteger), pointer :: f !&lt; Input: Field to deallocate
        type (field3dInteger), pointer :: f_cursor
 
        f_cursor =&gt; f
@@ -1227,8 +1539,20 @@
 
    end subroutine mpas_deallocate_field3d_integer!}}}
 
+!***********************************************************************
+!
+!  routine mpas_deallocate_field0d_real
+!
+!&gt; \brief   MPAS 0D real deallocation routine.
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine deallocates a 0D real field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_deallocate_field0d_real(f)!{{{
-       type (field0dReal), pointer :: f
+       type (field0dReal), pointer :: f !&lt; Input: Field to deallocate
        type (field0dReal), pointer :: f_cursor
 
        f_cursor =&gt; f
@@ -1251,8 +1575,20 @@
 
    end subroutine mpas_deallocate_field0d_real!}}}
 
+!***********************************************************************
+!
+!  routine mpas_deallocate_field1D_real
+!
+!&gt; \brief   MPAS 1D real deallocation routine.
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine deallocates a 1D real field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_deallocate_field1d_real(f)!{{{
-       type (field1dReal), pointer :: f
+       type (field1dReal), pointer :: f !&lt; Input: Field to deallocate
        type (field1dReal), pointer :: f_cursor
 
        f_cursor =&gt; f
@@ -1278,8 +1614,20 @@
 
    end subroutine mpas_deallocate_field1d_real!}}}
 
+!***********************************************************************
+!
+!  routine mpas_deallocate_field2D_real
+!
+!&gt; \brief   MPAS 2D real deallocation routine.
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine deallocates a 2D real field.
+!
+
    subroutine mpas_deallocate_field2d_real(f)!{{{
-       type (field2dReal), pointer :: f
+       type (field2dReal), pointer :: f !&lt; Input: Field to deallocate
        type (field2dReal), pointer :: f_cursor
 
        f_cursor =&gt; f
@@ -1305,8 +1653,20 @@
 
    end subroutine mpas_deallocate_field2d_real!}}}
 
+!***********************************************************************
+!
+!  routine mpas_deallocate_field3D_real
+!
+!&gt; \brief   MPAS 3D real deallocation routine.
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine deallocates a 3D real field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_deallocate_field3d_real(f)!{{{
-       type (field3dReal), pointer :: f
+       type (field3dReal), pointer :: f !&lt; Input: Field to deallocate
        type (field3dReal), pointer :: f_cursor
 
        f_cursor =&gt; f
@@ -1332,8 +1692,20 @@
 
    end subroutine mpas_deallocate_field3d_real!}}}
 
+!***********************************************************************
+!
+!  routine mpas_deallocate_field4D_real
+!
+!&gt; \brief   MPAS 4D real deallocation routine.
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine deallocates a 4D real field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_deallocate_field4d_real(f)!{{{
-       type (field4dReal), pointer :: f
+       type (field4dReal), pointer :: f !&lt; Input: Field to deallocate
        type (field4dReal), pointer :: f_cursor
 
        f_cursor =&gt; f
@@ -1359,8 +1731,20 @@
 
    end subroutine mpas_deallocate_field4d_real!}}}
 
+!***********************************************************************
+!
+!  routine mpas_deallocate_field5D_real
+!
+!&gt; \brief   MPAS 5D real deallocation routine.
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine deallocates a 5D real field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_deallocate_field5d_real(f)!{{{
-       type (field5dReal), pointer :: f
+       type (field5dReal), pointer :: f !&lt; Input: Field to deallocate
        type (field5dReal), pointer :: f_cursor
 
        f_cursor =&gt; f
@@ -1386,8 +1770,20 @@
 
    end subroutine mpas_deallocate_field5d_real!}}}
 
+!***********************************************************************
+!
+!  routine mpas_deallocate_field0D_char
+!
+!&gt; \brief   MPAS 0D character deallocation routine.
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine deallocates a 0D character field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_deallocate_field0d_char(f)!{{{
-       type (field0dChar), pointer :: f
+       type (field0dChar), pointer :: f !&lt; Input: Field to deallocate
        type (field0dChar), pointer :: f_cursor
 
        f_cursor =&gt; f
@@ -1409,8 +1805,20 @@
 
    end subroutine mpas_deallocate_field0d_char!}}}
 
+!***********************************************************************
+!
+!  routine mpas_deallocate_field1D_char
+!
+!&gt; \brief   MPAS 1D character deallocation routine.
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine deallocates a 1D character field.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_deallocate_field1d_char(f)!{{{
-       type (field1dChar), pointer :: f
+       type (field1dChar), pointer :: f !&lt; Input: Field to deallocate
        type (field1dChar), pointer :: f_cursor
 
        f_cursor =&gt; f
@@ -1436,16 +1844,29 @@
 
    end subroutine mpas_deallocate_field1d_char!}}}
 
+!***********************************************************************
+!
+!  routine mpas_deallocate_block
+!
+!&gt; \brief   MPAS Block deallocation routine
+!&gt; \author  Doug Jacobsen
+!&gt; \date    04/02/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine deallocates a block structure.
+!
+!-----------------------------------------------------------------------
    subroutine mpas_deallocate_block(b)!{{{
  
       implicit none
 
-      type (block_type), intent(inout) :: b
+      type (block_type), intent(inout) :: b !&lt; Input/Output: Block to be deallocated.
 
       integer :: i
 
       ! BUG: It seems like we should be deallocating the exchange lists before we 
       !      deallocate the array of head pointers and the parinfo type...
+      !      It also seems like these deallocations should happen with mpas_dmpar_destroy_multihalo_exchange_list
 
       deallocate(b % parinfo % cellsToSend)
       deallocate(b % parinfo % cellsToRecv)

Modified: branches/ocean_projects/tensor_operations/src/framework/mpas_io_input.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/framework/mpas_io_input.F        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/framework/mpas_io_input.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -10,10 +10,6 @@
    use mpas_io_streams
 
 
-#ifdef HAVE_ZOLTAN
-   use mpas_zoltan_interface
-#endif
-
    integer, parameter :: STREAM_INPUT=1, STREAM_SFC=2, STREAM_RESTART=3
 
    type io_input_object
@@ -245,6 +241,22 @@
         end if
       end if
 
+      call MPAS_readStreamAtt(input_obj % io_stream, 'history', domain % history, ierr)
+      if (ierr /= MPAS_STREAM_NOERR) then
+        write(0,*) 'Warning: Attribute History not found in '//trim(input_obj % filename)
+        write(0,*) '   Setting History to '''''
+        domain % history = &quot;&quot;
+      else
+        ! Remove C String NULL characters, replace C String newlines with semicolons
+        do i = 1, len(domain % history)
+          if(iachar(domain % history(i:i)) == 0) then
+            domain % history(i:i) = &quot; &quot;
+          else if(iachar(domain % history(i:i)) == 10) then
+            domain % history(i:i) = &quot;;&quot;
+          end if
+        end do
+      end if
+
       block_ptr =&gt; domain % blocklist % next
       do while (associated(block_ptr))
         block_ptr % mesh % sphere_radius = domain % blocklist % mesh % sphere_radius
@@ -339,161 +351,12 @@
       call mpas_deallocate_field(nVerticesSolveField)
       call mpas_deallocate_field(nEdgesSolveField)
 
-#ifdef HAVE_ZOLTAN      
-      call mpas_deallocate_field(xCellField)
-      call mpas_deallocate_field(yCellField)
-      call mpas_deallocate_field(zCellField)
-      call mpas_deallocate_field(xVertexField)
-      call mpas_deallocate_field(yVertexField)
-      call mpas_deallocate_field(zVertexField)
-      call mpas_deallocate_field(xEdgeField)
-      call mpas_deallocate_field(yEdgeField)
-      call mpas_deallocate_field(zEdgeField)
-
-      call mpas_deallocate_field(xCell)
-      call mpas_deallocate_field(yCell)
-      call mpas_deallocate_field(zCell)
-      call mpas_deallocate_field(xVertex)
-      call mpas_deallocate_field(yVertex)
-      call mpas_deallocate_field(zVertex)
-      call mpas_deallocate_field(xEdge)
-      call mpas_deallocate_field(yEdge)
-      call mpas_deallocate_field(zEdge)
-#endif
-
       deallocate(local_cell_list)
       deallocate(block_id)
       deallocate(block_start)
       deallocate(block_count)
       deallocate(readingBlock)
 
-!#ifdef HAVE_ZOLTAN
-!#ifdef _MPI 
-!     allocate(xCell(size(local_cell_list)))
-!     allocate(yCell(size(local_cell_list)))
-!     allocate(zCell(size(local_cell_list)))
-!     call mpas_dmpar_alltoall_field(domain % dminfo, xCellField % array, xCell, &amp;
-!                               size(xCellField % array), size(local_cell_list), &amp;
-!                               sendCellList, recvCellList)
-!   
-!     call mpas_dmpar_alltoall_field(domain % dminfo, yCellField % array, yCell, &amp;
-!                               size(yCellField % array), size(local_cell_list), &amp;
-!                               sendCellList, recvCellList)
-!   
-!     call mpas_dmpar_alltoall_field(domain % dminfo, zCellField % array, zCell, &amp;
-!                               size(zCellField % array), size(local_cell_list), &amp;
-!                               sendCellList, recvCellList)
-!#endif
-!#endif

-!#ifdef HAVE_ZOLTAN
-!#ifdef _MPI 
-!      !! For now, only use Zoltan with MPI
-!      !! Zoltan initialization
-!      call mpas_zoltan_start()
-!
-!      !! Zoltan hook for cells
-!      call mpas_zoltan_order_loc_hsfc_cells(block_graph_2Halo%nVertices,block_graph_2Halo%VertexID,3,xCell,yCell,zCell)
-!#endif
-!#endif
-!
-!   
-!#ifdef HAVE_ZOLTAN
-!#ifdef _MPI 
-!      allocate(xEdge(nlocal_edges))
-!      allocate(yEdge(nlocal_edges))
-!      allocate(zEdge(nlocal_edges))
-!      allocate(xVertex(nlocal_vertices))
-!      allocate(yVertex(nlocal_vertices))
-!      allocate(zVertex(nlocal_vertices))
-!#endif
-!#endif
-!    
-!#ifdef HAVE_ZOLTAN
-!#ifdef _MPI 
-!      call mpas_dmpar_alltoall_field(domain % dminfo, xEdgeField % array, xEdge, &amp;
-!                                size(xEdgeField % array), nlocal_edges, &amp;
-!                                sendEdgeList, recvEdgeList)
-!      call mpas_dmpar_alltoall_field(domain % dminfo, yEdgeField % array, yEdge, &amp;
-!                                size(yEdgeField % array), nlocal_edges, &amp;
-!                                sendEdgeList, recvEdgeList)
-!      call mpas_dmpar_alltoall_field(domain % dminfo, zEdgeField % array, zEdge, &amp;
-!                                size(zEdgeField % array), nlocal_edges, &amp;
-!                                sendEdgeList, recvEdgeList)
-!
-!      call mpas_dmpar_alltoall_field(domain % dminfo, xVertexField % array, xVertex, &amp;
-!                                size(xVertexField % array), nlocal_vertices, &amp;
-!                                sendVertexList, recvVertexList)
-!      call mpas_dmpar_alltoall_field(domain % dminfo, yVertexField % array, yVertex, &amp;
-!                                size(yVertexField % array), nlocal_vertices, &amp;
-!                                sendVertexList, recvVertexList)
-!      call mpas_dmpar_alltoall_field(domain % dminfo, zVertexField % array, zVertex, &amp;
-!                                size(zVertexField % array), nlocal_vertices, &amp;
-!                                sendVertexList, recvVertexList)
-!      !!!!!!!!!!!!!!!!!!
-!      !! Reorder edges
-!      !!!!!!!!!!!!!!!!!!
-!      call mpas_zoltan_order_loc_hsfc_edges(nOwnEdges,local_edge_list,3,xEdge,yEdge,zEdge)
-!      !!!!!!!!!!!!!!!!!!
-!
-!      !!!!!!!!!!!!!!!!!!
-!      !! Reorder vertices
-!      !!!!!!!!!!!!!!!!!!
-!      call mpas_zoltan_order_loc_hsfc_verts(nOwnVertices,local_vertex_list,3,xVertex,yVertex,zVertex)
-!      !!!!!!!!!!!!!!!!!!
-!
-!      deallocate(sendEdgeList % list)
-!      deallocate(sendEdgeList)
-!      deallocate(recvEdgeList % list)
-!      deallocate(recvEdgeList)
-!   
-!      deallocate(sendVertexList % list)
-!      deallocate(sendVertexList)
-!      deallocate(recvVertexList % list)
-!      deallocate(recvVertexList)
-!    
-!      !
-!      ! Knowing which edges/vertices are owned by this block and which are actually read
-!      !   from the input or restart file, we can build exchange lists to perform 
-!      !   all-to-all field exchanges from process that reads a field to the processes that
-!      !   need them
-!      !
-!      call mpas_dmpar_get_owner_list(domain % dminfo, &amp;
-!                                size(indexToEdgeIDField % array), nlocal_edges, &amp;
-!                                indexToEdgeIDField % array, local_edge_list, &amp;
-!                                sendEdgeList, recvEdgeList)
-!   
-!      call mpas_dmpar_get_owner_list(domain % dminfo, &amp;
-!                                size(indexToVertexIDField % array), nlocal_vertices, &amp;
-!                                indexToVertexIDField % array, local_vertex_list, &amp;
-!                                sendVertexList, recvVertexList)
-!
-!#endif
-!#endif
-!
-
-
-!      !
-!      ! Deallocate fields, graphs, and other memory
-!      !
-!#ifdef HAVE_ZOLTAN
-!#ifdef _MPI 
-!      deallocate(xCellField % ioinfo)
-!      deallocate(xCellField % array)
-!      deallocate(yCellField % ioinfo)
-!      deallocate(yCellField % array)
-!      deallocate(zCellField % ioinfo)
-!      deallocate(zCellField % array)
-!#endif
-!#endif
-
-!#ifdef HAVE_ZOLTAN
-!#ifdef _MPI
-!      deallocate(xCell)
-!      deallocate(yCell)
-!      deallocate(zCell)
-!#endif
-!#endif
    end subroutine mpas_input_state_for_domain!}}}
 
    !CR:TODO: an identical subroutine is found in module_io_output - merge
@@ -672,61 +535,7 @@
      call mpas_dmpar_init_mulithalo_exchange_list(indexToCellID % copyList, nHalos)
      nullify(indexToCellID % next)
    
-#ifdef HAVE_ZOLTAN
-#ifdef _MPI 
-     ! Cell x-coordinates (in 3d Cartesian space)
-     allocate(xCell)
-     allocate(xCell % ioinfo)
-     xCell % ioinfo % fieldName = 'xCell'
-     xCell % ioinfo % start(1) = readCellStart
-     xCell % ioinfo % count(1) = nReadCells
-     allocate(xCell % array(nReadCells))
-     call MPAS_io_inq_var(inputHandle, 'xCell', ierr=ierr)
-     call MPAS_io_set_var_indices(inputHandle, 'xCell', readIndices, ierr=ierr)
-     call mpas_io_get_var(inputHandle, 'xCell', xCell % array, ierr)
-     xCell % dimSizes(1) = nReadCells
-     xCell % block =&gt; readingBlock
-     xCell % sendList =&gt; indexToCellID % sendList
-     xCell % recvList =&gt; indexToCellID % recvList
-     xCell % copyList =&gt; indexToCellID % copyList
-     nullify(xCell % next)
 
-     ! Cell y-coordinates (in 3d Cartesian space)
-     allocate(yCell)
-     allocate(yCell % ioinfo)
-     yCell % ioinfo % fieldName = 'yCell'
-     yCell % ioinfo % start(1) = readCellStart
-     yCell % ioinfo % count(1) = nReadCells
-     allocate(yCell % array(nReadCells))
-     call MPAS_io_inq_var(inputHandle, 'yCell', ierr=ierr)
-     call MPAS_io_set_var_indices(inputHandle, 'yCell', readIndices, ierr=ierr)
-     call mpas_io_get_var(inputHandle, 'yCell', yCell % array, ierr)
-     yCell % sendList =&gt; indexToCellID % sendList
-     yCell % recvList =&gt; indexToCellID % recvList
-     yCell % copyList =&gt; indexToCellID % copyList
-     yCell % dimSizes(1) = nReadCells
-     yCell % block =&gt; readingBlock
-     nullify(yCell % next)
-
-     ! Cell z-coordinates (in 3d Cartesian space)
-     allocate(zCell)
-     allocate(zCell % ioinfo)
-     zCell % ioinfo % fieldName = 'zCell'
-     zCell % ioinfo % start(1) = readCellStart
-     zCell % ioinfo % count(1) = nReadCells
-     allocate(zCell % array(nReadCells))
-     call MPAS_io_inq_var(inputHandle, 'zCell', ierr=ierr)
-     call MPAS_io_set_var_indices(inputHandle, 'zCell', readIndices, ierr=ierr)
-     call mpas_io_get_var(inputHandle, 'zCell', zCell % array, ierr)
-     zCell % dimSizes(1) = nReadCells
-     zCell % block =&gt; readingBlock
-     zCell % sendList =&gt; indexToCellID % sendList
-     zCell % recvList =&gt; indexToCellID % recvList
-     zCell % copyList =&gt; indexToCellID % copyList
-     nullify(zCell % next)
-#endif
-#endif
-
      ! Number of cell/edges/vertices adjacent to each cell
      allocate(nEdgesOnCell)
      allocate(nEdgesOnCell % ioinfo)
@@ -852,61 +661,6 @@
      call mpas_dmpar_init_mulithalo_exchange_list(indexToEdgeID % copyList, nHalos+1)
      nullify(indexToEdgeID % next)
    
-#ifdef HAVE_ZOLTAN
-#ifdef _MPI 
-     ! Edge x-coordinates (in 3d Cartesian space)
-     allocate(xEdge)
-     allocate(xEdge % ioinfo)
-     xEdge % ioinfo % fieldName = 'xEdge'
-     xEdge % ioinfo % start(1) = readEdgeStart
-     xEdge % ioinfo % count(1) = nReadEdges
-     allocate(xEdge % array(nReadEdges))
-     call MPAS_io_inq_var(inputHandle, 'xEdge', ierr=ierr)
-     call MPAS_io_set_var_indices(inputHandle, 'xEdge', readIndices, ierr=ierr)
-     call mpas_io_get_var(inputHandle, 'xEdge', xEdge % array, ierr)
-     xEdge % dimSizes(1) = nReadEdges
-     xEdge % block =&gt; readingBlock
-     xEdge % sendList =&gt; indexToEdgeID % sendList
-     xEdge % recvList =&gt; indexToEdgeID % recvList
-     xEdge % copyList =&gt; indexToEdgeID % copyList
-     nullify(xEdge % next)
-
-     ! Edge y-coordinates (in 3d Cartesian space)
-     allocate(yEdge)
-     allocate(yEdge % ioinfo)
-     yEdge % ioinfo % fieldName = 'yEdge'
-     yEdge % ioinfo % start(1) = readEdgeStart
-     yEdge % ioinfo % count(1) = nReadEdges
-     allocate(yEdge % array(nReadEdges))
-     call MPAS_io_inq_var(inputHandle, 'yEdge', ierr=ierr)
-     call MPAS_io_set_var_indices(inputHandle, 'yEdge', readIndices, ierr=ierr)
-     call mpas_io_get_var(inputHandle, 'yEdge', yEdge % array, ierr)
-     yEdge % dimSizes(1) = nReadEdges
-     yEdge % block =&gt; readingBlock
-     yEdge % sendList =&gt; indexToEdgeID % sendList
-     yEdge % recvList =&gt; indexToEdgeID % recvList
-     yEdge % copyList =&gt; indexToEdgeID % copyList
-     nullify(yEdge % next)
-
-     ! Edge z-coordinates (in 3d Cartesian space)
-     allocate(zEdge)
-     allocate(zEdge % ioinfo)
-     zEdge % ioinfo % fieldName = 'zEdge'
-     zEdge % ioinfo % start(1) = readEdgeStart
-     zEdge % ioinfo % count(1) = nReadEdges
-     allocate(zEdge % array(nReadEdges))
-     call MPAS_io_inq_var(inputHandle, 'zEdge', ierr=ierr)
-     call MPAS_io_set_var_indices(inputHandle, 'zEdge', readIndices, ierr=ierr)
-     call mpas_io_get_var(inputHandle, 'zEdge', zEdge % array, ierr)
-     zEdge % dimSizes(1) = nReadEdges
-     zEdge % block =&gt; readingBlock
-     zEdge % sendList =&gt; indexToEdgeID % sendList
-     zEdge % recvList =&gt; indexToEdgeID % recvList
-     zEdge % copyList =&gt; indexToEdgeID % copyList
-     nullify(zEdge % next)
-#endif
-#endif
-
    
      ! Global indices of cells adjacent to each edge
      !    used for determining which edges are owned by a block, where 
@@ -972,61 +726,6 @@
      call mpas_dmpar_init_mulithalo_exchange_list(indexToVertexID % copyList, nHalos+1)
      nullify(indexToVertexID % next)
    
-#ifdef HAVE_ZOLTAN
-#ifdef _MPI
-     ! Vertex x-coordinates (in 3d Cartesian space)
-     allocate(xVertex)
-     allocate(xVertex % ioinfo)
-     xVertex % ioinfo % fieldName = 'xVertex'
-     xVertex % ioinfo % start(1) = readVertexStart
-     xVertex % ioinfo % count(1) = nReadVertices
-     allocate(xVertex % array(nReadVertices))
-     call MPAS_io_inq_var(inputHandle, 'xVertex', ierr=ierr)
-     call MPAS_io_set_var_indices(inputHandle, 'xVertex', readIndices, ierr=ierr)
-     call mpas_io_get_var(inputHandle, 'xVertex', xVertex % array, ierr)
-     xVertex % dimSizes(1) = nReadVertices
-     xVertex % block =&gt; readingBlock
-     xVertex % sendList =&gt; indexToVertexID % sendList
-     xVertex % recvList =&gt; indexToVertexID % recvList
-     xVertex % copyList =&gt; indexToVertexID % copyList
-     nullify(xVertex % next)
-
-     ! Vertex y-coordinates (in 3d Cartesian space)
-     allocate(yVertex)
-     allocate(yVertex % ioinfo)
-     yVertex % ioinfo % fieldName = 'yVertex'
-     yVertex % ioinfo % start(1) = readVertexStart
-     yVertex % ioinfo % count(1) = nReadVertices
-     allocate(yVertex % array(nReadVertices))
-     call MPAS_io_inq_var(inputHandle, 'yVertex', ierr=ierr)
-     call MPAS_io_set_var_indices(inputHandle, 'yVertex', readIndices, ierr=ierr)
-     call mpas_io_get_var(inputHandle, 'yVertex', yVertex % array, ierr)
-     yVertex % dimSizes(1) = nReadVertices
-     yVertex % block =&gt; readingBlock
-     yVertex % sendList =&gt; indexToVertexID % sendList
-     yVertex % recvList =&gt; indexToVertexID % recvList
-     yVertex % copyList =&gt; indexToVertexID % copyList
-     nullify(yVertex % next)
-
-     ! Vertex z-coordinates (in 3d Cartesian space)
-     allocate(zVertex)
-     allocate(zVertex % ioinfo)
-     zVertex % ioinfo % fieldName = 'zVertex'
-     zVertex % ioinfo % start(1) = readVertexStart
-     zVertex % ioinfo % count(1) = nReadVertices
-     allocate(zVertex % array(nReadVertices))
-     call MPAS_io_inq_var(inputHandle, 'zVertex', ierr=ierr)
-     call MPAS_io_set_var_indices(inputHandle, 'zVertex', readIndices, ierr=ierr)
-     call mpas_io_get_var(inputHandle, 'zVertex', zVertex % array, ierr)
-     zVertex % dimSizes(1) = nReadVertices
-     zVertex % block =&gt; readingBlock
-     zVertex % sendList =&gt; indexToVertexID % sendList
-     zVertex % recvList =&gt; indexToVertexID % recvList
-     zVertex % copyList =&gt; indexToVertexID % copyList
-     nullify(zVertex % next)
-#endif
-#endif
-
    
      ! Global indices of cells adjacent to each vertex
      !    used for determining which vertices are owned by a block, where 

Modified: branches/ocean_projects/tensor_operations/src/framework/mpas_io_output.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/framework/mpas_io_output.F        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/framework/mpas_io_output.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -343,6 +343,13 @@
  
       integer :: nferr, ierr
       integer, dimension(10) :: dimlist
+      character (len=StrKIND*4) :: runCmd
+
+      if(len(trim(domain % history)) &gt; 0) then
+          write(runCmd,'(a,a,i0,a,a,a)') trim(domain % history),' mpirun -n ',domain % dminfo % nProcs, ' ', trim(domain % coreName), '_model.exe; '
+      else
+          write(runCmd,'(a,i0,a,a,a)') 'mpirun -n ',domain % dminfo % nProcs, ' ', trim(domain % coreName), '_model.exe; '
+      end if
  
       call MPAS_createStream(output_obj % io_stream, trim(output_obj % filename), MPAS_IO_PNETCDF, MPAS_IO_WRITE, 1, nferr)
 
@@ -354,6 +361,10 @@
          call MPAS_writeStreamAtt(output_obj % io_stream, 'on_a_sphere', 'NO              ', nferr)
       end if
       call MPAS_writeStreamAtt(output_obj % io_stream, 'sphere_radius', mesh % sphere_radius, nferr)
+      call MPAS_writeStreamAtt(output_obj % io_stream, 'model_name', domain % modelName, nferr)
+      call MPAS_writeStreamAtt(output_obj % io_stream, 'core_name', domain % coreName, nferr)
+      call MPAS_writeStreamAtt(output_obj % io_stream, 'model_version', domain % modelVersion, nferr)
+      call MPAS_writeStreamAtt(output_obj % io_stream, 'history', runCmd, nferr)
 
 #include &quot;add_output_atts.inc&quot;
  

Deleted: branches/ocean_projects/tensor_operations/src/framework/mpas_zoltan_interface.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/framework/mpas_zoltan_interface.F        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/framework/mpas_zoltan_interface.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -1,581 +0,0 @@
-module mpas_zoltan_interface
-   use zoltan
-
-   implicit none
-
-   include 'mpif.h'
-
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   !! Data for reordering cells
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   integer :: numCells
-   integer, dimension(:), pointer :: cellIDs
-   integer :: geomDim
-   real (kind=RKIND), dimension(:), pointer :: cellCoordX, cellCoordY, cellCoordZ
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   !! Data for reordering edges
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   integer :: numEdges
-   integer, dimension(:), pointer :: edgeIDs
-   real (kind=RKIND), dimension(:), pointer :: edgeCoordX, edgeCoordY, edgeCoordZ  
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   !! Data for reordering vertices
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   integer :: numVerts
-   integer, dimension(:), pointer :: vertIDs
-   real (kind=RKIND), dimension(:), pointer :: vertCoordX, vertCoordY, vertCoordZ  
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-
-   contains
-
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   !! Perhaps not necessary, but implemented in case it helps
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   subroutine mpas_zoltan_start()  
-
-      integer(Zoltan_INT) :: error
-      real(Zoltan_FLOAT) :: version
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      !! Body of subroutine
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      error = Zoltan_Initialize(version)
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      
-   end subroutine
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   subroutine mpas_zoltan_order_loc_hsfc_cells(in_numcells,in_cellIDs,in_geomDim,in_cellX, &amp;
-                                       in_cellY, in_cellZ)
-      implicit none
-
-      integer :: in_numcells
-      integer, dimension(:), pointer :: in_cellIDs
-      integer :: in_geomDim
-      real (kind=RKIND), dimension(:), pointer :: in_cellX, in_cellY, in_cellZ
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      !! local variables
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-      type(Zoltan_Struct), pointer :: zz_obj
-      integer(ZOLTAN_INT) :: ierr
-
-      integer :: numGidEntries, i
-      integer(ZOLTAN_INT), allocatable :: global_ids(:), permIndices(:),permGIDs(:)
-      real(kind=RKIND), allocatable :: permXs(:),permYs(:),permZs(:)
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      !! Body of subroutine
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      numCells = in_numcells
-      cellIDs =&gt; in_cellIDs
-      geomDim = in_geomDim
-      cellCoordX =&gt; in_cellX
-      cellCoordY =&gt; in_cellY
-      cellCoordZ =&gt; in_cellZ
-
-      nullify(zz_obj)
-      zz_obj =&gt; Zoltan_Create(MPI_COMM_SELF)
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      !! General Zoltan Parameters
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      ierr = Zoltan_Set_Param(zz_obj, &quot;ORDER_METHOD&quot;, &quot;LOCAL_HSFC&quot;)
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      !! register query functions
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      ierr = Zoltan_Set_Fn(zz_obj, ZOLTAN_NUM_OBJ_FN_TYPE,zqfNumCells)
-      ierr = Zoltan_Set_Fn(zz_obj, ZOLTAN_OBJ_LIST_FN_TYPE,zqfGetCells)
-      ierr = Zoltan_Set_Fn(zz_obj, ZOLTAN_NUM_GEOM_FN_TYPE,zqfGeomDim)
-      ierr =  Zoltan_Set_Fn(zz_obj, ZOLTAN_GEOM_FN_TYPE, zqfGetCellGeom)
-
-      numGidEntries=1
-
-      allocate(global_ids(numCells))
-      allocate(permIndices(numCells))
-      allocate(permGIDs(numCells))
-      allocate(permXs(numCells))
-      allocate(permYs(numCells))
-      allocate(permZs(numCells))
-
-      !! MMW: There might be a way to use cellIDs directly
-      do i=1,numCells
-        global_ids(i) = cellIDs(i)
-      end do
-
-      ierr = Zoltan_Order(zz_obj, numGidEntries, numCells, global_ids, permIndices);
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!
-      !! This is necessary for now until we fix a small bug in Zoltan_Order
-      !!!!!!!!!!!!!!!!!!!!!!!!!!
-      do i=1,numCells
-        permGIDs(i) = global_ids(permIndices(i)+1)
-        permXs(i) = cellCoordX(permIndices(i)+1)
-        permYs(i) = cellCoordY(permIndices(i)+1)
-        permZs(i) = cellCoordZ(permIndices(i)+1)
-      end do
-
-      !!do i=1,numCells
-      !!   write(*,*) global_ids(i), permGIDs(i)
-      !!end do
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!
-      !! Actually change the ordering of the cells
-      !!!!!!!!!!!!!!!!!!!!!!!!!!
-      do i=1,numCells
-        cellIDs(i) = permGIDs(i)
-        cellCoordX(i) = permXs(i)
-        cellCoordY(i) = permYs(i)
-        cellCoordZ(i) = permZs(i)
-      end do
-      !!!!!!!!!!!!!!!!!!!!!!!!!!
-
-      deallocate(global_ids)
-      deallocate(permIndices)
-      deallocate(permGIDs)
-      deallocate(permXs)
-      deallocate(permYs)
-      deallocate(permZs)
-
-      call Zoltan_Destroy(zz_obj)
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-   end subroutine mpas_zoltan_order_loc_hsfc_cells
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   !! zoltan query function:
-   !!    Returns number of cells
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   integer function zqfNumCells(data, ierr)
-
-      ! Local declarations
-      integer(ZOLTAN_INT), intent(in) :: data(*)
-      integer(ZOLTAN_INT), intent(out) :: ierr
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      zqfNumCells = numCells
-      ierr = ZOLTAN_OK
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   end function zqfNumCells
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   !! zoltan query function: 
-   !!    Returns lists of Cell IDs
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   subroutine mpas_zqf_get_cells (data, num_gid_entries, num_lid_entries, global_ids, &amp;
-                           local_ids, wgt_dim, obj_wgts, ierr)
-     integer(ZOLTAN_INT), intent(in) :: data(*)
-     integer(ZOLTAN_INT), intent(in) :: num_gid_entries, num_lid_entries
-     integer(ZOLTAN_INT), intent(out) :: global_ids(*), local_ids(*)
-     integer(ZOLTAN_INT), intent(in) :: wgt_dim 
-     real(ZOLTAN_FLOAT), intent(out) :: obj_wgts(*)
-     integer(ZOLTAN_INT), intent(out) :: ierr
-
-     ! local declarations
-     integer :: i
-
-     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-     do i= 1, numCells
-       global_ids(i) = cellIDs(i)
-       local_ids(i) = i
-     end do
-
-     ierr = ZOLTAN_OK
-     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   end subroutine mpas_zqf_get_cells
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   !! Zoltan Query Function:
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   integer function zqfGeomDim(data, ierr)
-      !use zoltan
-      implicit none
-      integer(ZOLTAN_INT), intent(in) :: data(*)
-      integer(ZOLTAN_INT) :: ierr
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      zqfGeomDim = geomDim
-      ierr = ZOLTAN_OK
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   end function zqfGeomDim
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   !! Zoltan Query Function:
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   subroutine mpas_zqf_get_cell_geom(data, num_gid_entries, num_lid_entries, global_id, &amp;
-                             local_id, geom_vec, ierr)
-      !use zoltan
-      implicit none
-
-      integer(ZOLTAN_INT), intent(in) :: data(*)
-      integer(ZOLTAN_INT), intent(in) :: num_gid_entries, num_lid_entries
-      integer(ZOLTAN_INT), intent(in) :: global_id, local_id
-      real(ZOLTAN_DOUBLE), intent(out) :: geom_vec(*)
-      integer(ZOLTAN_INT), intent(out) :: ierr
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      !! Assuming geom_dim is 3
-      geom_vec(1) = cellCoordX(local_id)
-      geom_vec(2) = cellCoordY(local_id)
-      geom_vec(3) = cellCoordZ(local_id)
-
-      ierr = ZOLTAN_OK
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   end subroutine mpas_zqf_get_cell_geom
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   !! The ordering functions should perhaps be refactored so that there
-   !! are not separate functions for cells, edges, and vertices
-   !! Not sure if this is worth it with the additional conditionals that would 
-   !! be required. 
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   subroutine mpas_zoltan_order_loc_hsfc_edges(in_numedges,in_edgeIDs,in_geomDim,in_edgeX, &amp;
-                                       in_edgeY, in_edgeZ)
-      implicit none
-
-      integer :: in_numedges
-      integer, dimension(:), pointer :: in_edgeIDs
-      integer :: in_geomDim
-      real (kind=RKIND), dimension(:), pointer :: in_edgeX, in_edgeY, in_edgeZ
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      !! local variables
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      type(Zoltan_Struct), pointer :: zz_obj
-      integer(ZOLTAN_INT) :: ierr
-
-      integer :: numGidEntries, i
-      integer(ZOLTAN_INT), allocatable :: global_ids(:), permIndices(:),permGIDs(:)
-      real(kind=RKIND), allocatable :: permXs(:),permYs(:),permZs(:)
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      !! Body of subroutine
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      numEdges = in_numedges
-      edgeIDs =&gt; in_edgeIDs
-      geomDim = in_geomDim
-      edgeCoordX =&gt; in_edgeX
-      edgeCoordY =&gt; in_edgeY
-      edgeCoordZ =&gt; in_edgeZ
-
-      nullify(zz_obj)
-      zz_obj =&gt; Zoltan_Create(MPI_COMM_SELF)
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      !! General Zoltan Parameters
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      ierr = Zoltan_Set_Param(zz_obj, &quot;ORDER_METHOD&quot;, &quot;LOCAL_HSFC&quot;)
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      !! register query functions
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      ierr = Zoltan_Set_Fn(zz_obj, ZOLTAN_NUM_OBJ_FN_TYPE,zqfNumEdges)
-      ierr = Zoltan_Set_Fn(zz_obj, ZOLTAN_OBJ_LIST_FN_TYPE,zqfGetEdges)
-      ierr = Zoltan_Set_Fn(zz_obj, ZOLTAN_NUM_GEOM_FN_TYPE,zqfGeomDim)
-      ierr =  Zoltan_Set_Fn(zz_obj, ZOLTAN_GEOM_FN_TYPE, zqfGetEdgeGeom)
-
-      numGidEntries=1
-
-      allocate(global_ids(numEdges))
-      allocate(permIndices(numEdges))
-      allocate(permGIDs(numEdges))
-      allocate(permXs(numEdges))
-      allocate(permYs(numEdges))
-      allocate(permZs(numEdges))
-
-      !! MMW: There might be a way to use edgeIDs directly
-      do i=1,numEdges
-        global_ids(i) = edgeIDs(i)
-      end do
-
-      ierr = Zoltan_Order(zz_obj, numGidEntries, numEdges, global_ids, permIndices);
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!
-      !! This is necessary for now until we fix a small bug in Zoltan_Order
-      !!!!!!!!!!!!!!!!!!!!!!!!!!
-      do i=1,numEdges
-        permGIDs(i) = global_ids(permIndices(i)+1)
-        permXs(i) = edgeCoordX(permIndices(i)+1)
-        permYs(i) = edgeCoordY(permIndices(i)+1)
-        permZs(i) = edgeCoordZ(permIndices(i)+1)
-      end do
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!
-      !! Actually change the ordering of the edges
-      !!!!!!!!!!!!!!!!!!!!!!!!!!
-      do i=1,numEdges
-        edgeIDs(i) = permGIDs(i)
-        edgeCoordX(i) = permXs(i)
-        edgeCoordY(i) = permYs(i)
-        edgeCoordZ(i) = permZs(i)
-      end do
-      !!!!!!!!!!!!!!!!!!!!!!!!!!
-
-      deallocate(global_ids)
-      deallocate(permIndices)
-      deallocate(permGIDs)
-      deallocate(permXs)
-      deallocate(permYs)
-      deallocate(permZs)
-
-      call Zoltan_Destroy(zz_obj)
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   end subroutine mpas_zoltan_order_loc_hsfc_edges
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   !! zoltan query function:
-   !!    Returns number of edges
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   integer function zqfNumEdges(data, ierr)
-      ! Local declarations
-      integer(ZOLTAN_INT), intent(in) :: data(*)
-      integer(ZOLTAN_INT), intent(out) :: ierr
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      zqfNumEdges = numEdges
-      ierr = ZOLTAN_OK
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   end function zqfNumEdges
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   !! zoltan query function: 
-   !!    Returns lists of Edge IDs
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   subroutine mpas_zqf_get_edges (data, num_gid_entries, num_lid_entries, global_ids, &amp;
-                           local_ids, wgt_dim, obj_wgts, ierr)
-     integer(ZOLTAN_INT), intent(in) :: data(*)
-     integer(ZOLTAN_INT), intent(in) :: num_gid_entries, num_lid_entries
-     integer(ZOLTAN_INT), intent(out) :: global_ids(*), local_ids(*)
-     integer(ZOLTAN_INT), intent(in) :: wgt_dim 
-     real(ZOLTAN_FLOAT), intent(out) :: obj_wgts(*)
-     integer(ZOLTAN_INT), intent(out) :: ierr
-
-     ! local declarations
-     integer :: i
-
-     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-     do i= 1, numEdges
-       global_ids(i) = edgeIDs(i)
-       local_ids(i) = i
-     end do
-
-     ierr = ZOLTAN_OK
-     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   end subroutine mpas_zqf_get_edges
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   !! Zoltan Query Function:
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   subroutine mpas_zqf_get_edge_geom(data, num_gid_entries, num_lid_entries, global_id, &amp;
-                             local_id, geom_vec, ierr)
-      !use zoltan
-      implicit none
-
-      integer(ZOLTAN_INT), intent(in) :: data(*)
-      integer(ZOLTAN_INT), intent(in) :: num_gid_entries, num_lid_entries
-      integer(ZOLTAN_INT), intent(in) :: global_id, local_id
-      real(ZOLTAN_DOUBLE), intent(out) :: geom_vec(*)
-      integer(ZOLTAN_INT), intent(out) :: ierr
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      !! Assuming geom_dim is 3
-      geom_vec(1) = edgeCoordX(local_id)
-      geom_vec(2) = edgeCoordY(local_id)
-      geom_vec(3) = edgeCoordZ(local_id)
-
-      ierr = ZOLTAN_OK
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   end subroutine mpas_zqf_get_edge_geom
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   subroutine mpas_zoltan_order_loc_hsfc_verts(in_numverts,in_vertIDs,in_geomDim,in_vertX, &amp;
-                                       in_vertY, in_vertZ)
-      implicit none
-
-      integer :: in_numverts
-      integer, dimension(:), pointer :: in_vertIDs
-      integer :: in_geomDim
-      real (kind=RKIND), dimension(:), pointer :: in_vertX, in_vertY, in_vertZ
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      !! local variables
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      type(Zoltan_Struct), pointer :: zz_obj
-      integer(ZOLTAN_INT) :: ierr
-
-      integer :: numGidEntries, i
-      integer(ZOLTAN_INT), allocatable :: global_ids(:), permIndices(:),permGIDs(:)
-      real(kind=RKIND), allocatable :: permXs(:),permYs(:),permZs(:)
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      !! Body of subroutine
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      numVerts = in_numverts
-      vertIDs =&gt; in_vertIDs
-      geomDim = in_geomDim
-      vertCoordX =&gt; in_vertX
-      vertCoordY =&gt; in_vertY
-      vertCoordZ =&gt; in_vertZ
-
-      nullify(zz_obj)
-      zz_obj =&gt; Zoltan_Create(MPI_COMM_SELF)
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      !! General Zoltan Parameters
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      ierr = Zoltan_Set_Param(zz_obj, &quot;ORDER_METHOD&quot;, &quot;LOCAL_HSFC&quot;)
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      !! register query functions
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      ierr = Zoltan_Set_Fn(zz_obj, ZOLTAN_NUM_OBJ_FN_TYPE,zqfNumVerts)
-      ierr = Zoltan_Set_Fn(zz_obj, ZOLTAN_OBJ_LIST_FN_TYPE,zqfGetVerts)
-      ierr = Zoltan_Set_Fn(zz_obj, ZOLTAN_NUM_GEOM_FN_TYPE,zqfGeomDim)
-      ierr =  Zoltan_Set_Fn(zz_obj, ZOLTAN_GEOM_FN_TYPE, zqfGetVertGeom)
-
-      numGidEntries=1
-
-      allocate(global_ids(numVerts))
-      allocate(permIndices(numVerts))
-      allocate(permGIDs(numVerts))
-      allocate(permXs(numVerts))
-      allocate(permYs(numVerts))
-      allocate(permZs(numVerts))
-
-      !! MMW: There might be a way to use vertIDs directly
-      do i=1,numVerts
-        global_ids(i) = vertIDs(i)
-      end do
-
-      ierr = Zoltan_Order(zz_obj, numGidEntries, numVerts, global_ids, permIndices);
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!
-      !! This is necessary for now until we fix a small bug in Zoltan_Order
-      !!!!!!!!!!!!!!!!!!!!!!!!!!
-      do i=1,numVerts
-        permGIDs(i) = global_ids(permIndices(i)+1)
-        permXs(i) = vertCoordX(permIndices(i)+1)
-        permYs(i) = vertCoordY(permIndices(i)+1)
-        permZs(i) = vertCoordZ(permIndices(i)+1)
-      end do
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!
-      !! Actually change the ordering of the verts
-      !!!!!!!!!!!!!!!!!!!!!!!!!!
-      do i=1,numVerts
-        vertIDs(i) = permGIDs(i)
-        vertCoordX(i) = permXs(i)
-        vertCoordY(i) = permYs(i)
-        vertCoordZ(i) = permZs(i)
-      end do
-      !!!!!!!!!!!!!!!!!!!!!!!!!!
-
-      deallocate(global_ids)
-      deallocate(permIndices)
-      deallocate(permGIDs)
-      deallocate(permXs)
-      deallocate(permYs)
-      deallocate(permZs)
-
-      call Zoltan_Destroy(zz_obj)
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-   end subroutine mpas_zoltan_order_loc_hsfc_verts
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   !! zoltan query function:
-   !!    Returns number of verts
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   integer function zqfNumVerts(data, ierr)
-
-      ! Local declarations
-      integer(ZOLTAN_INT), intent(in) :: data(*)
-      integer(ZOLTAN_INT), intent(out) :: ierr
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      zqfNumVerts = numVerts
-      ierr = ZOLTAN_OK
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   end function zqfNumVerts
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   !! zoltan query function: 
-   !!    Returns lists of Vert IDs
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   subroutine mpas_zqf_get_verts (data, num_gid_entries, num_lid_entries, global_ids, &amp;
-                           local_ids, wgt_dim, obj_wgts, ierr)
-
-     integer(ZOLTAN_INT), intent(in) :: data(*)
-     integer(ZOLTAN_INT), intent(in) :: num_gid_entries, num_lid_entries
-     integer(ZOLTAN_INT), intent(out) :: global_ids(*), local_ids(*)
-     integer(ZOLTAN_INT), intent(in) :: wgt_dim 
-     real(ZOLTAN_FLOAT), intent(out) :: obj_wgts(*)
-     integer(ZOLTAN_INT), intent(out) :: ierr
-
-     ! local declarations
-     integer :: i
-
-     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-     do i= 1, numVerts
-       global_ids(i) = vertIDs(i)
-       local_ids(i) = i
-     end do
-
-     ierr = ZOLTAN_OK
-     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   end subroutine mpas_zqf_get_verts
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   !! Zoltan Query Function:
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   subroutine mpas_zqf_get_vert_geom(data, num_gid_entries, num_lid_entries, global_id, &amp;
-                             local_id, geom_vec, ierr)
-      !use zoltan
-      implicit none
-
-      integer(ZOLTAN_INT), intent(in) :: data(*)
-      integer(ZOLTAN_INT), intent(in) :: num_gid_entries, num_lid_entries
-      integer(ZOLTAN_INT), intent(in) :: global_id, local_id
-      real(ZOLTAN_DOUBLE), intent(out) :: geom_vec(*)
-      integer(ZOLTAN_INT), intent(out) :: ierr
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      !! Assuming geom_dim is 3
-      geom_vec(1) = vertCoordX(local_id)
-      geom_vec(2) = vertCoordY(local_id)
-      geom_vec(3) = vertCoordZ(local_id)
-
-      ierr = ZOLTAN_OK
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   end subroutine mpas_zqf_get_vert_geom
-   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-
-
-
-end module mpas_zoltan_interface

Modified: branches/ocean_projects/tensor_operations/src/framework/streams.c
===================================================================
--- branches/ocean_projects/tensor_operations/src/framework/streams.c        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/framework/streams.c        2013-04-18 15:33:42 UTC (rev 2767)
@@ -34,14 +34,14 @@
                    return;
            }
    } else {
-           sprintf(fname, &quot;/dev/null&quot;, *id);
+           sprintf(fname, &quot;/dev/null&quot;);
            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="red">&quot;);
                    return;
            }
 
-           sprintf(fname, &quot;/dev/null&quot;, *id);
+           sprintf(fname, &quot;/dev/null&quot;);
            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;);

Modified: branches/ocean_projects/tensor_operations/src/operators/Makefile
===================================================================
--- branches/ocean_projects/tensor_operations/src/operators/Makefile        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/operators/Makefile        2013-04-18 15:33:42 UTC (rev 2767)
@@ -1,14 +1,22 @@
 .SUFFIXES: .F .o
 
-OBJS = mpas_rbf_interpolation.o mpas_vector_reconstruction.o mpas_spline_interpolation.o
+OBJS = mpas_vector_operations.o \
+       mpas_matrix_operations.o \
+       mpas_tensor_operations.o \
+       mpas_rbf_interpolation.o \
+       mpas_vector_reconstruction.o \
+       mpas_spline_interpolation.o
 
 all: operators
 
 operators: $(OBJS)
         ar -ru libops.a $(OBJS)
 
+mpas_vector_operations.o:
+mpas_matrix_operations.o:
+mpas_tensor_operations.o: mpas_vector_operations.o mpas_matrix_operations.o
+mpas_rbf_interpolation.o: mpas_vector_operations.o
 mpas_vector_reconstruction.o: mpas_rbf_interpolation.o
-mpas_rbf_interpolation.o:
 mpas_spline_interpolation:
 
 clean:

Added: branches/ocean_projects/tensor_operations/src/operators/mpas_matrix_operations.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/operators/mpas_matrix_operations.F                                (rev 0)
+++ branches/ocean_projects/tensor_operations/src/operators/mpas_matrix_operations.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -0,0 +1,438 @@
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  mpas_matrix_operations
+!
+!&gt; \brief MPAS matrix operations
+!&gt; \author Mark Petersen
+!&gt; \date    15 April 2013
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This module contains the routines for matrix operations
+!
+!-----------------------------------------------------------------------
+
+module mpas_matrix_operations
+
+   use mpas_grid_types
+   use mpas_constants
+
+   implicit none
+   private
+   save
+
+   !--------------------------------------------------------------------
+   !
+   ! Public parameters
+   !
+   !--------------------------------------------------------------------
+
+   !--------------------------------------------------------------------
+   !
+   ! Public member functions
+   !
+   !--------------------------------------------------------------------
+
+   public :: mpas_rotate_2D_matrix_2x2, &amp;
+             mpas_rotate_2D_matrix_sym3index, &amp;
+             mpas_matrix_sym6index_to_3x3, &amp;
+             mpas_matrix_3x3_to_sym6index, &amp;
+             mpas_matrix_cell_to_edge, &amp;
+             mpas_outer_product
+
+   !--------------------------------------------------------------------
+   !
+   ! Private module variables
+   !
+   !--------------------------------------------------------------------
+
+!***********************************************************************
+
+contains
+
+!***********************************************************************
+!
+!  routine mpas_rotate_2D_matrix_2x2
+!
+!&gt; \brief   Rotate a 2D matrix in 2x2 index format
+!&gt; \author  Mark Petersen
+!&gt; \date    15 April 2013
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt;  Rotate matrix A about the angle theta using rotation matrix R, where
+!&gt;  B = RAR'  and R' is the tranpose.
+!
+!-----------------------------------------------------------------------
+
+   subroutine mpas_rotate_2D_matrix_2x2(A,theta,B)
+
+      !-----------------------------------------------------------------
+      !
+      ! input variables
+      !
+      !-----------------------------------------------------------------
+
+      real (kind=RKIND), dimension(2,2), intent(in) :: &amp;
+         A   !&lt; Input: 2x2 matrix
+
+      real (kind=RKIND), intent(in) :: &amp;
+         theta   !&lt; Input: rotation angle
+
+      !-----------------------------------------------------------------
+      !
+      ! input/output variables
+      !
+      !-----------------------------------------------------------------
+
+      !-----------------------------------------------------------------
+      !
+      ! output variables
+      !
+      !-----------------------------------------------------------------
+
+      real (kind=RKIND), dimension(2,2), intent(out) :: &amp;
+         B   !&lt; Output: 2x2 matrix
+
+      !-----------------------------------------------------------------
+      !
+      ! local variables
+      !
+      !-----------------------------------------------------------------
+
+      real (kind=RKIND), dimension(2,2) :: &amp;
+         R   ! 2x2 rotation matrix
+
+      integer :: i,j,k,l
+
+      real (kind=RKIND) :: sin1, cos1
+
+      cos1 = cos(theta)
+      sin1 = sin(theta)
+
+      ! create rotation matrix
+      R(1,1) = cos1
+      R(1,2) = -sin1
+      R(2,1) = sin1
+      R(2,2) = cos1
+
+      B = 0.0
+      do i=1,2
+        do j=1,2
+          do k=1,2
+            do l=1,2
+              ! B = R A R' in matrix format
+              ! B(i,j) =  R(i,k) A(k,l) R(j,l) in index format
+              ! note indices switched on second R due to transpose.
+              B(i,j) = B(i,j) + R(i,k)*A(k,l)*R(j,l)
+            enddo
+          enddo
+        enddo
+      enddo
+
+   end subroutine mpas_rotate_2D_matrix_2x2!}}}
+
+!***********************************************************************
+!
+!  routine mpas_rotate_2D_matrix_sym3index
+!
+!&gt; \brief   Rotate a 2D matrix in 3-index format
+!&gt; \author  Mark Petersen
+!&gt; \date    15 April 2013
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt;  Rotate matrix A about the angle theta using rotation matrix R, where
+!&gt;  B = RAR'  and R' is the tranpose.  A is a symmetric matrix in 3-index
+!&gt;  format, where A(1)=A_{11}, A(2)=A_{22}, and A(3)=A_{12}
+!
+!-----------------------------------------------------------------------
+
+   subroutine mpas_rotate_2D_matrix_sym3index(A,theta,B)
+
+      !-----------------------------------------------------------------
+      !
+      ! input variables
+      !
+      !-----------------------------------------------------------------
+
+      real (kind=RKIND), dimension(3), intent(in) :: &amp;
+         A   !&lt; Input: 2x2 symmetric matrix in 3-index format
+
+      real (kind=RKIND), intent(in) :: &amp;
+         theta   !&lt; Input: rotation angle
+
+      !-----------------------------------------------------------------
+      !
+      ! input/output variables
+      !
+      !-----------------------------------------------------------------
+
+      !-----------------------------------------------------------------
+      !
+      ! output variables
+      !
+      !-----------------------------------------------------------------
+
+      real (kind=RKIND), dimension(3), intent(out) :: &amp;
+         B   !&lt; Input: 2x2 symmetric matrix in 3-index format
+
+      !-----------------------------------------------------------------
+      !
+      ! local variables
+      !
+      !-----------------------------------------------------------------
+
+      real (kind=RKIND) :: sin1, cos1, sin2, cos2, cossin
+
+      cos1 = cos(theta)
+      sin1 = sin(theta)
+      cos2 = cos1**2
+      sin2 = sin1**2
+      cossin = cos1*sin1
+
+      ! Tensor rotation through angle theta:
+      ! R = | cos(theta)    -sin(theta)  |
+      !     | sin(theta)     cos(theta)  |
+      ! is the 2D rotation matrix.  Tensor rotation is
+      ! B = R A R'  where R' is the transpose.
+
+      ! A and B are symmetric, in 3-index format:
+      ! A(1)=A_{11}, A(2)=A_{22}, and A(3)=A_{12}
+
+      B(1) = A(1)*cos2 + A(2)*sin2 - A(3)*2*cossin
+      B(2) = A(1)*sin2 + A(2)*cos2 + A(3)*2*cossin 
+      B(3) = (A(1) - A(2))*cossin + A(3)*(cos2-sin2)
+
+   end subroutine mpas_rotate_2D_matrix_sym3index!}}}
+
+
+!***********************************************************************
+!
+!  routine mpas_matrix_sym6index_to_3x3
+!
+!&gt; \brief   Convert a symetric 6-index matrix to 3x3 format
+!&gt; \author  Mark Petersen
+!&gt; \date    15 April 2013
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt;  Given a symetric 6-index matrix A, produce a 3x3 matrix B, where
+!&gt;  A(1)=B_{11}, A(2)=B_{22}, A(3)=A_{33},
+!&gt;  A(4)=B_{12}, A(5)=B_{23}, A(6)=A_{13},
+!
+!-----------------------------------------------------------------------
+
+   subroutine mpas_matrix_sym6index_to_3x3(A,B)
+
+      !-----------------------------------------------------------------
+      !
+      ! input variables
+      !
+      !-----------------------------------------------------------------
+
+      real (kind=RKIND), dimension(6), intent(in) :: &amp;
+         A   !&lt; Input: 3x3 symmetric matrix in 6-index format
+
+      !-----------------------------------------------------------------
+      !
+      ! output variables
+      !
+      !-----------------------------------------------------------------
+
+      real (kind=RKIND), dimension(3,3), intent(out) :: &amp;
+         B   !&lt; Output: 3x3 symmetric matrix in 3x3 format
+
+
+      B(1,1) = A(1)
+      B(2,2) = A(2)
+      B(3,3) = A(3)
+      B(1,2) = A(4)
+      B(2,1) = A(4)
+      B(2,3) = A(5)
+      B(3,2) = A(5)
+      B(1,3) = A(6)
+      B(3,1) = A(6)
+
+   end subroutine mpas_matrix_sym6index_to_3x3!}}}
+
+
+!***********************************************************************
+!
+!  routine mpas_matrix_3x3_to_sym6index
+!
+!&gt; \brief   Convert a 3x3 format matrix to a symetric 6-index matrix
+!&gt; \author  Mark Petersen
+!&gt; \date    15 April 2013
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt;  Given a 3x3 matrix B, produce a symetric 6-index matrix A,
+!&gt;  B(1)=A(1,1), B(2)=A(2,2), B(3)=A(3,3)
+!&gt;  B(4)=(A(1,2)+A(2,1))/2
+!&gt;  B(5)=(A(2,3)+A(3,2))/2
+!&gt;  B(6)=(A(1,3)+A(3,1))/2
+!
+!-----------------------------------------------------------------------
+
+   subroutine mpas_matrix_3x3_to_sym6index(A,B)
+
+      !-----------------------------------------------------------------
+      !
+      ! input variables
+      !
+      !-----------------------------------------------------------------
+
+      real (kind=RKIND), dimension(3,3), intent(in) :: &amp;
+         A   !&lt; Input: 3x3 symmetric matrix in 3x3 format
+
+      !-----------------------------------------------------------------
+      !
+      ! output variables
+      !
+      !-----------------------------------------------------------------
+
+      real (kind=RKIND), dimension(6), intent(out) :: &amp;
+         B   !&lt; Output: 3x3 symmetric matrix in 6-index format
+
+
+      B(1) = A(1,1)
+      B(2) = A(2,2)
+      B(3) = A(3,3)
+      B(4) = 0.5*(A(1,2)+A(2,1))
+      B(5) = 0.5*(A(2,3)+A(3,2))
+      B(6) = 0.5*(A(1,3)+A(3,1))
+
+   end subroutine mpas_matrix_3x3_to_sym6index!}}}
+
+
+!***********************************************************************
+!
+!  routine mpas_matrix_cell_to_edge
+!
+!&gt; \brief   Interpolate a matrix from cell to edge
+!&gt; \author  Mark Petersen
+!&gt; \date    5 April 2013
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt;  This routine interpolates a matrix from cell to edge locations.
+!&gt;  derivative.  Output is a 2D strain rate in 3-index format, with
+!&gt;  direction one normal to the edge and direction two tangent to the edge.
+!
+!-----------------------------------------------------------------------
+
+   subroutine mpas_matrix_cell_to_edge(grid, matrixCell, matrixEdge)!{{{
+
+      !-----------------------------------------------------------------
+      !
+      ! input variables
+      !
+      !-----------------------------------------------------------------
+
+      real (kind=RKIND), dimension(:,:,:), intent(in) :: &amp;
+         matrixCell   !&lt; Input: matrix located at Cell
+
+      type (mesh_type), intent(in) :: &amp;
+         grid          !&lt; Input: grid information
+
+      !-----------------------------------------------------------------
+      !
+      ! output variables
+      !
+      !-----------------------------------------------------------------
+
+      real (kind=RKIND), dimension(:,:,:), intent(out) :: &amp;
+         matrixEdge   !&lt; Output: matrix located at Edge
+
+      !-----------------------------------------------------------------
+      !
+      ! local variables
+      !
+      !-----------------------------------------------------------------
+
+      integer :: iEdge, nEdges, cell1, cell2, k, nVertLevels
+      integer, dimension(:,:), pointer :: cellsOnEdge
+
+      nEdges = grid % nEdges
+      nVertLevels = grid % nVertLevels
+
+      cellsOnEdge =&gt; grid % cellsOnEdge % array
+
+      ! error check that index 1 of matrixEdge and matrixCell are same length?
+
+      do iEdge=1,nEdges
+         cell1 = cellsOnEdge(1,iEdge)
+         cell2 = cellsOnEdge(2,iEdge)
+
+         do k=1,nVertLevels
+
+            matrixEdge(:,k,iEdge) = 0.5*(matrixCell(:,k,cell1) + matrixCell(:,k,cell2))
+
+         enddo
+      enddo
+
+   end subroutine mpas_matrix_cell_to_edge!}}}
+
+
+!***********************************************************************
+!
+!  routine mpas_outer_product
+!
+!&gt; \brief   Compute the outer product of vectors u and v
+!&gt; \author  Mark Petersen
+!&gt; \date    15 April 2013
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt;  Given two n-length vector u and m-length vector v, compute the 
+!&gt;  outer product (tensor product) to compute the nxm matrix A,
+!&gt;  A(i,j) = u(i)*v(j)
+!
+!-----------------------------------------------------------------------
+
+   subroutine mpas_outer_product(u,v,A)
+
+      !-----------------------------------------------------------------
+      !
+      ! input variables
+      !
+      !-----------------------------------------------------------------
+
+      real (kind=RKIND), dimension(:), intent(in) :: &amp;
+         u, &amp;!&lt; Input: n-length vector
+         v   !&lt; Input: m-length vector
+
+      !-----------------------------------------------------------------
+      !
+      ! output variables
+      !
+      !-----------------------------------------------------------------
+
+      real (kind=RKIND), dimension(:,:), intent(out) :: &amp;
+         A   !&lt; Output: nxm matrix
+
+      !-----------------------------------------------------------------
+      !
+      ! local variables
+      !
+      !-----------------------------------------------------------------
+
+      integer :: n,m,i,j
+
+      n = size(u)
+      m = size(v)
+
+      ! mrp: find out how to do correct error check.
+      if (size(A,1).ne.n.or.size(A,2).ne.m) then
+        write(*,*) 'error, mpas_outer_product: size of A must match u and v'
+        stop
+      endif
+
+      do i=1,n
+        do j=1,m
+          A(i,j) = u(i)*v(j)
+        enddo
+      enddo
+
+   end subroutine mpas_outer_product!}}}
+
+
+end module mpas_matrix_operations
+
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+! vim: foldmethod=marker
+

Modified: branches/ocean_projects/tensor_operations/src/operators/mpas_rbf_interpolation.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/operators/mpas_rbf_interpolation.F        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/operators/mpas_rbf_interpolation.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -14,6 +14,7 @@
 module mpas_rbf_interpolation
    use mpas_dmpar
    use mpas_grid_types
+   use mpas_vector_operations
 
    implicit none
    private
@@ -115,7 +116,7 @@
 !&gt; the interpolation routines.
 !&gt; Input: the grid
 !&gt; Output:
-!&gt;      edgeNormalVectors - the unit vector at the center of each edge tangent to the sphere
+!&gt;      edgeNormalVector - the unit vector at the center of each edge tangent to the sphere
 !&gt;      cellTangentPlane - 2 orthogonal unit vectors in the tangent plane of each cell
 !&gt;                         The first unit vector is chosen to point toward the center of the first
 !&gt;                         edge on the cell.
@@ -128,77 +129,8 @@
 
     type (mesh_type), intent(inout) :: grid  !&lt; Input/Output: Grid information
 
-    integer :: nCells, nEdges
-    integer, dimension(:,:), pointer :: cellsOnEdge, edgesOnCell
-    integer :: iEdge, iCell, cell1, cell2
-    real(kind=RKIND), dimension(:), pointer :: xCell, yCell, zCell, xEdge, yEdge, zEdge
-    real(kind=RKIND), dimension(:,:), pointer :: localVerticalUnitVectors, edgeNormalVectors
-    real(kind=RKIND), dimension(:,:,:), pointer :: cellTangentPlane
-    real(kind=RKIND), dimension(3) :: xHatPlane, yHatPlane, rHat
-    real(kind=RKIND) :: normalDotRHat
-    logical :: on_a_sphere
+    call mpas_initialize_vectors(grid)
 
-    xCell       =&gt; grid % xCell % array
-    yCell       =&gt; grid % yCell % array
-    zCell       =&gt; grid % zCell % array
-    xEdge       =&gt; grid % xEdge % array
-    yEdge       =&gt; grid % yEdge % array
-    zEdge       =&gt; grid % zEdge % array
-    cellsOnEdge =&gt; grid % cellsOnEdge % array
-    edgesOnCell =&gt; grid % edgesOnCell % array
-    nCells      = grid % nCells
-    nEdges      = grid % nEdges
-    on_a_sphere = grid % on_a_sphere
-
-    localVerticalUnitVectors =&gt; grid % localVerticalUnitVectors % array
-    edgeNormalVectors =&gt; grid % edgeNormalVectors % array
-    cellTangentPlane =&gt; grid % cellTangentPlane % array
-
-    ! init arrays
-    edgeNormalVectors = 0
-    localVerticalUnitVectors = 0
-
-    ! loop over all cells to be solved on this block
-    do iCell=1,nCells
-      if(on_a_sphere) then
-        localVerticalUnitVectors(1,iCell) = xCell(iCell)
-        localVerticalUnitVectors(2,iCell) = yCell(iCell)
-        localVerticalUnitVectors(3,iCell) = zCell(iCell)
-        call mpas_unit_vec_in_r3(localVerticalUnitVectors(:,iCell))
-      else ! on a plane
-        localVerticalUnitVectors(:,iCell) = (/ 0., 0., 1. /)
-      end if
-    end do
-
-    do iEdge = 1,nEdges
-      iCell = cellsOnEdge(1,iEdge) ! the normal vector points from the first cell toward the edge
-      if(iCell == nCells+1) then ! this is a boundary edge
-        ! the first cell bordering this edge is not real, use the second cell
-        !  The normal should always point outward at boundaries, away from the valid cell center
-        iCell = cellsOnEdge(2,iEdge)
-      end if
-      ! the normal points from the cell location to the edge location
-      edgeNormalVectors(1,iEdge) = xEdge(iEdge) - xCell(iCell)
-      edgeNormalVectors(2,iEdge) = yEdge(iEdge) - yCell(iCell)
-      edgeNormalVectors(3,iEdge) = zEdge(iEdge) - zCell(iCell)
-      call mpas_unit_vec_in_r3(edgeNormalVectors(:,iEdge))
-    end do
-
-    do iCell=1,nCells
-      iEdge = edgesOnCell(1,iCell)
-      ! xHat and yHat are a local basis in the plane of the horizontal cell
-      ! we arbitrarily choose xHat to point toward the first edge
-      rHat = localVerticalUnitVectors(:,iCell)
-      normalDotRHat = sum(edgeNormalVectors(:,iEdge)*rHat)
-      xHatPlane = edgeNormalVectors(:,iEdge) - normalDotRHat*rHat
-      call mpas_unit_vec_in_r3(xHatPlane)
-
-      call mpas_cross_product_in_r3(rHat, xHatPlane, yHatPlane)
-      call mpas_unit_vec_in_r3(yHatPlane) ! just to be sure...
-      cellTangentPlane(:,1,iCell) = xHatPlane
-      cellTangentPlane(:,2,iCell) = yHatPlane
-    end do
-
   end subroutine mpas_rbf_interp_initialize!}}}
 
 !***********************************************************************
@@ -1812,46 +1744,6 @@
 
   end subroutine mpas_set_up_vector_free_slip_rbf_matrix_and_rhs!}}}
 
-!***********************************************************************
-!
-!  routine mpas_unit_vec_in_r3
-!
-!&gt; \brief   MPAS 3D unit vector routine
-!&gt; \author  Xylar Asay-Davis
-!&gt; \date    03/28/13
-!&gt; \version SVN:$Id$
-!&gt; \details 
-!&gt; This routine creates a unit vector out of an input point.
-!-----------------------------------------------------------------------
-  subroutine mpas_unit_vec_in_r3(xin)!{{{
-    implicit none
-    real (kind=RKIND), intent(inout) :: xin(3) !&lt; Input/Output: Vector and unit vector
-    real (kind=RKIND) :: mag
-    mag = sqrt(xin(1)**2+xin(2)**2+xin(3)**2)
-    xin(:) = xin(:) / mag
-  end subroutine mpas_unit_vec_in_r3!}}}
-
-!***********************************************************************
-!
-!  routine mpas_cross_product_in_r3
-!
-!&gt; \brief   MPAS 3D cross product routine
-!&gt; \author  Xylar Asay-Davis
-!&gt; \date    03/28/13
-!&gt; \version SVN:$Id$
-!&gt; \details 
-!&gt; This routine computes the cross product of two input vectors.
-!-----------------------------------------------------------------------
-  subroutine mpas_cross_product_in_r3(p_1,p_2,p_out)!{{{
-    real (kind=RKIND), intent(in) :: p_1 (3) !&lt; Input: Vector 1
-    real (kind=RKIND), intent(in) :: p_2 (3) !&lt; Input: Vector 2
-    real (kind=RKIND), intent(out) :: p_out (3) !&lt; Output: Cross product of vector 1 and vector 2
-
-    p_out(1) = p_1(2)*p_2(3)-p_1(3)*p_2(2)
-    p_out(2) = p_1(3)*p_2(1)-p_1(1)*p_2(3)
-    p_out(3) = p_1(1)*p_2(2)-p_1(2)*p_2(1)
-  end subroutine mpas_cross_product_in_r3!}}}
-
 ! Updated 10/24/2001.
 !
 !!!!!!!!!!!!!!!!!!!!!!!!!!!   Program 4.3   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Added: branches/ocean_projects/tensor_operations/src/operators/mpas_tensor_operations.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/operators/mpas_tensor_operations.F                                (rev 0)
+++ branches/ocean_projects/tensor_operations/src/operators/mpas_tensor_operations.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -0,0 +1,537 @@
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  mpas_tensor_operations
+!
+!&gt; \brief MPAS tensor operations
+!&gt; \author Mark Petersen
+!&gt; \date    17 April 2013
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This module contains the routines for computing
+!&gt;  the strain rate tensor, the divergence of a tensor,
+!&gt;  and a testing routine to verify these work properly.
+!
+!-----------------------------------------------------------------------
+
+module mpas_tensor_operations
+
+   use mpas_grid_types
+   use mpas_constants
+   use mpas_vector_operations
+   use mpas_matrix_operations
+
+   implicit none
+   private
+   save
+
+   !--------------------------------------------------------------------
+   !
+   ! Public parameters
+   !
+   !--------------------------------------------------------------------
+
+   !--------------------------------------------------------------------
+   !
+   ! Public member functions
+   !
+   !--------------------------------------------------------------------
+
+   public :: mpas_strain_rate, &amp;
+             mpas_divergence_of_tensor, &amp;
+             mpas_tensor_edge_3D_to_2D, &amp;
+             mpas_tensor_edge_2D_to_3D, &amp;
+             mpas_test_tensor
+
+   !--------------------------------------------------------------------
+   !
+   ! Private module variables
+   !
+   !--------------------------------------------------------------------
+
+!***********************************************************************
+
+contains
+
+!***********************************************************************
+!
+!  routine mpas_strain_rate
+!
+!&gt; \brief   Computes 2D strain rate at edges
+!&gt; \author  Mark Petersen
+!&gt; \date    17 April 2013
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt;  This routine computes the strain rate at cell centers using the weak 
+!&gt;  derivative.  Output is a 3D strain rate tensor in 6-index format.
+!
+!-----------------------------------------------------------------------
+
+   subroutine mpas_strain_rate(grid, normalVelocity, tangentialVelocity, strainRate3DCell)!{{{
+
+      !-----------------------------------------------------------------
+      !
+      ! input variables
+      !
+      !-----------------------------------------------------------------
+
+      real (kind=RKIND), dimension(:,:), intent(in) :: &amp;
+         normalVelocity, &amp;!&lt; Input: Horizontal velocity normal to edge
+         tangentialVelocity   !&lt; Input: Horizontal velocity tangent to edge
+
+      type (mesh_type), intent(in) :: &amp;
+         grid          !&lt; Input: grid information
+
+      !-----------------------------------------------------------------
+      !
+      ! output variables
+      !
+      !-----------------------------------------------------------------
+
+      real (kind=RKIND), dimension(:,:,:), intent(out) :: &amp;
+         strainRate3DCell   !&lt; Output: strain rate tensor at cell center, 3D, in symmetric 6-index form
+
+      !-----------------------------------------------------------------
+      !
+      ! local variables
+      !
+      !-----------------------------------------------------------------
+
+      integer :: iEdge, nEdges, iCell, nCells, i,j,k
+
+      integer, dimension(:), pointer :: maxLevelEdgeBot, nEdgesOnCell, maxLevelCell
+      integer, dimension(:,:), pointer :: edgesOnCell, edgeSignOnCell
+
+      real (kind=RKIND) :: invAreaCell
+      real (kind=RKIND), dimension(3,3) :: outerProductEdge3x3
+      real (kind=RKIND), dimension(:), pointer :: dvEdge, areaCell
+      real (kind=RKIND), dimension(:,:), pointer :: edgeNormalVectors, edgeTangentVectors
+      real (kind=RKIND), dimension(:,:,:), pointer :: outerProductEdgeSym6
+
+      nEdges = grid % nEdges
+      nCells = grid % nCells
+
+      maxLevelEdgeBot   =&gt; grid % maxLevelEdgeBot % array
+      maxLevelCell      =&gt; grid % maxLevelCell % array
+      edgesOnCell       =&gt; grid % edgesOnCell % array
+      edgeSignOnCell    =&gt; grid % edgeSignOnCell % array
+      dvEdge            =&gt; grid % dvEdge % array
+      areaCell          =&gt; grid % areaCell % array
+      edgeNormalVectors  =&gt; grid % edgeNormalVectors % array
+      edgeTangentVectors =&gt; grid % edgeTangentVectors % array
+
+      ! mrp change outerProductEdgeSym6 to a scratch variable later
+      outerProductEdgeSym6  =&gt; grid % outerProductEdgeSym6 % array
+
+      do iEdge=1,nEdges
+         ! mrp question: for this to be general across cores, we need to use nVertLevels
+         do k=1,maxLevelEdgeBot(iEdge)
+           do i=1,3
+             do j=1,3
+               ! outer produce at each edge:
+               ! u_e n_e n_e* + v_e n_e \tilde{n}_e* 
+               outerProductEdge3x3(i,j) = edgeNormalVectors(i,iEdge) &amp;
+                       *(  normalVelocity(k,iEdge) *edgeNormalVectors(j,iEdge) &amp;
+                         + tangentialVelocity(k,iEdge)*edgeTangentVectors(j,iEdge) &amp;
+                           ) * dvEdge(iEdge) 
+             enddo
+           enddo
+           call mpas_matrix_3x3_to_sym6index(outerProductEdge3x3,outerProductEdgeSym6(:,iEdge,k))
+         enddo
+      enddo
+
+      strainRate3DCell = 0.0
+      do iCell = 1, nCells
+         invAreaCell = 1.0 / areaCell(iCell)
+         do i = 1, nEdgesOnCell(iCell)
+            iEdge = edgesOnCell(i, iCell)
+            do k = 1, maxLevelCell(iCell)
+               ! mrp edgeSignOnCell is to get outward unit normal on edgeNormalVectors
+               ! minus sign in front is to match form on divergence, below
+               strainRate3DCell(:,k,iCell) = strainRate3DCell(:,k,iCell) &amp;
+                 - edgeSignOnCell(i,iCell)*outerProductEdgeSym6(:,iEdge,k)*invAreaCell 
+            end do
+         end do
+      end do
+
+   end subroutine mpas_strain_rate!}}}
+
+!***********************************************************************
+!
+!  routine mpas_divergence_of_tensor
+!
+!&gt; \brief   Computes divergence of the stress tensor
+!&gt; \author  Mark Petersen
+!&gt; \date    17 April 2013
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt;  This routine computes the divergence of the stress tensor
+!
+!-----------------------------------------------------------------------
+
+   subroutine mpas_divergence_of_tensor(grid, strainRate3DEdge, divTensor3DCell)!{{{
+
+      !-----------------------------------------------------------------
+      !
+      ! input variables
+      !
+      !-----------------------------------------------------------------
+
+      real (kind=RKIND), dimension(:,:,:), intent(in) :: &amp;
+         strainRate3DEdge  !&lt; Input: tensor at edge, 3D, in symmetric 6-index form
+
+      type (mesh_type), intent(in) :: &amp;
+         grid          !&lt; Input: grid information
+
+      !-----------------------------------------------------------------
+      !
+      ! output variables
+      !
+      !-----------------------------------------------------------------
+
+      real (kind=RKIND), dimension(:,:,:), intent(out) :: &amp;
+         divTensor3DCell  !&lt; Output: divergence of the tensor at cell center, 
+                          !&lt; as a 3-vector in x,y,z space
+
+      !-----------------------------------------------------------------
+      !
+      ! local variables
+      !
+      !-----------------------------------------------------------------
+
+      integer :: iEdge, nEdges, iCell, nCells, i,j,k,p,q
+
+      integer, dimension(:), pointer :: nEdgesOnCell, maxLevelCell
+      integer, dimension(:,:), pointer :: edgesOnCell, edgeSignOnCell
+
+      real (kind=RKIND) :: invAreaCell
+      real (kind=RKIND), dimension(3) :: edgeNormalDotTensor
+      real (kind=RKIND), dimension(3,3) :: strainRate3DEdge3x3
+      real (kind=RKIND), dimension(:), pointer :: dvEdge, areaCell
+      real (kind=RKIND), dimension(:,:), pointer :: edgeNormalVectors
+
+      nEdges = grid % nEdges
+      nCells = grid % nCells
+
+      maxLevelCell      =&gt; grid % maxLevelCell % array
+      edgesOnCell       =&gt; grid % edgesOnCell % array
+      dvEdge            =&gt; grid % dvEdge % array
+      areaCell          =&gt; grid % areaCell % array
+      edgeNormalVectors  =&gt; grid % edgeNormalVectors % array
+      edgeSignOnCell    =&gt; grid % edgeSignOnCell % array
+
+      divTensor3DCell(:,:,:) = 0.0
+      do iCell = 1, nCells
+         invAreaCell = 1.0 / areaCell(iCell)
+         do i = 1, nEdgesOnCell(iCell)
+            iEdge = edgesOnCell(i, iCell)
+            do k = 1, maxLevelCell(iCell)
+               call mpas_matrix_sym6index_to_3x3(strainRate3DEdge(:,k,iEdge),strainRate3DEdge3x3)
+               edgeNormalDotTensor(:) = 0.0
+               do q=1,3
+                 do p=1,3
+                   edgeNormalDotTensor(q) = edgeNormalVectors(p,iEdge)*strainRate3DEdge3x3(p,q)
+                 enddo
+               enddo
+               divTensor3DCell(:,k,iCell) = divTensor3DCell(:,k,iCell) &amp;
+                 - edgeSignOnCell(i,iCell) * dvEdge(iEdge) * edgeNormalDotTensor(:) * invAreaCell
+            end do
+         end do
+      end do
+
+   end subroutine mpas_divergence_of_tensor!}}}
+
+!***********************************************************************
+!
+!  routine mpas_tensor_edge_3D_to_2D
+!
+!&gt; \brief   Convert a 3D tensor to a 2D tensor, at an edge
+!&gt; \author  Mark Petersen
+!&gt; \date    17 April 2013
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt;  Given a 3D tensor in symetric 6-index form, this routine rotates
+!&gt;  the tensor so that the 1-direction is towards the edge normal, and 
+!&gt;  the 2-direction is towards the edge tangent, and returns a 2D
+!&gt;  tensor in symmetric 3-index form. 
+!
+!-----------------------------------------------------------------------
+
+   subroutine mpas_tensor_edge_3D_to_2D(strainRate3DEdge, strainRate2DEdge, grid)!{{{
+
+      !-----------------------------------------------------------------
+      !
+      ! input variables
+      !
+      !-----------------------------------------------------------------
+
+      real (kind=RKIND), dimension(:,:,:), intent(in) :: &amp;
+         strainRate3DEdge  !&lt; Input: strain rate tensor at edge, 3D, in symmetric 6-index form
+
+      type (mesh_type), intent(in) :: &amp;
+         grid          !&lt; Input: grid information
+
+      !-----------------------------------------------------------------
+      !
+      ! output variables
+      !
+      !-----------------------------------------------------------------
+
+      real (kind=RKIND), dimension(:,:,:), intent(out) :: &amp;
+         strainRate2DEdge   !&lt; Output: strain rate tensor at edge, 2D, in symmetric 3-index form
+
+      !-----------------------------------------------------------------
+      !
+      ! local variables
+      !
+      !-----------------------------------------------------------------
+
+      integer :: iEdge, nEdges, i,j,k,p,q, nVertLevels
+      integer, dimension(:), pointer :: maxLevelEdgeBot
+
+      real (kind=RKIND), dimension(3) :: edgeVerticalVector
+      real (kind=RKIND), dimension(3,3) :: rotationMatrix, strainRate3DEdge3x3, strainRate3DEdge3x3Rotated
+      real (kind=RKIND), dimension(:,:), pointer :: edgeNormalVectors, edgeTangentVectors
+
+      nEdges = grid % nEdges
+      nVertLevels = grid % nVertLevels
+
+      maxLevelEdgeBot   =&gt; grid % maxLevelEdgeBot % array
+      edgeNormalVectors  =&gt; grid % edgeNormalVectors % array
+      edgeTangentVectors =&gt; grid % edgeTangentVectors % array
+
+      do iEdge=1,nEdges
+
+         ! compute vertical vector at edge
+         call mpas_cross_product_in_r3(edgeNormalVectors(:,iEdge),edgeTangentVectors(:,iEdge),edgeVerticalvector)
+
+         rotationMatrix(:,1) = edgeNormalVectors(:,iEdge)
+         rotationMatrix(:,2) = edgeTangentVectors(:,iEdge)
+         rotationMatrix(:,3) = edgeVerticalvector
+
+         ! mrp question: for this to be general across cores, we need to use nVertLevels
+         do k=1,maxLevelEdgeBot(iEdge)

+           call mpas_matrix_sym6index_to_3x3(strainRate3DEdge(:,k,iEdge),strainRate3DEdge3x3)
+
+           ! If I were convinced everything is correct, could just compute i=1,2 and j=1,i
+           do i=1,3
+             do j=1,3
+               do p=1,3
+                 do q=1,3
+                    ! I'm not sure if the star should be on the first or third matrix.
+                    ! Here it is on the first
+                    strainRate3DEdge3x3Rotated(i,j) = rotationMatrix(p,i)*strainRate3DEdge3x3(p,q)*rotationMatrix(q,j)
+                 enddo
+               enddo
+             enddo
+           enddo
+
+           strainRate2DEdge(1,k,iEdge) = strainRate3DEdge3x3Rotated(1,1)
+           strainRate2DEdge(2,k,iEdge) = strainRate3DEdge3x3Rotated(2,2)
+           strainRate2DEdge(3,k,iEdge) = 0.5*(strainRate3DEdge3x3Rotated(1,2) + strainRate3DEdge3x3Rotated(2,1))
+           ! mrp set land edges to zero?
+         enddo
+
+      enddo
+
+   end subroutine mpas_tensor_edge_3D_to_2D!}}}
+
+!***********************************************************************
+!
+!  routine mpas_tensor_edge_2D_to_3D
+!
+!&gt; \brief   Convert a 3D tensor to a 2D tensor, at an edge
+!&gt; \author  Mark Petersen
+!&gt; \date    17 April 2013
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt;  Given a 2D tensor in symetric 3-index form that is rotated such that
+!&gt;  the 1-direction is towards the edge normal, and 
+!&gt;  the 2-direction is towards the edge tangent, this routine rotates
+!&gt;  the tensor to x-y-z, and returns a 3D tensor in symetric 6-index form.
+!
+!-----------------------------------------------------------------------
+
+   subroutine mpas_tensor_edge_2D_to_3D(strainRate2DEdge, strainRate3DEdge, grid)!{{{
+
+      !-----------------------------------------------------------------
+      !
+      ! input variables
+      !
+      !-----------------------------------------------------------------
+
+      real (kind=RKIND), dimension(:,:,:), intent(in) :: &amp;
+         strainRate2DEdge   !&lt; Input: strain rate tensor at edge, 2D, in symmetric 3-index form
+
+      type (mesh_type), intent(in) :: &amp;
+         grid          !&lt; Input: grid information
+
+      !-----------------------------------------------------------------
+      !
+      ! output variables
+      !
+      !-----------------------------------------------------------------
+
+      real (kind=RKIND), dimension(:,:,:), intent(out) :: &amp;
+         strainRate3DEdge  !&lt; Output: strain rate tensor at edge, 3D, in symmetric 6-index form
+
+      !-----------------------------------------------------------------
+      !
+      ! local variables
+      !
+      !-----------------------------------------------------------------
+
+      integer :: iEdge, nEdges, i,j,k,p,q, nVertLevels
+      integer, dimension(:), pointer :: maxLevelEdgeBot
+
+      real (kind=RKIND), dimension(3) :: edgeVerticalVector
+      real (kind=RKIND), dimension(3,3) :: rotationMatrix, strainRate3DEdge3x3, strainRate3DEdge3x3Rotated
+      real (kind=RKIND), dimension(:,:), pointer :: edgeNormalVectors, edgeTangentVectors
+
+      nEdges = grid % nEdges
+      nVertLevels = grid % nVertLevels
+      maxLevelEdgeBot   =&gt; grid % maxLevelEdgeBot % array
+      edgeNormalVectors  =&gt; grid % edgeNormalVectors % array
+      edgeTangentVectors =&gt; grid % edgeTangentVectors % array
+
+      do iEdge=1,nEdges
+
+         ! compute vertical vector at edge
+         call mpas_cross_product_in_r3(edgeNormalVectors(:,iEdge),edgeTangentVectors(:,iEdge),edgeVerticalVector)
+
+         rotationMatrix(:,1) = edgeNormalVectors(:,iEdge)
+         rotationMatrix(:,2) = edgeTangentVectors(:,iEdge)
+         rotationMatrix(:,3) = edgeVerticalVector
+
+         ! mrp question: for this to be general across cores, we need to use nVertLevels
+         do k=1,maxLevelEdgeBot(iEdge)
+
+           strainRate3DEdge3x3Rotated = 0.0
+           strainRate3DEdge3x3Rotated(1,1) = strainRate2DEdge(1,k,iEdge) 
+           strainRate3DEdge3x3Rotated(2,2) = strainRate2DEdge(2,k,iEdge) 
+           strainRate3DEdge3x3Rotated(1,2) = strainRate2DEdge(3,k,iEdge) 
+           strainRate3DEdge3x3Rotated(2,1) = strainRate2DEdge(3,k,iEdge) 
+
+           ! If I were convinced everything is correct, could just compute i=1,2 and j=1,i
+           do i=1,3
+             do j=1,3
+               do p=1,3
+                 do q=1,3
+                    ! I'm not sure if the star should be on the first or third matrix.
+                    ! Here it is on the third
+                    strainRate3DEdge3x3(i,j) = rotationMatrix(i,p)*strainRate3DEdge3x3Rotated(p,q)*rotationMatrix(j,q)
+                 enddo
+               enddo
+             enddo
+           enddo

+           call mpas_matrix_3x3_to_sym6index(strainRate3DEdge3x3,strainRate3DEdge(:,k,iEdge))
+
+           ! mrp set land edges to zero?
+         enddo
+
+      enddo
+
+   end subroutine mpas_tensor_edge_2D_to_3D!}}}
+
+!***********************************************************************
+!
+!  routine mpas_test_tensor
+!
+!&gt; \brief   Tests strain rate and tensor divergence operators
+!&gt; \author  Mark Petersen
+!&gt; \date    17 April 2013
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt;  This routine tests strain rate and tensor divergence operators.
+!
+!-----------------------------------------------------------------------
+
+   subroutine mpas_test_tensor(domain) !{{{
+
+      !-----------------------------------------------------------------
+      !
+      ! input variables
+      !
+      !-----------------------------------------------------------------
+
+      !-----------------------------------------------------------------
+      !
+      ! input/output variables
+      !
+      !-----------------------------------------------------------------
+
+      type (domain_type), intent(inout) :: domain
+
+      !-----------------------------------------------------------------
+      !
+      ! output variables
+      !
+      !-----------------------------------------------------------------
+
+      !-----------------------------------------------------------------
+      !
+      ! local variables
+      !
+      !-----------------------------------------------------------------
+
+      type (block_type), pointer :: block
+
+      real (kind=RKIND), dimension(:,:), pointer :: normalVelocity, tangentialVelocity
+      real (kind=RKIND), dimension(:,:,:), pointer :: strainRate3DCell, strainRate3DEdge, divTensor3DCell
+
+      normalVelocity      =&gt; block % state % time_levs(1) % state % normalVelocity % array
+      tangentialVelocity  =&gt; block % state % time_levs(1) % state % tangentialVelocity % array
+
+      ! mrp convert these to scratch so they are not required for other cores
+      strainRate3DCell    =&gt; block % state % time_levs(1) % state % strainRate3DCell % array
+      strainRate3DEdge    =&gt; block % state % time_levs(1) % state % strainRate3DEdge % array
+      divTensor3DCell     =&gt; block % state % time_levs(1) % state % divTensor3DCell % array
+
+      ! Initialize z-level grid variables from h, read in from input file.
+      block =&gt; domain % blocklist
+      do while (associated(block))
+
+! see old branch for testing code.
+
+        ! create test functions for normalVelocity and tangentialVelocity
+        normalVelocity = 0.0
+        tangentialVelocity = 0.0
+
+        call mpas_strain_rate(block % mesh, normalVelocity, tangentialVelocity, strainRate3DCell)
+
+        call mpas_matrix_cell_to_edge(block % mesh, strainRate3DCell, strainRate3DEdge)
+
+        call mpas_divergence_of_tensor(block % mesh, strainRate3DEdge, divTensor3DCell)
+
+        block =&gt; block % next
+      end do
+
+   end subroutine mpas_test_tensor!}}}
+
+!***********************************************************************
+!
+!  routine mpas_tensor_operations_init
+!
+!&gt; \brief   Initializes flags used within tendency routines.
+!&gt; \author  Mark Petersen
+!&gt; \date    17 April 2013
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt;  This routine initializes flags related to quantities computed within
+!&gt;  other tendency routines.
+!
+!-----------------------------------------------------------------------
+!    subroutine mpas_tensor_operations_init(err)!{{{
+!        integer, intent(out) :: err !&lt; Output: Error flag
+
+!    end subroutine mpas_tensor_operations_init!}}}
+
+!***********************************************************************
+
+end module mpas_tensor_operations
+
+
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+! vim: foldmethod=marker
+

Added: branches/ocean_projects/tensor_operations/src/operators/mpas_vector_operations.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/operators/mpas_vector_operations.F                                (rev 0)
+++ branches/ocean_projects/tensor_operations/src/operators/mpas_vector_operations.F        2013-04-18 15:33:42 UTC (rev 2767)
@@ -0,0 +1,305 @@
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+!  mpas_vector_operations
+!
+!&gt; \brief MPAS vector operations
+!&gt; \author Mark Petersen
+!&gt; \date    25 September 2012
+!&gt; \version SVN:$Id:$
+!&gt; \details
+!&gt;  This module contains the routines involving vector operations
+!
+!-----------------------------------------------------------------------
+
+module mpas_vector_operations
+
+   use mpas_grid_types
+   use mpas_constants
+
+   implicit none
+   private
+   save
+
+   !--------------------------------------------------------------------
+   !
+   ! Public parameters
+   !
+   !--------------------------------------------------------------------
+
+   !--------------------------------------------------------------------
+   !
+   ! Public member functions
+   !
+   !--------------------------------------------------------------------
+
+   public :: mpas_initialize_vectors, &amp;
+             mpas_unit_vec_in_r3, &amp;
+             mpas_cross_product_in_r3, &amp;
+             mpas_vector_3DCell_to_2DEdge
+
+   !--------------------------------------------------------------------
+   !
+   ! Private module variables
+   !
+   !--------------------------------------------------------------------
+
+!***********************************************************************
+
+contains
+
+!***********************************************************************
+!
+!  routine mpas_unit_vec_in_r3
+!
+!&gt; \brief   MPAS 3D unit vector routine
+!&gt; \author  Xylar Asay-Davis
+!&gt; \date    03/28/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine creates a unit vector out of an input point.
+!-----------------------------------------------------------------------
+  subroutine mpas_unit_vec_in_r3(xin)!{{{
+    implicit none
+    real (kind=RKIND), intent(inout) :: xin(3) !&lt; Input/Output: Vector and unit vector
+    real (kind=RKIND) :: mag
+    mag = sqrt(xin(1)**2+xin(2)**2+xin(3)**2)
+    xin(:) = xin(:) / mag
+  end subroutine mpas_unit_vec_in_r3!}}}
+
+!***********************************************************************
+!
+!  routine mpas_cross_product_in_r3
+!
+!&gt; \brief   MPAS 3D cross product routine
+!&gt; \author  Xylar Asay-Davis
+!&gt; \date    03/28/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine computes the cross product of two input vectors.
+!-----------------------------------------------------------------------
+  subroutine mpas_cross_product_in_r3(p_1,p_2,p_out)!{{{
+    real (kind=RKIND), intent(in) :: p_1 (3) !&lt; Input: Vector 1
+    real (kind=RKIND), intent(in) :: p_2 (3) !&lt; Input: Vector 2
+    real (kind=RKIND), intent(out) :: p_out (3) !&lt; Output: Cross product of vector 1 and vector 2
+
+    p_out(1) = p_1(2)*p_2(3)-p_1(3)*p_2(2)
+    p_out(2) = p_1(3)*p_2(1)-p_1(1)*p_2(3)
+    p_out(3) = p_1(1)*p_2(2)-p_1(2)*p_2(1)
+  end subroutine mpas_cross_product_in_r3!}}}
+
+!***********************************************************************
+!
+!  routine mpas_vector_3DCell_to_2DEdge
+!
+!&gt; \brief   Convert a 3D cell-centered vector field to 2D vectors at edges
+!&gt; \author  Mark Petersen
+!&gt; \date    17 April 2013
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt;  Convert a 3D cell-centered vector field to 2D vectors at edges, where 
+!&gt;  the local coordinate system at the edge is normal and tangent to that edge.
+!
+!-----------------------------------------------------------------------
+
+   subroutine mpas_vector_3DCell_to_2DEdge(grid, vector3DCell, vector2DEdge)!{{{
+
+      !-----------------------------------------------------------------
+      !
+      ! input variables
+      !
+      !-----------------------------------------------------------------
+
+      real (kind=RKIND), dimension(:,:,:), intent(in) :: &amp;
+         vector3DCell  !&lt; Input: 3-vector located at cell centers, in x,y,z coordinates
+
+      type (mesh_type), intent(in) :: &amp;
+         grid          !&lt; Input: grid information
+
+      !-----------------------------------------------------------------
+      !
+      ! output variables
+      !
+      !-----------------------------------------------------------------
+
+      real (kind=RKIND), dimension(:,:,:), intent(out) :: &amp;
+         vector2DEdge   !&lt; Output: vector at edge, where 
+                        !&lt; index 1=1 is for normal component to edge
+                        !&lt; index 1=2 is for tangential component to edge
+
+      !-----------------------------------------------------------------
+      !
+      ! local variables
+      !
+      !-----------------------------------------------------------------
+
+      integer :: iEdge, nEdges, cell1, cell2, k, nVertLevels
+
+      integer, dimension(:,:), pointer :: cellsOnEdge
+
+      real (kind=RKIND), dimension(3) :: vector3DEdge
+      real(kind=RKIND), dimension(:,:), pointer :: edgeNormalVectors, edgeTangentVectors
+
+      nEdges = grid % nEdges
+      nVertLevels = grid % nVertLevels
+
+      edgeNormalVectors =&gt; grid % edgeNormalVectors % array
+      edgeTangentVectors =&gt; grid % edgeTangentVectors % array
+      cellsOnEdge       =&gt; grid % cellsOnEdge % array
+
+      do iEdge=1,nEdges
+         cell1 = cellsOnEdge(1,iEdge)
+         cell2 = cellsOnEdge(2,iEdge)
+
+         do k=1,nVertLevels
+
+           ! average neighboring cell-centered vectors to the edge
+           vector3DEdge(:) = 0.5*(vector3DCell(:,k,cell1) + vector3DCell(:,k,cell2))
+
+           ! components at edge: take dot products with unit vectors at edge
+           vector2DEdge(1,k,iEdge) = sum(vector3DEdge(:)*edgeNormalVectors(:,iEdge))
+           vector2DEdge(2,k,iEdge) = sum(vector3DEdge(:)*edgeTangentVectors(:,iEdge))      

+         enddo
+      enddo
+
+   end subroutine mpas_vector_3DCell_to_2DEdge!}}}
+
+!***********************************************************************
+!
+!  routine mpas_initialize_vectors
+!
+!&gt; \brief   MPAS RBF interpolation initialization routine
+!&gt; \author  Xylar Asay-Davis
+!&gt; \date    03/28/13
+!&gt; \version SVN:$Id$
+!&gt; \details 
+!&gt; This routine computes geometric fields that will be potentially useful for calling
+!&gt; the interpolation routines.
+!&gt; Input: the grid
+!&gt; Output:
+!&gt;      edgeNormalVector - the unit vector normal to the edge and tangent to the sphere
+!&gt;      edgeTangentVector - the unit vector tangent to the edge and tangent to the sphere
+!&gt;      cellTangentPlane - 2 orthogonal unit vectors in the tangent plane of each cell
+!&gt;                         The first unit vector is chosen to point toward the center of the first
+!&gt;                         edge on the cell.
+!&gt;      localVerticalUnitVectors - the unit normal vector of the tangent plane at the center 
+!&gt;                         of each cell
+!-----------------------------------------------------------------------
+  subroutine mpas_initialize_vectors(grid)!{{{
+
+    implicit none
+
+    type (mesh_type), intent(inout) :: grid  !&lt; Input/Output: Grid information
+
+    integer :: nCells, nEdges
+    integer, dimension(:,:), pointer :: cellsOnEdge, verticesOnEdge, edgesOnCell
+    integer :: iEdge, iCell, cell1, cell2, vertex1, vertex2
+    real(kind=RKIND), dimension(:), pointer :: xCell, yCell, zCell, xEdge, yEdge, zEdge, xVertex, yVertex, zVertex
+    real(kind=RKIND), dimension(:,:), pointer :: localVerticalUnitVectors, edgeNormalVectors, edgeTangentVectors
+    real(kind=RKIND), dimension(:,:,:), pointer :: cellTangentPlane
+    real(kind=RKIND), dimension(3) :: xHatPlane, yHatPlane, rHat
+    real(kind=RKIND) :: normalDotRHat
+    logical :: on_a_sphere
+
+    xCell       =&gt; grid % xCell % array
+    yCell       =&gt; grid % yCell % array
+    zCell       =&gt; grid % zCell % array
+    xEdge       =&gt; grid % xEdge % array
+    yEdge       =&gt; grid % yEdge % array
+    zEdge       =&gt; grid % zEdge % array
+    xVertex     =&gt; grid % xVertex % array
+    yVertex     =&gt; grid % yVertex % array
+    zVertex     =&gt; grid % zVertex % array
+    cellsOnEdge =&gt; grid % cellsOnEdge % array
+    verticesOnEdge =&gt; grid % verticesOnEdge % array
+    edgesOnCell =&gt; grid % edgesOnCell % array
+    nCells      = grid % nCells
+    nEdges      = grid % nEdges
+    on_a_sphere = grid % on_a_sphere
+
+    localVerticalUnitVectors =&gt; grid % localVerticalUnitVectors % array
+    edgeNormalVectors =&gt; grid % edgeNormalVectors % array
+    edgeTangentVectors =&gt; grid % edgeTangentVectors % array
+    cellTangentPlane =&gt; grid % cellTangentPlane % array
+
+    ! init arrays
+    edgeNormalVectors = 0
+    edgeTangentVectors = 0
+    localVerticalUnitVectors = 0
+
+    ! loop over all cells to be solved on this block
+    do iCell=1,nCells
+      if(on_a_sphere) then
+        localVerticalUnitVectors(1,iCell) = xCell(iCell)
+        localVerticalUnitVectors(2,iCell) = yCell(iCell)
+        localVerticalUnitVectors(3,iCell) = zCell(iCell)
+        call mpas_unit_vec_in_r3(localVerticalUnitVectors(:,iCell))
+      else ! on a plane
+        localVerticalUnitVectors(:,iCell) = (/ 0., 0., 1. /)
+      end if
+    end do
+
+    ! Initialize normal unit vectors at each edge
+    ! These vectors point from cell to cell.
+    ! At boundaries, one cell does not exist, so it points from cell to edge.
+    do iEdge = 1,nEdges
+      cell1 = cellsOnEdge(1,iEdge)
+      cell2 = cellsOnEdge(2,iEdge)
+
+      if (cell1 == nCells+1) then ! this is a boundary edge
+        ! the normal points from the cell location to the edge location
+        edgeNormalVectors(1,iEdge) = xEdge(iEdge) - xCell(cell2)
+        edgeNormalVectors(2,iEdge) = yEdge(iEdge) - yCell(cell2)
+        edgeNormalVectors(3,iEdge) = zEdge(iEdge) - zCell(cell2)
+
+      elseif (cell2 == nCells+1) then ! this is a boundary edge
+        ! the normal points from the cell location to the edge location
+        edgeNormalVectors(1,iEdge) = xEdge(iEdge) - xCell(cell1)
+        edgeNormalVectors(2,iEdge) = yEdge(iEdge) - yCell(cell1)
+        edgeNormalVectors(3,iEdge) = zEdge(iEdge) - zCell(cell1)
+
+      else ! this is not a boundary cell
+        ! the normal points from the cell 1 to cell2
+        edgeNormalVectors(1,iEdge) = xCell(cell2) - xCell(cell1)
+        edgeNormalVectors(2,iEdge) = yCell(cell2) - yCell(cell1)
+        edgeNormalVectors(3,iEdge) = zCell(cell2) - zCell(cell1)
+
+      endif
+      call mpas_unit_vec_in_r3(edgeNormalVectors(:,iEdge))
+    end do
+
+    ! Initialize tangent unit vectors at each edge
+    do iEdge = 1,nEdges
+      vertex1 = verticesOnEdge(1,iEdge) 
+      vertex2 = verticesOnEdge(2,iEdge) 
+      ! the tangent vector points from the vertex 1 to vertex 2
+      edgeTangentVectors(1,iEdge) = xVertex(vertex2) - xVertex(vertex1)
+      edgeTangentVectors(2,iEdge) = yVertex(vertex2) - yVertex(vertex1)
+      edgeTangentVectors(3,iEdge) = zVertex(vertex2) - zVertex(vertex1)
+      call mpas_unit_vec_in_r3(edgeTangentVectors(:,iEdge))
+    end do
+
+    do iCell=1,nCells
+      iEdge = edgesOnCell(1,iCell)
+      ! xHat and yHat are a local basis in the plane of the horizontal cell
+      ! we arbitrarily choose xHat to point toward the first edge
+      rHat = localVerticalUnitVectors(:,iCell)
+      normalDotRHat = sum(edgeNormalVectors(:,iEdge)*rHat)
+      xHatPlane = edgeNormalVectors(:,iEdge) - normalDotRHat*rHat
+      call mpas_unit_vec_in_r3(xHatPlane)
+
+      call mpas_cross_product_in_r3(rHat, xHatPlane, yHatPlane)
+      call mpas_unit_vec_in_r3(yHatPlane) ! just to be sure...
+      cellTangentPlane(:,1,iCell) = xHatPlane
+      cellTangentPlane(:,2,iCell) = yHatPlane
+    end do
+
+  end subroutine mpas_initialize_vectors!}}}
+
+
+end module mpas_vector_operations
+
+
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+! vim: foldmethod=marker
+

Modified: branches/ocean_projects/tensor_operations/src/registry/Makefile
===================================================================
--- branches/ocean_projects/tensor_operations/src/registry/Makefile        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/registry/Makefile        2013-04-18 15:33:42 UTC (rev 2767)
@@ -11,7 +11,7 @@
         $(CC) -o $@ $(OBJS)
 
 clean:
-        $(RM) *.o parse
+        $(RM) *.o ezxml/*.o parse
 
 .c.o:
         $(CC) -c $&lt;

Modified: branches/ocean_projects/tensor_operations/src/registry/Registry.xsd
===================================================================
--- branches/ocean_projects/tensor_operations/src/registry/Registry.xsd        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/registry/Registry.xsd        2013-04-18 15:33:42 UTC (rev 2767)
@@ -114,6 +114,12 @@
                                         &lt;/xs:complexType&gt;
                                 &lt;/xs:element&gt;
                         &lt;/xs:sequence&gt;
+                        &lt;!-- The model attribute defines the name of the model that is being run. Typically this will be MPAS. It will be written to all output files as a global attribute. --&gt;
+                        &lt;xs:attribute name=&quot;model&quot; type=&quot;xs:string&quot; use=&quot;required&quot;/&gt;
+                        &lt;!-- The core attribute defines the core a Registry.xml file belongs to. It will be written to all output files as a global attribute. --&gt;
+                        &lt;xs:attribute name=&quot;core&quot; type=&quot;xs:string&quot; use=&quot;required&quot;/&gt;
+                        &lt;!-- The version attribute defines the version of the model/core combination. It will be written to all output files as a global attribute. --&gt;
+                        &lt;xs:attribute name=&quot;version&quot; type=&quot;xs:string&quot; use=&quot;required&quot;/&gt;
                 &lt;/xs:complexType&gt;
         &lt;/xs:element&gt;
 &lt;/xs:schema&gt;

Modified: branches/ocean_projects/tensor_operations/src/registry/gen_inc.c
===================================================================
--- branches/ocean_projects/tensor_operations/src/registry/gen_inc.c        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/registry/gen_inc.c        2013-04-18 15:33:42 UTC (rev 2767)
@@ -169,7 +169,18 @@
    fclose(fd);
 }
 
+void gen_history_attributes(char * modelname, char * corename, char * version)
+{
+        FILE *fd;
 
+        fd = fopen(&quot;model_variables.inc&quot;,&quot;w&quot;);
+        fortprintf(fd, &quot;       character (len=StrKIND) :: modelName = '%s' !&lt; Constant: Name of model</font>
<font color="blue">&quot;, modelname);
+        fortprintf(fd, &quot;       character (len=StrKIND) :: coreName = '%s' !&lt; Constant: Name of core</font>
<font color="blue">&quot;, corename);
+        fortprintf(fd, &quot;       character (len=StrKIND) :: modelVersion = '%s' !&lt; Constant: Version number</font>
<font color="gray">&quot;, version);
+        fclose(fd);
+}
+
+
 void gen_field_defs(struct group_list * groups, struct variable * vars, struct dimension * dims)
 {
    struct variable * var_ptr;

Modified: branches/ocean_projects/tensor_operations/src/registry/gen_inc.h
===================================================================
--- branches/ocean_projects/tensor_operations/src/registry/gen_inc.h        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/registry/gen_inc.h        2013-04-18 15:33:42 UTC (rev 2767)
@@ -1,4 +1,5 @@
 void gen_namelists(struct namelist *);
+void gen_history_attributes(char * modelname, char * corename, char * version);
 void gen_field_defs(struct group_list * groups, struct variable *, struct dimension *);
 void gen_reads(struct group_list * groups, struct variable *, struct dimension *);
 void gen_writes(struct group_list * groups, struct variable *, struct dimension *, struct namelist *);

Modified: branches/ocean_projects/tensor_operations/src/registry/parse.c
===================================================================
--- branches/ocean_projects/tensor_operations/src/registry/parse.c        2013-04-18 00:25:31 UTC (rev 2766)
+++ branches/ocean_projects/tensor_operations/src/registry/parse.c        2013-04-18 15:33:42 UTC (rev 2767)
@@ -19,6 +19,8 @@
    struct variable * vars;
    struct group_list * groups;
 
+   char modelname[1024], corename[1024], version[1024];
+
    if (argc != 2) {
       fprintf(stderr,&quot;Reading registry file from standard input</font>
<font color="gray">&quot;);
       regfile = stdin;
@@ -32,7 +34,7 @@
    dims = NULL;
    vars = NULL;
   
-   if (parse_reg_xml(regfile, &amp;nls, &amp;dims, &amp;vars, &amp;groups)) {
+   if (parse_reg_xml(regfile, &amp;nls, &amp;dims, &amp;vars, &amp;groups, &amp;modelname, &amp;corename, &amp;version)) {
       return 1;
    }
   
@@ -45,6 +47,7 @@
    sort_vars(vars);
    sort_group_vars(groups);
 
+   gen_history_attributes(modelname, corename, version);
    gen_namelists(nls);
    gen_field_defs(groups, vars, dims);
    gen_reads(groups, vars, dims);
@@ -53,7 +56,7 @@
    return 0;
 }
 
-int parse_reg_xml(FILE * regfile, struct namelist **nls, struct dimension ** dims, struct variable ** vars, struct group_list ** groups)
+int parse_reg_xml(FILE * regfile, struct namelist **nls, struct dimension ** dims, struct variable ** vars, struct group_list ** groups, char * modelname, char * corename, char * version)
 {
         struct namelist * nls_ptr, *nls_ptr2;
         struct namelist * nls_chk_ptr;
@@ -75,6 +78,7 @@
         const char *vararrname, *vararrtype, *vararrdims, *vararrpersistence;
         const char *varname, *varpersistence, *vartype, *vardims, *varunits, *vardesc, *vararrgroup, *varstreams;
         const char *varname_in_code;
+        const char *const_model, *const_core, *const_version;
 
         char dimensions[2048];
         char *dimension_list;
@@ -90,6 +94,26 @@
         *vars = var_ptr;
         *groups = grouplist_ptr;
 
+        // Get model information
+        const_model = ezxml_attr(registry, &quot;model&quot;);
+        const_core = ezxml_attr(registry, &quot;core&quot;);
+        const_version = ezxml_attr(registry, &quot;version&quot;);
+
+        if(const_model == NULL)
+                sprintf(modelname, &quot;MISSING&quot;);
+        else
+                sprintf(modelname, &quot;%s&quot;, const_model);
+
+        if(const_core == NULL)
+                sprintf(corename, &quot;MISSING&quot;);
+        else
+                sprintf(corename, &quot;%s&quot;, const_core);
+
+        if(const_version == NULL)
+                sprintf(version, &quot;MISSING&quot;);
+        else
+                sprintf(version, &quot;%s&quot;, const_version);
+
         // Parse Namelist Records
         for (nmlrecs_xml = ezxml_child(registry, &quot;nml_record&quot;); nmlrecs_xml; nmlrecs_xml = nmlrecs_xml-&gt;next){
                 nmlrecname = ezxml_attr(nmlrecs_xml, &quot;name&quot;);

</font>
</pre>