[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[netCDF #LRS-412716]: alignment problem with compound types
- Subject: [netCDF #LRS-412716]: alignment problem with compound types
- Date: Wed, 03 Jun 2009 11:15:44 -0600
> Ed: The fundamental problem I have is this. For languages other than C
> (such as python and fortran), structured arrays don't necessarily have
> the same alignment as the default for the C compiler. In order the
> write structured arrays from python using the netcdf C lib, I need to be
> able to specify arbitrary offsets, and have the library actually use
> those offsets when I write the data. Reading is not a problem, since I
> can intrepret the offsets that I read from the file to construct a
> structured array to hold the data. If you can tell me how to write
> structured data with arbitrary offsets (usually packed) with netcdf,
> I'll be happy. If I can't do this, I'm afraid netcdf compound types
> will be practically useless for languages other than C.
In F90 there is a way to insist that the Fortran compiler use the same
(default) layout as the C compiler. This is not implemented in netCDF-4 yet,
but it will be as soon as I can get around to replacing the current fortran
APIs.
Now I see what you are getting at. I can think of at least one hackish way to
get what you need. Let me ponder and see if there is a more elegant way...
Thanks,
Ed
Ticket Details
===================
Ticket ID: LRS-412716
Department: Support netCDF
Priority: Normal
Status: Open