[ncl-talk] Script for multiple directories and multiple locations
Muhammad Omer Mughal
m.mughal1 at postgrad.curtin.edu.au
Thu Oct 20 22:03:59 MDT 2016
Hi Dennis
I have made the changes in the attached script. I am getting the following error. Can you or any one at NCL select a solution to my problem.
Variable: dirWRF
Type: string
Total Size: 32 bytes
4 values
Number of Dimensions: 1
Dimensions and sizes: [4]
Coordinates:
(0) /media/mughal/Seagate/ECMWF_WRF_RUNS2/run6
(1) /media/mughal/Seagate/ECMWF_WRF_RUNS2/run7
(2) /media/mughal/Seagate/ECMWF_WRF_RUNS2/run8
(3) /media/mughal/Seagate/ECMWF_WRF_RUNS2/run9
fatal:["FileSupport.c":2859]:_NclVerifyFile: Requested file </media/mughal/Seagate/ECMWF_WRF_RUNS2/run6wrfout_d04*> or </media/mughal/Seagate/ECMWF_WRF_RUNS2/run6wrfout_d> does not exist
fatal:["FileSupport.c":3052]:(/media/mughal/Seagate/ECMWF_WRF_RUNS2/run6wrfout_d04*) has no file extension, can't determine type of file to open
fatal:["FileSupport.c":2859]:_NclVerifyFile: Requested file </media/mughal/Seagate/ECMWF_WRF_RUNS2/run7wrfout_d04*> or </media/mughal/Seagate/ECMWF_WRF_RUNS2/run7wrfout_d> does not exist
fatal:["FileSupport.c":3052]:(/media/mughal/Seagate/ECMWF_WRF_RUNS2/run7wrfout_d04*) has no file extension, can't determine type of file to open
fatal:["FileSupport.c":2859]:_NclVerifyFile: Requested file </media/mughal/Seagate/ECMWF_WRF_RUNS2/run8wrfout_d04*> or </media/mughal/Seagate/ECMWF_WRF_RUNS2/run8wrfout_d> does not exist
fatal:["FileSupport.c":3052]:(/media/mughal/Seagate/ECMWF_WRF_RUNS2/run8wrfout_d04*) has no file extension, can't determine type of file to open
fatal:["FileSupport.c":2859]:_NclVerifyFile: Requested file </media/mughal/Seagate/ECMWF_WRF_RUNS2/run9wrfout_d04*> or </media/mughal/Seagate/ECMWF_WRF_RUNS2/run9wrfout_d> does not exist
fatal:["FileSupport.c":3052]:(/media/mughal/Seagate/ECMWF_WRF_RUNS2/run9wrfout_d04*) has no file extension, can't determine type of file to open
fatal:No valid instance of variable Times found in file list
fatal:["Execute.c":7743]:Execute: Error occurred at or near line 2177 in file $NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl
fatal:["Execute.c":7743]:Execute: Error occurred at or near line 18 in file wrf_script_r4
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/20161021/98e95fef/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wrf_script_r4
Type: application/octet-stream
Size: 1384 bytes
Desc: wrf_script_r4
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161021/98e95fef/attachment.obj
More information about the ncl-talk
mailing list