Re: HDF read example
- From: Paul van Delst <Paul.vanDelst@xxxxxxxx>
- Date: Tue, 27 May 2008 15:02:06 -0400
fj wrote:
On 27 mai, 18:54, clay.blankens...@xxxxxxxxx wrote:I need to write a program to read HDF files and am having a hard time
finding a simple example of a program and compiling instructions.
Specifically, which include files do I need to use? I tried including
hdf.f90 and dffunc.f90 but I get a whole list of undefined symbols.
Thanks,
Clay Blankenship
National Space Science and Technology Center
You need to compile HDF5 with the same F90 compiler you use. HDF5 is
written in C and has a F90 extension.
Your program must contain :
PROGRAM test
USE hdf5
...
END PROGRAM
Of course you need to compile in providing the location of the file
hdf5.mod (coming from the correct installation of HDF5).
After that, you need to link with the HDF5 library
On my computer, I needed to install HDF5 for various compilers. For
the compiler "ifort" for instance, the main files are :
/usr/local/hdf5-ifort/lib/libhdf5.so
/usr/local/hdf5-ifort/lib/hdf5.mod
When compiling : ifort -c -I/usr/local/hdf5-ifort/lib test.f90
When linking : ifort -L/usr/local/hdf5-ifort/lib test.o -lhdf5
This is a total stab in the dark assuming you're using a certain compiler, but when I started doing something similar with the netcdf library using gfortran or g95, I needed to use the "-fno-second-underscore" flag when I compiled the fortran and fortran90 API.
I have zero experience with any form of HDF, but it should be an easy test. The names of the undefined symbols (extra underscores?) should tell you if the test is even worth doing.
cheers,
paulv
.
- References:
- HDF read example
- From: clay . blankenship
- Re: HDF read example
- From: fj
- HDF read example
- Prev by Date: Re: HDF read example
- Next by Date: Re: Unsigned in CVF
- Previous by thread: Re: HDF read example
- Next by thread: Re: HDF read example
- Index(es):
Relevant Pages
|
|