I have a 3D nc variable PP = (time, lat, lon) of accumulated precipitation for an entire year and I want to calculate daily values.
I want to do something link in the example, but couldn't find any examples.
I've tried to do a loop in which the subtraction should be between the values with [index+1] minus value [index] (like below)
t = f->time(:) ;size = 365
pp = f->TOTALRAIN(:,:,:) ; time, lat, lon dimensions
do i = 0,dimsizes(t)-1
DailyPp = pp(i,:,:) - pp(i-1,:,:)
end do
but that way produces an error.
I need the daily values and only have accumulated precipitation as input information, and thought that a loop like that should be the best way.
How can I do the calculation from the variable???
I'm working with ncl
but if you have cdo
or nco
propositions they're welcome.