[Thread Prev][Thread Next][Index]

Re: [ferret_users] regridding 360_day to yearly data (yearly maximum)



Hi Peter,
           Main point in that method is the precision of yearly time axis.
This axis should be defined such that, it have exact mid points of every year,
with respect to your daily time axis. Please see the example below. Also
there is a worry free method, which may be bit resource demanding.....

Please let me know if you have any questions

Thanks and Regards,

Jaison

!------Example begins here--------------------------
!
\ cancel mode verify
!
    ! create some synthetic data
    define axis/t="01-JAN-1961:00":"30-DEC-1963:00":1/units=days/\
                        T0="30-DEC-1960:00"/calendar=360_DAY tdaily

    let prec =  SIN(t[gt=tdaily]/60) + COS(t[gt=tdaily]/20)

    plot prec

    ! Method 1 : define yearly time axis with time points EXACTLY
    !            at the mid-year (equal length to "01-JAN-yyyy:00"
    !            and "30-DEC-yyyy:00"). This is the key point.....

    define axis/t="30-JUN-1961:12":"30-JUN-1963:12":360/units=days/\
                        T0="30-DEC-1960:00"/calendar=360_DAY tyearly

    let prec_max = prec[gt=tyearly@MAX]

    set list/precision=7

    list  prec_max[l=1] - prec[l=1:360@MAX]
    list  prec_max[l=2] - prec[l=361:720@MAX]
    list  prec_max[l=3] - prec[l=721:1080@MAX]

    ! Method 2 : RESHAPE the data to another grid such that,
    !     1-360 days is on one axis and years on another axis. You need
    !     to have one axis free for doing this, and the axis order also
    !     does matter. For an XYT data, Z-axis suits the best.
    !     (not advisible for large datasets, but no worries about
    !      precision of time axis definition)

    define axis/t=1961:1963:1    tyrs
    define axis/z=1:360:1        zdays

    let gstamp  = t[gt=tyrs]*0 + z[gz=zdays]*0  ! add XY dimension if exists
    let prec_z  = RESHAPE(prec, gstamp)
    let prec_mx = prec_z[k=@MAX]

    list prec_mx[l=1] - prec[l=1:360@MAX]
    list prec_mx[l=2] - prec[l=361:720@MAX]
    list prec_mx[l=3] - prec[l=721:1080@MAX]

!------Example ends here----------------------------

> Dear Ferret Users,
> I want time-series of yearly maximum precipitation on a day. To achieve this
> for every year i should have my data on a yearly grid in time. I have netcdf
> file for 30 years with calendar of 360_days.
>
> define axis/t="1-JAN-1961":"1-JAN-1990"/np=30/calendar=360_day yearly
> let precip30=precip20[gt=yearly@max]
>
> "precip20" is the original variable and "precip30" consists of 30 time. I
> wanted to supervise this with the below command:
>
> fill precip20[l=1:360@max]-precip30[l=1]
>
> I counted the maximum 1-day precipitation for the first year in different
> way. They should be the same, and this subtraction exactly zero.
> Unfortunately, it is not zero.
>
> Does someone know what mistake did i make?
>
> Thanks,
> Peter Szabo
>



[Thread Prev][Thread Next][Index]

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

Privacy Policy | Disclaimer | Accessibility Statement