Re: writing along a dimension in a loop

From: mark collier <mark.collier_at_nyahnyahspammersnyahnyah>
Date: Wed Jul 14 2010 - 01:18:20 MDT

Hi,
I found a solution to the problem, getting the order of operations
correct is important and

fh_ovar->$ovar$(n,:,:,:) = (/ ovar /)

is correct syntax.

http://www.ncl.ucar.edu/Applications/Scripts/pp_conv_nc.ncl
gave me useful tips.

Regards,
Mark.
On 14/07/2010, at 2:14 PM, mark collier wrote:

> Hi,
> I've struggled to write along a time dimension in a loop, the
> following (cutdown) example illustrates the problem. I have to loop
> over time as the arrays are large. I have removed the call to the
> local function unesco and simply give it a value of the current loop
> counter. The problem in this case is that the new variable is
> continuously written to the first time in the file rather than
> successive times (I thought by attaching the time scalar to the time
> dimension would locate where to write the data. Obviously it cannot
> work out where to fill in the output variable with ovar - somehow I
> need to specify the location in "rhopoto" of where ovar goes?
>
> I don't think this kind of syntax is allowed:
>
> fh_ovar->ovar(n,:,:,:) = ovar
>
> I've uploaded the files (thetao.nc,so.nc,test.ncl) to your incoming
> directory which illustrates what I am trying to do.
>
> Regards,
> Mark.
>
>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jul 14 01:18:28 2010

This archive was generated by hypermail 2.1.8 : Mon Jul 19 2010 - 09:39:01 MDT