[ncl-talk] Script for multiple directories and multiple locations

Dennis Shea shea at ucar.edu
Wed Oct 19 11:38:49 MDT 2016


The question is not clear  (... a least to me...)

---
 6 ; Make a list of all files we are interested in
 7   DATADir = "./"
 8   FILES = systemfunc (" ls -1 " + DATADir + "wrfout_d04* ")
---

http://www.ncl.ucar.edu/Document/Functions/Built-in/systemfunc.shtml
Look at Example 6

---
Other options based on the Example 6 which has directories a1, a2, ..., a20

DATADir  = "/Some/dir/with/WRF/data/"
cmd         = "find " + DATADir + "a* -type d -print"
dirWRF    = systemfunc(cmd)
print(dirWRF)

n_dirWRF = dimsizes(dirWRF)

do n=0,n_dirWRF- 1      ; loop over directories

     f = addfiles(dirWrf(n)+"wrfout_d04*nc", "r")
       :
end do

=====

dirWRF = str_split(systemfunc("echo "+ DATADir), " /")
print(dirWRF)

=====
You can experiment



On Mon, Oct 17, 2016 at 9:12 PM, Muhammad Omer Mughal <
m.mughal1 at postgrad.curtin.edu.au> wrote:

> Hi
>
>
> Kindly see the attached script
>
>
> On the line number 7 I need to add multiple directories containing the
> wrfoutdo4 file and
>
>
> on line number 26 I need want to write a loop that can change  locations
> one by one and for each location gives the output as wind speed.
>
> I would be grateful for your help and support.
>
>
>
> Muhammad Omer Mughal
> MSc BSc Mechanical Engineering
> PhD  Research Scholar
> Remote Sensing and Satellite Research Group
> Department of Imaging and Applied Physics
> Curtin University
>
> Curtin University
> Tel | +61 8 9266 7962
> Fax | +61 8 9266 2377
> Mobile | 0470 237 525
>
> Email | m.mughal1 at postgrad.curtin.edu.au <m.lynch at curtin.edu.au>
> Web | http://curtin.edu.au
>
> Curtin University is a trademark of Curtin University of Technology.
> CRICOS Provider Code 00301J (WA), 02637B (NSW)
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161019/d745c4e7/attachment.html 


More information about the ncl-talk mailing list