Re: loop over an attribute

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri Feb 07 2014 - 16:58:30 MST

Ioana,

Individual array elements cannot have their own attributes, so doing something like this isn't going to work:

> pcvar(n)=eof(n,:,:,:)@pcvar(1)

I think that "pcvar" is still getting attached every time in the loop, so this should probably work:

> pcvar(n)=eof@pcvar(1)

On Feb 6, 2014, at 1:47 PM, Ioana Colfescu <colfescu@cola.iges.org> wrote:

>
> Hi,
>
> I'm calculating a series of eofs and associated PCs and I d like to get
> the explained variance too, for each of them it in a vector. It all
> works when I extract it without a loop but when I try to get the
> variance inside a loop ( loop over all the variables I calculate the
> eofs for) doesn't. What I do is :
>
> vars=12
> neof=1
> eof = new ((/vars,neof,41,170/),float)
> eof_ts = new ((/vars,neof,128/),float)
> pcvar = new((/vars/,float)
> do n=0,vars-1
> optEOF = 0
> optETS =0
> eof(n,:,:,:) = eofunc_Wrap(amoc, neof, optEOF)
> eof_ts(n,:,:)=eofunc_ts_Wrap(amoc3,eof(n,:,:,:), optETS)
> pcvar(n)=eof(n,:,:,:)@pcvar(1)
> end do
>
> You can see I have eof(n,:,:,:),eof_ts(n,:,:,:) - so is a vector but
> when I try to get pcvar(n)=eof(n,:,:,:)@pcvar(1) doesn't work. Could
> someone tell me what am I doing wrong ? Thanks,
>
>
>
> _______________________________________________
> 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 Fri Feb 7 16:58:40 2014

This archive was generated by hypermail 2.1.8 : Wed Feb 12 2014 - 09:35:52 MST