# predefined types in Fortran

**URL:** <https://forum.hdfgroup.org/t/predefined-types-in-fortran/1327>\
**Category:** Hdf-forum archives\
**Created:** [June 25, 2009, 8:54am UTC](https://forum.hdfgroup.org/t/predefined-types-in-fortran/1327 "2009-06-25T08:54:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hannes\_Grimm-Strele](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/h/76d3ee/32.png) [@Hannes\_Grimm-Strele](https://forum.hdfgroup.org/u/Hannes_Grimm-Strele)\
**Post date:** [June 25, 2009, 8:54am UTC](https://forum.hdfgroup.org/t/predefined-types-in-fortran/1327/1 "2009-06-25T08:54:10Z")

</div>

Hello,

I have some problems concerning serial HDF5 with Fortran. My program was  
written with PHDF5 and compiles without errors or warnings with Intel  
Compiler V10.1 on Linux/Gentoo 32 bit. But now I am trying to compile it  
on Windows XP with Intel Visual Fortran V11 and HDF 1.8.3 (serial). When I  
followed the instructions given for Windows build, I could compile my code  
but always retrieved warnings like

warning LNK4217: locally defined symbol \_H5F\_FLAGS imported in function  
"function".

First I thought it's because I use the wrong libraries (there are no  
static precompiled debug libraries for MS Visual Studio 2005 and Intel  
Fortran V11), but the warnings didn't disappear even though Pedro Vicente  
sent my the right libraries (thanks by the way!). Now I figured out that  
it's because of flags like "H5F\_ACC\_TRUNC\_F" and "H5T\_NATIVE\_REAL" I am  
using in my code. According to  
[http://www.hdfgroup.org/HDF5/doc/Tutor/crtdat.html](http://www.hdfgroup.org/HDF5/doc/Tutor/crtdat.html), the subroutine  
"h5init\_types\_f" must be called at the beginning of the program to get  
access to the pre-defined datatypes. But when I tried to call this  
routine, an error was returned since the routine seems not to be  
available.

Do you have any idea what I have to do? Thanks a lot for any advice.

Regards,

Hannes Grimm-Strele

---

<div class="post-metadata">

**Author:** ![epourmal](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/e/c67d28/32.png) [@epourmal](https://forum.hdfgroup.org/u/epourmal)\
**Post date:** [June 25, 2009, 5:07pm UTC](https://forum.hdfgroup.org/t/predefined-types-in-fortran/1327/2 "2009-06-25T17:07:57Z")

</div>

Hannes,

I am sorry; we have an error in our Tutorial. The calls one has to use are

h5open\_f and h5close\_f

Those call will initialize/close predefined types and ALL other flags.

Please see Fortran example on the same page or take a look at the Fortran examples under

[http://www.hdfgroup.uiuc.edu/UserSupport/examples-by-api/](http://www.hdfgroup.uiuc.edu/UserSupport/examples-by-api/)

Thank you for finding the problem!

Elena

> **···**
>
> On Jun 25, 2009, at 3:54 AM, Hannes Grimm-Strele wrote:
> 
> > Hello,
> > 
> > I have some problems concerning serial HDF5 with Fortran. My program was written with PHDF5 and compiles without errors or warnings with Intel Compiler V10.1 on Linux/Gentoo 32 bit. But now I am trying to compile it on Windows XP with Intel Visual Fortran V11 and HDF 1.8.3 (serial). When I followed the instructions given for Windows build, I could compile my code but always retrieved warnings like
> > 
> > warning LNK4217: locally defined symbol \_H5F\_FLAGS imported in function "function".
> > 
> > First I thought it's because I use the wrong libraries (there are no static precompiled debug libraries for MS Visual Studio 2005 and Intel Fortran V11), but the warnings didn't disappear even though Pedro Vicente sent my the right libraries (thanks by the way!). Now I figured out that it's because of flags like "H5F\_ACC\_TRUNC\_F" and "H5T\_NATIVE\_REAL" I am using in my code. According to [http://www.hdfgroup.org/HDF5/doc/Tutor/crtdat.html](http://www.hdfgroup.org/HDF5/doc/Tutor/crtdat.html), the subroutine "h5init\_types\_f" must be called at the beginning of the program to get access to the pre-defined datatypes. But when I tried to call this routine, an error was returned since the routine seems not to be available.
> > 
> > Do you have any idea what I have to do? Thanks a lot for any advice.
> > 
> > Regards,
> > 
> > Hannes Grimm-Strele

---

<div class="post-metadata">

**Author:** ![bljones](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/b/e5b9ba/32.png) [@bljones](https://forum.hdfgroup.org/u/bljones)\
**Post date:** [June 25, 2009, 5:55pm UTC](https://forum.hdfgroup.org/t/predefined-types-in-fortran/1327/3 "2009-06-25T17:55:06Z")

</div>

Hello Hannes,

You are referencing an old version of the HDF5 Tutorial.  
The location of the HDF5 Tutorial is now:

&nbsp;&nbsp;&nbsp;[http://www.hdfgroup.org/HDF5/Tutor/](http://www.hdfgroup.org/HDF5/Tutor/)

The old tutorial was still in the HDF5 Documentation, though  
there should be no links to it. (If you encountered a link  
from our web pages to the old HDF5 Tutorial, please do let me  
know!)

We will remove the old tutorial from the HDF5 Documentation,  
so that this does not happen again.

Sorry about that!  
-Barbara

> **···**
>
> +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+  
> Barbara Jones  
> The HDF Helpdesk
> 
> The HDF Group  
> help@hdfgroup.org  
> +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
> 
> > I have some problems concerning serial HDF5 with Fortran. My program was  
> > written with PHDF5 and compiles without errors or warnings with Intel  
> > Compiler V10.1 on Linux/Gentoo 32 bit. But now I am trying to compile it  
> > on Windows XP with Intel Visual Fortran V11 and HDF 1.8.3 (serial). When I  
> > followed the instructions given for Windows build, I could compile my code  
> > but always retrieved warnings like
> > 
> > warning LNK4217: locally defined symbol \_H5F\_FLAGS imported in function  
> > "function".
> > 
> > First I thought it's because I use the wrong libraries (there are no  
> > static precompiled debug libraries for MS Visual Studio 2005 and Intel  
> > Fortran V11), but the warnings didn't disappear even though Pedro Vicente  
> > sent my the right libraries (thanks by the way!). Now I figured out that  
> > it's because of flags like "H5F\_ACC\_TRUNC\_F" and "H5T\_NATIVE\_REAL" I am  
> > using in my code. According to  
> > [http://www.hdfgroup.org/HDF5/doc/Tutor/crtdat.html](http://www.hdfgroup.org/HDF5/doc/Tutor/crtdat.html), the subroutine  
> > "h5init\_types\_f" must be called at the beginning of the program to get  
> > access to the pre-defined datatypes. But when I tried to call this  
> > routine, an error was returned since the routine seems not to be  
> > available.
> > 
> > Do you have any idea what I have to do? Thanks a lot for any advice.
> > 
> > Regards,
> > 
> > Hannes Grimm-Strele
> 
> --
> 
> ----------------------------------------------------------------------  
> This mailing list is for HDF software users discussion.  
> To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.  
> To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.
