<div dir="ltr">Hey Michael,<div><br></div><div>I think this looks good.</div><div><br></div><div>Thanks,</div><div>Doug</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Mar 11, 2013 at 6:01 PM, Michael Duda <span dir="ltr">&lt;<a href="mailto:duda@ucar.edu" target="_blank">duda@ucar.edu</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi, All.<br>
<br>
I have a bug fix that I&#39;d like to commit to the trunk. The bug only<br>
affects time-independent scalar character variables, where we try to<br>
read or write the variable with length StrKIND, which is equal to 512,<br>
despite defining the variable with a truncated length of 64 in the file.<br>
Automatic truncation is handled for scalar character variables with a<br>
time dimension, and the fix is essentially to do the same for<br>
time-independent character variables. Here are the changes in mpas_io.F<br>
(original on the left, new on the right):<br>
<br>
1251c1251,1254<br>
&lt;             pio_ierr = PIO_get_var(handle % pio_file, field_cursor % fieldhandle % field_desc, charVal)<br>
---<br>
&gt;             start1(1) = 1<br>
&gt;             count1(1) = field_cursor % fieldhandle % dims(1) % dimsize<br>
&gt;             pio_ierr = PIO_get_var(handle % pio_file, field_cursor % fieldhandle % fieldid, start1, count1, tempchar)<br>
&gt;             charVal(1:count1(1)) = tempchar(1)(1:count1(1))<br>
1646c1649,1651<br>
&lt;             pio_ierr = PIO_put_var(handle % pio_file, field_cursor % fieldhandle % field_desc, charVal)<br>
---<br>
&gt;             start1(1) = 1<br>
&gt;             count1(1) = field_cursor % fieldhandle % dims(1) % dimsize<br>
&gt;             pio_ierr = PIO_put_var(handle % pio_file, field_cursor % fieldhandle % fieldid, start1, count1, (/charVal/))<br>
<br>
If anyone would like to test this by, e.g., defining a variable like<br>
<br>
   var persistent text    foo ( ) 0 so foo mesh - -<br>
<br>
a patch version of mpas_io.F already exists in<br>
branches/atmos_physics/src/framework/.<br>
<br>
If there are no objections or suggestions for improvement, I&#39;ll go ahead<br>
and commit this fix to the trunk in the next couple of days.<br>
<br>
Thanks,<br>
Michael<br>
_______________________________________________<br>
mpas-developers mailing list<br>
<a href="mailto:mpas-developers@mailman.ucar.edu">mpas-developers@mailman.ucar.edu</a><br>
<a href="http://mailman.ucar.edu/mailman/listinfo/mpas-developers" target="_blank">http://mailman.ucar.edu/mailman/listinfo/mpas-developers</a><br>
</blockquote></div><br></div>