<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Steven,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Sorry we didn't get back to you sooner.<br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The problem is that you are trying to use the dimension sizes of the full "var2" variable to create the "data" array:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"><span style="font-size:12.8px"> data = new((/2,dimsizes(var2)/),</span><span style="font-size:12.8px">float)</span><br style="font-size:12.8px"></font></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px"><br></span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px">var2 is a 2D array of size (/180,359/), so you are effectively trying to do this:</span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px"><br></span></div><div class="gmail_default" style="font-size:small"><div class="gmail_default"><font face="monospace, monospace"><span style="font-size:12.8px"> data = new((/2,(/180,359/)/),</span><span style="font-size:12.8px">float)</span><br style="font-size:12.8px"></font></div><div class="gmail_default"><span style="font-size:12.8px"><br></span></div><div class="gmail_default"><span style="font-size:12.8px">NCL doesn't allow for this kind of nested (/ and /) in the "new" statement; this is what's causing the weird "literal array" error.</span></div><div class="gmail_default"><span style="font-size:12.8px"><br></span></div><div class="gmail_default"><span style="font-size:12.8px">I think you meant to just include the rightmost dimension of var2:</span></div><div class="gmail_default"><span style="font-size:12.8px"><br></span></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace"><span style="font-size:12.8px"> data = new((/2,dimsizes(var2(0,:))/),</span><span style="font-size:12.8px">float)</span><br style="font-size:12.8px"></font></div><div><span style="font-size:12.8px"><br></span></div></div><div><span style="font-size:12.8px">--Mary</span></div><div><span style="font-size:12.8px"><br></span></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 27, 2016 at 1:54 PM, BLIUJUS, STEVEN D CTR USAF AFMC AFLCMC/HBAW-OL <span dir="ltr"><<a href="mailto:steven.bliujus.3.ctr@us.af.mil" target="_blank">steven.bliujus.3.ctr@us.af.mil</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am trying to produce a graph with 2 different variables on a single plot.<br>
I have AOD from two different sources (MODIS and Model output). They both<br>
have the same dimensions, both are 2 dimensions. I get the same thing when I<br>
print dimsizes for both variables.<br>
(0) 180<br>
(1) 359<br>
<br>
Unfortunately the FIM_Chem file is too large to attach.<br>
<br>
However when I run the code that was based off of xy_2.ncl I get the<br>
following error:<br>
<br>
fatal:_NclBuildArray: each element of a literal array must have the same<br>
dimension sizes, at least one item doesn't<br>
fatal:["Execute.c":8128]:Execute: Error occurred at or near line 49 in file<br>
Scatterplot.ncl<br>
<br>
This is my code:<br>
<br>
<br>
load "/home/bliujuss/ncl/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>
load "/home/bliujuss/ncl/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"<br>
load "/home/bliujuss/ncl/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br>
load "/home/bliujuss/ncl/lib/ncarg/nclscripts/csm/shea_util.ncl"<br>
;************************************************<br>
begin<br>
;************************************************<br>
; Generate some random data<br>
;************************************************<br>
<br>
a =<br>
addfile("/home/bliujuss/Plots/g4.timeAvgMap.MOD08_M3_051_Optical_Depth_Land_<br>
<a href="http://And_Ocean_Mean_Mean.20150701-20150731.180W_90S_180E_90N.nc" rel="noreferrer" target="_blank">And_Ocean_Mean_Mean.20150701-20150731.180W_90S_180E_90N.nc</a>","r")<br>
b = addfile("/home/bliujuss/Plots/FIM_Chem_<a href="tel:2014112418" value="+12014112418">2014112418</a>.nc","r")<br>
<br>
var1 = a->MOD08_M3_051_Optical_Depth_Land_And_Ocean_Mean_Mean<br>
var2 = b->VAR_147_GDS0_EATM<br>
var1_reorder = var1(lat|:,lon|0:358)<br>
;printVarSummary(var1_reorder)<br>
;printVarSummary(var2)<br>
<br>
;print(var2(120,199))<br>
;print(var1_reorder(120,199))<br>
<br>
bias = var1_reorder - var2<br>
wks = gsn_open_wks ("x11","xy") ; open workstation<br>
res = True ; plot mods desired<br>
res@gsnMaximize = True ; maximize plot<br>
res@tiMainString = "Two curve XY plot"<br>
res@xyLineThickness = (/1.0,2.0/)<br>
res@xyLineColors = (/"blue","red"/) ; add title<br>
res@xyMarkLineMode = "MarkLines" ; choose to use markers<br>
res@xyMarkers = (/1,2/) ; choose type of<br>
marker<br>
<br>
print(dimsizes(var1_reorder))<br>
print(dimsizes(var2))<br>
data = new((/2,dimsizes(var2)/),float)<br>
data(0,:) = var1_reorder(90,:)<br>
data(1,:) = var2(90,:)<br>
<br>
plot = gsn_csm_y (wks,data,res) ; create plot<br>
<br>
end<br>
<br>
<br>
I am using version 6.1.2<br>
I am using gcc version 4.1.2<br>
I'm using x86_64 GNU/Linux<br>
I have attached the two data files.<br>
<br>
Steven Bliujus, Contractor<br>
SEMS/16WS WXE<br>
557th Weather Wing<br>
DNS: 232-7151<br>
<br>
<br>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">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>
<br></blockquote></div><br></div>