<div dir="ltr">Hi,<div>  So I&#39;m looking at Wind Vector data for 3-month periods (JFM,FMA,MAM,etc) using data from the month that is the middle month of this 3-month period.  I have text file I&#39;m using to implement the specific years I want to look.  These are 4 sets of years each set of years for a different phase of QBO.  </div>

<div><br></div><div>  My question is for when I do November-December-January and December-January-February...how to get Grads to use my years just as they are for November/December for computing the Wind Vector composites in that NDJ case but to add one year to the January ones so that it considers the next year for January since January is of the next year...and then for the DJF to subtract one for the December years considered but to keep January and February as they are.</div>

<div><br></div><div>Here&#39;s just a sample of what my text file looks like (I&#39;ll have December one for the NDJ case and a January one for the DJF case):</div><div><br></div><div><div>pos dec neg inc</div><div>1966 1988 1965 1977</div>

<div>1980 1993 1974 1994</div><div>1995         2001</div><div>2011</div></div><div><br></div><div>And my code with the parts involving the text file and t-0,t+2 line I&#39;m using to get the months highlighted:</div><div>

<br></div><div><div>&#39;reinit&#39;</div><div>&#39;set display color white&#39;;&#39;c&#39;</div><div>&#39;set grid off&#39;</div><div><br></div><div>*- - -</div><div> xl=0.4 ; yt=7.5</div><div> dx=2.3 ; dy=1.4</div><div>

*- - -</div><div><br></div><div>size.1=2</div><div>size.2=4</div><div>size.3=2</div><div>size.4=3</div><div><br></div><div><span style="background-color:rgb(255,255,0)">file=&#39;Nov.txt&#39;</span></div><div><span style="background-color:rgb(255,255,0)">ret=read(file)</span></div>
<div><span style="background-color:rgb(255,255,0)"><br></span></div><div><span style="background-color:rgb(255,255,0)">n=1;while(n&lt;=100)</span></div>
<div><span style="background-color:rgb(255,255,0)">ret=read(file)</span></div><div><span style="background-color:rgb(255,255,0)">chk=sublin(ret,1);if(chk&gt;0);break;endif</span></div><div><span style="background-color:rgb(255,255,0)">ret=sublin(ret,2)</span></div>
<div><span style="background-color:rgb(255,255,0)"><br></span></div><div><span style="background-color:rgb(255,255,0)">ip=1;while(ip&lt;=4)</span></div><div><span style="background-color:rgb(255,255,0)">  if(n&lt;=size.ip)</span></div>
<div><span style="background-color:rgb(255,255,0)">*    year.ip.n=substr(ret,ip)</span></div>
<div><span style="background-color:rgb(255,255,0)">     year.1.n=substr(ret,1,4)</span></div><div><span style="background-color:rgb(255,255,0)">     year.2.n=substr(ret,6,4)</span></div><div><span style="background-color:rgb(255,255,0)">     year.3.n=substr(ret,11,4)</span></div>
<div><span style="background-color:rgb(255,255,0)">     year.4.n=substr(ret,16,4)</span></div><div><span style="background-color:rgb(255,255,0)">  endif</span></div><div><span style="background-color:rgb(255,255,0)">ip=ip+1;endwhile</span></div>
<div><span style="background-color:rgb(255,255,0)"><br></span></div>
<div><span style="background-color:rgb(255,255,0)">n=n+1;endwhile</span></div><div><br></div><div>*= = = = = = = = =</div><div><br></div><div>&#39;sdfopen /export1/Databank/NCEP_Month/pressure/<a href="http://uwnd.mon.mean.nc" target="_blank">uwnd.mon.mean.nc</a>&#39;</div>
</div><div><div>
&#39;sdfopen /export1/Databank/NCEP_Month/pressure/<a href="http://vwnd.mon.mean.nc" target="_blank">vwnd.mon.mean.nc</a>&#39;</div><div><br></div><div> lv=1 ; while(lv&lt;=2)</div><div>&#39;set t 17 775&#39;</div><div> if(lv=1); &#39;set lev 30&#39; ;endif</div>

<div> if(lv=2); &#39;set lev 200&#39; ;endif</div><div><br></div><div>&#39;define pu1=ave(uwnd.1,t-3,t+3)&#39;</div><div>&#39;define pu2=ave(uwnd.1,t-16,t+16)&#39;</div><div>&#39;define pufilter=pu1-pu2&#39;</div><div>&#39;define pv1=ave(vwnd.2,t-3,t+3)&#39;</div>

<div>&#39;define pv2=ave(vwnd.2,t-16,t+16)&#39;</div><div>&#39;define pvfilter=pv1-pv2&#39;</div><div><br></div><div><br></div><div> ip=1 ; while(ip&lt;=4)</div><div><br></div><div>&#39;define ucomp&#39;ip&#39;=const(pufilter,0)&#39;</div>

<div>&#39;define vcomp&#39;ip&#39;=const(pvfilter,0)&#39;</div><div><br></div><div> n=1 ; while(n&lt;=size.ip)</div><div><br></div><div>  <span style="background-color:rgb(255,255,0)"> &#39;set time oct&#39;year.ip.n   *(this I change to suit the 3-month period I&#39;m using, this one is Oct-Dec)</span></div>
<div><span style="background-color:rgb(255,255,0)">   &#39;ucomp&#39;ip&#39;=ucomp&#39;ip&#39;+ave(pufilter,t-0,t+2)/&#39;size.ip</span></div>
<div><span style="background-color:rgb(255,255,0)">   &#39;vcomp&#39;ip&#39;=vcomp&#39;ip&#39;+ave(pvfilter,t-0,t+2)/&#39;size.ip</span></div><div><br></div><div> n=n+1 ; endwhile</div><div><br></div><div> ip=ip+1 ; endwhile</div>
<div>* = = = = = = = = =</div><div>*&#39;set gxout shaded&#39;</div>
<div>&#39;set gxout vector&#39;</div><div>&#39;umean=(ucomp1+ucomp2+ucomp3+ucomp4)/4&#39;</div><div>&#39;vmean=(vcomp1+vcomp2+vcomp3+vcomp4)/4&#39;</div><div><br></div><div> ip=1 ; while(ip&lt;=4)</div></div><div><div>&#39;define utot&#39;ip&#39;= ucomp&#39;ip&#39; - umean&#39;</div>

<div>&#39;define vtot&#39;ip&#39;= vcomp&#39;ip&#39; - vmean&#39;</div><div>ip=ip+1 ; endwhile</div><div><br></div><div><br></div><div>* plotting</div><div><br></div><div><br></div><div> ip=1 ; while(ip&lt;=4)</div><div>
<br>
</div><div> xr=xl+dx</div><div> yb=yt-dy</div><div>&#39;set parea &#39;xl&#39; &#39;xr&#39; &#39;yb&#39; &#39;yt</div><div>&#39;set lat -90 90&#39;</div><div>&#39;set lon 0 360&#39;</div><div>&#39;set lev 30&#39;</div><div>

<br></div><div>&#39;set mproj scaled&#39;</div><div>&#39;set ccolor 1&#39;</div><div>&#39;set map 11&#39;</div><div>&#39;set annot 1 2&#39;</div><div>&#39;set xlopts 15 1 0.08&#39;</div><div>&#39;set ylopts 15 1 0.08&#39;</div>

<div><br></div><div>len=0.1</div><div>scale=3</div><div><br></div><div> &#39;color -10 10 -kind green-&gt;white-&gt;orangered&#39;</div><div> &#39;d utot&#39;ip</div><div><br></div><div>*&#39;set gxout vector&#39;</div><div>

*&#39;set arrscl &#39;len&#39; &#39;scale</div><div>*&#39;set arrlab off&#39;</div><div>*&#39;set arrowhead -0.2&#39;</div><div>*&#39;d skip(utot&#39;ip&#39;,6);skip(vtot&#39;ip&#39;,6)&#39;</div></div><div><div> &#39;set gxout stream&#39;</div>

<div>&#39;set cthick 1&#39; ; &#39;set ccolor 1&#39;</div><div> &#39;set strmden 1&#39;</div><div> &#39;d utot&#39;ip&#39;;vtot&#39;ip</div><div><br></div><div>&#39;set string 1 c 5&#39;</div><div>&#39;set strsiz 0.1 0.1&#39;</div>

<div>&#39;draw string 1.5 8.1 (1) Oct-Dec 30mb&#39;</div><div>&#39;draw string 1.5 7.9 Wind Anomaly&#39;</div><div>&#39;draw string 1.5 7.7 QBO Positive Phase&#39;</div><div><br></div><div>&#39;set string 1 c 5&#39;</div>

<div>&#39;set strsiz 0.1 0.1&#39;</div><div>&#39;draw string 4.2 8.1 (2) Oct-Dec 30mb&#39;</div><div>&#39;draw string 4.2 7.9 Wind Anomaly&#39;</div><div>&#39;draw string 4.2 7.7 QBO Decreasing Phase&#39;</div><div><br></div>

<div>&#39;set string 1 c 5&#39;</div><div>&#39;set strsiz 0.1 0.1&#39;</div><div>&#39;draw string 6.9 8.1 (3) Oct-Dec 30mb&#39;</div><div>&#39;draw string 6.9 7.9 Wind Anomaly&#39;</div><div>&#39;draw string 6.9 7.7 QBO Negative Phase&#39;</div>

<div><br></div><div>&#39;set string 1 c 5&#39;</div><div>&#39;set strsiz 0.1 0.1&#39;</div><div>&#39;draw string 9.6 8.1 (4) Oct-Dec 30mb&#39;</div><div>&#39;draw string 9.6 7.9 Wind Anomaly&#39;</div><div>&#39;draw string 9.6 7.7 QBO Increasing Phase&#39;</div>

<div><br></div><div>&#39;set string 1 c 5&#39;</div><div>&#39;set strsiz 0.1 0.1&#39;</div><div>&#39;draw string 1.5 4.7 (1) Oct-Dec 200mb&#39;</div><div>&#39;draw string 1.5 4.5 Wind Anomaly&#39;</div><div>&#39;draw string 1.5 4.3 QBO Positive Phase&#39;</div>

</div><div><br></div><div><div>&#39;set string 1 c 5&#39;</div><div>&#39;set strsiz 0.1 0.1&#39;</div><div>&#39;draw string 4.2 4.7 (2) Oct-Dec 200mb&#39;</div><div>&#39;draw string 4.2 4.5 Wind Anomaly&#39;</div><div>&#39;draw string 4.2 4.3 QBO Decreasing Phase&#39;</div>

<div><br></div><div>&#39;set string 1 c 5&#39;</div><div>&#39;set strsiz 0.1 0.1&#39;</div><div>&#39;draw string 6.9 4.7 (3) Oct-Dec 200mb&#39;</div><div>&#39;draw string 6.9 4.5 Wind Anomaly&#39;</div><div>&#39;draw string 6.9 4.3 QBO Negative Phase&#39;</div>

<div><br></div><div>&#39;set string 1 c 5&#39;</div><div>&#39;set strsiz 0.1 0.1&#39;</div><div>&#39;draw string 9.6 4.7 (4) Oct-Dec 200mb&#39;</div><div>&#39;draw string 9.6 4.5 Wind Anomaly&#39;</div><div>&#39;draw string 9.6 4.3 QBO Increasing Phase&#39;</div>

<div><br></div><div><br></div><div> xl=xr+0.4</div><div> ip=ip+1 ; endwhile</div><div><br></div><div> xl=0.4</div><div> yt=yb-2.0</div><div> lv=lv+1 ; endwhile</div><div><br></div><div><br></div></div></div>