[ncl-talk] How can I get the daily precipitation data in dry and in wet periods?

Beáta Szabó-Takács szabo.b at czechglobe.cz
Wed Jul 25 06:42:51 MDT 2018


Dear NCL Users,
I created an ncl script (dr_wet.ncl) to calculate the dry and wet period based on spatial mean yearly precipitation sum data. I would like to get the daily precipitation data in dry and in wet period but I do not know how I should calculate it? I attached the script. I tried the following way but unfortunately it does not give correct values:

year_dry = tointeger(utc_date(0:((tim_dims/2)-1),0))                          ; years in dry period
year_wet = tointeger(utc_date((tim_dims/2):tim_dims-1,0))            ; years in wet_period

utc_date2 = cd_calendar(time,0)                                      ; time is daily time data
year2 = tointeger(utc_date2(:,0))                                     ; get the years from serial date of daily time data

do j=0,(tim_dims/2)-1
  do n=0,time_size-1                                                            ; time_size is the length of the daily time data

    if(year2(n).eq.year_dry(j)) then
     pr_dry=pr(n,:,:)                                                                ; pr is the daily precipitation values pr(time, lon, lat)
    else
     pr_wet=pr(n,:,:)
    end if

   end do
  end do

Can someone suggest me a correct solution.
Thank you for your help in advance!
Kind regards,
Beata
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180725/b142d3db/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dry_wet.ncl
Type: application/octet-stream
Size: 2159 bytes
Desc: dry_wet.ncl
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180725/b142d3db/attachment.obj>


More information about the ncl-talk mailing list