[ncl-talk] total number of times in files opened with addfiles

Dave Allured - NOAA Affiliate dave.allured at noaa.gov
Fri Apr 1 15:53:34 MDT 2022


Please show print (files_all[0]->Times) and printVarSummary(times).


On Fri, Apr 1, 2022 at 3:42 PM Zilore Mumba via ncl-talk <
ncl-talk at mailman.ucar.edu> wrote:

> I have a number of WRF output files, one file per hour, which I open with
> files_all = addfiles(FILES+".nc","r")
>
> I then get the times and the total number with.
>   times = files_all[:]->Times      ; get all times in the file
>   ntimes = dimsizes(times)         ; number of times in the file
>
> I think I am missing something here because  with print(ntimes) I see two
> numbers.
> I want to use ntimes in a loop: do it = 0,ntimes-1,2
>
> This gives me the error: fatal:Loop end must be scalar, can't execute loop.
> How do I get the times from files opened with addfiles. I will appreciate
> any assistance.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20220401/852e0b42/attachment.html>


More information about the ncl-talk mailing list