diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2008-09-30 16:42:10 (GMT) |
---|---|---|
committer | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2008-09-30 16:42:10 (GMT) |
commit | fe1ca64d1672af7859c38c143b77533a14c518ec (patch) | |
tree | bbee085742020b59a4b6136f277c6dd4a0bc8de0 /fortran/src/H5test_kind_SIZEOF.f90 | |
parent | f361635ae5f344bc80aade6432e80bcf1647522b (diff) | |
download | hdf5-fe1ca64d1672af7859c38c143b77533a14c518ec.zip hdf5-fe1ca64d1672af7859c38c143b77533a14c518ec.tar.gz hdf5-fe1ca64d1672af7859c38c143b77533a14c518ec.tar.bz2 |
[svn-r15727]
Maintenance: Merged new Fortran Features and tests from trunk into hdf5_1_8 branch
(used svn merge -r 14941:14525 http://svn.hdfgroup.uiuc.edu/hdf5/trunk/fortran
command).
Diffstat (limited to 'fortran/src/H5test_kind_SIZEOF.f90')
-rw-r--r-- | fortran/src/H5test_kind_SIZEOF.f90 | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/fortran/src/H5test_kind_SIZEOF.f90 b/fortran/src/H5test_kind_SIZEOF.f90 new file mode 100644 index 0000000..72d9176 --- /dev/null +++ b/fortran/src/H5test_kind_SIZEOF.f90 @@ -0,0 +1,100 @@ +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! H5test_kind_SIZEOF.f90 +! +! This fortran program generates H5fortran_detect.f90 +! +! +PROGRAM test_kind + INTEGER :: i, j, ii, last, kind_numbers(10) + INTEGER :: jr, jd + last = -1 + ii = 0 + j = SELECTED_INT_KIND(18) + DO i = 1,100 + j = SELECTED_INT_KIND(i) + IF(j .NE. last) THEN + IF(last .NE. -1) THEN + ii = ii + 1 + kind_numbers(ii) = last + ENDIF + last = j + IF(j .EQ. -1) EXIT + ENDIF + ENDDO +! Generate a program + WRITE(*,*) "PROGRAM int_kind" + WRITE(*,*) "WRITE(*,*) "" /*generating header file*/ """ + j = 0 + WRITE(*, "("" CALL i"", i2.2,""()"")") j + jr = 0 + WRITE(*, "("" CALL r"", i2.2,""()"")") jr + jd = 0 + WRITE(*, "("" CALL d"", i2.2,""()"")") jd + DO i = 1, ii + j = kind_numbers(i) + WRITE(*, "("" CALL i"", i2.2,""()"")") j + ENDDO + WRITE(*,*) "END PROGRAM int_kind" + j = 0 + WRITE(*, "("" SUBROUTINE i"", i2.2,""()"")") j + WRITE(*,*)" IMPLICIT NONE" + WRITE(*,*)" INTEGER :: a" + WRITE(*,*)" INTEGER :: a_size" + WRITE(*,*)" CHARACTER(LEN=2) :: ichr2" + WRITE(*,*)" a_size = SIZEOF(a)" + WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" + WRITE(*,*)' WRITE(*,*) "#define H5_FORTRAN_HAS_NATIVE_"'//"//ADJUSTL(ichr2)" + WRITE(*,*)" RETURN" + WRITE(*,*)"END SUBROUTINE" + jr = 0 + WRITE(*, "("" SUBROUTINE r"", i2.2,""()"")") j + WRITE(*,*)" IMPLICIT NONE" + WRITE(*,*)" REAL :: a" + WRITE(*,*)" INTEGER :: a_size" + WRITE(*,*)" CHARACTER(LEN=2) :: ichr2" + WRITE(*,*)" a_size = SIZEOF(a)" + WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" + WRITE(*,*)' WRITE(*,*) "#define H5_FORTRAN_HAS_REAL_NATIVE_"'//"//ADJUSTL(ichr2)" + WRITE(*,*)" RETURN" + WRITE(*,*)"END SUBROUTINE" + jd = 0 + WRITE(*, "("" SUBROUTINE d"", i2.2,""()"")") jd + WRITE(*,*)" IMPLICIT NONE" + WRITE(*,*)" DOUBLE PRECISION :: a" + WRITE(*,*)" INTEGER :: a_size" + WRITE(*,*)" CHARACTER(LEN=2) :: ichr2" + WRITE(*,*)" a_size = SIZEOF(a)" + WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" + WRITE(*,*)' WRITE(*,*) "#define H5_FORTRAN_HAS_DOUBLE_NATIVE_"'//"//ADJUSTL(ichr2)" + WRITE(*,*)" RETURN" + WRITE(*,*)"END SUBROUTINE" + DO i = 1, ii + j = kind_numbers(i) + WRITE(*, "("" SUBROUTINE i"", i2.2,""()"")") j + WRITE(*,*)" IMPLICIT NONE" + WRITE(*,*)" INTEGER(",j,") :: a" + WRITE(*,*)" INTEGER :: a_size" + WRITE(*,*)" CHARACTER(LEN=2) :: ichr2" + WRITE(*,*)" a_size = SIZEOF(a)" + WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" + WRITE(*,*)' WRITE(*,*) "#define H5_FORTRAN_HAS_INTEGER_"'//"//ADJUSTL(ichr2)" + WRITE(*,*)" RETURN" + WRITE(*,*)"END SUBROUTINE" + ENDDO +END PROGRAM test_kind + + + |