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

Zilore Mumba zmumba at gmail.com
Fri Apr 1 15:41:35 MDT 2022


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/bf89d64c/attachment.html>


More information about the ncl-talk mailing list