Re: loop write variable to same file

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu Aug 15 2013 - 07:55:31 MDT

You can not using 'write_matrix'

   opt = True

   do i = 0, 10
      opt@fout = "foo.txt."+sprinti("%02.i",i)
      write_matrix (a1, "2D18.10", opt)
   end do

   system("cat foo.txt.* > FOO.txt ; /bin/rm -f foo.txt.*")

On 8/14/13 6:31 PM, Luo, Chao wrote:
> Hi,
>
>
> I try to loop write two dimensions variable to same filename, like:
>
>
> opt = True
> opt@fout = "foo.txt"
>
> do i = 0, 10
>
> write_matrix (a1(:,:), "2D18.10", opt)
>
> end do
>
>
> a1 is two dimensions variable by a1(x,2), x varies from i. The write_matrix only write last loop a1(10,2) to foo.txt. I think current variable a1 replace previous one. How to write total to same file?
>
>
> Thanks,
>
>
> cl
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Aug 15 07:55:39 2013

This archive was generated by hypermail 2.1.8 : Wed Aug 21 2013 - 13:54:15 MDT