[Thread Prev][Thread Next][Index]

FERRET : Re: modulo regridding



Hi Francois & Ansley,
                        This is more or less as a reply to the first mail
from Francois. Few points I want to stress...

   1. you don't have to get the variable on a time axis defined over
          mid-month dates "just for the sake of finding climatology".
          You can safely find the climatology with the data defined on
          1-st of every month. Suppose you want to get the climatology
          on mid-month dates...then there is a neat way to get it..please
          see the example below.

   2. If you know how to define a time axis, then there is no need
          to use the climatological_axes dataset and "month_reg"
          ...instead you can define a climatological time axis suitable
          for your dataset.

   3. Suppose you have monthly data for two years. If what you mean by
          a climatology for JAN is (JAN_year1 + JAN_year2)/2 then i think
          the best way is using "abstract" time axis instead of the
          default calendar axis.


 Have a look at the example below...

 Hope This helps

 With Regards

 Jaison

!------------------example.jnl-----------------------
\ cancel mode verify
!
!  let us create a dummy variable defined on 1-st of every month from
!      JAN-1991 to DEC-1992

    let tdat = TSEQUENCE({1,32,60,91,121,152,182,213,244,274,305,335,366,\
               397,426,457,487,518,548,579,610,640,671,701})
    define axis/t/units=days/t0=31-DEC-1990 tmon=tdat
    let var = sin(t[gt=tmon]/50)

! Now if you want the climatology as JAN_CLIM = ( JAN_1991 + JAN_1992 ) /2
!   Then the easy way (atleast for me !!!) is to
!
!      1. regrid the data to an "abstract" time axis (with same LSIZE)
!      2. define a modulo abstract climatological axis with 12 points
!      3. do modulo regridding to above axis to find the climatology
!      4. define proper calendar climatological time axis
!      5. assign above calendar time axis to the climatology

   let l_size = `var,r=lend`                    ! step 1
   define axis/t=1:`l_size`:1   tabs            !   "
   let var_abs      = var[gt=tabs@ASN]          !   "

   define axis/t=1:12:1/MODULO  tabs_clim       ! step 2
   let var_abs_clim = var_abs[gt=tabs_clim@MOD] ! step 3

   !  the /modulo present below doesnot have any impact on calculation
   define axis/t/units=days/T0=31-DEC-0000/MODULO tclim=tdat[l=1:12] ! step 4

   let var_clim = var_abs_clim[gt=tclim@ASN]    ! step 5

! do a cross-check

   list var_clim
   list/nohead (var[l=1]+var[l=13])/2
   list/nohead (var[l=2]+var[l=14])/2
   list/nohead (var[l=3]+var[l=15])/2

! now the climatology is on 1-st of all month..suppose you want to
!    get it on mid-month dates..then we need a 13th point as 01-JAN
!    (of next year) for interpolation since the last point now is
!    01-DEC....

   define axis/t/units=days/T0=31-DEC-0000 t13=tdat[l=1:13]
   let var_dummy  = var_clim[gt=t13@ASN]
   let var_dummy1 = IF L[GT=var_dummy] EQ 13 THEN var_dummy[l=1] ELSE var_dummy
   list var_dummy1

   define axis/t=15-JAN-0001:15-DEC-0001:`365.2425/12`/units=days/\
          T0=31-DEC-0000/MODULO tclim_mid ! the /modulo here doesnot have
                                          ! any impact on calculation
   let var_clim_mid = var_dummy1[gt=tclim_mid]

   plot var_clim_mid, var_clim

! -------------end of example.jnl---------------------------


On Mon, 13 Jun 2005, Ansley Manke wrote:

Hi Francois,
I don't see right now what is happening, but I think we need to use a different idea anyway. Your data is monthly data at the first of each month. It would be much better to define your own modulo time axis with the coordinates also at the start of each month and create your climatology at the start of each month.

yes? define axis/modulo/t=1-jan-0001:1-dec-0001:`365.2425/12`/units=days m1_reg
yes? let divclim1=div[gt=m1_reg@mod]



DELCLAUX Francois wrote:

Hi Ansley,
Now I understand why the demo described in User Guide is OK.
Unfortunately, I don't understand why it's not the case for my data.
Here below is the copy of the ferret output
Including a time range for the variable beeing regridded with month_reg@lin
does not change results: this variable is not defined in a correct way.
If you have some idea ...
Thanks.
Francois Delclaux



umhyd_delclaux% ferret
NOAA/PMEL TMAP
FERRET v5.40 Linux 2.4.3-12smp - 02/19/02
13-Jun-05 14:11 yes? use atm_era40.nc
yes? sh d/v
currently SET data sets:
1> ./atm_era40.nc (default)
name title I J K L
PV Potential vorticity 1:144 1:73 1:2 1:540
K m**2 kg**-1 s**-1 on grid GNL1 with -0.0001321826 & -32767 for mi
ssing data
X=1.2W(-1.2):1.2W Y=91.2S:91.2N Z=-125:1375 GEO Geopotential 1:144 1:73 1:2 1:540
m**2 s**-2 on grid GNL1 with -3089.586 & -32767 for missing data
X=1.2W(-1.2):1.2W Y=91.2S:91.2N Z=-125:1375 TEMP Temperature 1:144 1:73 1:2 1:540
K on grid GNL1 with 196.2303 & -32767 for missing data
X=1.2W(-1.2):1.2W Y=91.2S:91.2N Z=-125:1375 U U velocity 1:144 1:73 1:2 1:540
m s**-1 on grid GNL1 with -23.0944 & -32767 for missing data
X=1.2W(-1.2):1.2W Y=91.2S:91.2N Z=-125:1375 V V velocity 1:144 1:73 1:2 1:540
m s**-1 on grid GNL1 with -31.70974 & -32767 for missing data
X=1.2W(-1.2):1.2W Y=91.2S:91.2N Z=-125:1375 Q Specific humidity 1:144 1:73 1:2 1:540
kg kg**-1 on grid GNL1 with 6.80608E-07 & -32767 for missing data
X=1.2W(-1.2):1.2W Y=91.2S:91.2N Z=-125:1375 W Vertical velocity 1:144 1:73 1:2 1:540
Pa s**-1 on grid GNL1 with -0.7332675 & -32767 for missing data
X=1.2W(-1.2):1.2W Y=91.2S:91.2N Z=-125:1375 VO Vorticity (relative) 1:144 1:73 1:2 1:540
s**-1 on grid GNL1 with -0.00008048117 & -32767 for missing data
X=1.2W(-1.2):1.2W Y=91.2S:91.2N Z=-125:1375 D Divergence 1:144 1:73 1:2 1:540
s**-1 on grid GNL1 with -0.00004415594 & -32767 for missing data
X=1.2W(-1.2):1.2W Y=91.2S:91.2N Z=-125:1375 R Relative humidity 1:144 1:73 1:2 1:540
% on grid GNL1 with -4.914274 & -32767 for missing data
X=1.2W(-1.2):1.2W Y=91.2S:91.2N Z=-125:1375 O3 Ozone mass mixing ratio 1:144 1:73 1:2 1:540
kg kg**-1 on grid GNL1 with 9.47E-10 & -32767 for missing data
X=1.2W(-1.2):1.2W Y=91.2S:91.2N Z=-125:1375 time range: 01-SEP-1957 12:00 to 01-AUG-2002 12:00
yes? use climatological_axes
*** NOTE: regarding /home/delclaux/ferret/climatological_axes.cdf ...
*** NOTE: Climatological axes SEASONAL_REG, MONTH_REG, and MONTH_IRREG defined

! defining a new variable div at one point (x,y,z)
yes? let div=10e06*d[d=1,k=1,i=10,j=10]

! listing div variable for a 3 year period
yes? list/t="01-jan-1960":"1-dec-1962" div
VARIABLE : 10E06*D[D=atm_era40.nc,K=1,I=10,J=10]
SUBSET : 36 points (TIME)
LONGITUDE: 22.5E
LATITUDE : 67.5S
HEIGHT (millibars): 250
22.5E
10
01-JAN-1960 12 / 29: -0.15
01-FEB-1960 12 / 30: 11.22
01-MAR-1960 12 / 31: 0.16
01-APR-1960 12 / 32: 4.11
01-MAY-1960 12 / 33: 0.63
01-JUN-1960 12 / 34: -10.50
01-JUL-1960 12 / 35: 11.68
01-AUG-1960 12 / 36: 5.09
01-SEP-1960 12 / 37: -2.97
01-OCT-1960 12 / 38: -11.34
01-NOV-1960 12 / 39: -4.70
01-DEC-1960 12 / 40: -0.14
01-JAN-1961 12 / 41: -1.19
01-FEB-1961 12 / 42: -6.27
01-MAR-1961 12 / 43: 17.33
01-APR-1961 12 / 44: -2.21
01-MAY-1961 12 / 45: -6.09
01-JUN-1961 12 / 46: -1.26
01-JUL-1961 12 / 47: 23.96
01-AUG-1961 12 / 48: -17.12
01-SEP-1961 12 / 49: -2.58
01-OCT-1961 12 / 50: 12.22
01-NOV-1961 12 / 51: -5.44
01-DEC-1961 12 / 52: 2.17
01-JAN-1962 12 / 53: -3.58
01-FEB-1962 12 / 54: -8.62
01-MAR-1962 12 / 55: -3.75
01-APR-1962 12 / 56: -2.16
01-MAY-1962 12 / 57: -13.72
01-JUN-1962 12 / 58: -15.80
01-JUL-1962 12 / 59: -3.27
01-AUG-1962 12 / 60: -14.88
01-SEP-1962 12 / 61: -0.61
01-OCT-1962 12 / 62: -3.05
01-NOV-1962 12 / 63: -1.09
01-DEC-1962 12 / 64: -8.30

! defining a regridded variable divc by interpolation on month_reg axis
yes? let divc=div[gt=month_reg, t="01-SEP-1957":"01-AUG-2002"]

! listing divc variable
yes? list/t="01-jan-1960":"1-dec-1962" divc
VARIABLE : DIV[GT=MONTH_REG, T="01-SEP-1957":"01-AUG-2002"]
SUBSET : 36 points (TIME)
LONGITUDE: 22.5E
LATITUDE : 67.5S
HEIGHT (millibars): 250
23E
10
17-DEC-1959 / 23520:....
16-JAN-1960 / 23521:....
15-FEB-1960 / 23522:....
17-MAR-1960 / 23523:....
16-APR-1960 / 23524:....
17-MAY-1960 / 23525:....
16-JUN-1960 / 23526:....
17-JUL-1960 / 23527:....
16-AUG-1960 / 23528:....
16-SEP-1960 / 23529:....
16-OCT-1960 / 23530:....
15-NOV-1960 / 23531:....
16-DEC-1960 / 23532:....
15-JAN-1961 / 23533:....
15-FEB-1961 / 23534:....
17-MAR-1961 / 23535:....
17-APR-1961 / 23536:....
17-MAY-1961 / 23537:....
16-JUN-1961 / 23538:....
17-JUL-1961 / 23539:....
16-AUG-1961 / 23540:....
16-SEP-1961 / 23541:....
16-OCT-1961 / 23542:....
16-NOV-1961 / 23543:....
16-DEC-1961 / 23544:....
16-JAN-1962 / 23545:....
15-FEB-1962 / 23546:....
17-MAR-1962 / 23547:....
17-APR-1962 / 23548:....
17-MAY-1962 / 23549:....
17-JUN-1962 / 23550:....
17-JUL-1962 / 23551:....
17-AUG-1962 / 23552:....
16-SEP-1962 / 23553:....
16-OCT-1962 / 23554:....
16-NOV-1962 / 23555:....



Ansley Manke a écrit:

Hi Francois,
When you define the variables for centering, give the variable definitions a time range. When using linear regridding instead of modulo regridding, Ferret tries to regrid to the time range of the modulo axis, which is 16-jan-0000 to 16-dec-0000 (do "show axis month_reg" to see this). Since your time data in the range 1957 to 2002 doesn't overlap with the year 0000, there is no result. To regrid a time series variable to a modulo axis and have it apply to the time range of the variable,

let divc = div[gt=month_reg,t="01-SEP-1957 12:00":"01-AUG-2002 12:00"]

Modulo time axes are defined to have a time in year 0000 or 0001 for convenience, but this is a case where this choice causes some confusion. I believe this will solve your problem.

Ansley





--
___________________________________________________

    Jaison Kurian
    Centre for Atmospheric and Oceanic Sciences
    Indian Institute of Science
    B A N G A L O R E   560 012
    Ph: +91-80-22932505 Extn. 229
        +91-80-23600450
    Fax:+91-80-23600865
___________________________________________________

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement