[ncl-talk] loop over a unique filename

Kacie Shourd Kacie.Shourd at dri.edu
Tue Jul 12 07:44:00 MDT 2016


Hi, Chang

I have yet to figure out how to loop through files in such a way using purely NCL. There is the "addfiles" function, but I don't believe that loops through files -- it just pulls in the variables from all files and I'm not sure how to keep things separate.

I have handled this problem in the past by using a wrapper in an external language (Python, for example), and running things directly from the shell. Looping in other languages is much more straight forward (in my opinion), and shouldn't be too difficult to accomplish.

If you need assistance doing this, I would be happy to lend a hand/provide an example.

Best,
Kacie

---
Kacie N. Shourd
드림

Graduate Research Assistant
Desert Research Institute
Kacie.Shourd at dri.edu<mailto:Kacie.Shourd at dri.edu>
Work: (775) 674-7049

________________________________
From: ncl-talk-bounces at ucar.edu [ncl-talk-bounces at ucar.edu] on behalf of Xi Chang [xi.chang01 at gmail.com]
Sent: Tuesday, July 12, 2016 6:34 AM
To: ncl-talk at ucar.edu
Subject: [ncl-talk] loop over a unique filename

Dear NCL,

I have a unique *nc file like this (with increment 1):

data.0001.nc<http://data.0001.nc>
data.0002.nc<http://data.0002.nc>
data.0003.nc<http://data.0003.nc>
.
.
data.0010.nc<http://data.0010.nc>
data.0011.nc<http://data.0011.nc>
data.0012.nc<http://data.0012.nc>
.
.
.
data.0101.nc<http://data.0101.nc>
data.0102.nc<http://data.0102.nc>

I want to call this data using a loop, something like this:

t=1,1

input="/dir/data.000+"t".nc

but it doesnt work when then zero is reduced infront of the filename.
anys suggestion how to call this files on a loop?

Thanks

Chang


PUBLIC RECORDS NOTICE: In accordance with NRS Chapter 239, this email and responses, unless otherwise made confidential by law, may be subject to the Nevada Public Records laws and may be disclosed to the public upon request.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160712/0fa57137/attachment.html 


More information about the ncl-talk mailing list