[ncl-talk] Error trying to produce 2line graph
BLIUJUS, STEVEN D CTR USAF AFMC AFLCMC/HBAW-OL
steven.bliujus.3.ctr at us.af.mil
Wed Jan 27 13:54:41 MST 2016
I am trying to produce a graph with 2 different variables on a single plot.
I have AOD from two different sources (MODIS and Model output). They both
have the same dimensions, both are 2 dimensions. I get the same thing when I
print dimsizes for both variables.
(0) 180
(1) 359
Unfortunately the FIM_Chem file is too large to attach.
However when I run the code that was based off of xy_2.ncl I get the
following error:
fatal:_NclBuildArray: each element of a literal array must have the same
dimension sizes, at least one item doesn't
fatal:["Execute.c":8128]:Execute: Error occurred at or near line 49 in file
Scatterplot.ncl
This is my code:
load "/home/bliujuss/ncl/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "/home/bliujuss/ncl/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
load "/home/bliujuss/ncl/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "/home/bliujuss/ncl/lib/ncarg/nclscripts/csm/shea_util.ncl"
;************************************************
begin
;************************************************
; Generate some random data
;************************************************
a =
addfile("/home/bliujuss/Plots/g4.timeAvgMap.MOD08_M3_051_Optical_Depth_Land_
And_Ocean_Mean_Mean.20150701-20150731.180W_90S_180E_90N.nc","r")
b = addfile("/home/bliujuss/Plots/FIM_Chem_2014112418.nc","r")
var1 = a->MOD08_M3_051_Optical_Depth_Land_And_Ocean_Mean_Mean
var2 = b->VAR_147_GDS0_EATM
var1_reorder = var1(lat|:,lon|0:358)
;printVarSummary(var1_reorder)
;printVarSummary(var2)
;print(var2(120,199))
;print(var1_reorder(120,199))
bias = var1_reorder - var2
wks = gsn_open_wks ("x11","xy") ; open workstation
res = True ; plot mods desired
res at gsnMaximize = True ; maximize plot
res at tiMainString = "Two curve XY plot"
res at xyLineThickness = (/1.0,2.0/)
res at xyLineColors = (/"blue","red"/) ; add title
res at xyMarkLineMode = "MarkLines" ; choose to use markers
res at xyMarkers = (/1,2/) ; choose type of
marker
print(dimsizes(var1_reorder))
print(dimsizes(var2))
data = new((/2,dimsizes(var2)/),float)
data(0,:) = var1_reorder(90,:)
data(1,:) = var2(90,:)
plot = gsn_csm_y (wks,data,res) ; create plot
end
I am using version 6.1.2
I am using gcc version 4.1.2
I'm using x86_64 GNU/Linux
I have attached the two data files.
Steven Bliujus, Contractor
SEMS/16WS WXE
557th Weather Wing
DNS: 232-7151
-------------- next part --------------
A non-text attachment was scrubbed...
Name: g4.timeAvgMap.MOD08_M3_051_Optical_Depth_Land_And_Ocean_Mean_Mean.20150701-20150731.180W_90S_180E_90N.nc
Type: application/octet-stream
Size: 523968 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160127/9d00e821/attachment-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5647 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160127/9d00e821/attachment-0001.bin
More information about the ncl-talk
mailing list