<div dir="ltr">Hi,<div> So I'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'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's just a sample of what my text file looks like (I'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'm using to get the months highlighted:</div><div>
<br></div><div><div>'reinit'</div><div>'set display color white';'c'</div><div>'set grid off'</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='Nov.txt'</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<=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>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<=4)</span></div><div><span style="background-color:rgb(255,255,0)"> if(n<=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>'sdfopen /export1/Databank/NCEP_Month/pressure/<a href="http://uwnd.mon.mean.nc" target="_blank">uwnd.mon.mean.nc</a>'</div>
</div><div><div>
'sdfopen /export1/Databank/NCEP_Month/pressure/<a href="http://vwnd.mon.mean.nc" target="_blank">vwnd.mon.mean.nc</a>'</div><div><br></div><div> lv=1 ; while(lv<=2)</div><div>'set t 17 775'</div><div> if(lv=1); 'set lev 30' ;endif</div>
<div> if(lv=2); 'set lev 200' ;endif</div><div><br></div><div>'define pu1=ave(uwnd.1,t-3,t+3)'</div><div>'define pu2=ave(uwnd.1,t-16,t+16)'</div><div>'define pufilter=pu1-pu2'</div><div>'define pv1=ave(vwnd.2,t-3,t+3)'</div>
<div>'define pv2=ave(vwnd.2,t-16,t+16)'</div><div>'define pvfilter=pv1-pv2'</div><div><br></div><div><br></div><div> ip=1 ; while(ip<=4)</div><div><br></div><div>'define ucomp'ip'=const(pufilter,0)'</div>
<div>'define vcomp'ip'=const(pvfilter,0)'</div><div><br></div><div> n=1 ; while(n<=size.ip)</div><div><br></div><div> <span style="background-color:rgb(255,255,0)"> 'set time oct'year.ip.n *(this I change to suit the 3-month period I'm using, this one is Oct-Dec)</span></div>
<div><span style="background-color:rgb(255,255,0)"> 'ucomp'ip'=ucomp'ip'+ave(pufilter,t-0,t+2)/'size.ip</span></div>
<div><span style="background-color:rgb(255,255,0)"> 'vcomp'ip'=vcomp'ip'+ave(pvfilter,t-0,t+2)/'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>*'set gxout shaded'</div>
<div>'set gxout vector'</div><div>'umean=(ucomp1+ucomp2+ucomp3+ucomp4)/4'</div><div>'vmean=(vcomp1+vcomp2+vcomp3+vcomp4)/4'</div><div><br></div><div> ip=1 ; while(ip<=4)</div></div><div><div>'define utot'ip'= ucomp'ip' - umean'</div>
<div>'define vtot'ip'= vcomp'ip' - vmean'</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<=4)</div><div>
<br>
</div><div> xr=xl+dx</div><div> yb=yt-dy</div><div>'set parea 'xl' 'xr' 'yb' 'yt</div><div>'set lat -90 90'</div><div>'set lon 0 360'</div><div>'set lev 30'</div><div>
<br></div><div>'set mproj scaled'</div><div>'set ccolor 1'</div><div>'set map 11'</div><div>'set annot 1 2'</div><div>'set xlopts 15 1 0.08'</div><div>'set ylopts 15 1 0.08'</div>
<div><br></div><div>len=0.1</div><div>scale=3</div><div><br></div><div> 'color -10 10 -kind green->white->orangered'</div><div> 'd utot'ip</div><div><br></div><div>*'set gxout vector'</div><div>
*'set arrscl 'len' 'scale</div><div>*'set arrlab off'</div><div>*'set arrowhead -0.2'</div><div>*'d skip(utot'ip',6);skip(vtot'ip',6)'</div></div><div><div> 'set gxout stream'</div>
<div>'set cthick 1' ; 'set ccolor 1'</div><div> 'set strmden 1'</div><div> 'd utot'ip';vtot'ip</div><div><br></div><div>'set string 1 c 5'</div><div>'set strsiz 0.1 0.1'</div>
<div>'draw string 1.5 8.1 (1) Oct-Dec 30mb'</div><div>'draw string 1.5 7.9 Wind Anomaly'</div><div>'draw string 1.5 7.7 QBO Positive Phase'</div><div><br></div><div>'set string 1 c 5'</div>
<div>'set strsiz 0.1 0.1'</div><div>'draw string 4.2 8.1 (2) Oct-Dec 30mb'</div><div>'draw string 4.2 7.9 Wind Anomaly'</div><div>'draw string 4.2 7.7 QBO Decreasing Phase'</div><div><br></div>
<div>'set string 1 c 5'</div><div>'set strsiz 0.1 0.1'</div><div>'draw string 6.9 8.1 (3) Oct-Dec 30mb'</div><div>'draw string 6.9 7.9 Wind Anomaly'</div><div>'draw string 6.9 7.7 QBO Negative Phase'</div>
<div><br></div><div>'set string 1 c 5'</div><div>'set strsiz 0.1 0.1'</div><div>'draw string 9.6 8.1 (4) Oct-Dec 30mb'</div><div>'draw string 9.6 7.9 Wind Anomaly'</div><div>'draw string 9.6 7.7 QBO Increasing Phase'</div>
<div><br></div><div>'set string 1 c 5'</div><div>'set strsiz 0.1 0.1'</div><div>'draw string 1.5 4.7 (1) Oct-Dec 200mb'</div><div>'draw string 1.5 4.5 Wind Anomaly'</div><div>'draw string 1.5 4.3 QBO Positive Phase'</div>
</div><div><br></div><div><div>'set string 1 c 5'</div><div>'set strsiz 0.1 0.1'</div><div>'draw string 4.2 4.7 (2) Oct-Dec 200mb'</div><div>'draw string 4.2 4.5 Wind Anomaly'</div><div>'draw string 4.2 4.3 QBO Decreasing Phase'</div>
<div><br></div><div>'set string 1 c 5'</div><div>'set strsiz 0.1 0.1'</div><div>'draw string 6.9 4.7 (3) Oct-Dec 200mb'</div><div>'draw string 6.9 4.5 Wind Anomaly'</div><div>'draw string 6.9 4.3 QBO Negative Phase'</div>
<div><br></div><div>'set string 1 c 5'</div><div>'set strsiz 0.1 0.1'</div><div>'draw string 9.6 4.7 (4) Oct-Dec 200mb'</div><div>'draw string 9.6 4.5 Wind Anomaly'</div><div>'draw string 9.6 4.3 QBO Increasing Phase'</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>