[Thread Prev][Thread Next][Index]

Re: [ferret_users] Why does ferret fail to support swapping integraland differential?



Hi Feng,
Thank you for sending a clear example.

This turns out to be because derivatives and integrals on fields in latitude and longitude are done in units of meters on the earth, rather than degrees latitude and longitude. The fact that degrees of longitude are not a constant length over the earth means that the computations are not linear. Try this case, where the numbers may be easier to interpret.

yes? use coads_climatology
yes? set reg/x=1:3/y=51:55/L=1

yes? let uu_ddb = uu[x=@ddb]
yes? let uu_ddb_iin = uu_ddb[y=@iin]
yes? let uu_iin = uu[y=@iin]
yes? let uu_iin_ddb = uu_iin[x=@ddb]

! Define a function with simple integer values

yes? let uu = x[gx=uwnd] + y[gy=uwnd]
yes? list uu

! Set the axes so they are NOT in units of degrees
! longitude and latitude.

yes? set axis/units=" " coadsx
yes? set axis/units=" " coadsy

! The results are as you would expect.

yes? list uu_ddb
yes? list uu_iin
yes? list uu_ddb_iin
yes? list uu_iin_ddb



FENG HE wrote:

Based on calculus, in a fixed domain, the integral and differential
could be swapped.
Basically, d/dx(Int{a:b}u(x,y) dy) = Int{a:b}(du(x,y)/dx) dy

But Ferret could not support it. Here is a code to do the test

First, an integral is performed in Y direction, and then a differential
in X direction. Second, an differential is performed in X direction, and then an
integral in y direction.
I expect the result is almost the same. But from the result, there are
big differences.
use coads_climatology
set region/x=340:350/y=40:50/l=1
let UWND_iin= UWND[y=@iin]
let UWND_iin_ddb = UWND_iin[x=@ddb]
let UWND_ddb = UWND[x=@ddb]
let UWND_ddb_iin = UWND_ddb[y=@iin]
list UWND_ddb_iin
VARIABLE : UWND_DDB[Y=@IIN]
FILENAME : coads_climatology.cdf
FILEPATH : /contrib/ferret-5.22//data/
SUBSET : 5 by 5 points (LONGITUDE-LATITUDE)
TIME : 16-JAN 06:00
19W 17W 15W 13W 11W 161 162 163 164 165
49N / 70: 0.231 -2.136 -0.327 -1.634 -2.852
47N / 69: -0.342 -1.077 -0.369 -1.615 -2.513
45N / 68: -0.641 -0.924 0.486 -2.642 -1.725
43N / 67: -0.236 -0.497 -0.051 -1.943 -1.921
41N / 66: -0.071 -0.255 0.198 -1.417 -1.029
list UWND_iin_ddb
VARIABLE : UWND_IIN[X=@DDB]
FILENAME : coads_climatology.cdf
FILEPATH : /contrib/ferret-5.22//data/
SUBSET : 5 by 5 points (LONGITUDE-LATITUDE)
TIME : 16-JAN 06:00
19W 17W 15W 13W 11W 161 162 163 164 165
49N / 70: 0.182 -2.242 -0.318 -1.921 -3.125
47N / 69: -0.376 -1.137 -0.346 -1.830 -2.680
45N / 68: -0.651 -0.950 0.491 -2.755 -1.825
43N / 67: -0.238 -0.505 -0.044 -1.988 -1.953
41N / 66: -0.071 -0.255 0.198 -1.417 -1.029
Best regards

Feng He Center for Climate Research
Atmospheric and Oceanic Sciences
University of Wisconsin - Madison


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement