<p><b>duda</b> 2013-03-13 12:05:30 -0600 (Wed, 13 Mar 2013)</p><p>Bug fix to I/O code.<br>
<br>
Previously, defining a time-independent scalar character field, e.g.,<br>
<br>
   var persistent text    foo ( ) 0 so foo mesh - -<br>
<br>
led to read errors due to the difference in size between strings in<br>
memory (StrKIND=512) and strings as stored in files (64); when reading a<br>
stream, this read error would cause the reading of all subsequent fields<br>
in the stream to be abandoned, generally leaving the model without valid<br>
fields.<br>
<br>
Now, we treat time-independent character variables in the same way as <br>
time-dependent character variables.<br>
<br>
<br>
M    src/framework/mpas_io.F<br>
</p><hr noshade><pre><font color="gray">Modified: trunk/mpas/src/framework/mpas_io.F
===================================================================
--- trunk/mpas/src/framework/mpas_io.F        2013-03-13 17:47:31 UTC (rev 2602)
+++ trunk/mpas/src/framework/mpas_io.F        2013-03-13 18:05:30 UTC (rev 2603)
@@ -1248,7 +1248,10 @@
             pio_ierr = PIO_get_var(handle % pio_file, field_cursor % fieldhandle % fieldid, start2, count2, tempchar)
             charVal(1:count2(1)) = tempchar(1)(1:count2(1))
          else
-            pio_ierr = PIO_get_var(handle % pio_file, field_cursor % fieldhandle % field_desc, charVal)
+            start1(1) = 1
+            count1(1) = field_cursor % fieldhandle % dims(1) % dimsize
+            pio_ierr = PIO_get_var(handle % pio_file, field_cursor % fieldhandle % fieldid, start1, count1, tempchar)
+            charVal(1:count1(1)) = tempchar(1)(1:count1(1))
          end if
       else if (present(realArray1d)) then
 !         write (0,*) '  value is real1'
@@ -1643,7 +1646,9 @@
             count2(1) = field_cursor % fieldhandle % dims(1) % dimsize
             pio_ierr = PIO_put_var(handle % pio_file, field_cursor % fieldhandle % fieldid, start2, count2, (/charVal/))
          else
-            pio_ierr = PIO_put_var(handle % pio_file, field_cursor % fieldhandle % field_desc, charVal)
+            start1(1) = 1
+            count1(1) = field_cursor % fieldhandle % dims(1) % dimsize
+            pio_ierr = PIO_put_var(handle % pio_file, field_cursor % fieldhandle % fieldid, start1, count1, (/charVal/))
          end if
       else if (present(realArray1d)) then
          call PIO_write_darray(handle % pio_file, field_cursor % fieldhandle % field_desc, field_cursor % fieldhandle % decomp % pio_iodesc, &amp;

</font>
</pre>