<div dir="ltr"><p class="MsoNormal"><span lang="EN-GB">Hi</span></p><p class="MsoNormal"><br></p><p class="MsoNormal">I am running ncl 6.2.1 in cygwin</p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">I am
running a plot script which seems to be working but I get this error.</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="" style="margin-left:42pt"><span lang="EN-GB">(0)<span style="font-stretch:normal;font-size:7pt;font-family:'Times New Roman'">
</span></span><span lang="EN-GB">gsn_csm_xy:
Fatal: X and Y must have the same dimensions sizes, or one must be
one-dimensional and both have the same rightmost dimension.</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">However
when I print out the two variables I am plotting I get this </span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">Variable:
dt</span></p>
<p class="MsoNormal"><span lang="EN-GB">Type: float</span></p>
<p class="MsoNormal"><span lang="EN-GB">Total Size:
12 bytes</span></p>
<p class="MsoNormal"><span lang="EN-GB">
3 values</span></p>
<p class="MsoNormal"><span lang="EN-GB">Number of
Dimensions: 1</span></p>
<p class="MsoNormal"><span lang="EN-GB">Dimensions
and sizes: [3]</span></p>
<p class="MsoNormal"><span lang="EN-GB">Coordinates:
</span></p>
<p class="MsoNormal"><span lang="EN-GB">Number Of
Attributes: 1</span></p>
<p class="MsoNormal"><span lang="EN-GB">
_FillValue : 9.96921e+36</span></p>
<p class="MsoNormal"><span lang="EN-GB">(0)
0</span></p>
<p class="MsoNormal"><span lang="EN-GB">(1)
3</span></p>
<p class="MsoNormal"><span lang="EN-GB">(2)
6</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">Variable:
T_dif</span></p>
<p class="MsoNormal"><span lang="EN-GB">Type: float</span></p>
<p class="MsoNormal"><span lang="EN-GB">Total Size:
12 bytes</span></p>
<p class="MsoNormal"><span lang="EN-GB">
3 values</span></p>
<p class="MsoNormal"><span lang="EN-GB">Number of
Dimensions: 1</span></p>
<p class="MsoNormal"><span lang="EN-GB">Dimensions
and sizes: [3]</span></p>
<p class="MsoNormal"><span lang="EN-GB">Coordinates:
</span></p>
<p class="MsoNormal"><span lang="EN-GB">Number Of
Attributes: 1</span></p>
<p class="MsoNormal"><span lang="EN-GB">
_FillValue : 9.96921e+36</span></p>
<p class="MsoNormal"><span lang="EN-GB">(0)
0.1149902</span></p>
<p class="MsoNormal"><span lang="EN-GB">(1)
-0.3859797</span></p>
<p class="MsoNormal"><span lang="EN-GB">(2)
-0.0739994</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">The line of
code is as follows</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">
res3 = res</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res3@tiMainString = ""</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res3@tiXAxisString = "Time Step"</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res3@tiYAxisString = "Temperature Difference
(C)"</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res3@trYMinF
= -3</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res3@trYMaxF
= 3</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res3@trXMinF
= 0</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res3@trXMaxF
= 240</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res3@vpXF
= 0.1</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res3@gsnYRefLine = 0.0</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res3@gsnAboveYRefLineColor = "red"</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res3@gsnBelowYRefLineColor = "blue"</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">
polyres
= True</span></p>
<p class="MsoNormal"><span lang="EN-GB">
polyres@gsLineThicknessF = 3.0</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">
if (dimsizes(T).gt.1).and.(dimsizes(T).lt.240) then</span></p>
<p class="MsoNormal"><span lang="EN-GB">
plot2 = gsn_csm_xy(wks,dt,T_dif,res3)</span></p>
<p class="MsoNormal"><span lang="EN-GB">
gsn_polyline(wks,plot,dt,T_dif,polyres)</span></p>
<p class="MsoNormal"><span lang="EN-GB">
psres = True</span></p>
<p class="MsoNormal"><span lang="EN-GB">
gsn_panel(wks,(/plot,plot2/),(/1,2/),psres)</span></p>
<p class="MsoNormal"><span lang="EN-GB">
end if</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">Obviously
this isn’t the whole piece of code but the other graph in the image using
gsn_csm_x2y2 so that can’t be the cause of the error. There do seem to be some
errors in this because the gsn_polyline is on plot2 not plot one on the image
it creates, but if I put plot there instead it draws a mysterious line of the
first plot. All in all I am quite confused what I have done.</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">I have
attached the full script just incase that help shed light on my coding.</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">Thanks in
advance</span></p>
<p class="MsoNormal"><span lang="EN-GB">Lara</span></p>
<p class="MsoNormal"><span lang="EN-GB">
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</span></p>
<p class="MsoNormal"><span lang="EN-GB">
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">
grib_in = addfile("$file1","r")</span></p>
<p class="MsoNormal"><span lang="EN-GB">
names = getfilevarnames(grib_in)</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">
ncdf_out = addfile("$file2","c")</span></p>
<p class="MsoNormal"><span lang="EN-GB">
do i=0,dimsizes(names)-1</span></p>
<p class="MsoNormal"><span lang="EN-GB">
ncdf_out->$extra(i)$ = grib_in->$extra(i) $</span></p>
<p class="MsoNormal"><span lang="EN-GB">
end do</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">
setfileoption("nc","FileStructure","Advanced")</span></p>
<p class="MsoNormal"><span lang="EN-GB">
fn = "$file2"</span></p>
<p class="MsoNormal"><span lang="EN-GB">
fi = addfile(fn,"r")</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">
t2m = fi->TMP_P0_L103_GLL0</span></p>
<p class="MsoNormal"><span lang="EN-GB">
lat = fi->lat_0</span></p>
<p class="MsoNormal"><span lang="EN-GB">
lon = fi->lon_0</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">
T_london=t2m(154,0)</span></p>
<p class="MsoNormal"><span lang="EN-GB">
T_birmingham=t2m(150,1432)</span></p>
<p class="MsoNormal"><span lang="EN-GB">
T_manchester=t2m(146,1431)</span></p>
<p class="MsoNormal"><span lang="EN-GB">
T_glasgow=t2m(137,1421)</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">
T_UK =
(0.44*(T_london)+0.18*T_birmingham+0.27*(T_manchester)+0.11*(T_glasgow))-272.15</span></p>
<p class="MsoNormal"><span lang="EN-GB">
asciiwrite ("T_UK_$i",T_UK)</span></p>
<p class="MsoNormal"><span lang="EN-GB">
asciiwrite
("dt_$i",$i)</span></p>
<p class="MsoNormal"><span lang="EN-GB">
system("cat T_UK_* > T_UK")</span></p>
<p class="MsoNormal"><span lang="EN-GB">
system("cat dt_* > datefile")</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">
T_old=asciiread("T_00z",-1,"float")</span></p>
<p class="MsoNormal"><span lang="EN-GB">
dt_old=asciiread("DATEFILE_00z",-1,"float")</span></p>
<p class="MsoNormal"><span lang="EN-GB">
T=asciiread("T_UK",-1,"float")</span></p>
<p class="MsoNormal"><span lang="EN-GB">
dt=asciiread("datefile",-1,"float")</span></p>
<p class="MsoNormal"><span lang="EN-GB">
dt2=dt+6</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">
if (dimsizes(T).lt.240) then</span></p>
<p class="MsoNormal"><span lang="EN-GB">
T_dif = T(0:dimsizes(T)-1)-T_old(2:(2+dimsizes(T))-1)</span></p>
<p class="MsoNormal"><span lang="EN-GB">
end if</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">
filename="$a"</span></p>
<p class="MsoNormal"><span lang="EN-GB">
wks = gsn_open_wks("png",filename)</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">
res
= True</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res@gsnFrame
= False</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res@gsnDraw
= False</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res@tiMainString
= "GFS 06z op UK Temperatures"</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res@tiXAxisString
= "Time Step"</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res@tiYAxisString
= "Temperature (C)"</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res@trYMinF
= min(T_old)-2</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res@trYMaxF
= max(T_old)+2</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res@trXMinF
= 0</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res@trXMaxF
= 390</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res@xyLineColor
= "black"</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res@xyLineThicknessF
= 4</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res@xyDashPattern
= 4</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res2
= True</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res2@gsnFrame
= False</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res2@gsnDraw
= False</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res2@trYMinF
= min(T_old)-2</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res2@trYMaxF
= max(T_old)+2</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res2@trXMinF
= 0</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res2@trXMaxF
= 390</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res2@xyLineColor
= "red"</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res2@xyLineThicknessF = 4</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res2@xyDashPattern
= 0</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">
if (dimsizes(T).gt.1) then</span></p>
<p class="MsoNormal"><span lang="EN-GB">
plot = gsn_csm_x2y2(wks,dt_old,dt2,T_old,T,res,res2)</span></p>
<p class="MsoNormal"><span lang="EN-GB">
end if</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">
res3 = res</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res3@tiMainString = ""</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res3@tiXAxisString
= "Time Step"</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res3@tiYAxisString = "Temperature Difference
(C)"</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res3@trYMinF
= -3</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res3@trYMaxF
= 3</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res3@trXMinF
= 0</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res3@trXMaxF
= 240</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res3@vpXF
= 0.1</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res3@gsnYRefLine = 0.0</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res3@gsnAboveYRefLineColor = "red"</span></p>
<p class="MsoNormal"><span lang="EN-GB">
res3@gsnBelowYRefLineColor = "blue"</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">
polyres
= True</span></p>
<p class="MsoNormal"><span lang="EN-GB">
polyres@gsLineThicknessF = 3.0</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">
if (dimsizes(T).gt.1).and.(dimsizes(T).lt.240)
then</span></p>
<p class="MsoNormal"><span lang="EN-GB">
plot2 = gsn_csm_xy(wks,dt,T_dif,res3)</span></p>
<p class="MsoNormal"><span lang="EN-GB">
gsn_polyline(wks,plot,dt,T_dif,polyres)</span></p>
<p class="MsoNormal"><span lang="EN-GB">
psres = True</span></p>
<p class="MsoNormal"><span lang="EN-GB">
gsn_panel(wks,(/plot,plot2/),(/1,2/),psres)</span></p>
<p class="MsoNormal"><span lang="EN-GB">
end if</span></p></div>