[ncl-talk] plotting I J variables from the WRF out file

ali mughal mughalali655 at gmail.com
Mon May 11 17:29:07 MDT 2020


Dear NCL Team

For the first question regarding modification to the code I did the
attached changes (i.e. test1.ncl) though it shows the map where I intend to
plot the data but still there is no data plotted. The I, j values in the
csv I shared earlier and repeated here for convenience (zero_skipped.csv)
correspond to the lat longs in the file (WRF_latlongs.xlsx).

For the second question regarding the usage of wrf_user_ij_ll when I try to
use this function like the way in the attached file (lat_lons.ncl) I get a
segmentation fault (core dumped) message. However, if I don't use the
script and copy these values directly into the ncl interface instead of
submitting it in the form a script I get the values printed out. Please
note that the I,j values printed here correspond to the same lat longs as
in the file (WRF_lotlongs.xlsx).

Regards

On Tue, May 12, 2020 at 3:15 AM Dennis Shea <shea at ucar.edu> wrote:

> Actually, it is not quite clearer what you are looking for:
>
> As indicated by Rick  *wrf_user_ij_to_ll*
> <https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_ij_to_ll.shtml>
>
> other possibilities include the following very similar functions:
>
> *region_ind*
> <https://www.ncl.ucar.edu/Document/Functions/Contributed/region_ind.shtml>
> and  *getind_latlon2d*
> <https://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml>
>
> *You* must experiment. Please use print statements like *printVarSummary *while
> debugging.
> The output from *printVarSummary *is for you to look at to examine
> variable type and shape, etc.
>
> On Sun, May 10, 2020 at 7:45 PM Rick Brownrigg via ncl-talk <
> ncl-talk at ucar.edu> wrote:
>
>> Hi,
>>
>> Please do not reply directly back to me, but rather to the group as a
>> whole -- they provide a broader pool of expertise to draw upon.
>>
>> I *think* wrf_user_ij_to_ll work() will do what you want, but it will
>> likely require some experimentation. Liberal use of printVarSummary() is
>> your best friend ;-)
>>
>> Rick
>>
>>
>>
>> On Sun, May 10, 2020 at 3:03 PM ali mughal <mughalali655 at gmail.com>
>> wrote:
>>
>>> Dear Rick
>>>
>>> Thanks for the reply.
>>>
>>> In continuation to my previous email, I asked that in the shared the
>>> first two columns represent I,j values of the WRF grid. If i have to
>>> evaluate 2m air temperature on the same I,j values will wrf_user_ij_to_ll
>>> work or do I need to use some other method.
>>>
>>> Regards
>>>
>>> On Sunday, May 10, 2020, Rick Brownrigg <brownrig at ucar.edu> wrote:
>>>
>>>> Hi,
>>>>
>>>> There are at least two problems. One is that str_get_field() returns
>>>> strings, and so "data" in the call to gsn_csm_contour_map() is a string,
>>>> and this is the source of the error message. Try adding these 3 lines:
>>>>
>>>> lat := stringtofloat(lat)
>>>> lon := stringtofloat(lon)
>>>> data := stringtofloat(data)
>>>>
>>>> The other problem is that the min/max bounds are inappropriate for the
>>>> data -- I get a blank plot. If I used the true min/max I get a mostly
>>>> centered over Siberia:
>>>>
>>>> res at mpMinLatF = min(lat) ;-6.080154 ; range to zoom in on
>>>> res at mpMaxLatF = max(lat) ;10.04061
>>>> res at mpMinLonF = min(lon) ;95.908
>>>> res at mpMaxLonF = max(lon) ;112.092
>>>>
>>>> Finally, the values for lat/lon in the file look suspect -- is this
>>>> really a 1-degree grid? I might have guessed they are row/column values.
>>>>
>>>> Good luck,
>>>> Rick
>>>>
>>>>
>>>> On Sun, May 10, 2020 at 2:23 AM ali mughal via ncl-talk <
>>>> ncl-talk at ucar.edu> wrote:
>>>>
>>>>> Dear Users
>>>>>
>>>>> I have csv file attached with the data available at specific grids of
>>>>> the WRF outfile.Could any one help how to correct my attached code in NCL?
>>>>>
>>>>> When I try to run the code, I get the following error message
>>>>>
>>>>> (0)     This file has 4825 rows and 3 columns.
>>>>> fatal:Argument type mismatch on argument (1) of (gsn_csm_contour_map)
>>>>> can not coerce
>>>>> fatal:["Execute.c":8578]:Execute: Error occurred at or near line 64 in
>>>>> file test_1.ncl
>>>>>
>>>>>
>>>>> Later I want to use the same code to be modified to calculate 2m air
>>>>> temperature at the same I J grids.
>>>>>
>>>>> Regards
>>>>> _______________________________________________
>>>>> 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/20200512/7b3e0ece/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_1.ncl
Type: application/octet-stream
Size: 2213 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200512/7b3e0ece/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lat_lons.ncl
Type: application/octet-stream
Size: 31711 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200512/7b3e0ece/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zero_skipped.csv
Type: application/vnd.ms-excel
Size: 88923 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200512/7b3e0ece/attachment.xlb>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WRFlatlongs.xlsx
Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Size: 13061 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200512/7b3e0ece/attachment.xlsx>


More information about the ncl-talk mailing list