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

Barry Lynn barry.h.lynn at gmail.com
Thu Oct 20 23:51:27 MDT 2016


Dear Muhammad:

The error indicates that the program is not finding the file.

If you ls -ltr */media/mughal/Seagate/ECMWF_WRF_RUNS2/run6wrfout_d*

do you see the file?

My guess is no.

So, the anser to your question  is how to set your NCL code to indicate the
correct path and file.

What are the path directories and file names you want to read?

Barry

On Fri, Oct 21, 2016 at 7:03 AM, Muhammad Omer Mughal <
m.mughal1 at postgrad.curtin.edu.au> wrote:

> 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 <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)
>
>
> ------------------------------
> *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> 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
>>
>>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>


-- 
Barry H. Lynn, Ph.D
Senior Lecturer,
The Institute of the Earth Science,
The Hebrew University of Jerusalem,
Givat Ram, Jerusalem 91904, Israel
Tel: 972 547 231 170
Fax: (972)-25662581

C.E.O, Weather It Is, LTD
Weather and Climate Focus
http://weather-it-is.com
Jerusalem, Israel
Local: 02 930 9525
Cell: 054 7 231 170
Int-IS: x972 2 930 9525
US 914 432 3108
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161021/c126f42b/attachment.html 


More information about the ncl-talk mailing list