<div dir="ltr"><div>Barry illustrated how to get some answers via wrf_ functions</div><div>====</div><div>In your screen shot you are using NCL's "<b>coordinate variable</b>" syntax:   {...}</div><div><br></div><div>By netCDF definition, a "<b>coordinate variable</b>" is a *one* dimensional variable.<br>Some examples include: time(time), level(level), lat(lat), lon(lon).<br><br>WRF geographical coordinates are *multi-dimensional*. Hence, they are not "coordinate variables". <br>For eample:<br>        float XLAT(Time, south_north, west_east)<br>        float XLONG(Time, south_north, west_east)<br>They are variables that contain coordinates. <br><br>By rule, NCL's coordinate variable notation [ {...} ] can not be used on multi-dimensional arrays that contain coordinates..<br><br>--------------<br>You can interpolate to a specific locations using: <b><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/rcm2points.shtml">rcm2points</a> </b>or <a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/rcm2points_Wrap.shtml"><b>rcm2points_Wrap</b></a><br>(Possibly, these could be slow.)</div><div><br></div><div>   lon_pts = (/-104.867, -102.0/)<br>   lat_pts  = (/   39.75,      38.0/)<br><br>   f     = addfile ("some_WRF_file.nc", "r")<br>   lat2d  = f->XLAT(0,:,:)                  ; size = (nlat,nlon)<br>   lon2d = f->XLONG(0,:,:)              ; size = (nlat,nlon)<br>   x     = f->X<br><br>   x_pts  = <b>rcm2points_Wrap </b>(lat2d, lon2d, x, lat_pts, lon_pts, 0)<br>   print(x_pts)<br>   <br>---------------</div><div>The following will return the indices (subscripts) of the spatial coordinates closest to a location.<br></div><div><br></div><div><a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml"><b>getind_latlon2d</b></a><br><br></div><div>   lon_pts = (/-104.867, -102.0/)<br>   lat_pts  = (/ 39.75,     38.0/)<br><br>   f     = addfile ("some_WRF_file.nc", "r")<br>   lat2d  = f->XLAT(0,:,:)                  ; size = (nlat,nlon)<br>   lon2d = f->XLONG(0,:,:)              ; size = (nlat,nlon)<br>   x     = f->X</div><div><br></div><div><pre>  nm = <strong>getind_latlon2d</strong> (lat2d,lon2d, lat_pts, lon_pts)

  <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/print.shtml"><strong>print</strong></a>(nm)

  do k=0,<a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/dimsizes.shtml"><strong>dimsizes</strong></a>(lat_pts)-1    ; loop over locations
     n = nm(k,0)
     m = nm(k,1)<br></pre><pre>     x_nm = x(:,n,m)     ;  x(:,:,n,m)<br></pre><pre>     print("---")<br><strong>     </strong><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/print.shtml"><strong>print</strong></a>(lat2d(n,m)+"   "+lon2d(n,m))<br>     print(x_nm)<br></pre><pre>  end do
</pre><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Oct 24, 2021 at 2:15 PM Setareh Rahimi via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu">ncl-talk@mailman.ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Dear all,</div><div>Regarding my question, I tried below codes to extract point values.But I noticed there is no associated coordinate variable for latitude( have look at the attached image).</div><div><br></div><div><span style="background-color:rgb(217,210,233)">begin<br>a = addfile("wrfout_d03_2021-01-27_00:00:00","r")<br>lat = a->XLAT<br>printVarSummary(lat)<br>t = a->T2(:,{35.6},{51})      ;T2 refers to temperature at 2m <br></span></div><div><span style="background-color:rgb(217,210,233)">printVarSummary(t)<br>asciiwrite("outfile.txt",t)<br>end</span></div><div><br></div><div> Therefore I can not choose my desire lat/lon to extract point value for a specific variable.</div><div>May I ask you please to advise me on how to sort this issue out?</div><div>Many thanks in advance,</div><div>Best wishes<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Oct 23, 2021 at 8:20 PM Setareh Rahimi <<a href="mailto:setareh.rahimi@gmail.com" target="_blank">setareh.rahimi@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Dear NCL users,</div><div>I have a WRF output file in nc format. I need to have point values of wind, temperature,and humidity  at specific lat/lon and specific times. I do not need a map plot or time series. I just want point values for each variable at specific times ( 00,03,06,09,12,15,18,21 UTC) in ascii format .For example, for wind variable at lat:y and lon:x</div><div>Time:             00   ,  03   , 06   , 09   ,12</div><div>wind value :   x1   ,  x2   , x3   , x4   , x5, <br></div><div>Would  you please kindly help me in this regard?</div><div>Best wishes,<br></div><div><div><div><div><br>-- <br><div dir="ltr">S.Rahimi<br><br></div></div></div></div></div></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr">S.Rahimi<br><br></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>