[ncl-talk] write new text filename after every do loop

Ashish Sharma asharma7 at nd.edu
Wed Feb 24 10:11:33 MST 2016


Thanks. I worked. I think I was having a syntax error.
Appreciated Dave.

Ashish

On Wed, Feb 24, 2016 at 12:07 PM, David Brown <dbrown at ucar.edu> wrote:

> Try
> opt at fout = "foo_DATA" + (site + 1)
>  -dave
>
> On Wed, Feb 24, 2016 at 9:40 AM, Ashish Sharma <asharma7 at nd.edu> wrote:
> > hello,
> >
> > I want to create new output file, say foo_DATA1, foo_DATA2 and foo_DATA3
> > after each do loop. (see sample code below).
> > How can I modify the code near write_matrix to create a new file every
> time
> > it goes in do loop.
> >
> > do site=0,2
> >
> >   locij = wrf_user_ll_to_ij(a, lon(site), lat(site), llres)
> >
> >   locij = locij - 1         ; array pointers in NCL space
> >
> >   locX = locij(0)
> >
> >   locY = locij(1)
> >
> >
> > t2 = new((/9,72/),float)
> >
> > t2(0,:) = obs(site,:)
> >
> > t2(1,:) = f1->T2(:,locY,locX)-273.15
> >
> > t2(2,:) = f2->T2(:,locY,locX)-273.15
> >
> >
> >  opt = True
> >
> >  opt at fout = "foo_DATA"
> >
> >   write_matrix (t2, "72f7.2", opt)
> >
> > ;;;*****************************************************;;;;;;;;;;;
> >
> >
> > end do
> >
> >
> >
> > thanks
> >
> > Ashish
> >
> >
> >
> > _______________________________________________
> > ncl-talk mailing list
> > ncl-talk at ucar.edu
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160224/094de7cc/attachment.html 


More information about the ncl-talk mailing list