Thanks to Scott and Timothy I narrowed down the problem and confirmed it in a test program. I am posting this incase it helps others. Here is how my test program looks like:
1. First I built a DLL (read_data.DLL) that static links with HDF5 library. This DLL has a subroutine to open a HDF5 file in read-only and selects hyperslabs by union method and stores in memory hyperslab with same number of elements. It closes the file and exits. 2. Then I wrote a driver that calls h5open_f to initialize Fortran interface and then writes out a dataset and close it. The file is also closed. Then the subroutine from DLL is called and the data is displayed to screen output. The above program is a modification of the hyperslab example available on HDF5 website. It seems like the problem is that the main application can see the global variables and common block memory but the DLL cannot. I confirmed this by writing to stdout the variable values. When I called h5open_f in DLL also the problem went away. The problem seems to stem from static linking against HDF5 libraries for both application and DLL. If I dynamically link, and share the library against the application and my read_data DLL, this problem goes away. Thank you, Vikram
_______________________________________________ Hdf-forum is for HDF software users discussion. Hdf-forum@lists.hdfgroup.org http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org Twitter: https://twitter.com/hdf5