<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 12px; font-family: Helvetica, sans-serif;">
<div>Good afternoon!</div>
<div><br>
</div>
<div>I am attempting to produce a time series of our SFWF variable from our POP2 output in CESM1.2 and am getting the following error:</div>
<div><br>
</div>
<div>Dimension (nlon) of (var0) does not have an associated coordinate variable</div>
<div><br>
</div>
<div>No matter how I attempt to treat the variable var0 (specifying coordinates manually, applying Meta data from other variables, etc), the program does not seem to associate nlon with a coordinate variable.</div>
<div><br>
</div>
<div>The code is below my signature for the email. Any help with this would be wonderful. I’ve already looked through some of the fixes that were posted on the ncl-talk list, but none worked for me.</div>
<div><br>
</div>
<div>Thanks in advance!</div>
<div><br>
</div>
<div>Taylor M Hughlett, Ph.D.<br>
UTA Earth and Environmental Sciences<br>
500 Yates St.<br>
Geoscience Bldg Rm 117<br>
Arlington, TX 76013-0049</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</div>
<div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"</div>
<div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"</div>
<div><br>
</div>
<div>begin</div>
<div><br>
</div>
<div>;**************************************************</div>
<div>; Set file paths and plot specifics</div>
<div>;**************************************************</div>
<div><br>
</div>
<div>print("Setting File Paths")</div>
<div><br>
</div>
<div>;***** File Paths and Names *****</div>
<div><br>
</div>
<div>case = "b.e12.B1850C5CN.f09_g16.YD13ka.003"</div>
<div>filen = "b.e12.B1850C5CN.f09_g16.YD13ka.003.pop.SFWF.1_cat_840.nc"</div>
<div>file_loc = "/glade/scratch/hughlett/csm/b.e12.B1850C5CN.f09_g16.YD13ka.003/ocn/tseries/cat/"</div>
<div>grid = "b.e12.B1850C5CN.f09_g16.YD13ka.003.pop.h.0810.nc"</div>
<div>grid_loc = "/glade/scratch/hughlett/csm/b.e12.B1850C5CN.f09_g16.YD13ka.003/ocn/hist/"</div>
<div>plot_loc = "/glade/scratch/hughlett/plots/b.e12.B1850C5CN.f09_g16.YD13ka.003/timeseries"</div>
<div><br>
</div>
<div>;***** Text for Plot *****</div>
<div><br>
</div>
<div>CenterString = "Surface Freshwater Flux"</div>
<div>YAxisString = "SFWF (Sverdrups)"</div>
<div>XAxisString = "Years"</div>
<div><br>
</div>
<div>;***** Start and End Time for Plot *****</div>
<div><br>
</div>
<div>plot_begin = 0001</div>
<div>plot_end = 840</div>
<div><br>
</div>
<div>;***** Data Options (0 = no, 1 = yes) *****</div>
<div><br>
</div>
<div>smooth = 0</div>
<div>dtrd = 0</div>
<div>ncwrite = 0</div>
<div><br>
</div>
<div>;**************************************************</div>
<div>; Read In and Process Data</div>
<div>;**************************************************</div>
<div><br>
</div>
<div>print("Reading in and processing data")</div>
<div><br>
</div>
<div>;***** Read in All Variables *****</div>
<div><br>
</div>
<div>fvar = addfile(file_loc+filen,"r")</div>
<div>fgrid = addfile(grid_loc+grid,"r")</div>
<div><br>
</div>
<div>var0 = fvar->SFWF(:,:,:)</div>
<div>lat2d = fgrid->TLAT</div>
<div>lon2d = fgrid->TLONG</div>
</div>
<div>
<div><br>
</div>
<div>;***** Create a More Plottable Timeline *****</div>
<div><br>
</div>
<div>years = ispan(plot_begin,plot_end,1)</div>
<div>nyrs = dimsizes(years)</div>
<div><br>
</div>
<div>;***** Copy Over Coordinate Data *****</div>
<div><br>
</div>
<div>LON2D = lon2d(::1,::1)</div>
<div>LAT2D = lat2d(::1,::1)</div>
<div>var0@nlon = LON2D</div>
<div>var0@nlat = LAT2D</div>
<div><br>
</div>
<div>printVarSummary(var0)</div>
<div>;**************************************************</div>
<div>; Open workstation, set plot resources, and plot</div>
<div>;**************************************************</div>
<div><br>
</div>
<div>print("Creating Plot")</div>
<div><br>
</div>
<div>;***** Create Plot Name *****</div>
<div><br>
</div>
<div>pname = var + "." + case + "_" + "timeseries_0m" + plot_begin + "-" + plot_end</div>
<div><br>
</div>
<div>;***** Open workstation *****</div>
<div><br>
</div>
<div>wks = gsn_open_wks("ps",plot_loc+pname)</div>
<div><br>
</div>
<div>;***** Set Resources *****</div>
<div><br>
</div>
<div>res = True</div>
<div>res@gsnMaximize = True</div>
<div>res@gsnFrame = False</div>
<div>res@gsnDraw = False</div>
<div>res@vpHeightF = .23</div>
<div>res@vpWidthF = .783</div>
<div>res@tiXAxisFontHeightF = .015</div>
<div>res@tiYAxisFontHeightF = .015</div>
<div>res@tmYLLabelFontHeightF = .015</div>
<div>res@tmXBLabelFontHeightF = .015</div>
<div>res@gsnLeftString = " "</div>
<div>res@gsnRightString = " "</div>
<div>res@xyLineColor = (/"black"/)</div>
<div>res@gsnCenterString = CenterString</div>
<div>res@tiYAxisString = YAxisString</div>
<div>res@tiXAxisString = XAxisString</div>
<div>res@trYMinF = 15</div>
<div>res@trYMaxF = 19</div>
</div>
<div>
<div><br>
</div>
<div>;***** Create New Plot *****</div>
<div><br>
</div>
<div>plot = new(1,graphic)</div>
<div>plot(0) = gsn_csm_xy (wks,years,var0(:,{28},{50}),res)</div>
<div><br>
</div>
<div>print("Plot Created")</div>
<div><br>
</div>
<div>End</div>
</div>
<div><br>
</div>
</body>
</html>