<p><b>duda</b> 2009-12-18 16:31:29 -0700 (Fri, 18 Dec 2009)</p><p>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 '&amp;' 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: trunk/swmodel/Registry/Registry
===================================================================
--- trunk/swmodel/Registry/Registry        2009-12-18 23:01:54 UTC (rev 91)
+++ trunk/swmodel/Registry/Registry        2009-12-18 23:31:29 UTC (rev 92)
@@ -20,12 +20,12 @@
 dim maxEdges2 maxEdges2
 dim nVertices nVertices
 dim TWO 2
-dim THREE 3
+dim vertexDegree vertexDegree
 dim nVertLevels nVertLevels
 dim nTracers nTracers
 
 #
-# var  type  name_in_file  ( dims )  iro-  name_in_code
+# var  type  name_in_file  ( dims )  iro-  name_in_code super-array array_class
 #
 var real    xtime ( Time ) ro xtime - -
 
@@ -66,9 +66,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: trunk/swmodel/Registry/fortprintf.c
===================================================================
--- trunk/swmodel/Registry/fortprintf.c        2009-12-18 23:01:54 UTC (rev 91)
+++ trunk/swmodel/Registry/fortprintf.c        2009-12-18 23:31:29 UTC (rev 92)
@@ -24,7 +24,7 @@
       for(i=0; i&lt;MAX_LINE_LEN-1 &amp;&amp; i&lt;nbuf; i++) {
          if (fbuffer[i] == '\'' &amp;&amp; (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] == ' ' &amp;&amp; fbuffer[i+1] != '&amp;') sp = i;
       }
       if (nbuf &lt;= MAX_LINE_LEN) sp = -1;
 

Modified: trunk/swmodel/src/module_io_input.F
===================================================================
--- trunk/swmodel/src/module_io_input.F        2009-12-18 23:01:54 UTC (rev 91)
+++ trunk/swmodel/src/module_io_input.F        2009-12-18 23:31:29 UTC (rev 92)
@@ -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, &amp;
                                 2, size(cellsOnEdgeField % array, 2), nlocal_edges, &amp;
                                 sendEdgeList, recvEdgeList)
    
       call dmpar_alltoall_field(domain % dminfo, cellsOnVertexField % array, cellsOnVertex_2Halo, &amp;
-                                3, size(cellsOnVertexField % array, 2), nlocal_vertices, &amp;
+                                vertexDegree, size(cellsOnVertexField % array, 2), nlocal_vertices, &amp;
                                 sendVertexList, recvVertexList)
    
    
@@ -413,7 +413,7 @@
                                               2, nlocal_edges, cellsOnEdge_2Halo, local_edge_list, ghostEdgeStart)
       call block_decomp_partitioned_edge_list(block_graph_2Halo % nVertices, &amp;
                                               block_graph_2Halo % vertexID(1:block_graph_2Halo % nVertices), &amp;
-                                              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
@@ -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, &amp;
                               domain % blocklist % mesh % cellsOnVertex % array(j,i))

Modified: trunk/swmodel/src/module_io_output.F
===================================================================
--- trunk/swmodel/src/module_io_output.F        2009-12-18 23:01:54 UTC (rev 91)
+++ trunk/swmodel/src/module_io_output.F        2009-12-18 23:31:29 UTC (rev 92)
@@ -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( &amp;
                                                                            domain % blocklist % mesh % cellsOnVertex % array(j,i))
             edgesOnVertex(j,i) = domain % blocklist % mesh % indexToEdgeID % array( &amp;

Modified: trunk/swmodel/src/module_time_integration.F
===================================================================
--- trunk/swmodel/src/module_time_integration.F        2009-12-18 23:01:54 UTC (rev 91)
+++ trunk/swmodel/src/module_time_integration.F        2009-12-18 23:31:29 UTC (rev 92)
@@ -606,22 +606,20 @@
       ! Compute height at vertices, pv at vertices, and average pv to edge locations
       !  ( this computes pv_vertex at all vertices bounding real cells and distance-1 ghost cells )
       !
-      do iVertex = 1,nVertices
-         if (cellsOnVertex(1,iVertex) &gt; 0 .and. &amp;
-             cellsOnVertex(2,iVertex) &gt; 0 .and. &amp;
-             cellsOnVertex(3,iVertex) &gt; 0       &amp;
-            ) 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) &lt;= 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
 
 
@@ -644,7 +642,7 @@
       !
       pv_edge(:,:) = 0.0
       do iVertex = 1,nVertices
-        do i=1,3
+        do i=1,grid % vertexDegree
           iEdge = edgesOnVertex(i,iVertex)
           if(iEdge &gt; 0) then
             do k=1,nVertLevels
@@ -673,7 +671,7 @@
       !
       pv_cell(:,:) = 0.0
       do iVertex = 1, nVertices
-       do i=1,3
+       do i=1,grid % vertexDegree
          iCell = cellsOnVertex(i,iVertex)
          if( iCell &gt; 0) then
            do k = 1,nVertLevels

</font>
</pre>