[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
Thu Jul 26 23:35:18 MDT 2018


Hi Dennis,
Thank you very much for your help! I tested get1Dindex_repeat function with daily data and it works fine.
Have a nice day,
Beata

From: Dennis Shea [mailto:shea at ucar.edu]
Sent: Thursday, July 26, 2018 3:41 PM
To: Beáta Szabó-Takács <szabo.b at czechglobe.cz>
Subject: Re: [ncl-talk] How can I get the daily precipitation data in dry and in wet periods?

Hi Beata
Can you please post back to ncl-talk?

===
I did a test using monthly data.
I modified get1Dindex to return repeated values:  get1Dindex_repeat
See attached
%> ncl Beata.ncl

D

On Thu, Jul 26, 2018 at 4:23 AM, Beáta Szabó-Takács <szabo.b at czechglobe.cz<mailto:szabo.b at czechglobe.cz>> wrote:
Dear Dennis,

Thank you for your help, but unfortunately get1Dindex does not help because it will find the first match and the return index is that of the first match. I also tried:

idry = ind(get1Dindex(day_year,year_dry))
but it caused the following warning message:
warning:Argument 0 of the current function or procedure was coerced to the appropriate type and thus will not change if the function or procedure modifies its value

and it caused same index values as get1Dindex function.
Could you please suggest me a way to repetate the year_dry values to have a same size as day_year? I mean that each year value in year_dry vector would be repetated 365 times.

Thank you for your help in advance!
Have a nice day,
Beata

From: Dennis Shea [mailto:shea at ucar.edu<mailto:shea at ucar.edu>]
Sent: Thursday, July 26, 2018 2:52 AM
To: Beáta Szabó-Takács <szabo.b at czechglobe.cz<mailto:szabo.b at czechglobe.cz>>
Subject: Re: [ncl-talk] How can I get the daily precipitation data in dry and in wet periods?

Forgot:

http://www.ncl.ucar.edu/Document/Functions/Contributed/get1Dindex.shtml

On Wed, Jul 25, 2018 at 6:01 PM, Dennis Shea <shea at ucar.edu<mailto:shea at ucar.edu>> wrote:
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<mailto: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<mailto: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/20180727/f609fbfb/attachment.html>


More information about the ncl-talk mailing list