[Thread Prev][Thread Next][Index]

Re: [ferret_users] monthly_average_runoff



Hi Yadu,
          With Ferret, it is very easy to compute different climatologies,
and it is well documented/discussed. Please have a look at the following :

 FAQ : http://ferret.pmel.noaa.gov/Ferret/faq/ferret-faqs#analysis
        (you can find different entries here, related to climatology and
        averages, with a complete description and full-length examples)
           
 User Manual : Ch4 Sec2.5.  Modulo regridding 

 Ferret Archives : http://ferret.pmel.noaa.gov/Ferret/email-users-group 
                   (use the search archives tool at this page to find 
                   previous postings with discuss about your topic of 
                   interest...for example "monthly climatology")

 Ok. To find monthly (or any other) climatology, Ferret uses the concept
of "Modulo Regridding". This method involves the usage of a new 
destination climatological time axis, with 12 number of time points 
(representing 12-climatological months) and a "/MODULO" attribute. Then, 
the source data is regridded to this new time axis, using "@MOD" 
regridding. In this "@MOD" regridding, every 12th point is included in 
the average to find the climatological value for the respective month. 
This method will work equally well on calendar time axis and abstract 
L-axis (axis consists of time axis index values like 1,2,3.....etc, 
irrespective of the calendar time values). Let us see examples for both 
types, using monthly_navy_winds.cdf, available with Ferret.

Use exactly the same calendar type as the source data while defining the
destination climatological time axis, as shown below. The "year length" 
is also a matter of concern, when you extend the climatlogy to an 
interannual time axis (say for finding monthly anomalies).

The @ASN tranformation just changes the time axis labels, and does not 
attempt any averaging or interpolation. For details, please see User 
Manual, Ch4 Sec2.4.1.  Regridding transformations.


    ! Monthly Climatology : Example
    !==============================

    set data monthly_navy_winds
    show data
    say `uwnd[d=1],r=calendar` 
    define symbol ctype = `uwnd[d=1],r=calendar`
    define axis/t="15-JAN-1900":"15-DEC-1900":`365.2425/12`/units=days\
         /calendar=($ctype)/T0="01-JAN-1900:00"/MODULO  tclim_mon

    ! Using Calendar time-axis
    !-------------------------

    let uwnd_clim = uwnd[d=1,gt=tclim_mon@MOD]
    plot/x=60/y=10 uwnd_clim
   
    ! Using Abstract time-axis 
    !-------------------------

    let L_size = `uwnd[d=1],r=lend` - `uwnd[d=1],r=lstart` + 1
    define axis/t=1:`l_size`:1 tabs
    let u_abs   =  uwnd[d=1,gt=tabs@ASN]
    define axis/t=1:12:1/MODULO tabs_clim
    let u_abs_clim = u_abs[gt=tabs_clim@MOD]

    let u_clim = u_abs_clim[gt=tclim_mon@ASN]

    plot/x=60/y=10/ov u_clim

The advantage with the abstract time axis method is that, it will 
deliver the "exact mean values" for each month. The calendar time axis
method may apply some weighting with respect to the length of each 
months, according to the set up of input data's time axis and 
destination climatological time axis.

   To find monthly anomalies, extend the climatology to the inter-
annual time axis, as follows 

    let u_anom = uwnd[d=1] - u_clim[gt=uwnd[d=1]]

Here, due to the presence of "MODULO" attribute with u_clim, the 
same climatological values will repeat for every year and will deliver
the monthly anomaly. 

To save any of this variables to a NetCDF file for future use, 

    set var/title="U clim"/units="m/s" u_clim
    save/file=u_clim.nc/append u_clim


Please let me know if you have any questions.

Regards,

Jaison

On Tue, 27 Nov 2007 11:45:52 +0900, yadu pokhrel wrote
> Dear ferret users,
> 
> I am a novice to ferret and I am stuck with a simple problem.
> 
> I am using ferret FERRET v5.81  on
>        Linux(g77) 2.4.21-32 - 07/13/05
> 
> What I want to do is to get monthly average values of the 100 years
> runoff data. My file has global gridded data with 1200 time steps 
> (100 year monthly data). To get average looks simple if I just 
> average over continuous time interval eg. t=1:12 or t=1:1200 or so 
> on. However, what I exactly want to do is to get average for every 
> month, so I need to average data for t=1,13,25,37,... at every 12 
> time step increment.
> 
> I would be really grateful if you could let me know some way out for 
> this.
> 
> Thanking you all a lot in advance.
> 
> Regards,
> YP
> 
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement