<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, " allocate(s %% %s %% ioinfo)</font>
<font color="red">", var_ptr->name_in_code);
fortprintf(fd, " allocate(s %% %s %% array(", var_ptr->name_in_code);
dimlist_ptr = var_ptr->dimlist;
- if (!strncmp(dimlist_ptr->dim->name_in_file, "nCells", 1024) ||
- !strncmp(dimlist_ptr->dim->name_in_file, "nEdges", 1024) ||
- !strncmp(dimlist_ptr->dim->name_in_file, "nVertices", 1024))
- fortprintf(fd, "b %% mesh %% %s + 1", dimlist_ptr->dim->name_in_code);
- else
- fortprintf(fd, "b %% mesh %% %s", dimlist_ptr->dim->name_in_code);
- dimlist_ptr = dimlist_ptr->next;
- while (dimlist_ptr) {
+ if (dimlist_ptr->dim->constant_value < 0) {
if (!strncmp(dimlist_ptr->dim->name_in_file, "nCells", 1024) ||
!strncmp(dimlist_ptr->dim->name_in_file, "nEdges", 1024) ||
!strncmp(dimlist_ptr->dim->name_in_file, "nVertices", 1024))
- fortprintf(fd, ", b %% mesh %% %s + 1", dimlist_ptr->dim->name_in_code);
+ fortprintf(fd, "b %% mesh %% %s + 1", dimlist_ptr->dim->name_in_code);
else
- fortprintf(fd, ", b %% mesh %% %s", dimlist_ptr->dim->name_in_code);
+ fortprintf(fd, "b %% mesh %% %s", dimlist_ptr->dim->name_in_code);
+ }
+ else {
+ fortprintf(fd, "%i", dimlist_ptr->dim->constant_value);
+ }
+ dimlist_ptr = dimlist_ptr->next;
+ while (dimlist_ptr) {
+ if (dimlist_ptr->dim->constant_value < 0) {
+ if (!strncmp(dimlist_ptr->dim->name_in_file, "nCells", 1024) ||
+ !strncmp(dimlist_ptr->dim->name_in_file, "nEdges", 1024) ||
+ !strncmp(dimlist_ptr->dim->name_in_file, "nVertices", 1024))
+ fortprintf(fd, ", b %% mesh %% %s + 1", dimlist_ptr->dim->name_in_code);
+ else
+ fortprintf(fd, ", b %% mesh %% %s", dimlist_ptr->dim->name_in_code);
+ }
+ else {
+ fortprintf(fd, ", %i", dimlist_ptr->dim->constant_value);
+ }
dimlist_ptr = dimlist_ptr->next;
}
fortprintf(fd, "))</font>
<font color="black">");
</font>
</pre>