[ncl-talk] How can I get the daily precipitation data in dry and in wet periods?
Dennis Shea
shea at ucar.edu
Wed Jul 25 16:01:01 MDT 2018
year_dry =....
year_wet =
day_year = ..... ;* year value for each day*
iyr = ind(
idry = *get1Dindex*(day_year,year_dry)
iwet = *get1Dindex*(day_year,year_wet)
pwet = prcDay(iwet,:,:)
pdry = prcDay(idry,:,:)
On Wed, Jul 25, 2018 at 8:42 AM, Beáta Szabó-Takács <szabo.b at czechglobe.cz>
wrote:
> 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
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180725/33c8f426/attachment.html>
More information about the ncl-talk
mailing list