[ncl-talk] Error while plotting winds from WRF dataset

Dennis Shea shea at ucar.edu
Mon Nov 20 23:02:05 MST 2017


The following is pointing to where the error is occurring

atal:syntax error: line 25 in file try_wind.ncl before or near ,
  contour = wrf_contour((a[0],
-----------------------------^

fatal:syntax error: line 29 in file try_wind.ncl before or near ,
  plot = wrf_map_overlays((a[0],
-----------------------------^
======
Theses should be;

contour = wrf_contour(a[0],...

 plot = wrf_map_overlays((a[0],...

======
Also

tt  = dim_avg_Wrap(t2(south_north|:,west_east|:, Time|:) )

should be replaced by the more efficient

tt  = dim_avg_n_Wrap(t2(, 0 )

On Mon, Nov 20, 2017 at 10:52 PM, swati shewale <shewaleswati16 at gmail.com>
wrote:

> Thanks a lot Mary for reciprocating. Actually I wanted to do average for
> all time, for that purpose I did concatenated. As per you suggestion, I did
> call all the files at a time and then did average over all time steps (for
> time being here, temperature parameter, once get rectified will try on
> winds) using ncl function dim_avg_Wrap. after that when I go for
> contouring, It gives me error as below. It gave me error as
>
> *fatal:Argument type mismatch on argument (0) of (wrf_contour) can *
>
> *not coerce.*Then from one of your earlier answer to above issue, I did
> change like instead of taking multiple file a, I give as a[0]. Now facing
> follow issue
>
>
> fatal:syntax error: line 25 in file try_wind.ncl before or near ,
>   contour = wrf_contour((a[0],
> -----------------------------^
>
> fatal:syntax error: line 29 in file try_wind.ncl before or near ,
>   plot = wrf_map_overlays((a[0],
> -------------------------------^
>
> Below is the script
>
>   wrf_files = systemfunc("ls /home/swati/work/analysis/2_
> cities/Patna/14aug2014/wrf_out_data/3rd_domain/wrfout_d03_2014-08-13*")
>   a = addfiles(wrf_files,"r")
>   t2    = wrf_user_getvar(a,"T2",-1)
>   tt  = dim_avg_Wrap(t2(south_north|:,west_east|:, Time|:) )
>   wks = gsn_open_wks("png","try")
>   res = True
>   contour = wrf_contour((a[0],wks,tt,res)
>   pltres = True
>   mpres = True
>   plot = wrf_map_overlays((a[0],wks,(/contour/),pltres,mpres)
>
>
>
> On Tue, Nov 21, 2017 at 4:14 AM, Mary Haley <haley at ucar.edu> wrote:
>
>> The ball was dropped on this question, because we thought somebody else
>> was handling it.
>>
>> You have numerous errors in your script, which indicates to us that you
>> are not checking your error messages closely. Please make an effort to
>> clean up these errors before sending your scripts and data to us.
>>
>> For example, this error is telling you exactly which line the error
>> occurs on, and what the issue is:
>>
>> *fatal:["Execute.c":8567]:Execute: Error occurred at or near line 50 in
>> file wind_climatology_850hpa_all_files.ncl*
>> *fatal:Dimension size mismatch, dimension (0) of left hand side reference
>> does not have the same size as the right hand side reference after
>> subscripting.*
>>
>>
>> If you don't understand an error, then look at our "Common error
>> messages" page:
>>
>> http://www.ncl.ucar.edu/Document/Language/error_messages.shtml
>>
>> The above error is explained on this page. Here's the exact link:
>>
>> http://www.ncl.ucar.edu/Document/Language/error_messages.sht
>> ml#DimsMismatch
>>
>>
>> <http://www.ncl.ucar.edu/Document/Language/error_messages.shtml#DimsMismatch>
>> However, I think the real issue may be that you are trying to use
>> wrf_user_intrp3d on non WRF files. You mentioned using ncrcat to create the
>> new files and I have a feeling these new files do not conform to the WRF
>> output file standards required by the wrf_xxx functions.
>>
>> I don't understand why you needed to concatenate the files first. You
>> should be able to use "addfiles" to read in a series of WRF output files
>> directly. For example, let's say you have several WRF output files each
>> with one time step:
>>
>> wrfout_d01_2008-09-28_00:30:00
>> wrfout_d01_2008-09-28_01:00:00
>> wrfout_d01_2008-09-28_01:30:00
>> wrfout_d01_2008-09-28_02:00:00
>> wrfout_d01_2008-09-28_02:30:00
>> wrfout_d01_2008-09-28_03:00:00
>> wrfout_d01_2008-09-28_03:30:00
>> wrfout_d01_2008-09-28_04:00:00
>> . . .
>>
>> You can read these files in directoy with the following NCL script. Note
>> the use of addfiles:
>>
>>   wrf_files = systemfunc("ls wrfout_d01_2008-09-29*")
>>
>>   a = addfiles(wrf_files,"r")
>>
>>   t2    = wrf_user_getvar(a,"T2",-1)     ; -1 means all time steps
>>                                 u     = wrf_user_getvar(a,"ua",-1)
>>   v     = wrf_user_getvar(a,"va",-1)
>>   times = wrf_user_getvar(a,"times",-1)  ; get all times across all
>> files
>>   print(times)
>>   printVarSummary(t2)
>>   printVarSummary(u)
>>   printVarSummary(v)
>>
>>
>> Remember that you cannot use wrf_xxxx functions on the DD_aug_2014.nc
>> files, unless they are WRF output files.
>>
>> --Mary
>>
>>
>>
>> On Mon, Nov 13, 2017 at 9:06 PM, swati shewale <shewaleswati16 at gmail.com>
>> wrote:
>>
>>> Dear All,
>>>
>>> I wish to plot winds at 850 hpa but facing error as below. Tried it
>>> several ways like plotted separately by taking single file at a time, doing
>>> this it works fine. while doing panel plot, third file shows some weird
>>> error as mismatch array (If I handle third file separately, it does not
>>> show any error). I have uploaded 3 datafiles via NCL ftp, these are WRF
>>> files renamed as 13_aug_2014.nc, 14_aug_2014.nc <http://13_aug_2014.nc>,
>>> 15_aug_2014.nc <http://13_aug_2014.nc> (concanated using ncrcat).
>>> Please have a look at it and suggest me modification I need to carry out in
>>> the script.
>>>
>>> I have attached script. In the script, all the three files e.g. a0,a1,a2
>>> (I have repeated same files again as a3,a4,a5) have same structure except
>>> time.
>>>
>>>
>>> fatal:Dimension size mismatch, dimension (0) of left hand side reference
>>> does not have the same size as the right hand side reference after
>>> subscripting.
>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line 245 in
>>> file $NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl
>>>
>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line 50 in
>>> file wind_climatology_850hpa_all_files.ncl
>>>
>>> fatal:Dimension size mismatch, dimension (0) of left hand side reference
>>> does not have the same size as the right hand side reference after
>>> subscripting.
>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line 245 in
>>> file $NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl
>>>
>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line 51 in
>>> file wind_climatology_850hpa_all_files.ncl
>>>
>>> fatal:Undefined identifier: (uu2) is undefined, can't continue
>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line 53 in
>>> file wind_climatology_850hpa_all_files.ncl
>>>
>>> fatal:Undefined identifier: (vv2) is undefined, can't continue
>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line 54 in
>>> file wind_climatology_850hpa_all_files.ncl
>>>
>>> fatal:Variable (u_plane2) is undefined
>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line 55 in
>>> file wind_climatology_850hpa_all_files.ncl
>>>
>>> fatal:Dimension size mismatch, dimension (0) of left hand side reference
>>> does not have the same size as the right hand side reference after
>>> subscripting.
>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line 245 in
>>> file $NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl
>>>
>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line 83 in
>>> file wind_climatology_850hpa_all_files.ncl
>>>
>>> fatal:Dimension size mismatch, dimension (0) of left hand side reference
>>> does not have the same size as the right hand side reference after
>>> subscripting.
>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line 245 in
>>> file $NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl
>>>
>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line 84 in
>>> file wind_climatology_850hpa_all_files.ncl
>>>
>>> fatal:Undefined identifier: (uu5) is undefined, can't continue
>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line 86 in
>>> file wind_climatology_850hpa_all_files.ncl
>>>
>>> fatal:Undefined identifier: (vv5) is undefined, can't continue
>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line 87 in
>>> file wind_climatology_850hpa_all_files.ncl
>>>
>>> fatal:Variable (u_plane5) is undefined
>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line 88 in
>>> file wind_climatology_850hpa_all_files.ncl
>>>
>>> On Fri, Nov 10, 2017 at 10:54 AM, swati shewale <
>>> shewaleswati16 at gmail.com> wrote:
>>>
>>>> Dear All,
>>>>
>>>> Thank you Sir. It is working now.  Sorry for inconvenience.  from my
>>>> side am going through various scripts coming under vector form. Actually
>>>> after trying hard, If am unable to resolve the issue, then only approaches
>>>> to NCL user. Anyway, I have uploaded the files as well as script, if find
>>>> it easy to go through, Please suggest.
>>>>
>>>> On Fri, Nov 10, 2017 at 10:04 AM, Dennis Shea <shea at ucar.edu> wrote:
>>>>
>>>>> offline here
>>>>>
>>>>>
>>>>> I do not have any answer. I am not involved with systems or ftp.
>>>>>
>>>>> ---
>>>>>
>>>>> Possibly, after cd to the 'incoming' directory, the 'put' is trying to create a directory on the ftp site.
>>>>> Perhaps something named:
>>>>>
>>>>> /ftp/incoming/home/swati/work/analysis/2_cities/Patna/14aug2014/wrf_out_data/3rd_domain
>>>>>
>>>>> or ????
>>>>>
>>>>> /ftp/incoming/home/swati/work/analysis/2_cities/Patna/14aug2014/wrf_out_data/3rd_domain/try
>>>>>
>>>>>
>>>>> ========
>>>>>
>>>>> Maybe, you should cd to the directory with the data files
>>>>>
>>>>> %> cd /home/swati/work/analysis/2_cities/Patna/14aug2014/wrf_out_data/3rd_domain
>>>>>
>>>>> or
>>>>>
>>>>> %> cd /home/swati/work/analysis/2_cities/Patna/14aug2014/wrf_out_data/3rd_domain/try
>>>>>
>>>>>
>>>>> then, from that directory, try the ftp
>>>>>
>>>>> ftp ftp.cgd.ucar.edu
>>>>> anonymous*<enter your email address for the password>*
>>>>> cd incoming
>>>>> put 13_aug_2014.nc
>>>>>  . . .*continue with 'put' commands until all desired files are uploaded*. . .
>>>>> quit
>>>>>
>>>>>
>>>>> =======
>>>>>
>>>>> FYI: There may be major changes in ncl support. People are sending many complicated scripts
>>>>> which take considerable time on our part to understand. Sometimes *hours* ... even *days*.
>>>>>
>>>>> The NCL team wants to help but is not paid to answer NCL questions.
>>>>>
>>>>> In fact, some people just keep sending is poorly written scripts that we ust spend time
>>>>>
>>>>> cleaning up.
>>>>>
>>>>> It is frustrating.
>>>>>
>>>>> D
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Nov 9, 2017 at 8:54 PM, swati shewale <
>>>>> shewaleswati16 at gmail.com> wrote:
>>>>>
>>>>>> Dear Dennis,
>>>>>>
>>>>>> All the three files, I want to sent has a size of 3.4 GB (total). As
>>>>>> per your suggestion, I tried to upload it still facing same issue.
>>>>>>
>>>>>> On Thu, Nov 9, 2017 at 8:39 PM, Dennis Shea <shea at ucar.edu> wrote:
>>>>>>
>>>>>>> How big is the file?
>>>>>>>
>>>>>>> The ftp area is only 24% full. Please try again.
>>>>>>>
>>>>>>> Sent from my iPhone
>>>>>>>
>>>>>>> On Nov 9, 2017, at 5:32 AM, swati shewale <shewaleswati16 at gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>> Dear All,
>>>>>>>
>>>>>>> Using below link, I followed the steps for uploading datafiles.
>>>>>>>
>>>>>>> https://www.ncl.ucar.edu/ftp_files.shtml
>>>>>>>
>>>>>>> It shows error as follow
>>>>>>>
>>>>>>> ftp> cd incoming
>>>>>>> 250 Directory successfully changed.
>>>>>>>
>>>>>>> ftp> put /home/swati/work/analysis/2_ci
>>>>>>> ties/Patna/14aug2014/wrf_out_data/3rd_domain/13_aug_2014.nc
>>>>>>> local: /home/swati/work/analysis/2_cities/Patna/14aug2014/wrf_out_d
>>>>>>> ata/3rd_domain/13_aug_2014.nc remote: /home/swati/work/analysis/2_ci
>>>>>>> ties/Patna/14aug2014/wrf_out_data/3rd_domain/13_aug_2014.nc
>>>>>>>
>>>>>>> 227 Entering Passive Mode (128,117,23,220,192,16).
>>>>>>> 553 Could not create file.
>>>>>>>
>>>>>>> Please let me know further steps to do. Thanks in advance.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Nov 9, 2017 at 5:25 PM, swati shewale <
>>>>>>> shewaleswati16 at gmail.com> wrote:
>>>>>>>
>>>>>>>> Dear All,
>>>>>>>>
>>>>>>>> I wish to plot winds at 850 hpa but facing error as below. Tried it
>>>>>>>> several ways like plotted separately by taking single file at a time, doing
>>>>>>>> this it works fine. while doing panel plot, third file shows some weird
>>>>>>>> error as mismatch array. I wish to send the dataset files, total 3 files
>>>>>>>> have size around 3.5 GB. Is it possible to send the dataset. Please give me
>>>>>>>> some insight. I have attached script.
>>>>>>>>
>>>>>>>> In the script, all the three files e.g. a0,a1,a2 (I have repeated
>>>>>>>> same files again as a3,a4,a5) have same structure except time. once I send
>>>>>>>> the data files (I used ncrcat command to concanate all the files),  you can
>>>>>>>> see no of files (using ncdump -h command) get concanated (at the bottom)
>>>>>>>>
>>>>>>>>
>>>>>>>> fatal:Dimension size mismatch, dimension (0) of left hand side
>>>>>>>> reference does not have the same size as the right hand side reference
>>>>>>>> after subscripting.
>>>>>>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line
>>>>>>>> 245 in file $NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl
>>>>>>>>
>>>>>>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line
>>>>>>>> 50 in file wind_climatology_850hpa_all_files.ncl
>>>>>>>>
>>>>>>>> fatal:Dimension size mismatch, dimension (0) of left hand side
>>>>>>>> reference does not have the same size as the right hand side reference
>>>>>>>> after subscripting.
>>>>>>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line
>>>>>>>> 245 in file $NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl
>>>>>>>>
>>>>>>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line
>>>>>>>> 51 in file wind_climatology_850hpa_all_files.ncl
>>>>>>>>
>>>>>>>> fatal:Undefined identifier: (uu2) is undefined, can't continue
>>>>>>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line
>>>>>>>> 53 in file wind_climatology_850hpa_all_files.ncl
>>>>>>>>
>>>>>>>> fatal:Undefined identifier: (vv2) is undefined, can't continue
>>>>>>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line
>>>>>>>> 54 in file wind_climatology_850hpa_all_files.ncl
>>>>>>>>
>>>>>>>> fatal:Variable (u_plane2) is undefined
>>>>>>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line
>>>>>>>> 55 in file wind_climatology_850hpa_all_files.ncl
>>>>>>>>
>>>>>>>> fatal:Dimension size mismatch, dimension (0) of left hand side
>>>>>>>> reference does not have the same size as the right hand side reference
>>>>>>>> after subscripting.
>>>>>>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line
>>>>>>>> 245 in file $NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl
>>>>>>>>
>>>>>>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line
>>>>>>>> 83 in file wind_climatology_850hpa_all_files.ncl
>>>>>>>>
>>>>>>>> fatal:Dimension size mismatch, dimension (0) of left hand side
>>>>>>>> reference does not have the same size as the right hand side reference
>>>>>>>> after subscripting.
>>>>>>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line
>>>>>>>> 245 in file $NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl
>>>>>>>>
>>>>>>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line
>>>>>>>> 84 in file wind_climatology_850hpa_all_files.ncl
>>>>>>>>
>>>>>>>> fatal:Undefined identifier: (uu5) is undefined, can't continue
>>>>>>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line
>>>>>>>> 86 in file wind_climatology_850hpa_all_files.ncl
>>>>>>>>
>>>>>>>> fatal:Undefined identifier: (vv5) is undefined, can't continue
>>>>>>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line
>>>>>>>> 87 in file wind_climatology_850hpa_all_files.ncl
>>>>>>>>
>>>>>>>> fatal:Variable (u_plane5) is undefined
>>>>>>>> fatal:["Execute.c":8567]:Execute: Error occurred at or near line
>>>>>>>> 88 in file wind_climatology_850hpa_all_files.ncl
>>>>>>>>
>>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> 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
>>>
>>>
>>
>
> _______________________________________________
> 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/20171120/fad7eb90/attachment.html>


More information about the ncl-talk mailing list