[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help writing arrays as you go

This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.


  • Subject: Re: Help writing arrays as you go
  • Date: Sat, 24 Feb 2007 17:38:04 -0700



Gabriella Turek wrote:
I keep getting a "Bad section rank" error.
What I am trying to do:
I have an array of dimension (t,x,y,z) where t is declared unlimited
My code:

loop over time
 instantiate an ArrayDouble of dimension (x,y,z)
 loop over x,y,x
  fill array
 end x,y,z loop
 set origin                   <---- here is the problem
 write array
end time loop

What is the origin supposed to be, and is even this possible at all?
Thanx
gaby


1. you should probably send the actual code, and the actual exception


2. you probably need to use a rank-4 array with the time dimension length 1.

Have a look at the tutorial:

http://www.unidata.ucar.edu/software/netcdf-java/tutorial/

in particular:

http://www.unidata.ucar.edu/software/netcdf-java/tutorial/NetcdfFile.html

"Reading data from a Variable"

===============================================================================
To unsubscribe netcdf-java, visit:
http://www.unidata.ucar.edu/mailing-list-delete-form.html
===============================================================================