<p><b>duda</b> 2010-03-02 18:16:54 -0700 (Tue, 02 Mar 2010)</p><p>Fix bug in handling of time-invariant super-arrays in registry code.<br>
<br>
M    Registry/gen_inc.c<br>
</p><hr noshade><pre><font color="gray">Modified: trunk/swmodel/Registry/gen_inc.c
===================================================================
--- trunk/swmodel/Registry/gen_inc.c        2010-03-03 01:16:01 UTC (rev 121)
+++ trunk/swmodel/Registry/gen_inc.c        2010-03-03 01:16:54 UTC (rev 122)
@@ -311,8 +311,8 @@
                var_ptr2 = var_ptr;
                var_ptr = var_ptr->next;
             }
-            if (vtype == INTEGER)  fortprintf(fd, "      type (field%idInteger), pointer :: %s</font>
<font color="red">", (var_ptr2->ndims)+1, var_ptr2->name_in_code);
-            if (vtype == REAL)     fortprintf(fd, "      type (field%idReal), pointer :: %s</font>
<font color="blue">", (var_ptr2->ndims)+1, var_ptr2->name_in_code);
+            if (vtype == INTEGER)  fortprintf(fd, "      type (field%idInteger), pointer :: %s</font>
<font color="blue">", (var_ptr2->ndims)+1, var_ptr2->super_array);
+            if (vtype == REAL)     fortprintf(fd, "      type (field%idReal), pointer :: %s</font>
<font color="black">", (var_ptr2->ndims)+1, var_ptr2->super_array);
          }
          else {
             if (var_ptr->vtype == INTEGER)  fortprintf(fd, "      type (field%idInteger), pointer :: %s</font>
<font color="gray">", var_ptr->ndims, var_ptr->name_in_code);
@@ -377,13 +377,15 @@
             memcpy(super_array, var_ptr->super_array, 1024);
             memcpy(array_class, var_ptr->array_class, 1024);
             vtype = var_ptr->vtype;
+            i = 0;
             while (var_ptr && strncmp(super_array, var_ptr->super_array, 1024) == 0) {
+               i++;
                var_ptr2 = var_ptr;
                var_ptr = var_ptr->next;
             }
-            fortprintf(fd, "      allocate(g %% %s)</font>
<font color="red">", var_ptr2->name_in_code);
-            fortprintf(fd, "      allocate(g %% %s %% ioinfo)</font>
<font color="red">", var_ptr2->name_in_code);
-            fortprintf(fd, "      allocate(g %% %s %% array(", var_ptr2->name_in_code);
+            fortprintf(fd, "      allocate(g %% %s)</font>
<font color="blue">", var_ptr2->super_array);
+            fortprintf(fd, "      allocate(g %% %s %% ioinfo)</font>
<font color="gray">", var_ptr2->super_array);
+            fortprintf(fd, "      allocate(g %% %s %% array(%i, ", var_ptr2->super_array, i);
             dimlist_ptr = var_ptr2->dimlist;
             fortprintf(fd, "%s", dimlist_ptr->dim->name_in_code);
             dimlist_ptr = dimlist_ptr->next;
@@ -394,19 +396,19 @@
             fortprintf(fd, "))</font>
<font color="red">");
 
             if (var_ptr2->iostreams & INPUT0) 
-               fortprintf(fd, "      g %% %s %% ioinfo %% input = .true.</font>
<font color="blue">", var_ptr2->name_in_code);
+               fortprintf(fd, "      g %% %s %% ioinfo %% input = .true.</font>
<font color="red">", var_ptr2->super_array);
             else
-               fortprintf(fd, "      g %% %s %% ioinfo %% input = .false.</font>
<font color="blue">", var_ptr2->name_in_code);
+               fortprintf(fd, "      g %% %s %% ioinfo %% input = .false.</font>
<font color="red">", var_ptr2->super_array);
 
             if (var_ptr2->iostreams & RESTART0) 
-               fortprintf(fd, "      g %% %s %% ioinfo %% restart = .true.</font>
<font color="blue">", var_ptr2->name_in_code);
+               fortprintf(fd, "      g %% %s %% ioinfo %% restart = .true.</font>
<font color="red">", var_ptr2->super_array);
             else
-               fortprintf(fd, "      g %% %s %% ioinfo %% restart = .false.</font>
<font color="blue">", var_ptr2->name_in_code);
+               fortprintf(fd, "      g %% %s %% ioinfo %% restart = .false.</font>
<font color="red">", var_ptr2->super_array);
 
             if (var_ptr2->iostreams & OUTPUT0) 
-               fortprintf(fd, "      g %% %s %% ioinfo %% output = .true.</font>
<font color="blue">", var_ptr2->name_in_code);
+               fortprintf(fd, "      g %% %s %% ioinfo %% output = .true.</font>
<font color="red">", var_ptr2->super_array);
             else
-               fortprintf(fd, "      g %% %s %% ioinfo %% output = .false.</font>
<font color="blue">", var_ptr2->name_in_code);
+               fortprintf(fd, "      g %% %s %% ioinfo %% output = .false.</font>
<font color="black">", var_ptr2->super_array);
             fortprintf(fd, "</font>
<font color="gray">");
          }
          else {
@@ -920,7 +922,7 @@
             if (var_ptr->timedim) 
                fortprintf(fd, "                                %s%id %% array, super_%s%id, &</font>
<font color="red">", vtype, var_ptr->ndims, vtype, var_ptr->ndims);
             else
-               fortprintf(fd, "                                %s%id %% array, block %% mesh %% %s %% array, &</font>
<font color="blue">", vtype, var_ptr->ndims, var_ptr->name_in_code);
+               fortprintf(fd, "                                %s%id %% array, super_%s%id, &</font>
<font color="black">", vtype, var_ptr->ndims, vtype, var_ptr->ndims);
          }
          else {
             if (var_ptr->timedim) 
</font>
</pre>