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

Muhammad Omer Mughal m.mughal1 at postgrad.curtin.edu.au
Thu Oct 20 03:39:43 MDT 2016


Hi Denis


I meant that I want to change location of lat longs in the scripts  one by one to get a wind speed at each location. Is it possible to do it for 365 locations or do I have to run the script each time for each location


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<mailto:m.lynch at curtin.edu.au>
Web | http://curtin.edu.au<http://curtin.edu.au/>

Curtin University is a trademark of Curtin University of Technology.
CRICOS Provider Code 00301J (WA), 02637B (NSW)


________________________________
From: Dennis Shea <shea at ucar.edu>
Sent: Thursday, 20 October 2016 1:38:49 AM
To: Muhammad Omer Mughal
Cc: ncl-talk at ucar.edu
Subject: Re: [ncl-talk] Script for multiple directories and multiple locations

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<mailto: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<mailto:m.lynch at curtin.edu.au>
Web | http://curtin.edu.au<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<mailto: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/20161020/8b095089/attachment.html 


More information about the ncl-talk mailing list