[gradsusr] Help

China Satyanarayana csn003 at yahoo.com
Fri Apr 5 03:17:49 EDT 2013


Hello GrADS Users

I have a monthly dataset from 1948 to 2012.

I would like to calculate the trend(Slope)year wise.

The code that I have is given below, 
        'reinit'
        'sdfopen uwnd.mon.mean.nc'
        'set xlint 4'
        'set ylint 4'
        'set grads off'
        'set grid on'        
        'set csmooth on'
        'set lat 0 40'
'set lev 850'
'set lon 40 120'
'define yvar = ave(uwnd,t=1,t=264)'
'xvar = uwnd*0 + 1'
'xvar = const(xvar,1,-uwnd)'
'xvar = 265 - sum(xvar,t+0,t=264)'
'set t 1'
'define p = sum(xvar,t=1,t=264)'
'define q = sum(yvar,t=1,t=264)'
'define r = sum(xvar*yvar,t=1,t=264)'
'define s = sum(xvar*xvar,t=1,t=264)'
'define rn = ave(xvar*yvar,t=1,t=264)'
'define n = r/rn'
'define amp = (nr - p*q)/(ns - p*p)'
'define dd = (q - amp*p)/n'
'set gxout shaded'
'set cint 0.5'
'd amp'
'set gxout contour'
'set cint 0.5'
'd amp'
'run cbarn'
'draw title U-wind trend 850mb(1948-2069)'
'enable print uwndtrn85069.gmf'       
'print'

Regards
LC




More information about the gradsusr mailing list