<p><b>duda</b> 2010-05-13 17:47:08 -0600 (Thu, 13 May 2010)</p><p>Fix bug that was causing the registry-generated array allocation<br>
code for time-varying fields with a constant dimension to be<br>
incorrectly generated. Now, it should be possible to specify,<br>
<br>
dim nCells nCells                                                                                                                                     <br>
dim R3 3                                                                                                                                              <br>
var real foo ( R3 nCells Time ) - foo - -      <br>
<br>
in a Registry file, for example.<br>
<br>
<br>
M    src/registry/gen_inc.c<br>
</p><hr noshade><pre><font color="gray">Modified: trunk/mpas/src/registry/gen_inc.c
===================================================================
--- trunk/mpas/src/registry/gen_inc.c        2010-05-13 23:37:03 UTC (rev 271)
+++ trunk/mpas/src/registry/gen_inc.c        2010-05-13 23:47:08 UTC (rev 272)
@@ -576,20 +576,30 @@
             fortprintf(fd, &quot;      allocate(s %% %s %% ioinfo)</font>
<font color="red">&quot;, var_ptr-&gt;name_in_code);
             fortprintf(fd, &quot;      allocate(s %% %s %% array(&quot;, var_ptr-&gt;name_in_code);
             dimlist_ptr = var_ptr-&gt;dimlist;
-            if (!strncmp(dimlist_ptr-&gt;dim-&gt;name_in_file, &quot;nCells&quot;, 1024) ||
-                !strncmp(dimlist_ptr-&gt;dim-&gt;name_in_file, &quot;nEdges&quot;, 1024) ||
-                !strncmp(dimlist_ptr-&gt;dim-&gt;name_in_file, &quot;nVertices&quot;, 1024))
-               fortprintf(fd, &quot;b %% mesh %% %s + 1&quot;, dimlist_ptr-&gt;dim-&gt;name_in_code);
-            else
-               fortprintf(fd, &quot;b %% mesh %% %s&quot;, dimlist_ptr-&gt;dim-&gt;name_in_code);
-            dimlist_ptr = dimlist_ptr-&gt;next;
-            while (dimlist_ptr) {
+            if (dimlist_ptr-&gt;dim-&gt;constant_value &lt; 0) {
                if (!strncmp(dimlist_ptr-&gt;dim-&gt;name_in_file, &quot;nCells&quot;, 1024) ||
                    !strncmp(dimlist_ptr-&gt;dim-&gt;name_in_file, &quot;nEdges&quot;, 1024) ||
                    !strncmp(dimlist_ptr-&gt;dim-&gt;name_in_file, &quot;nVertices&quot;, 1024))
-                  fortprintf(fd, &quot;, b %% mesh %% %s + 1&quot;, dimlist_ptr-&gt;dim-&gt;name_in_code);
+                  fortprintf(fd, &quot;b %% mesh %% %s + 1&quot;, dimlist_ptr-&gt;dim-&gt;name_in_code);
                else
-                  fortprintf(fd, &quot;, b %% mesh %% %s&quot;, dimlist_ptr-&gt;dim-&gt;name_in_code);
+                  fortprintf(fd, &quot;b %% mesh %% %s&quot;, dimlist_ptr-&gt;dim-&gt;name_in_code);
+            }
+            else {
+               fortprintf(fd, &quot;%i&quot;, dimlist_ptr-&gt;dim-&gt;constant_value);
+            }
+            dimlist_ptr = dimlist_ptr-&gt;next;
+            while (dimlist_ptr) {
+               if (dimlist_ptr-&gt;dim-&gt;constant_value &lt; 0) {
+                  if (!strncmp(dimlist_ptr-&gt;dim-&gt;name_in_file, &quot;nCells&quot;, 1024) ||
+                      !strncmp(dimlist_ptr-&gt;dim-&gt;name_in_file, &quot;nEdges&quot;, 1024) ||
+                      !strncmp(dimlist_ptr-&gt;dim-&gt;name_in_file, &quot;nVertices&quot;, 1024))
+                     fortprintf(fd, &quot;, b %% mesh %% %s + 1&quot;, dimlist_ptr-&gt;dim-&gt;name_in_code);
+                  else
+                     fortprintf(fd, &quot;, b %% mesh %% %s&quot;, dimlist_ptr-&gt;dim-&gt;name_in_code);
+               }
+               else {
+                  fortprintf(fd, &quot;, %i&quot;, dimlist_ptr-&gt;dim-&gt;constant_value);
+               }
                dimlist_ptr = dimlist_ptr-&gt;next;
             }
             fortprintf(fd, &quot;))</font>
<font color="black">&quot;);

</font>
</pre>