[Thread Prev][Thread Next][Index]

Re: [ferret_users] @sum bug ?



Hi,

I can confirm this with your and also with independent data (see below
for details). The conclusion is:

(1) Only FERRET v6.401 (and older versions) with xsequence() gives the
correct result (I checked  it with NCL's sum()).

(2) FERRET v6.401 without xsequence(), i.e. TAS[i=@sum,j=@sum], gives a
wrong result.

(3) FERRET v6.6 and v6.62 give wrong results that are slightly different
than the wrong result of (2). These results are independent of using
xsequence() or not.


One thing that I noticed is that the compiler changed from g77 to
gfortran between v6.401 and v6.6, but I don't know if that is of
importance in this case.

In any case this looks rather scary...

Marco


-----------------------------------------------------

FERRET v6.401
Linux(g77) 2.4.21-57.ELsmp - 12/09/09

list/p=10 tas[i=@sum,j=@sum] ; \
let a=xsequence(tas) ; \
list/p=10 a[i=@sum]
          2526427.250
          2526434.500

list/p=20 s[i=@sum,j=@sum,l=1,k=1] ; \
let a = xsequence(s[l=1,k=1]) ; \
list/p=20 a[i=@sum]
          283937.1875000000
          283936.0937500000

-----------------------------------------------------

FERRET v6.6
Linux rh5 (gfortran) 2.6.18-164.11.1.el5 - 04/06/10

list/p=10 tas[i=@sum,j=@sum] ; \
let a=xsequence(tas) ; \
list/p=10 a[i=@sum]
          2526427.750
          2526427.750

list/p=20 s[i=@sum,j=@sum,l=1,k=1] ; \
let a = xsequence(s[l=1,k=1]) ; \
list/p=20 a[i=@sum]
          283937.2500000000
          283937.2500000000

-----------------------------------------------------

FERRET v6.62
Linux rh5 (gfortran) 2.6.18-164.11.1.el5 - 06/11/10

list/p=10 tas[i=@sum,j=@sum] ; \
let a=xsequence(tas) ; \
list/p=10 a[i=@sum]
          2526427.750
          2526427.750

list/p=20 s[i=@sum,j=@sum,l=1,k=1] ; \
let a = xsequence(s[l=1,k=1]) ; \
list/p=20 a[i=@sum]
          283937.2500000000
          283937.2500000000

----------------------------------------------------

NCAR Command Language Version 5.2.0

ncl 10> print(sprintf("%.8f",sum(f1->TAS)))
(0)	2526434.50000000

ncl 11> print(sprintf("%.8f",sum(f2->S(0,0,:,:))))
(0)	283936.09375000

----------------------------------------------------


Brockmann Patrick wrote:
> Hi all,
> 
> I am just discovering that the @sum operator gives different results
> from 6.61 and next release 6.62, 6.64.
> I haven't any new about this serious bug in release notes.
> 
> My test are available from:
> http://dods.ipsl.jussieu.fr/brocksce/ferret_bugs/err661_sum.jnl
> http://dods.ipsl.jussieu.fr/brocksce/ferret_bugs/err661_sum_file.nc
> 
> And gives:
> ######################################"
> $ ferret -script err661_sum.jnl
> use err661_sum_file.nc
> list/p=10 tas[i=@sum,j=@sum]
>             VARIABLE : TAS
>             FILENAME : err661_sum_file.nc
>             X        : 0.5 to 96.5 (summed)
>             Y        : 0.5 to 96.5 (summed)
>          2526427.750
> let a=xsequence(tas)
> list/p=10 a[i=@sum]
>             VARIABLE : XSEQUENCE(TAS)
>             FILENAME : err661_sum_file.nc
>             X        : 0.5 to 9216.5 (summed)
>          2526427.750
> 
> And with 6.62 and 6.64
> ######################################"
> use err661_sum_file.nc
> list/p=10 tas[i=@sum,j=@sum]
>             VARIABLE : TAS
>             FILENAME : err661_sum_file.nc
>             X        : 0.5 to 96.5 (summed)
>             Y        : 0.5 to 96.5 (summed)
>          2526427.250
> let a=xsequence(tas)
> list/p=10 a[i=@sum]
>             VARIABLE : XSEQUENCE(TAS)
>             FILENAME : err661_sum_file.nc
>             X        : 0.5 to 9216.5 (summed)
>          2526434.500
> 
> ######################################"
> From python/netCDF4/numpy
> I know that the sum is really 2526434.500
> 
> 
> Other question related: why tas[i=@sum,j=@sum]
> and xsequence then i=@sum gives different results.
> Both should give 2526434.500
> 
> Hope it a bad dream...
> Let me know if you can confirm this.
> 
> Patrick


-- 
***************************************
Marco Steinacher

Climate and Environmental Physics
Physics Institute, University of Bern
Sidlerstrasse 5, CH-3012 Bern

Phone ++41 (0)31 631 34 02
Fax   ++41 (0)31 631 87 42
steinacher@xxxxxxxxxxxxxxxx
http://www.climate.unibe.ch/~steinach
OpenPGP Key ID: 0x62937F7F
***************************************


[Thread Prev][Thread Next][Index]

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

Privacy Policy | Disclaimer | Accessibility Statement