<div dir="ltr"><div dir="ltr">Hi Jyothi,<div>Try using getind_latlon2d to return the nearest 2D coordinate indices to a lat/lon pair: </div><div><a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml">http://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml</a><br></div><div><br></div><div>If you have further questions let the ncl-talk email list know.</div><div>Adam</div></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Oct 29, 2018 at 12:34 PM Jyothi Lingala <<a href="mailto:jyothirao.lingala@gmail.com">jyothirao.lingala@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hii..<div><br></div><div>I am trying to plot a time series at specific location from model output. Attached is my model file. I suppose my input data is on a curvilinear grid, where I cannot use "{" and "}" for coordinate subscripting. The following script works when I specify the lat and lon indices manually. Instead of doing this, I would like to specify the lat and lon values directly(eg, 9N 67E). Kindly correct me where I am going wrong.<br></div><div><br></div><div><b>SCRIPT</b></div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"<br>load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/time_axis_labels.ncl"<br>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"<br><br>dir    = "/incois_ncmrwfx/incois/hycom/hwrf_output/pytmp/HYCOMcoupled_gsi/2017120100/03B/runwrf/"<br>files  = systemfunc("ls " + dir + "wrfout_d01_2017-12-*_*_00_00") ; one of the files is attached<br>a      = addfiles(files,"r")<div class="gmail_chip gmail_drive_chip" style="width:396px;height:18px;max-height:18px;background-color:#f5f5f5;padding:5px;color:#222;font-family:arial;font-style:normal;font-weight:bold;font-size:13px;border:1px solid #ddd;line-height:1"><a href="https://drive.google.com/file/d/1CO8FnR_N82jlcOSeb2OlKImJAqXRjT40/view?usp=drive_web" style="display:inline-block;max-width:366px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration:none;padding:1px 0;border:none" target="_blank"><img style="vertical-align:bottom;border:none" src="https://ssl.gstatic.com/docs/doclist/images/icon_10_generic_list.png"> <span dir="ltr" style="color:#15c;text-decoration:none;vertical-align:bottom">wrfout_d01_2017-12-01_00_00_00</span></a><img style="display:none;opacity:0.55;float:right"></div><br>ListSetType(a,"cat")<br>vNames = getfilevarnames(a[0])<br>;print(vNames)<br><br>;----- Read character variable Times -  Convert to units of "hours since" for plotting purposes<br><br>  times     = a[:]->Times<br>  Time      = wrf_times_c(a[:]->Times, 0)  ; convert to "hours since"<br>;  print(Time)<br> <br> sst                = a[:]->SST<br> sst                = sst-273.15<br> lat                 = a[:]->HLAT<br> lon                = a[:]->HLON<br> sst@lon2d        = lon<br> sst@lat2d        = lat<br><br>utc_date =  cd_calendar(Time, 0)<br>year        =  tointeger(utc_date(:,0))<br>month     =  tointeger(utc_date(:,1))<br>day         =  tointeger(utc_date(:,2))<br>date_str   =  sprinti("%0.4i-",year)+sprinti("%0.2i-", month) + \<br>            sprinti("%0.2i", day);+sprinti("%0.2i", hour)<br><br>wks = gsn_open_wks("png","timeseries_WRF")<br><br>res                          = True <br>res@gsnMaximize              = True <br>res@vpWidthF                 = 0.65 <br>res@vpHeightF                = 0.3<br>restick                      = True <br>restick@ttmFormat            = "%D/%c"<br>time_axis_labels(Time,res,restick)<br><br>plot = gsn_csm_xy(wks,Time,sst(:,291,151),res);;;;:::::::::::This line is working. Here I want to specify the lat and lon values directly(eg. 9N 67E).</div><div><br></div><div>Thanks and regards</div><div>Jyothi<br></div></div></div></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist,  </font></span><span><font color="#888888">Climate and Global Dynamics Laboratory, NCAR<br></font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a>   </font></span><span><font color="#888888">303-497-1726 </font></span></div><span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div></div></div></div></div></div></div>