[ncl-talk] Sub: Area average of a specific US state
Adv
advita6 at gmail.com
Thu Dec 1 13:49:13 MST 2016
Hi ,
Could someone help me to compute area average of specific US state. ?
Thank you
Adv
ymStrt = 196501
ymLast = 200512
fili = "air.mon.mean.nc"
f = addfile(diri+fili,"r")
YYYYMM = cd_calendar( f->time, -1)
iStrt = ind(YYYYMM.eq.ymStrt)
iLast = ind(YYYYMM.eq.ymLast)
xt = f->air(:,::-1,:)
printVarSummary(xt) ; [time| 720]x[lat|
91]x[lon| 180]
; Minnesota., Montana......
x = xt(iStrt:iLast,{40:49},{104:97})
x1 = xt(iStrt:iLast,{45:49},{116:104})
x2 = xt(iStrt:iLast,{43.5:49},{97:93})
x3 = xt(iStrt:iLast,{43.5:49},{97.5:90})
delete(xt)
printVarSummary(x) ; [time| 720]x[lat|
91]x[lon| 180]
;************************************************
; Calculate the Annual Mean (slopes)
;************************************************
rc= dim_avg_n(x,(/1,2/))
rc1= dim_avg_n(x1,(/1,2/))
rc2= dim_avg_n(x2,(/1,2/))
rc3= dim_avg_n(x3,(/1,2/))
printVarSummary(rc)
t=(rc+rc1+rc2+rc3)/4
print(t)
return
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161201/529652c4/attachment.html
More information about the ncl-talk
mailing list