[ncl-talk] NCL wrf_contour use for multiple files

Wang,Yu wangyu8722 at ufl.edu
Wed Jun 15 10:04:47 MDT 2016


Hi Bill,

Thank you so much for your suggestion. Here are some of the screenshot of my file.
First I have addfiles of these two files:
[cid:37031a61-6b37-45b5-96d6-420ea4f1ab68]
Then I printed all times:
[cid:ef05eaba-261d-4e70-a95d-15d217a6633a]
[cid:403a76c4-5318-4235-84e0-0f48bd2cfde8]
My loop looks like below:
[cid:5ae5fc2d-46df-485c-a2a6-4fb1721a6fc5]
And here is the ncdump -h results:
[cid:bc85c89e-a66d-48f8-8fc8-f669a4d2c82e]
I think the error (out of range) I get is at line from the loop:
> contour_psl = wrf_contour(a[it],wks,slp(it,:,:),opts_psl) when it = 12

Hope this information can help me better solve this problem. Thank you so much for all your help.

Best,

Jade



________________________________
From: Bill Ladwig <ladwig at ucar.edu>
Sent: Wednesday, June 15, 2016 11:36:37 AM
To: Wang,Yu; NCL
Subject: Re: [ncl-talk] NCL wrf_contour use for multiple files

Hi Jade,

Please include ncl-talk in your replies so that it posts to the email list.  The error you're getting is most likely due to 'it' being out of the bounds for your 'a' list variable.  This leads me to believe there aren't actually 12 timesteps in that second file.  Have you looked at the file?  Never assume it's what you think it is, always check.  Please do an 'ncdump -h wrfout_d01_2005-08-25_06:00:00' and report back the result.  Until I know what's really in that second file, it's hard to guess what might be going wrong.  Also, if you can print the 'times' result from 'times = wrf_user_getvar(a, "times", -1)', that would be helpful too.

Thanks,

Bill

On Tue, Jun 14, 2016 at 6:29 PM, Wang,Yu <wangyu8722 at ufl.edu<mailto:wangyu8722 at ufl.edu>> wrote:

Thank you so much for your help.


I think I will put my question in a different way maybe it is more clear.


I have two nc files wrfout_d01_2005-08-25_00:00:00 and wrfout_d01_2005-08-25_06:00:00, each of them have 12 time steps, whic means they have 30 minutes interval. I put them together using a addfiles command. And using a timestep of 2 to loop over to calculate the hourly precipitation tendency by using a later time minus an earlier one, for example, using the 5th time step (2005-08-25_02:00:00) of the first file minus the 3rd time step (2005-08-25_01:00:00) to calculate the tendency between 01Z to 02Z.


When I was trying to plot the tendency from 2005-08-25_05:00:00 (which is the 11th time step of the first file as well as the 11th of the addfiles resulted list) to 2005-08-25_06:00:00(which is the 3rd time step of the second file, and the 13th time step of the addfiles list) using the line below:

> contour_psl = wrf_contour(a[it],wks,slp(it,:,:),opts_psl)

And get the error of fatal:ListSelect: Index out of range.


If this still does not make any sense. Could you give me some suggestion about how to use wrf_contour to plot the difference between the last time step of one wrf output file and the first time step of the second file? Can it be done or I have to use some other functions.


Hope this explain better of my question.


Thanks again for your help.


Best,


Jade

________________________________
From: Bill Ladwig <ladwig at ucar.edu<mailto:ladwig at ucar.edu>>
Sent: Tuesday, June 14, 2016 6:21:11 PM
To: Wang,Yu
Cc: ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu>; wrfhelp at ucar.edu<mailto:wrfhelp at ucar.edu>
Subject: Re: [ncl-talk] NCL wrf_contour use for multiple files

Hi Jade,

Can you do an "ncdump -h wrf_file" or an ncl_filedump and report back the number of times for each file?  With WRF, sometimes the last file has less times than the other files.  In this case, it might be only 1.  With a tend_int greater than 1, you might be jumping past the last time.  Without seeing the data, it's hard to say.

Bill

On Tue, Jun 14, 2016 at 2:53 PM, Wang,Yu <wangyu8722 at ufl.edu<mailto:wangyu8722 at ufl.edu>> wrote:

Dear ncl_talk and wrfhelp,

Hope everything goes well with everyone.

I am having a problem with ncl when I wanted to plot hourly precipitation tendencies multiple files. I used the example from the wrf website as below
http://www2.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/Examples/PRECIP/wrf_Precip_multi_files.ncl. All I did is to change the input file. I have 2 domain 1 files, including 6 hours with 30 mins interval in each file. The script works perfectly when it was processing the first file as below:

(0)     Working on time: 2005-08-25_01:00:00
(0)     Working on time: 2005-08-25_02:00:00
(0)     Working on time: 2005-08-25_03:00:00
(0)     Working on time: 2005-08-25_04:00:00
(0)     Working on time: 2005-08-25_05:00:00
But when it get to calculate the next hour which should use both files, the script starts to have trouble and give me an error of
fatal:ListSelect: Index out of range
fatal:["Execute.c":8575]:Execute: Error occurred at or near line 89 in file wrf_Precip_multi_files.ncl
Is this because of my output file or there is something I should change in the script?

Hope some one can provide some help. I would really appreciate any help. Thank you so much.

Best,

Jade


_______________________________________________
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/20160615/8aecb5e0/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file.JPG
Type: image/jpeg
Size: 13336 bytes
Desc: file.JPG
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160615/8aecb5e0/attachment.jpe 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: times.JPG
Type: image/jpeg
Size: 17328 bytes
Desc: times.JPG
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160615/8aecb5e0/attachment-0001.jpe 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: times_result.JPG
Type: image/jpeg
Size: 39207 bytes
Desc: times_result.JPG
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160615/8aecb5e0/attachment-0002.jpe 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: loop.JPG
Type: image/jpeg
Size: 42491 bytes
Desc: loop.JPG
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160615/8aecb5e0/attachment-0003.jpe 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ncdump 08-25 00.JPG
Type: image/jpeg
Size: 21984 bytes
Desc: ncdump 08-25 00.JPG
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160615/8aecb5e0/attachment-0004.jpe 


More information about the ncl-talk mailing list