# [ncl-talk] Precipitation annual cycle

Dinuka Silva dinu.kera at gmail.com
Mon Feb 12 22:15:22 MST 2018

```Hello,

I am trying to plot annual cycle of precipitation. I could plot it but I
have space after December. how can I remove that space?

begin
;----------------------------------------------------------------------
f    =  "mon.precip.nc"

time = f1->time
ymd = cd_calendar(time,2)
iTime = ind (ymd.ge.19790101.and.ymd.lt.20130101)
precip = f1->precip (iTime,{0:-12},{90:130})

Avg = dim_avg_Wrap(dim_avg_Wrap( precip(time|:,lat|:,lon|:)))
index = abs(Avg)
index!0 = "time"
index&time = Avg&time
;------------------------------------------------------------
T = index&time
YMD = cd_calendar(T,0)
imont = tointeger(YMD(:,1))
;-----------------------------------------------------------------------
k= new((/12/),float)
do mo = 0,11
mo1=mo+1
Nmont = ind(imont.eq.mo1)
k(mo) = dim_avg_Wrap(index(time|Nmont))
end do
;printVarSummary(k)
;---------------------------------------------------------------------
x = new((/12/),float)
x = (/00.,01.,02.,03.,04.,05.,06.,07.,08.,09.,10.,11./)
;--------------------------------------------------------------
res2                        = True
res2 at tiMainString           = "Monthly precipitation"
res2 at tiXAxisString          = "months"
res2 at tiYAxisString          = "precipitation (mm/month)"
res2 at xyLineColors           =  "blue"
res2 at xyLineThicknessF       =  5.0
res2 at tmXBMode               = "Explicit"
res2 at tmXBValues             = x
res2 at tmXBLabels    = (/"J","F","M","A","M","J","J","A","S","O","N","D"/)
;---------------------------------------------------------------------
wks = gsn_open_wks("x11","")
plot = gsn_xy(wks,x,k,res2)
end

[image: Inline image 1]

Thank you.

Sincerly,
Dinuka

Virus-free.
www.avast.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180213/a5dfb139/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 29652 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180213/a5dfb139/attachment.png>
```