Re: variable with zero elements

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri Oct 18 2013 - 10:26:50 MDT

Hi Prince,

Did you try doing an ncdump -h on the file? This is the Unidata tool that behaves similarly to "ncl_filedump".

Or, you can try one of the "getfilevarxxx" functions in NCL, like "getfilevardimsizes":

a = addfile("","r")

You can also just print the dimensions on the file:


It's possible that NCL is not dealing with this file very gracefully, if it was written improperly. For example, if somebody failed to define the dimension sizes on the file correctly, I'm not sure how NCL would deal with this.

Can you provide us with the file?


On Oct 18, 2013, at 3:09 AM, Prince K XAVIER <> wrote:

> Hi NCL-talk,
> I encountered a very strange problem when writing an NCL script to read a WRF output file.
> Basically this wrfout file has not been written properly and I fail to read the XLAT/XLONG/T2 information.
> When I ncl_filedump, it correctly shows Dimensions and sizes [Time | XXX] x [south_north | XXX] x [west_east | XXX].
> But when we do a lat = f-> XLAT and print(lat), it shows the correct dimensions, but with no elements in the array.
> Is there a way to check whether a variable in a file has valid elements?
> Thanks,
> Prince
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:

ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Fri Oct 18 10:27:00 2013

This archive was generated by hypermail 2.1.8 : Tue Oct 22 2013 - 10:35:27 MDT