;;---------------------------------------------------------------------------------------
CDD=new((/nyr,dimsizes(pre&lat),dimsizes(pre&lon)/),"float",-9999.0)
CDD=0.
n = new((/nyr,dimsizes(pre&lat),dimsizes(pre&lon)/),"float",-9999.0)
n = 0.
count = new((/nyr,dimsizes(pre&lat),dimsizes(pre&lon)/),"float",-9999.0)
count = 0.
do i=0,nlat-1
do j=0,nlon-1
do t = 0, nyr-1
do d = 0, 90
if (.not.ismissing(npre(t,d,i,j)).and.npre(t,d,i,j).lt.1) then
n(t,i,j) = n(t,i,j)+1
else
count(t,i,j) = n(t,i,j)
n(t,i,j) = 0
end if
end do
CDD(t,i,j)=max(count(:,i,j))
end do
end do
end do