<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I’m not sure how those lines came to be. &nbsp;Read the documentation and the examples on the documentation page. They are usually very helpful to understand what functions are doing and how to interact with them.<div class=""><br class=""></div><div class="">Here is a greatly reduced version of your script to focus on getind_latlon2d() function and output. &nbsp;Make sure you understand what is happening before copy pasting into your original script.&nbsp;</div><div class=""><br class=""></div><div class="">if in doubt run it interactively line by line, with extensive use of print() and printVarSummary() to understand the variable types and dimensions.&nbsp;</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Alan.&nbsp;</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div class="">;load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</div><div class="">;load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"</div><div class="">;load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"</div><div class=""><br class=""></div><div class="">;; The above lines aren't necessary if you're using a current version of ncl.&nbsp;</div><div class=""><br class=""></div><div class="">begin</div><div class=""><br class=""></div><div class="">;**************************************************</div><div class="">; Set file paths and plot specifics</div><div class="">;**************************************************</div><div class=""><br class=""></div><div class="">print("Setting File Paths")</div><div class=""><br class=""></div><div class="">;***** File Paths and Names *****</div><div class=""><br class=""></div><div class="">filen &nbsp; &nbsp; &nbsp;= "b.e12.B1850C5CN.f09_g16.YD13ka.003.pop.SFWF.1_cat_840.nc"</div><div class="">file_loc &nbsp; = "/glade/scratch/hughlett/csm/b.e12.B1850C5CN.f09_g16.YD13ka.003/ocn/tseries/cat/"</div><div class="">grid &nbsp; &nbsp; &nbsp; = "b.e12.B1850C5CN.f09_g16.YD13ka.003.pop.h.0810.nc"</div><div class="">grid_loc &nbsp; = "/glade/scratch/hughlett/csm/b.e12.B1850C5CN.f09_g16.YD13ka.003/ocn/hist/"</div><div class="">;**************************************************</div><div class="">; Read In and Process Data</div><div class="">;**************************************************</div><div class=""><br class=""></div><div class="">print("Reading in and processing data")</div><div class="">;***** Read in All Variables *****</div><div class=""><br class=""></div><div class="">fvar &nbsp;= addfile(file_loc+filen,"r")</div><div class="">fgrid = addfile(grid_loc+grid,"r")</div><div class=""><br class=""></div><div class="">lat2d = fgrid-&gt;TLAT</div><div class="">lon2d = fgrid-&gt;TLONG</div><div class=""><br class=""></div><div class="">lat = 50</div><div class="">lon = 28</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">;***** Get indicies of the point to plot *****</div><div class=""><br class=""></div><div class="">ll_ind = getind_latlon2d( lat2d, lon2d, lat, lon)</div><div class=""><br class=""></div><div class="">print(ll_ind) &nbsp; ; should be a 1x2 array or dimsizes(lat) x 2&nbsp;</div><div class=""><br class=""></div><div class="">do k=0,dimsizes(lat)-1 &nbsp; &nbsp; &nbsp; &nbsp;;; single iteration in this case. &nbsp;k=0</div><div class="">&nbsp; n = ll_ind(k,0) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;; this is how you should retrieve the relevant index for lat</div><div class="">&nbsp; m = ll_ind(k,1) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;; and for lon</div><div class="">&nbsp; print(lat2d(n,m)+" &nbsp; "+lon2d(n,m)) &nbsp;;; &nbsp;check that n &amp; m reference the right location. should be close to 50 &nbsp; 28</div><div class="">end do</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">lat_index = ll_ind(0,0)</div><div class="">lon_index = ll_ind(0,1)</div><div class=""><br class=""></div><div class="">printVarSummary(var0(:,lat_index,lon_index) )</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">end</div></div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 2 Feb 2017, at 15:15, Hughlett, Taylor M &lt;<a href="mailto:taylor.hughlett@uta.edu" class="">taylor.hughlett@uta.edu</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class="">

<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" class="">

<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 12px; font-family: Helvetica, sans-serif;" class="">
<div class="">
<div class="">
<div class="">Hello again,</div>
<div class=""><br class="">
</div>
<div class="">Thank you both for the info, and I seem to have fixed that issue, but now it appears I am back to square 1. The error reads:</div>
<div class="">
<div class="">fatal:No coordinate variable exists for dimension (lat) in variable (ll_ind)</div>
</div>
<div class=""><br class="">
</div>
<div class="">As always, full code is below the sig.</div>
<div class=""><br class="">
</div>
<div class="">Thanks again,</div>
<div class="">Taylor M Hughlett, Ph.D.<br class="">
UTA Earth and Environmental Sciences<br class="">
500 Yates St.<br class="">
Geoscience Bldg Rm 117<br class="">
Arlington, TX 76013-0049</div>
</div>
</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</div>
<div class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"</div>
<div class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"</div>
<div class=""><br class="">
</div>
<div class="">begin</div>
<div class=""><br class="">
</div>
<div class="">;**************************************************</div>
<div class="">; Set file paths and plot specifics</div>
<div class="">;**************************************************</div>
<div class=""><br class="">
</div>
<div class="">print("Setting File Paths")</div>
<div class=""><br class="">
</div>
<div class="">;***** File Paths and Names *****</div>
<div class=""><br class="">
</div>
<div class="">case &nbsp; &nbsp; &nbsp; = "b.e12.B1850C5CN.f09_g16.YD13ka.003"</div>
<div class="">filen &nbsp; &nbsp; &nbsp;= "b.e12.B1850C5CN.f09_g16.YD13ka.003.pop.SFWF.1_cat_840.nc"</div>
<div class="">file_loc &nbsp; = "/glade/scratch/hughlett/csm/b.e12.B1850C5CN.f09_g16.YD13ka.003/ocn/tseries/cat/"</div>
<div class="">grid &nbsp; &nbsp; &nbsp; = "b.e12.B1850C5CN.f09_g16.YD13ka.003.pop.h.0810.nc"</div>
<div class="">grid_loc &nbsp; = "/glade/scratch/hughlett/csm/b.e12.B1850C5CN.f09_g16.YD13ka.003/ocn/hist/"</div>
<div class="">plot_loc &nbsp; = "/glade/scratch/hughlett/plots/b.e12.B1850C5CN.f09_g16.YD13ka.003/timeseries"</div>
<div class=""><br class="">
</div>
<div class="">;***** Variable to Plot *****</div>
<div class=""><br class="">
</div>
<div class="">var &nbsp; &nbsp; &nbsp; &nbsp;= "SFWF"</div>
<div class=""><br class="">
</div>
<div class="">;***** Text for Plot *****</div>
<div class=""><br class="">
</div>
<div class="">CenterString = "Surface Freshwater Flux"</div>
<div class="">YAxisString &nbsp;= "SFWF (Sverdrups)"</div>
<div class="">XAxisString &nbsp;= "Years"</div>
<div class=""><br class="">
</div>
<div class="">;***** Start and End Time for Plot *****</div>
<div class=""><br class="">
</div>
<div class="">plot_begin = 0001</div>
<div class="">plot_end &nbsp; = 840</div>
<div class=""><br class="">
</div>
<div class="">;***** Data Options (0 = no, 1 = yes) *****</div>
<div class=""><br class="">
</div>
<div class="">smooth &nbsp;= 0</div>
<div class="">dtrd &nbsp; &nbsp;= 0</div>
<div class="">ncwrite = 0</div>
<div class=""><br class="">
</div>
<div class="">;**************************************************</div>
<div class="">; Read In and Process Data</div>
<div class="">;**************************************************</div>
<div class=""><br class="">
</div>
<div class="">print("Reading in and processing data")</div>
</div>
<div class="">
<div class="">;***** Read in All Variables *****</div>
<div class=""><br class="">
</div>
<div class="">fvar &nbsp;= addfile(file_loc+filen,"r")</div>
<div class="">fgrid = addfile(grid_loc+grid,"r")</div>
<div class=""><br class="">
</div>
<div class="">var0 &nbsp;= fvar-&gt;SFWF(:,:,:)</div>
<div class="">lat2d = fgrid-&gt;TLAT</div>
<div class="">lon2d = fgrid-&gt;TLONG</div>
<div class="">salt &nbsp;= fgrid-&gt;SALT</div>
<div class=""><br class="">
</div>
<div class="">lat = 50</div>
<div class="">lon = 28</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">;***** Create a More Plottable Timeline *****</div>
<div class=""><br class="">
</div>
<div class="">years = ispan(plot_begin,plot_end,1)</div>
<div class="">nyrs = dimsizes(years)</div>
<div class=""><br class="">
</div>
<div class="">;***** Get indicies of the point to plot *****</div>
<div class=""><br class="">
</div>
<div class="">ll_ind = getind_latlon2d( lat2d, lon2d, lat, lon)</div>
<div class=""><br class="">
</div>
<div class="">ll_ind!0 = "lat"</div>
<div class="">ll_ind!1 = "lon"</div>
<div class=""><br class="">
</div>
<div class="">copy_VarCoords_n(salt,ll_ind,(/2,3/))</div>
<div class=""><br class="">
</div>
<div class="">;**************************************************</div>
<div class="">; Open workstation, set plot resources, and plot</div>
<div class="">;**************************************************</div>
<div class=""><br class="">
</div>
<div class="">print("Creating Plot")</div>
<div class=""><br class="">
</div>
<div class="">;***** Create Plot Name *****</div>
<div class=""><br class="">
</div>
<div class="">pname = var + "." + case + "_" + "timeseries_0m" + plot_begin + "-" + plot_end</div>
<div class=""><br class="">
</div>
<div class="">;***** Open workstation *****</div>
<div class=""><br class="">
</div>
<div class="">wks = gsn_open_wks("ps",plot_loc+pname)</div>
<div class=""><br class="">
</div>
<div class="">;***** Set Resources *****</div>
<div class=""><br class="">
</div>
<div class="">res &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= True</div>
<div class="">res@gsnMaximize &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= True</div>
<div class="">res@gsnFrame &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = False</div>
<div class="">res@gsnDraw &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= False</div>
<div class="">res@vpHeightF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= .23</div>
<div class="">res@vpWidthF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = .783</div>
<div class="">res@tiXAxisFontHeightF &nbsp; = .015</div>
<div class="">res@tiYAxisFontHeightF &nbsp; = .015</div>
<div class="">res@tmYLLabelFontHeightF = .015</div>
<div class="">res@tmXBLabelFontHeightF = .015</div>
<div class="">res@gsnLeftString &nbsp; &nbsp; &nbsp; &nbsp;= " "</div>
<div class="">res@gsnRightString &nbsp; &nbsp; &nbsp; = " "</div>
<div class="">res@xyLineColor &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (/"black"/)</div>
</div>
<div class="">
<div class="">res@gsnCenterString &nbsp; &nbsp; &nbsp;= CenterString</div>
<div class="">res@tiYAxisString &nbsp; &nbsp; &nbsp; &nbsp;= YAxisString</div>
<div class="">res@tiXAxisString &nbsp; &nbsp; &nbsp; &nbsp;= XAxisString</div>
<div class="">res@trYMinF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 15</div>
<div class="">res@trYMaxF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 19</div>
<div class=""><br class="">
</div>
<div class="">;***** Create New Plot *****</div>
<div class=""><br class="">
</div>
<div class="">plot &nbsp; &nbsp; &nbsp;= new(1,graphic)</div>
<div class="">plot(0) &nbsp; = gsn_csm_xy (wks,years,var0(:,ll_ind&amp;lat,ll_ind&amp;lon),res)</div>
<div class=""><br class="">
</div>
<div class="">print("Plot Created")</div>
<div class=""><br class="">
</div>
<div class="">end</div>
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<span id="OLK_SRC_BODY_SECTION" class="">
<div style="font-family: Calibri; font-size: 11pt; text-align: left; border-width: 1pt medium medium; border-style: solid none none; padding: 3pt 0in 0in; border-top-color: rgb(181, 196, 223);" class="">
<span style="font-weight:bold" class="">From: </span>Alan Brammer &lt;<a href="mailto:abrammer@albany.edu" class="">abrammer@albany.edu</a>&gt;<br class="">
<span style="font-weight:bold" class="">Date: </span>Thursday, February 2, 2017 at 11:20 AM<br class="">
<span style="font-weight:bold" class="">To: </span>"Hughlett, Taylor M" &lt;<a href="mailto:taylor.hughlett@uta.edu" class="">taylor.hughlett@uta.edu</a>&gt;<br class="">
<span style="font-weight:bold" class="">Cc: </span>"<a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a>" &lt;<a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a>&gt;<br class="">
<span style="font-weight:bold" class="">Subject: </span>Re: [ncl-talk] Dimension (nlon) of (var0) does not have an associated coordinate variable<br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Yeah, Guido is right. &nbsp;
<div class=""><br class="">
</div>
<div class="">I didn’t test the code I wrote. &nbsp;Do a printVarSummary(ll_ind) and read the docs and you’ll see&nbsp;<span style="font-family: Helvetica, sans-serif;" class="">getind_latlon2d always returns a 2-d array. &nbsp;</span></div>
<div class=""><font face="Helvetica,sans-serif" class=""><br class="">
</font></div>
<div class=""><font face="Helvetica,sans-serif" class="">for a&nbsp;single point it should be (0,0) and (0,1) for lat | &nbsp;lon indices. &nbsp;Examples in the docs show you how to double check that it is all working as desired. &nbsp;</font></div>
<div class=""><font face="Helvetica,sans-serif" class=""><br class="">
</font></div>
<div class=""><font face="Helvetica,sans-serif" class=""><br class="">
</font></div>
<div class=""><font face="Helvetica,sans-serif" class="">Alan.</font></div>
<div class=""><font face="Helvetica,sans-serif" class=""><br class="">
</font></div>
<div class=""><font face="Helvetica,sans-serif" class=""><br class="">
</font>
<div class="">
<blockquote type="cite" class="">
<div class="">On 2 Feb 2017, at 12:17, Guido Cioni &lt;<a href="mailto:guidocioni@gmail.com" class="">guidocioni@gmail.com</a>&gt; wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
I'm pretty sure NCL is referring to <font face="Menlo" class="">ll_ind</font>, which is 2-Dimensional :) &nbsp;(see&nbsp;<a href="https://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml" class="">https://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml</a>).<br class="">
<div class="">
<div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<br class="Apple-interchange-newline">
Guido Cioni</div>
<div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<a href="http://guidocioni.altervista/" class="">http://guidocioni.altervista</a>.org</div>
</div>
<br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On 02 Feb 2017, at 18:14, Hughlett, Taylor M &lt;<a href="mailto:taylor.hughlett@uta.edu" class="">taylor.hughlett@uta.edu</a>&gt; wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 12px; font-family: Helvetica, sans-serif;" class="">
<div class="">
<div class="">Good afternoon,</div>
<div class=""><br class="">
</div>
<div class="">Thank you very much for the suggestion! I have used the function that you recommended, but now I am receiving the following error:</div>
<div class=""><br class="">
</div>
<div class="">Number of subscripts do not match number of dimensions of variable,(1) Subscripts used, (2) Subscripts expected</div>
<div class=""><br class="">
</div>
<div class="">It occurs at the line where I actually create the plot:</div>
<div class=""><br class="">
</div>
<div class="">plot(0) &nbsp; = gsn_csm_xy (wks,years,var0(:,ll_ind(0),ll_ind(1)),res)</div>
<div class=""><br class="">
</div>
<div class="">I have checked that var0 is three dimensional, and I have specified three subscripts required…</div>
<div class=""><br class="">
</div>
<div class="">Have I missed something?</div>
<div class=""><br class="">
</div>
<div class="">Taylor M Hughlett, Ph.D.<br class="">
UTA Earth and Environmental Sciences<br class="">
500 Yates St.<br class="">
Geoscience Bldg Rm 117<br class="">
Arlington, TX 76013-0049</div>
</div>
<div class=""><br class="">
</div>
<div class="">The Full Code:</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</div>
<div class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"</div>
<div class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"</div>
<div class=""><br class="">
</div>
<div class="">begin</div>
<div class=""><br class="">
</div>
<div class="">;**************************************************</div>
<div class="">; Set file paths and plot specifics</div>
<div class="">;**************************************************</div>
<div class=""><br class="">
</div>
<div class="">print("Setting File Paths")</div>
<div class=""><br class="">
</div>
<div class="">;***** File Paths and Names *****</div>
<div class=""><br class="">
</div>
<div class="">case &nbsp; &nbsp; &nbsp; = "b.e12.B1850C5CN.f09_g16.YD13ka.003"</div>
<div class="">filen &nbsp; &nbsp; &nbsp;= "b.e12.B1850C5CN.f09_g16.YD13ka.003.pop.SFWF.1_cat_840.nc"</div>
<div class="">file_loc &nbsp; = "/glade/scratch/hughlett/csm/b.e12.B1850C5CN.f09_g16.YD13ka.003/ocn/tseries/cat/"</div>
<div class="">grid &nbsp; &nbsp; &nbsp; = "b.e12.B1850C5CN.f09_g16.YD13ka.003.pop.h.0810.nc"</div>
<div class="">grid_loc &nbsp; = "/glade/scratch/hughlett/csm/b.e12.B1850C5CN.f09_g16.YD13ka.003/ocn/hist/"</div>
<div class="">plot_loc &nbsp; = "/glade/scratch/hughlett/plots/b.e12.B1850C5CN.f09_g16.YD13ka.003/timeseries"</div>
<div class=""><br class="">
</div>
<div class="">;***** Variable to Plot *****</div>
<div class=""><br class="">
</div>
<div class="">var &nbsp; &nbsp; &nbsp; &nbsp;= "SFWF"</div>
<div class=""><br class="">
</div>
<div class="">;***** Text for Plot *****</div>
<div class=""><br class="">
</div>
<div class="">CenterString = "Surface Freshwater Flux"</div>
<div class="">YAxisString &nbsp;= "SFWF (Sverdrups)"</div>
<div class="">XAxisString &nbsp;= "Years"</div>
<div class=""><br class="">
</div>
<div class="">;***** Start and End Time for Plot *****</div>
<div class=""><br class="">
</div>
<div class="">plot_begin = 0001</div>
<div class="">plot_end &nbsp; = 840</div>
<div class=""><br class="">
</div>
<div class="">;***** Data Options (0 = no, 1 = yes) *****</div>
<div class=""><br class="">
</div>
<div class="">smooth &nbsp;= 0</div>
<div class="">dtrd &nbsp; &nbsp;= 0</div>
<div class="">ncwrite = 0</div>
<div class=""><br class="">
</div>
<div class="">;**************************************************</div>
<div class="">; Read In and Process Data</div>
<div class="">;**************************************************</div>
<div class=""><br class="">
</div>
<div class="">print("Reading in and processing data")</div>
</div>
<div class="">
<div class="">;***** Read in All Variables *****</div>
<div class=""><br class="">
</div>
<div class="">fvar &nbsp;= addfile(file_loc+filen,"r")</div>
<div class="">fgrid = addfile(grid_loc+grid,"r")</div>
<div class=""><br class="">
</div>
<div class="">var0 &nbsp;= fvar-&gt;SFWF(:,:,:)</div>
<div class="">lat2d = fgrid-&gt;TLAT</div>
<div class="">lon2d = fgrid-&gt;TLONG</div>
<div class=""><br class="">
</div>
<div class="">lat = 50</div>
<div class="">lon = 28</div>
<div class=""><br class="">
</div>
<div class="">;***** Create a More Plottable Timeline *****</div>
<div class=""><br class="">
</div>
<div class="">years = ispan(plot_begin,plot_end,1)</div>
<div class="">nyrs = dimsizes(years)</div>
<div class=""><br class="">
</div>
<div class="">;***** Get indicies of the point to plot *****</div>
<div class=""><br class="">
</div>
<div class="">ll_ind = getind_latlon2d( lat2d, lon2d, lat, lon)</div>
<div class=""><br class="">
</div>
<div class="">;**************************************************</div>
<div class="">; Open workstation, set plot resources, and plot</div>
<div class="">;**************************************************</div>
<div class=""><br class="">
</div>
<div class="">print("Creating Plot")</div>
<div class=""><br class="">
</div>
<div class="">;***** Create Plot Name *****</div>
<div class=""><br class="">
</div>
<div class="">pname = var + "." + case + "_" + "timeseries_0m" + plot_begin + "-" + plot_end</div>
<div class=""><br class="">
</div>
<div class="">;***** Open workstation *****</div>
<div class=""><br class="">
</div>
<div class="">wks = gsn_open_wks("ps",plot_loc+pname)</div>
<div class=""><br class="">
</div>
<div class="">;***** Set Resources *****</div>
<div class=""><br class="">
</div>
<div class="">res &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= True</div>
<div class="">res@gsnMaximize &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= True</div>
<div class="">res@gsnFrame &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = False</div>
<div class="">res@gsnDraw &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= False</div>
<div class="">res@vpHeightF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= .23</div>
<div class="">res@vpWidthF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = .783</div>
<div class="">res@tiXAxisFontHeightF &nbsp; = .015</div>
<div class="">res@tiYAxisFontHeightF &nbsp; = .015</div>
<div class="">res@tmYLLabelFontHeightF = .015</div>
<div class="">res@tmXBLabelFontHeightF = .015</div>
<div class="">res@gsnLeftString &nbsp; &nbsp; &nbsp; &nbsp;= " "</div>
<div class="">res@gsnRightString &nbsp; &nbsp; &nbsp; = " "</div>
<div class="">res@xyLineColor &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (/"black"/)</div>
<div class="">res@gsnCenterString &nbsp; &nbsp; &nbsp;= CenterString</div>
<div class="">res@tiYAxisString &nbsp; &nbsp; &nbsp; &nbsp;= YAxisString</div>
<div class="">res@tiXAxisString &nbsp; &nbsp; &nbsp; &nbsp;= XAxisString</div>
<div class="">res@trYMinF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 15</div>
<div class="">res@trYMaxF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 19</div>
<div class=""><br class="">
</div>
<div class="">;***** Create New Plot *****</div>
</div>
<div class="">
<div class=""><br class="">
</div>
<div class="">plot &nbsp; &nbsp; &nbsp;= new(1,graphic)</div>
<div class="">plot(0) &nbsp; = gsn_csm_xy (wks,years,var0(:,ll_ind(0),ll_ind(1)),res)</div>
<div class=""><br class="">
</div>
<div class="">print("Plot Created")</div>
<div class=""><br class="">
</div>
<div class="">end</div>
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<span id="OLK_SRC_BODY_SECTION" class="">
<div style="font-family: Calibri; font-size: 11pt; text-align: left; border-width: 1pt medium medium; border-style: solid none none; padding: 3pt 0in 0in; border-top-color: rgb(181, 196, 223);" class="">
<span style="font-weight:bold" class="">From: </span>Alan Brammer &lt;<a href="mailto:abrammer@albany.edu" class="">abrammer@albany.edu</a>&gt;<br class="">
<span style="font-weight:bold" class="">Date: </span>Wednesday, February 1, 2017 at 2:15 PM<br class="">
<span style="font-weight:bold" class="">To: </span>"Hughlett, Taylor M" &lt;<a href="mailto:taylor.hughlett@uta.edu" class="">taylor.hughlett@uta.edu</a>&gt;<br class="">
<span style="font-weight:bold" class="">Cc: </span>"<a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a>" &lt;<a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a>&gt;<br class="">
<span style="font-weight:bold" class="">Subject: </span>Re: [ncl-talk] Dimension (nlon) of (var0) does not have an associated coordinate variable<br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
&nbsp;If you were plotting a map, like Barry Lynn's similar question today also on ncl-talk, you would want to do:
<div class=""><br class="">
</div>
<div class=""><span style="font-family: Helvetica, sans-serif;" class="">var0@lon2d =&nbsp;</span><span style="font-family: Helvetica, sans-serif;" class="">lon2d</span>
<div class="" style="font-family: Helvetica, sans-serif;">var0@lat2d = lat2d</div>
</div>
<div class="" style="font-family: Helvetica, sans-serif;"><br class="">
</div>
<div class="" style="font-family: Helvetica, sans-serif;">The below lines are not needed.&nbsp;</div>
<div class=""><font face="Helvetica,sans-serif" class="">&nbsp; &nbsp; ; LON2D &nbsp;= lon2d(::1,::1) &nbsp; &nbsp; &nbsp; &nbsp;;; I don’t think (::1,::1) does anything,&nbsp;</font><span style="font-family: Helvetica, sans-serif;" class="">&nbsp;it will take all values with an increment of 1, i.e.&nbsp;the&nbsp;whole&nbsp;array.&nbsp;</span></div>
<div class="">
<div class="" style="font-family: Helvetica, sans-serif;">&nbsp; &nbsp; ; LAT2D &nbsp;= lat2d(::1,::1)<span class="Apple-tab-span" style="white-space:pre"></span>&nbsp; &nbsp;; &nbsp; so this is just redundant characters which aren’t needed.&nbsp;</div>
</div>
<div class="">You don’t need to replicate a variable that already exists.&nbsp;</div>
<div class=""><br class="">
</div>
<div class="">
<div class="" style="font-family: Helvetica, sans-serif;">To set coordinate variables named nlon and nlat, you want to use the &amp; syntax not the @ syntax, but coordinate subscripting won’t work with 2d coordinates anyway.&nbsp;</div>
<div class="" style="font-family: Helvetica, sans-serif;"><br class="">
</div>
<div class="" style="font-family: Helvetica, sans-serif;">So instead get the index of the point you want using:</div>
<div class=""><font face="Helvetica,sans-serif" class=""><a href="https://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml" class="">https://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml</a></font></div>
<div class="">e.g.</div>
<div class=""><br class="">
</div>
<div class=""><font face="Helvetica,sans-serif" class="">ll_ind =&nbsp;getind_latlon2d( lat2d, lon2d,&nbsp;</font><span style="font-family: Helvetica, sans-serif;" class="">28,50)</span></div>
<div class=""><font face="Helvetica,sans-serif" class="">…</font></div>
<div class=""><font face="Helvetica,sans-serif" class="">…&nbsp;</font></div>
<div class=""><span style="font-family: Helvetica, sans-serif;" class="">plot(0) &nbsp; = gsn_csm_xy (wks, years, var0(:, ll_ind(0), ll_ind(1) ), res)</span></div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Good luck,&nbsp;</div>
<div class=""><br class="">
</div>
<div class="">Alan</div>
<div class=""><br class="">
</div>
<br class="">
<div class="">
<div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
##############################<br class="">
Alan Brammer,
<div class="">Post-Doc Researcher</div>
<div class=""><br class="">
</div>
<div class="">Department of Atmospheric and&nbsp;Environmental Sciences,<br class="">
University at Albany,&nbsp;State University of New&nbsp;York,&nbsp;Albany, NY, 12222
<div class=""><a href="mailto:abrammer@albany.edu" class="">abrammer@albany.edu</a><br class="">
##############################</div>
</div>
</div>
</span></div>
</div>
</div>
</div>
</div>
</div>
</span></div>
_______________________________________________<br class="">
ncl-talk mailing list<br class="">
<a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a><br class="">
List instructions, subscriber options, unsubscribe:<br class="">
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</span>
</div>

</div></blockquote></div><br class=""></div></body></html>