summaryrefslogtreecommitdiffstats
path: root/windows
diff options
context:
space:
mode:
authorFang Guo <fangguo@ncsa.uiuc.edu>2005-12-20 20:31:38 (GMT)
committerFang Guo <fangguo@ncsa.uiuc.edu>2005-12-20 20:31:38 (GMT)
commit91ddc081ba173814b45a952c7e36ee2b8c5b0014 (patch)
treead682517cc5fbcdf7d3212d41e43b1329076804d /windows
parentd6c3f668826b0d7ef1c30e52f0bd588d0000ec3b (diff)
downloadhdf5-91ddc081ba173814b45a952c7e36ee2b8c5b0014.zip
hdf5-91ddc081ba173814b45a952c7e36ee2b8c5b0014.tar.gz
hdf5-91ddc081ba173814b45a952c7e36ee2b8c5b0014.tar.bz2
[svn-r11804] Purpose:
Maintenance on Windows Description: Add hl fortran examples Solution: Platforms tested: Windows XP Misc. update:
Diffstat (limited to 'windows')
-rw-r--r--windows/hl/fortran/examples/ex_litedll/ex_litedll.dsp112
-rw-r--r--windows/hl/fortran/examples/exlite.f9090
2 files changed, 202 insertions, 0 deletions
diff --git a/windows/hl/fortran/examples/ex_litedll/ex_litedll.dsp b/windows/hl/fortran/examples/ex_litedll/ex_litedll.dsp
new file mode 100644
index 0000000..11fa3ba
--- /dev/null
+++ b/windows/hl/fortran/examples/ex_litedll/ex_litedll.dsp
@@ -0,0 +1,112 @@
+# Microsoft Developer Studio Project File - Name="ex_litedll" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=ex_litedll - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "ex_litedll.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "ex_litedll.mak" CFG="ex_litedll - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "ex_litedll - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "ex_litedll - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+F90=df.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "ex_litedll - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\..\..\..\..\hl\fortran\examples\ex_litedll\Release"
+# PROP Intermediate_Dir "..\..\..\..\..\hl\fortran\examples\ex_litedll\Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE F90 /compile_only /nologo /warn:nofileopt
+# ADD F90 /compile_only /include:"..\..\..\..\..\proj\hdf5_fortrandll\release/" /include:"..\..\..\..\..\proj\hdf5_hl_fortrandll\release/" /nologo /warn:nofileopt /module:"Release/"
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib hdf5_fortrandll.lib hdf5_hl_fortrandll.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\..\..\proj\hdf5_fortrandll\release" /libpath:"..\..\..\..\..\proj\hdf5_hl_fortrandll\release"
+
+!ELSEIF "$(CFG)" == "ex_litedll - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "ex_litedll___Win32_Debug"
+# PROP BASE Intermediate_Dir "ex_litedll___Win32_Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\..\hl\fortran\examples\ex_litedll\Debug"
+# PROP Intermediate_Dir "..\..\..\..\hl\fortran\examples\ex_litedll\Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE F90 /check:bounds /compile_only /dbglibs /debug:full /nologo /traceback /warn:argument_checking /warn:nofileopt
+# ADD F90 /check:bounds /compile_only /dbglibs /debug:full /include:"..\..\..\..\..\proj\hdf5_fortrandll\debug/" /include:"..\..\..\..\..\proj\hdf5_hl_fortrandll\debug/" /nologo /traceback /warn:argument_checking /warn:nofileopt /module:"Debug/"
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib hdf5_fortranddll.lib hdf5_hl_fortrandlld.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /nodefaultlib:"libc.lib" /out:"..\..\..\..\..\hl\fortran\examples\ex_litedll\Debug\ex_litedll.exe" /pdbtype:sept /libpath:"..\..\..\..\..\proj\hdf5_fortrandll\debug" /libpath:"..\..\..\..\..\proj\hdf5_hl_fortrandll\debug"
+# SUBTRACT LINK32 /nodefaultlib
+
+!ENDIF
+
+# Begin Target
+
+# Name "ex_litedll - Win32 Release"
+# Name "ex_litedll - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;f90;for;f;fpp"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\hl\fortran\examples\exlite.f90
+DEP_F90_EXLIT=\
+ "..\..\..\..\..\proj\hdf5_fortrandll\debug\HDF5.mod"\
+ "..\..\..\..\..\proj\hdf5_hl_fortrandll\debug\H5LT.mod"\
+
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/windows/hl/fortran/examples/exlite.f90 b/windows/hl/fortran/examples/exlite.f90
new file mode 100644
index 0000000..f12aa5b
--- /dev/null
+++ b/windows/hl/fortran/examples/exlite.f90
@@ -0,0 +1,90 @@
+! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+! Copyright by the Board of Trustees of the University of Illinois. *
+! All rights reserved. *
+! *
+! This file is part of HDF5. The full HDF5 copyright notice, including *
+! terms governing use, modification, and redistribution, is contained in *
+! the files COPYING and Copyright.html. COPYING can be found at the root *
+! of the source code distribution tree; Copyright.html can be found at the *
+! root level of an installed copy of the electronic HDF5 document set and *
+! is linked from the top-level documents page. It can also be found at *
+! http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have *
+! access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
+! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+!
+!
+! This file contains a FORTRAN90 example for the H5LT API
+!
+
+program lite_example
+
+use H5LT ! module of H5LT
+use HDF5 ! module of HDF5 library
+
+implicit none
+
+integer, parameter :: DIM1 = 4; ! Dimension of array
+character(len=9), parameter :: filename = "exlite.h5"! File name
+character(LEN=5), parameter :: dsetname1 = "dset1" ! Dataset name
+integer(HID_T) :: file_id ! File identifier
+integer(HSIZE_T), dimension(1) :: dims = (/DIM1/) ! Dataset dimensions
+integer :: rank = 1 ! Dataset rank
+integer, dimension(DIM1) :: buf1 ! Data buffer
+integer, dimension(DIM1) :: bufr1 ! Data buffer
+integer :: errcode ! Error flag
+integer :: i ! general purpose integer
+
+!
+! Initialize the data array.
+!
+do i = 1, DIM1
+ buf1(i) = i;
+end do
+
+!
+! Initialize FORTRAN predefined datatypes.
+!
+call h5open_f(errcode)
+
+!
+! Create a new file using default properties.
+!
+call h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, errcode)
+
+!
+! write dataset.
+!
+call h5ltmake_dataset_f(file_id, dsetname1, rank, dims, H5T_NATIVE_INTEGER, buf1, errcode)
+
+!
+! read dataset.
+!
+call h5ltread_dataset_f(file_id, dsetname1, H5T_NATIVE_INTEGER, bufr1, dims, errcode)
+
+!
+! compare read and write buffers.
+!
+do i = 1, DIM1
+ if ( buf1(i) .ne. bufr1(i) ) then
+ print *, 'read buffer differs from write buffer'
+ print *, bufr1(i), ' and ', buf1(i)
+ stop
+ endif
+end do
+
+
+!
+! Close the file.
+!
+call h5fclose_f(file_id, errcode)
+
+!
+! Close FORTRAN predefined datatypes.
+!
+call h5close_f(errcode)
+
+!
+! end
+!
+end program lite_example
+