<p><b>dwj07@fsu.edu</b> 2013-04-17 15:03:20 -0600 (Wed, 17 Apr 2013)</p><p><br>
        -- BRANCH COMMIT --<br>
<br>
        Merging trunk to branch.<br>
</p><hr noshade><pre><font color="gray">Index: branches/ocean_projects/variable_name_change
===================================================================
--- branches/ocean_projects/variable_name_change        2013-04-17 20:55:12 UTC (rev 2764)
+++ branches/ocean_projects/variable_name_change        2013-04-17 21:03:20 UTC (rev 2765)
Property changes on: branches/ocean_projects/variable_name_change
___________________________________________________________________
Modified: svn:mergeinfo
## -35,4 +35,5 ##
/branches/source_renaming:1082-1113
/branches/time_manager:924-962
/branches/xml_registry:2610-2662
-/trunk/mpas:2689-2754
+/branches/zoltan_cleaning:2753-2760
+/trunk/mpas:2689-2764
\ No newline at end of property
Modified: branches/ocean_projects/variable_name_change/Makefile
===================================================================
--- branches/ocean_projects/variable_name_change/Makefile        2013-04-17 20:55:12 UTC (rev 2764)
+++ branches/ocean_projects/variable_name_change/Makefile        2013-04-17 21:03:20 UTC (rev 2765)
@@ -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 @@
        "DEBUG = $(DEBUG)" \
        "SERIAL = $(SERIAL)" \
        "USE_PAPI = $(USE_PAPI)" \
-        "CPPFLAGS = $(MODEL_FORMULATION) $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
+        "CPPFLAGS = $(MODEL_FORMULATION) $(FILE_OFFSET)" )
ftn:
        ( $(MAKE) all \
@@ -47,7 +39,7 @@
        "DEBUG = $(DEBUG)" \
        "SERIAL = $(SERIAL)" \
        "USE_PAPI = $(USE_PAPI)" \
-        "CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
+        "CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET)" )
pgi:
        ( $(MAKE) all \
@@ -65,7 +57,7 @@
        "DEBUG = $(DEBUG)" \
        "SERIAL = $(SERIAL)" \
        "USE_PAPI = $(USE_PAPI)" \
-        "CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
+        "CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET)" )
pgi-nersc:
        ( $(MAKE) all \
@@ -80,7 +72,7 @@
        "DEBUG = $(DEBUG)" \
        "SERIAL = $(SERIAL)" \
        "USE_PAPI = $(USE_PAPI)" \
-        "CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
+        "CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET)" )
pgi-llnl:
        ( $(MAKE) all \
@@ -95,7 +87,7 @@
        "DEBUG = $(DEBUG)" \
        "SERIAL = $(SERIAL)" \
        "USE_PAPI = $(USE_PAPI)" \
-        "CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
+        "CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET)" )
ifort:
        ( $(MAKE) all \
@@ -113,7 +105,7 @@
        "DEBUG = $(DEBUG)" \
        "SERIAL = $(SERIAL)" \
        "USE_PAPI = $(USE_PAPI)" \
-        "CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE -m64 $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
+        "CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE -m64 $(FILE_OFFSET)" )
gfortran:
        ( $(MAKE) all \
@@ -131,7 +123,7 @@
        "DEBUG = $(DEBUG)" \
        "SERIAL = $(SERIAL)" \
        "USE_PAPI = $(USE_PAPI)" \
-        "CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE -m64 $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
+        "CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE -m64 $(FILE_OFFSET)" )
g95:
        ( $(MAKE) all \
@@ -146,7 +138,7 @@
        "DEBUG = $(DEBUG)" \
        "SERIAL = $(SERIAL)" \
        "USE_PAPI = $(USE_PAPI)" \
-        "CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
+        "CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET)" )
pathscale-nersc:
        ( $(MAKE) all \
@@ -161,7 +153,7 @@
        "DEBUG = $(DEBUG)" \
        "SERIAL = $(SERIAL)" \
        "USE_PAPI = $(USE_PAPI)" \
-        "CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
+        "CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET)" )
cray-nersc:
        ( $(MAKE) all \
@@ -176,7 +168,7 @@
        "DEBUG = $(DEBUG)" \
        "SERIAL = $(SERIAL)" \
        "USE_PAPI = $(USE_PAPI)" \
-        "CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
+        "CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET)" )
intel-nersc:
        ( $(MAKE) all \
@@ -191,7 +183,7 @@
        "DEBUG = $(DEBUG)" \
        "SERIAL = $(SERIAL)" \
        "USE_PAPI = $(USE_PAPI)" \
-        "CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
+        "CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET)" )
CPPINCLUDES =
FCINCLUDES =
@@ -217,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 "$(DEBUG)" "true"
Modified: branches/ocean_projects/variable_name_change/src/Makefile.in.CESM_OCN
===================================================================
--- branches/ocean_projects/variable_name_change/src/Makefile.in.CESM_OCN        2013-04-17 20:55:12 UTC (rev 2764)
+++ branches/ocean_projects/variable_name_change/src/Makefile.in.CESM_OCN        2013-04-17 21:03:20 UTC (rev 2765)
@@ -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
Modified: branches/ocean_projects/variable_name_change/src/framework/Makefile
===================================================================
--- branches/ocean_projects/variable_name_change/src/framework/Makefile        2013-04-17 20:55:12 UTC (rev 2764)
+++ branches/ocean_projects/variable_name_change/src/framework/Makefile        2013-04-17 21:03:20 UTC (rev 2765)
@@ -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/variable_name_change/src/framework/mpas_io_input.F
===================================================================
--- branches/ocean_projects/variable_name_change/src/framework/mpas_io_input.F        2013-04-17 20:55:12 UTC (rev 2764)
+++ branches/ocean_projects/variable_name_change/src/framework/mpas_io_input.F        2013-04-17 21:03:20 UTC (rev 2765)
@@ -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
@@ -355,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, &
-! size(xCellField % array), size(local_cell_list), &
-! sendCellList, recvCellList)
-!
-! call mpas_dmpar_alltoall_field(domain % dminfo, yCellField % array, yCell, &
-! size(yCellField % array), size(local_cell_list), &
-! sendCellList, recvCellList)
-!
-! call mpas_dmpar_alltoall_field(domain % dminfo, zCellField % array, zCell, &
-! size(zCellField % array), size(local_cell_list), &
-! 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, &
-! size(xEdgeField % array), nlocal_edges, &
-! sendEdgeList, recvEdgeList)
-! call mpas_dmpar_alltoall_field(domain % dminfo, yEdgeField % array, yEdge, &
-! size(yEdgeField % array), nlocal_edges, &
-! sendEdgeList, recvEdgeList)
-! call mpas_dmpar_alltoall_field(domain % dminfo, zEdgeField % array, zEdge, &
-! size(zEdgeField % array), nlocal_edges, &
-! sendEdgeList, recvEdgeList)
-!
-! call mpas_dmpar_alltoall_field(domain % dminfo, xVertexField % array, xVertex, &
-! size(xVertexField % array), nlocal_vertices, &
-! sendVertexList, recvVertexList)
-! call mpas_dmpar_alltoall_field(domain % dminfo, yVertexField % array, yVertex, &
-! size(yVertexField % array), nlocal_vertices, &
-! sendVertexList, recvVertexList)
-! call mpas_dmpar_alltoall_field(domain % dminfo, zVertexField % array, zVertex, &
-! size(zVertexField % array), nlocal_vertices, &
-! 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, &
-! size(indexToEdgeIDField % array), nlocal_edges, &
-! indexToEdgeIDField % array, local_edge_list, &
-! sendEdgeList, recvEdgeList)
-!
-! call mpas_dmpar_get_owner_list(domain % dminfo, &
-! size(indexToVertexIDField % array), nlocal_vertices, &
-! indexToVertexIDField % array, local_vertex_list, &
-! 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
@@ -688,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 => readingBlock
- xCell % sendList => indexToCellID % sendList
- xCell % recvList => indexToCellID % recvList
- xCell % copyList => 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 => indexToCellID % sendList
- yCell % recvList => indexToCellID % recvList
- yCell % copyList => indexToCellID % copyList
- yCell % dimSizes(1) = nReadCells
- yCell % block => 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 => readingBlock
- zCell % sendList => indexToCellID % sendList
- zCell % recvList => indexToCellID % recvList
- zCell % copyList => indexToCellID % copyList
- nullify(zCell % next)
-#endif
-#endif
-
! Number of cell/edges/vertices adjacent to each cell
allocate(nEdgesOnCell)
allocate(nEdgesOnCell % ioinfo)
@@ -868,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 => readingBlock
- xEdge % sendList => indexToEdgeID % sendList
- xEdge % recvList => indexToEdgeID % recvList
- xEdge % copyList => 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 => readingBlock
- yEdge % sendList => indexToEdgeID % sendList
- yEdge % recvList => indexToEdgeID % recvList
- yEdge % copyList => 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 => readingBlock
- zEdge % sendList => indexToEdgeID % sendList
- zEdge % recvList => indexToEdgeID % recvList
- zEdge % copyList => 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
@@ -988,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 => readingBlock
- xVertex % sendList => indexToVertexID % sendList
- xVertex % recvList => indexToVertexID % recvList
- xVertex % copyList => 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 => readingBlock
- yVertex % sendList => indexToVertexID % sendList
- yVertex % recvList => indexToVertexID % recvList
- yVertex % copyList => 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 => readingBlock
- zVertex % sendList => indexToVertexID % sendList
- zVertex % recvList => indexToVertexID % recvList
- zVertex % copyList => 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
Deleted: branches/ocean_projects/variable_name_change/src/framework/mpas_zoltan_interface.F
===================================================================
--- branches/ocean_projects/variable_name_change/src/framework/mpas_zoltan_interface.F        2013-04-17 20:55:12 UTC (rev 2764)
+++ branches/ocean_projects/variable_name_change/src/framework/mpas_zoltan_interface.F        2013-04-17 21:03:20 UTC (rev 2765)
@@ -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, &
- 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 => in_cellIDs
- geomDim = in_geomDim
- cellCoordX => in_cellX
- cellCoordY => in_cellY
- cellCoordZ => in_cellZ
-
- nullify(zz_obj)
- zz_obj => Zoltan_Create(MPI_COMM_SELF)
-
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! General Zoltan Parameters
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- ierr = Zoltan_Set_Param(zz_obj, "ORDER_METHOD", "LOCAL_HSFC")
-
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! 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, &
- 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, &
- 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, &
- 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 => in_edgeIDs
- geomDim = in_geomDim
- edgeCoordX => in_edgeX
- edgeCoordY => in_edgeY
- edgeCoordZ => in_edgeZ
-
- nullify(zz_obj)
- zz_obj => Zoltan_Create(MPI_COMM_SELF)
-
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! General Zoltan Parameters
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- ierr = Zoltan_Set_Param(zz_obj, "ORDER_METHOD", "LOCAL_HSFC")
-
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! 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, &
- 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, &
- 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, &
- 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 => in_vertIDs
- geomDim = in_geomDim
- vertCoordX => in_vertX
- vertCoordY => in_vertY
- vertCoordZ => in_vertZ
-
- nullify(zz_obj)
- zz_obj => Zoltan_Create(MPI_COMM_SELF)
-
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! General Zoltan Parameters
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- ierr = Zoltan_Set_Param(zz_obj, "ORDER_METHOD", "LOCAL_HSFC")
-
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! 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, &
- 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, &
- 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
</font>
</pre>