<p><b>duda</b> 2009-12-21 12:25:43 -0700 (Mon, 21 Dec 2009)</p><p>BRANCH COMMIT: branches/hyd_model<br>
<br>
1) Permit vertices in the dual mesh to have degree other than 3, so<br>
long as they all have the same different degree (e.g., 4 in the case <br>
of pure quadrilateral meshes). This is done by:<br>
<br>
- Changing the dimension THREE (which was hardwired to the <br>
constant value 3) to vertexDegree and update all variables <br>
using this dimension in the grid.nc files<br>
<br>
- Update the Registry to dimension fields using vertexDegree, whose<br>
value is specified in the grid.nc file, to vertexDegree<br>
<br>
- Update loops and array specifications in the code to use the<br>
dimension vertexDegree rather than a hardwired value of 3<br>
<br>
M src/module_io_input.F<br>
M src/module_io_output.F<br>
M src/module_time_integration.F<br>
M Registry/Registry<br>
<br>
<br>
2) Add a bugfix for the Registry code that was inappropriately inserting<br>
a line brake into lines that were just at 132 columns including a <br>
continuation character '&' at the end.<br>
<br>
M Registry/fortprintf.c<br>
<br>
<br>
NOTE: With the changes in (1), old grid.nc files or Registry files that<br>
use the THREE dimension will not work.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/hyd_model/Registry/Registry
===================================================================
--- branches/hyd_model/Registry/Registry        2009-12-21 17:11:51 UTC (rev 94)
+++ branches/hyd_model/Registry/Registry        2009-12-21 19:25:43 UTC (rev 95)
@@ -26,7 +26,7 @@
dim maxEdges2 maxEdges2
dim nVertices nVertices
dim TWO 2
-dim THREE 3
+dim vertexDegree vertexDegree
dim FIFTEEN 15
dim TWENTYONE 21
dim nVertLevels nVertLevels
@@ -75,9 +75,9 @@
var integer cellsOnCell ( maxEdges nCells ) iro cellsOnCell - -
var integer verticesOnCell ( maxEdges nCells ) iro verticesOnCell - -
var integer verticesOnEdge ( TWO nEdges ) iro verticesOnEdge - -
-var integer edgesOnVertex ( THREE nVertices ) iro edgesOnVertex - -
-var integer cellsOnVertex ( THREE nVertices ) iro cellsOnVertex - -
-var real kiteAreasOnVertex ( THREE nVertices ) iro kiteAreasOnVertex - -
+var integer edgesOnVertex ( vertexDegree nVertices ) iro edgesOnVertex - -
+var integer cellsOnVertex ( vertexDegree nVertices ) iro cellsOnVertex - -
+var real kiteAreasOnVertex ( vertexDegree nVertices ) iro kiteAreasOnVertex - -
var real fEdge ( nEdges ) iro fEdge - -
var real fVertex ( nVertices ) iro fVertex - -
var real h_s ( nCells ) iro h_s - -
Modified: branches/hyd_model/Registry/fortprintf.c
===================================================================
--- branches/hyd_model/Registry/fortprintf.c        2009-12-21 17:11:51 UTC (rev 94)
+++ branches/hyd_model/Registry/fortprintf.c        2009-12-21 19:25:43 UTC (rev 95)
@@ -24,7 +24,7 @@
for(i=0; i<MAX_LINE_LEN-1 && i<nbuf; i++) {
if (fbuffer[i] == '\'' && (fbuffer[i+1] != '\'' || i == nbuf-1)) inquotes = (inquotes + 1) % 2;
if (fbuffer[i] == '</font>
<font color="gray">') nl = i;
- if (fbuffer[i] == ' ') sp = i;
+ if (fbuffer[i] == ' ' && fbuffer[i+1] != '&') sp = i;
}
if (nbuf <= MAX_LINE_LEN) sp = -1;
Modified: branches/hyd_model/src/module_io_input.F
===================================================================
--- branches/hyd_model/src/module_io_input.F        2009-12-21 17:11:51 UTC (rev 94)
+++ branches/hyd_model/src/module_io_input.F        2009-12-21 19:25:43 UTC (rev 95)
@@ -207,9 +207,9 @@
cellsOnVertexField % ioinfo % fieldName = 'cellsOnVertex'
cellsOnVertexField % ioinfo % start(1) = 1
cellsOnVertexField % ioinfo % start(2) = readVertexStart
- cellsOnVertexField % ioinfo % count(1) = 3
+ cellsOnVertexField % ioinfo % count(1) = vertexDegree
cellsOnVertexField % ioinfo % count(2) = nReadVertices
- allocate(cellsOnVertexField % array(3,nReadVertices))
+ allocate(cellsOnVertexField % array(vertexDegree,nReadVertices))
call io_input_field(input_obj, cellsOnVertexField)
@@ -397,14 +397,14 @@
! Work out which edges and vertices are owned by this process, and which are ghost
!
allocate(cellsOnEdge_2Halo(2,nlocal_edges))
- allocate(cellsOnVertex_2Halo(3,nlocal_vertices))
+ allocate(cellsOnVertex_2Halo(vertexDegree,nlocal_vertices))
call dmpar_alltoall_field(domain % dminfo, cellsOnEdgeField % array, cellsOnEdge_2Halo, &
2, size(cellsOnEdgeField % array, 2), nlocal_edges, &
sendEdgeList, recvEdgeList)
call dmpar_alltoall_field(domain % dminfo, cellsOnVertexField % array, cellsOnVertex_2Halo, &
- 3, size(cellsOnVertexField % array, 2), nlocal_vertices, &
+ vertexDegree, size(cellsOnVertexField % array, 2), nlocal_vertices, &
sendVertexList, recvVertexList)
@@ -413,13 +413,13 @@
2, nlocal_edges, cellsOnEdge_2Halo, local_edge_list, ghostEdgeStart)
call block_decomp_partitioned_edge_list(block_graph_2Halo % nVertices, &
block_graph_2Halo % vertexID(1:block_graph_2Halo % nVertices), &
- 3, nlocal_vertices, cellsOnVertex_2Halo, local_vertex_list, ghostVertexStart)
+ vertexDegree, nlocal_vertices, cellsOnVertex_2Halo, local_vertex_list, ghostVertexStart)
- ! At this point, local_edge_list(1:ghostEdgeStart-1) contains all of the owned edges for this block
+ ! At this point, local_edge_list(1;ghostEdgeStart-1) contains all of the owned edges for this block
! and local_edge_list(ghostEdgeStart:nlocal_edges) contains all of the ghost edges
- ! At this point, local_vertex_list(1:ghostVertexStart-1) contains all of the owned vertices for this block
+ ! At this point, local_vertex_list(1;ghostVertexStart-1) contains all of the owned vertices for this block
! and local_vertex_list(ghostVertexStart:nlocal_vertices) contains all of the ghost vertices
! Also, at this point, block_graph_2Halo % vertexID(1:block_graph_2Halo%nVertices) contains all of the owned
@@ -649,7 +649,7 @@
end do
do i=1,domain % blocklist % mesh % nVertices
- do j=1,3
+ do j=1,vertexDegree
k = binary_search(cellIDSorted, 2, 1, domain % blocklist % mesh % nCells, &
domain % blocklist % mesh % cellsOnVertex % array(j,i))
Modified: branches/hyd_model/src/module_io_output.F
===================================================================
--- branches/hyd_model/src/module_io_output.F        2009-12-21 17:11:51 UTC (rev 94)
+++ branches/hyd_model/src/module_io_output.F        2009-12-21 19:25:43 UTC (rev 95)
@@ -149,8 +149,8 @@
allocate(cellsOnEdge(2, domain % blocklist % mesh % nEdgesSolve))
allocate(verticesOnEdge(2, domain % blocklist % mesh % nEdgesSolve))
allocate(edgesOnEdge(2 * domain % blocklist % mesh % maxEdges, domain % blocklist % mesh % nEdgesSolve))
- allocate(cellsOnVertex(3, domain % blocklist % mesh % nVerticesSolve))
- allocate(edgesOnVertex(3, domain % blocklist % mesh % nVerticesSolve))
+ allocate(cellsOnVertex(domain % blocklist % mesh % vertexDegree, domain % blocklist % mesh % nVerticesSolve))
+ allocate(edgesOnVertex(domain % blocklist % mesh % vertexDegree, domain % blocklist % mesh % nVerticesSolve))
!
@@ -191,7 +191,7 @@
end do
end do
do i=1,domain % blocklist % mesh % nVerticesSolve
- do j=1,3
+ do j=1,domain % blocklist % mesh % vertexDegree
cellsOnVertex(j,i) = domain % blocklist % mesh % indexToCellID % array( &
domain % blocklist % mesh % cellsOnVertex % array(j,i))
edgesOnVertex(j,i) = domain % blocklist % mesh % indexToEdgeID % array( &
Modified: branches/hyd_model/src/module_time_integration.F
===================================================================
--- branches/hyd_model/src/module_time_integration.F        2009-12-21 17:11:51 UTC (rev 94)
+++ branches/hyd_model/src/module_time_integration.F        2009-12-21 19:25:43 UTC (rev 95)
@@ -1472,22 +1472,20 @@
! Compute height at vertices, pv at vertices, and average pv to edge locations
! ( this computes pv_vertex at all vertices bounding real cells )
!
- do iVertex = 1,nVertices
- if (cellsOnVertex(1,iVertex) > 0 .and. &
- cellsOnVertex(2,iVertex) > 0 .and. &
- cellsOnVertex(3,iVertex) > 0 &
- ) then
- do k=1,nVertLevels
- h_vertex = 0.0
- do i=1,3
- h_vertex = h_vertex + h(k,cellsOnVertex(i,iVertex)) * kiteAreasOnVertex(i,iVertex)
- end do
- h_vertex = h_vertex / areaTriangle(iVertex)
-
- pv_vertex(k,iVertex) = (fVertex(iVertex) + vorticity(k,iVertex)) / h_vertex
+ VTX_LOOP: do iVertex = 1,nVertices
+ do i=1,grid % vertexDegree
+ if (cellsOnVertex(i,iVertex) <= 0) cycle VTX_LOOP
+ end do
+ do k=1,nVertLevels
+ h_vertex = 0.0
+ do i=1,grid % vertexDegree
+ h_vertex = h_vertex + h(k,cellsOnVertex(i,iVertex)) * kiteAreasOnVertex(i,iVertex)
end do
- end if
- end do
+ h_vertex = h_vertex / areaTriangle(iVertex)
+
+ pv_vertex(k,iVertex) = (fVertex(iVertex) + vorticity(k,iVertex)) / h_vertex
+ end do
+ end do VTX_LOOP
! tdr
@@ -1510,7 +1508,7 @@
!
pv_edge(:,:) = 0.0
do iVertex = 1,nVertices
- do i=1,3
+ do i=1,grid % vertexDegree
iEdge = edgesOnVertex(i,iVertex)
if(iEdge > 0) then
do k=1,nVertLevels
@@ -1539,7 +1537,7 @@
!
pv_cell(:,:) = 0.0
do iVertex = 1, nVertices
- do i=1,3
+ do i=1,grid % vertexDegree
iCell = cellsOnVertex(i,iVertex)
if( iCell > 0) then
do k = 1,nVertLevels
</font>
</pre>