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

20010827: NC_MAX_DIMS exceeded (cont.)



>From: Reggie Chang <address@hidden>
>Organization: ZONA Technology, Inc.
>Keywords: 200108230004.f7N040102190 netCDF NC_MAX_DIMS

Reggie,

>Thank you for the reply.

No problem.

>Since you ask, let me explain my situation.
>I'm dealing with the task to write out a data
>file with NetCDF format within iterations.
>
>The main reason for me to go over the default
>limit is that I cannot use 'unlimited' time variable.
>At first I attempted to use it (a very good feature)
>but realized later that all arrays with unlimited
>dimension will be expanded to the largest bound.
>The data file that I'm dealing with has various kinds
>of matirces(arrays) and they are written out within
>different iterations.  I got some huge arrays and
>some very small arrays. Unfortunately the small
>arrays are much longer in 'unlimited' dimension;
>therefore I got disk space waste from huge arrays.

Personally, I would probably write out the results from each iteration
to a different netCDF.

>Because I approach the problem assuming that
>I do not know how many iterations needed,
>I define new variable names each time when I
>encounter an array.  Actually I already developed
>a subroutine to re-use the same dimensions which
>have been previously defined.  Although I no longer
>have 'NC_MAX_DIMS exceeded' message, now
>I have 'NC_MAX_VARS exceeded' message.

OK.  You should be aware that each time you add to a netCDF, a
new file is created and the contents from the old is copied.  This
can get to be more and more of a resource hog as the number of 
iterations grows.

>Unless there is a better to handle this kind of
>situation, I guess I'll have to change the default
>limit.

Perhaps you should consider using multiple files.

>But it would be a pain to do it in Windows
>environment because the files (netcdf.lib, netcdf.dll)
>I am using are pre-built.  I wonder if you know
>somebody who can help me to build my own library
>on Windows.

Building the netCDF library and DLL is covered in the netCDF FAQs:

Frequently Asked Questions about netCDF
http://www.unidata.ucar.edu/packages/netcdf/faq.html
  Is netCDF available for Windows 95/98 or Windows NT?
  To do your own source build, get this zip file (these make files are
  for Microsoft Visual C 6 and Digital Fortran 6, you will have to modify
  for a different environment). Read WIN32_README.TXT for more info.

>Your information is very much appreciated.

You are welcome.

Tom

>From address@hidden Wed Aug 29 19:06:44 2001
>Subject: Re: 20010827: NC_MAX_DIMS exceeded (cont.)

Tom,

Thank you so much for all the help.

Best regards,

Reggie