Re: Re: [ncl-talk] Reducing the rank of an arbitrary variable

From: Jan Ploski <Jan.Ploski_at_nyahnyahspammersnyahnyah>
Date: Wed, 5 Dec 2007 15:38:10 +0100

Dennis Shea <shea_at_ucar.edu> schrieb am 12/05/2007 03:32:35 PM:

>
> X = V(i,:,:,...,:)
> printVarSummary(X)

I guess I didn't express myself clearly enough: the actual problem is that
I do not know the rank of V in advance. I would like to avoid writing code
like:

rankV = dimsizes(dimsizes(V))
if (rankV .eq. 1) then
    X = V(i)
end if
if (rankV .eq. 2) then
    X = V(i,:)
end if
if (rankV .eq. 3) then
    X = V(i,:,:)
end if
if (rankV .eq. 4) then
    X = V(i,:,:,:)
end if
...

and so on. Any ideas?

Regards,
Jan Ploski
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Dec 05 2007 - 07:38:10 MST

This archive was generated by hypermail 2.2.0 : Wed Dec 05 2007 - 10:17:04 MST