[ncl-talk] curious indexing behaviour when reading an array

Rick Brownrigg brownrig at ucar.edu
Tue Jun 25 06:33:47 MDT 2019


Hi Will,

That is strange, and I don't see anything offhand. Are you able to send me
that file, if its not too large?

Rick

On Tue, Jun 25, 2019 at 1:22 AM Will Hobbs via ncl-talk <ncl-talk at ucar.edu>
wrote:

> Hi all
>
>
>
> I suspect this is some kind of Endian issue or something with netCDF4 and
> nothing much can be done, but I’ve a found a weird issue that I’ve never
> noticed in previous versions (I’m using v 6.6.2 on a Mac, OSX 10.11)
>
>
>
> Reading in a rank 5 array from netCDF using addfile(), dimensioned (3, 2,
> nlev, nlat, nlon):
>
>
>
> >fi = addfile(“filename.nc”,”r”)
>
> >data = fi->thetao
>
> >do i = 0, 2
>
>    print(num(ismissing(thetao(i,:,:,:,:))))
>
> >end do
>
>
>
> ;;;returns the numbers 971700, 952510, 0
>
>
>
> ;now use indexing
>
>
>
> eInd = (/0,1,2/)
>
> data := fi->thetao(eInd,:,:,:,:)
>
> >do i = 0, 2
>
>    print(num(ismissing(thetao(i,:,:,:,:))))
>
> >end do
>
>
>
> ;;;returns the numbers 0, 952510, 971700 – i.e. the dimension has
> ‘flipped’ for no good reason
>
>
>
> Has anyone else seen this? I couldn’t find anything in the NCL-talk
> archives
>
>
>
> Will
>
>
>
>
>
>
>
>
>
>
>
>
>
> University of Tasmania Electronic Communications Policy (December, 2014).
> This email is confidential, and is for the intended recipient only.
> Access, disclosure, copying, distribution, or reliance on any of it by
> anyone outside the intended recipient organisation is prohibited and may be
> a criminal offence. Please delete if obtained in error and email
> confirmation to the sender. The views expressed in this email are not
> necessarily the views of the University of Tasmania, unless clearly
> intended otherwise.
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190625/6680f3c0/attachment.html>


More information about the ncl-talk mailing list