<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:&#39;Times New Roman&#39;">       
</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       = &quot;&quot;</span></p>

<p class="MsoNormal"><span lang="EN-GB">                        
res3@tiXAxisString      = &quot;Time Step&quot;</span></p>

<p class="MsoNormal"><span lang="EN-GB">                        
res3@tiYAxisString      = &quot;Temperature Difference
(C)&quot;</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 = &quot;red&quot;</span></p>

<p class="MsoNormal"><span lang="EN-GB">                        
res3@gsnBelowYRefLineColor = &quot;blue&quot;</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 &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;</span></p>

<p class="MsoNormal"><span lang="EN-GB">                       
load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;</span></p>

<p class="MsoNormal"><span lang="EN-GB"> </span></p>

<p class="MsoNormal"><span lang="EN-GB">                       
grib_in = addfile(&quot;$file1&quot;,&quot;r&quot;)</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(&quot;$file2&quot;,&quot;c&quot;)</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-&gt;$extra(i)$ = grib_in-&gt;$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(&quot;nc&quot;,&quot;FileStructure&quot;,&quot;Advanced&quot;)</span></p>

<p class="MsoNormal"><span lang="EN-GB">                       
fn = &quot;$file2&quot;</span></p>

<p class="MsoNormal"><span lang="EN-GB">                       
fi = addfile(fn,&quot;r&quot;)</span></p>

<p class="MsoNormal"><span lang="EN-GB"> </span></p>

<p class="MsoNormal"><span lang="EN-GB">                       
t2m = fi-&gt;TMP_P0_L103_GLL0</span></p>

<p class="MsoNormal"><span lang="EN-GB">                       
lat = fi-&gt;lat_0</span></p>

<p class="MsoNormal"><span lang="EN-GB">                       
lon = fi-&gt;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 (&quot;T_UK_$i&quot;,T_UK)</span></p>

<p class="MsoNormal"><span lang="EN-GB">               
         asciiwrite
(&quot;dt_$i&quot;,$i)</span></p>

<p class="MsoNormal"><span lang="EN-GB">                        
system(&quot;cat T_UK_* &gt; T_UK&quot;)</span></p>

<p class="MsoNormal"><span lang="EN-GB">                        
system(&quot;cat dt_* &gt; datefile&quot;)</span></p>

<p class="MsoNormal"><span lang="EN-GB"> </span></p>

<p class="MsoNormal"><span lang="EN-GB">                        
T_old=asciiread(&quot;T_00z&quot;,-1,&quot;float&quot;)</span></p>

<p class="MsoNormal"><span lang="EN-GB">                        
dt_old=asciiread(&quot;DATEFILE_00z&quot;,-1,&quot;float&quot;)</span></p>

<p class="MsoNormal"><span lang="EN-GB">                        
T=asciiread(&quot;T_UK&quot;,-1,&quot;float&quot;)</span></p>

<p class="MsoNormal"><span lang="EN-GB">                        
dt=asciiread(&quot;datefile&quot;,-1,&quot;float&quot;)</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=&quot;$a&quot;</span></p>

<p class="MsoNormal"><span lang="EN-GB">                        
wks = gsn_open_wks(&quot;png&quot;,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              
= &quot;GFS 06z op UK Temperatures&quot;</span></p>

<p class="MsoNormal"><span lang="EN-GB">                        
res@tiXAxisString             
= &quot;Time Step&quot;</span></p>

<p class="MsoNormal"><span lang="EN-GB">                        
res@tiYAxisString             
= &quot;Temperature (C)&quot;</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               
= &quot;black&quot;</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              
= &quot;red&quot;</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       = &quot;&quot;</span></p>

<p class="MsoNormal"><span lang="EN-GB">              
          res3@tiXAxisString     
= &quot;Time Step&quot;</span></p>

<p class="MsoNormal"><span lang="EN-GB">                        
res3@tiYAxisString      = &quot;Temperature Difference
(C)&quot;</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 = &quot;red&quot;</span></p>

<p class="MsoNormal"><span lang="EN-GB">                        
res3@gsnBelowYRefLineColor = &quot;blue&quot;</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>