<p><b>duda</b> 2013-03-11 17:51:09 -0600 (Mon, 11 Mar 2013)</p><p>BRANCH COMMIT<br>
<br>
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 (StrLen=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>
***This is a general fix that should be propagated to the trunk***<br>
<br>
<br>
M    src/framework/mpas_io.F<br>
</p><hr noshade><pre><font color="gray">Modified: branches/atmos_physics/src/framework/mpas_io.F
===================================================================
--- branches/atmos_physics/src/framework/mpas_io.F        2013-03-11 20:54:13 UTC (rev 2585)
+++ branches/atmos_physics/src/framework/mpas_io.F        2013-03-11 23:51:09 UTC (rev 2586)
@@ -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>