<p><b>duda</b> 2012-03-16 13:40:23 -0600 (Fri, 16 Mar 2012)</p><p>Add components to the field derived data types to identify whether the<br>
field is a super-array (isSuperArray), and if so, the names of the <br>
constituent fields (constituentNames). Also, add code to initialize these<br>
new components in the registry.<br>
<br>
Example: For the scalars super-array, we have<br>
<br>
scalars % isSuperArray = .true.<br>
scalars % constituentNames(1) = 'qv'<br>
scalars % constituentNames(2) = 'qc'<br>
scalars % constituentNames(3) = 'qr'<br>
<br>
and for a non-super-array like u, we have<br>
<br>
scalars % isSuperArray = .false.<br>
scalars % constituentNames => null()<br>
<br>
<br>
M registry/gen_inc.c<br>
M framework/mpas_grid_types.F<br>
</p><hr noshade><pre><font color="gray">Modified: branches/omp_blocks/io/src/framework/mpas_grid_types.F
===================================================================
--- branches/omp_blocks/io/src/framework/mpas_grid_types.F        2012-03-16 18:20:53 UTC (rev 1663)
+++ branches/omp_blocks/io/src/framework/mpas_grid_types.F        2012-03-16 19:40:23 UTC (rev 1664)
@@ -33,9 +33,11 @@
! Information used by the I/O layer
type (io_info), pointer :: ioinfo ! to be removed later
character (len=64) :: fieldName
+ character (len=64), dimension(:), pointer :: constituentNames => null()
character (len=64), dimension(3) :: dimNames
integer, dimension(3) :: dimSizes
logical :: hasTimeDimension
+ logical :: isSuperArray
type (att_list_type), pointer :: attList => null()
! Pointers to the prev and next blocks for this field on this task
@@ -60,9 +62,11 @@
! Information used by the I/O layer
type (io_info), pointer :: ioinfo ! to be removed later
character (len=64) :: fieldName
+ character (len=64), dimension(:), pointer :: constituentNames => null()
character (len=64), dimension(2) :: dimNames
integer, dimension(2) :: dimSizes
logical :: hasTimeDimension
+ logical :: isSuperArray
type (att_list_type), pointer :: attList => null()
! Pointers to the prev and next blocks for this field on this task
@@ -87,9 +91,11 @@
! Information used by the I/O layer
type (io_info), pointer :: ioinfo ! to be removed later
character (len=64) :: fieldName
+ character (len=64), dimension(:), pointer :: constituentNames => null()
character (len=64), dimension(1) :: dimNames
integer, dimension(1) :: dimSizes
logical :: hasTimeDimension
+ logical :: isSuperArray
type (att_list_type), pointer :: attList => null()
! Pointers to the prev and next blocks for this field on this task
@@ -114,7 +120,9 @@
! Information used by the I/O layer
type (io_info), pointer :: ioinfo ! to be removed later
character (len=64) :: fieldName
+ character (len=64), dimension(:), pointer :: constituentNames => null()
logical :: hasTimeDimension
+ logical :: isSuperArray
type (att_list_type), pointer :: attList => null()
! Pointers to the prev and next blocks for this field on this task
@@ -139,9 +147,11 @@
! Information used by the I/O layer
type (io_info), pointer :: ioinfo ! to be removed later
character (len=64) :: fieldName
+ character (len=64), dimension(:), pointer :: constituentNames => null()
character (len=64), dimension(3) :: dimNames
integer, dimension(3) :: dimSizes
logical :: hasTimeDimension
+ logical :: isSuperArray
type (att_list_type), pointer :: attList => null()
! Pointers to the prev and next blocks for this field on this task
@@ -166,9 +176,11 @@
! Information used by the I/O layer
type (io_info), pointer :: ioinfo ! to be removed later
character (len=64) :: fieldName
+ character (len=64), dimension(:), pointer :: constituentNames => null()
character (len=64), dimension(2) :: dimNames
integer, dimension(2) :: dimSizes
logical :: hasTimeDimension
+ logical :: isSuperArray
type (att_list_type), pointer :: attList => null()
! Pointers to the prev and next blocks for this field on this task
@@ -193,9 +205,11 @@
! Information used by the I/O layer
type (io_info), pointer :: ioinfo ! to be removed later
character (len=64) :: fieldName
+ character (len=64), dimension(:), pointer :: constituentNames => null()
character (len=64), dimension(1) :: dimNames
integer, dimension(1) :: dimSizes
logical :: hasTimeDimension
+ logical :: isSuperArray
type (att_list_type), pointer :: attList => null()
! Pointers to the prev and next blocks for this field on this task
@@ -220,7 +234,9 @@
! Information used by the I/O layer
type (io_info), pointer :: ioinfo ! to be removed later
character (len=64) :: fieldName
+ character (len=64), dimension(:), pointer :: constituentNames => null()
logical :: hasTimeDimension
+ logical :: isSuperArray
type (att_list_type), pointer :: attList => null()
! Pointers to the prev and next blocks for this field on this task
@@ -245,9 +261,11 @@
! Information used by the I/O layer
type (io_info), pointer :: ioinfo ! to be removed later
character (len=64) :: fieldName
+ character (len=64), dimension(:), pointer :: constituentNames => null()
character (len=64), dimension(1) :: dimNames
integer, dimension(1) :: dimSizes
logical :: hasTimeDimension
+ logical :: isSuperArray
type (att_list_type), pointer :: attList => null()
! Pointers to the prev and next blocks for this field on this task
@@ -272,7 +290,9 @@
! Information used by the I/O layer
type (io_info), pointer :: ioinfo ! to be removed later
character (len=64) :: fieldName
+ character (len=64), dimension(:), pointer :: constituentNames => null()
logical :: hasTimeDimension
+ logical :: isSuperArray
type (att_list_type), pointer :: attList => null()
! Pointers to the prev and next blocks for this field on this task
Modified: branches/omp_blocks/io/src/registry/gen_inc.c
===================================================================
--- branches/omp_blocks/io/src/registry/gen_inc.c        2012-03-16 18:20:53 UTC (rev 1663)
+++ branches/omp_blocks/io/src/registry/gen_inc.c        2012-03-16 19:40:23 UTC (rev 1664)
@@ -176,6 +176,7 @@
struct variable * var_ptr2;
struct variable_list * var_list_ptr;
struct variable_list * var_list_ptr2;
+ struct variable_list * var_list_ptr3;
struct dimension * dim_ptr;
struct dimension_list * dimlist_ptr;
struct group_list * group_ptr;
@@ -576,6 +577,20 @@
fortprintf(fd, " allocate(%s %% %s)</font>
<font color="black">", group_ptr->name, var_ptr2->super_array);
fortprintf(fd, " allocate(%s %% %s %% ioinfo)</font>
<font color="black">", group_ptr->name, var_ptr2->super_array);
fortprintf(fd, " %s %% %s %% fieldName = \'%s\'</font>
<font color="blue">", group_ptr->name, var_ptr2->super_array, var_ptr2->super_array);
+ fortprintf(fd, " %s %% %s %% isSuperArray = .true.</font>
<font color="blue">", group_ptr->name, var_ptr2->super_array);
+ fortprintf(fd, " allocate(%s %% %s %% constituentNames(%i))</font>
<font color="blue">", group_ptr->name, var_ptr2->super_array, i);
+
+ /* Initialization for constituent names */
+ i = 0;
+ var_list_ptr3 = group_ptr->vlist;
+ while (var_list_ptr3) {
+ if (strncmp(super_array, var_list_ptr3->var->super_array, 1024) == 0) {
+ i++;
+ fortprintf(fd, " %s %% %s %% constituentNames(%i) = \'%s\'</font>
<font color="gray">", group_ptr->name, var_ptr2->super_array, i, var_list_ptr3->var->name_in_file);
+ }
+ var_list_ptr3 = var_list_ptr3->next;
+ }
+
fortprintf(fd, " allocate(%s %% %s %% array(%i, ", group_ptr->name, var_ptr2->super_array, i);
dimlist_ptr = var_ptr2->dimlist;
if (!strncmp(dimlist_ptr->dim->name_in_file, "nCells", 1024) ||
@@ -669,6 +684,7 @@
fortprintf(fd, " allocate(%s %% %s)</font>
<font color="black">", group_ptr->name, var_ptr->name_in_code);
fortprintf(fd, " allocate(%s %% %s %% ioinfo)</font>
<font color="black">", group_ptr->name, var_ptr->name_in_code);
fortprintf(fd, " %s %% %s %% fieldName = \'%s\'</font>
<font color="blue">", group_ptr->name, var_ptr->name_in_code, var_ptr->name_in_file);
+ fortprintf(fd, " %s %% %s %% isSuperArray = .false.</font>
<font color="black">", group_ptr->name, var_ptr->name_in_code);
if (var_ptr->ndims > 0) {
fortprintf(fd, " allocate(%s %% %s %% array(", group_ptr->name, var_ptr->name_in_code);
dimlist_ptr = var_ptr->dimlist;
</font>
</pre>