Re: wrong results somehow related to addfiles

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Fri, 19 Jun 2009 15:39:45 -0600

Fixed: 5.1.1

===============
http://www.ncl.ucar.edu/new_release.shtml

================
CGD has not updated to the new NCL.

Add the following to your .aliases [.tcshrc] ... whatever

alias testncl 'source /contrib/bin/testncl.csh'
alias origncl 'source /contrib/bin/origncl.csh'

===
source the file

%> testncl

You are now using the test version of NCL: 5.1.1

Keith Lindsay wrote:
> Hi,
>
> I have discovered that an NCL script of mine is silently generating
> incorrect results. I've managed to boil it down to a fairly simple
> script and pair of netCDF files, which are attached.
>
> The incorrect results are with 5.1.0 on Linux and AIX. It's rather scary
> because there is no hint that things are going wrong.
>
> The script contents are:
>
> begin
> fnames = (/ "file01.nc", "file02.nc" /)
> fp = addfiles(fnames, "r")
> days = fp[:]->days
> print(days)
> days = days / sum(days)
> print(days)
> end
>
> The value printed with the first print are correct: 31 and 28. So it
> looks like the values are being read in correctly.
>
> However, after dividing the variable days by the sum of days, both
> values printed in the second print statement are identical. I get
> 0.5254237288135594 twice, instead of 0.5254237288135594 and
> 0.4745762711864407. Somehow the statement "days = days / sum(days)" is
> setting both values on the left hand side to the first value of the
> right hand side. When I experiment and add more files, the pattern is
> that the all values on the left hand sides are set to the first value of
> the right hand side.
>
> Additional info is that if there are 2 files with 2 timelevels each, the
> results of the division are correct, while if there are 4 files with 1
> timelevel each, the results are wrong.
>
> Also, if I change the statement "days = days / sum(days)" to
> "days(:) = days(:) / sum(days)", it works correctly.
>
> I'm not doing explicity striding, so I'm not sure if this is the same
> bug that is mentioned as being fixed in 5.1.1 with respect to addfiles.
>
> Keith
>
>
> ------------------------------------------------------------------------
>
> begin
> fnames = (/ "file01.nc", "file02.nc" /)
> fp = addfiles(fnames, "r")
> days = fp[:]->days
> print(days)
> days = days / sum(days)
> print(days)
> end
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

-- 
======================================================
Dennis J. Shea                  tel: 303-497-1361    |
P.O. Box 3000                   fax: 303-497-1333    |
Climate Analysis Section                             |
Climate & Global Dynamics Div.                       |
National Center for Atmospheric Research             |
Boulder, CO  80307                                   |
USA                        email: shea 'at' ucar.edu |
======================================================
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Jun 19 2009 - 15:39:45 MDT

This archive was generated by hypermail 2.2.0 : Mon Jun 22 2009 - 15:36:10 MDT