[ncl-talk] VB: write_table problem

Sjökvist Elin elin.sjokvist at smhi.se
Tue Sep 23 01:47:30 MDT 2014


Hi,
I'm trying to print data to an ascii file using the write_table function.
My data is a 19x12 matrix (tslice45) that I use to create a list, then trying to write:

dlist45 = NewList("lifo")
do j=0,nr_columns-1
        ListPush(dlist45,(/tslice45(:,j)/))
end do

format_string="%4.2f%4.2f%4.2f%4.2f%4.2f%4.2f%4.2f%4.2f%4.2f%4.2f%4.2f%4.2f"
write_table(filename,"w",dlist45,format_string)

I get a file with what seems to be correct output data, but when looking closer some values are wrong and some values are completely missing! This I found out by printing the tslice45 matrix just before creating the list and comparing with the output. The errors seem to occur randomly.
I have tried changing the format of the data, my script uses double precision as standard so I  added the function doubletofloat for tslice45 just before creating the list, but it makes no difference.
What is going on?
I'm using NCL v6.1.0.
Thankful for all help,
Elin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140923/447750de/attachment.html 


More information about the ncl-talk mailing list