diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2011-08-18 14:32:47 (GMT) |
---|---|---|
committer | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2011-08-18 14:32:47 (GMT) |
commit | a9c065c5ce65bb7dca560d53642574dba608dc78 (patch) | |
tree | 2d36b7afd3f3a83314db25aba081e95254d28841 /fortran/src/H5test_kind_SIZEOF.f90 | |
parent | a968e2d409d975ac5b584680620d2589b0409f88 (diff) | |
download | hdf5-a9c065c5ce65bb7dca560d53642574dba608dc78.zip hdf5-a9c065c5ce65bb7dca560d53642574dba608dc78.tar.gz hdf5-a9c065c5ce65bb7dca560d53642574dba608dc78.tar.bz2 |
[svn-r21248] Mereged the F2003 branch into the trunk.
Items merged: fortran directory,
src/libhdf5.settings.in
configure.in configure
MANIFEST
Tested: (all platforms used by daily tests, both with --enable-fortran and --enable-fortran2003)
Diffstat (limited to 'fortran/src/H5test_kind_SIZEOF.f90')
-rw-r--r-- | fortran/src/H5test_kind_SIZEOF.f90 | 94 |
1 files changed, 55 insertions, 39 deletions
diff --git a/fortran/src/H5test_kind_SIZEOF.f90 b/fortran/src/H5test_kind_SIZEOF.f90 index fbbe8e9..ba982ee 100644 --- a/fortran/src/H5test_kind_SIZEOF.f90 +++ b/fortran/src/H5test_kind_SIZEOF.f90 @@ -1,9 +1,12 @@ -!****h* fortran/src/H5test_kind_SIZEOF.f90 +!****p* Program/H5test_kind_SIZEOF ! ! NAME -! H5test_kind +! Executable: H5test_kind ! -! FUNCTION +! FILE +! fortran/src/H5test_kind_SIZEOF.f90 +! +! PURPOSE ! This stand alone program is used at build time to generate the program ! H5fortran_detect.f90. It cycles through all the available KIND parameters for ! integers and reals. The appropriate program and subroutines are then generated @@ -18,30 +21,30 @@ ! condition is set in the configure variable "FORTRAN_HAVE_SIZEOF". ! ! COPYRIGHT -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! Copyright by The HDF Group. * -! 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://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! Copyright by The HDF Group. * +! 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://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * +! access to either file, you may request a copy from help@hdfgroup.org. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! AUTHOR -! M.S. Breitenfeld +! M. Scot Breitenfeld ! !***** PROGRAM test_kind IMPLICIT NONE - INTEGER :: i, j, ii, ir, last, ikind_numbers(10),rkind_numbers(10) - INTEGER :: jr, jd + INTEGER :: i, j, ii, ir, last, ikind_numbers(10), rkind_numbers(10) + INTEGER :: ji, jr, jd last = -1 ii = 0 DO i = 1,100 @@ -70,15 +73,15 @@ PROGRAM test_kind ENDIF ENDDO -! Generate program information: +! Generate program information: WRITE(*,'(40(A,/))') & -'!****h* fortran/src/H5fortran_detect.f90',& +'!****h* ROBODoc/H5fortran_detect.f90',& '!',& '! NAME',& '! H5fortran_detect',& '! ',& -'! FUNCTION',& +'! PURPOSE',& '! This stand alone program is used at build time to generate the header file',& '! H5fort_type_defines.h. The source code itself was automatically generated by',& '! the program H5test_kind_SIZEOF.f90',& @@ -109,11 +112,11 @@ WRITE(*,'(40(A,/))') & '!',& '!*****' -! Generate a program +! Generate a program WRITE(*,*) "PROGRAM int_kind" WRITE(*,*) "WRITE(*,*) "" /*generating header file*/ """ - j = 0 - WRITE(*, "("" CALL i"", i2.2,""()"")") j + ji = 0 + WRITE(*, "("" CALL i"", i2.2,""()"")") ji jr = 0 WRITE(*, "("" CALL r"", i2.2,""()"")") jr jd = 0 @@ -128,48 +131,59 @@ WRITE(*,'(40(A,/))') & ENDDO WRITE(*,*) "END PROGRAM int_kind" j = 0 + ji = KIND(1) WRITE(*, "("" SUBROUTINE i"", i2.2,""()"")") j WRITE(*,*)" IMPLICIT NONE" WRITE(*,*)" INTEGER :: a" WRITE(*,*)" INTEGER :: a_size" - WRITE(*,*)" CHARACTER(LEN=2) :: ichr2" + WRITE(*,*)" CHARACTER(LEN=2) :: ichr2, jchr2" WRITE(*,*)" a_size = SIZEOF(a)" WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" - WRITE(*,*)' WRITE(*,*) "#define H5_FORTRAN_HAS_NATIVE_"'//"//ADJUSTL(ichr2)" + WRITE(*,'(A,I0)')" WRITE(jchr2,'(I2)') ",ji + WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_NATIVE_"'// & + "//TRIM(ADJUSTL(ichr2))//"//'"_KIND "'//"//ADJUSTL(jchr2)" WRITE(*,*)" RETURN" WRITE(*,*)"END SUBROUTINE" jr = 0 - WRITE(*, "("" SUBROUTINE r"", i2.2,""()"")") j + j = KIND(1.0) + WRITE(*, "("" SUBROUTINE r"", i2.2,""()"")") jr WRITE(*,*)" IMPLICIT NONE" WRITE(*,*)" REAL :: a" WRITE(*,*)" INTEGER :: a_size" - WRITE(*,*)" CHARACTER(LEN=2) :: ichr2" + WRITE(*,*)" CHARACTER(LEN=2) :: ichr2, jchr2" WRITE(*,*)" a_size = SIZEOF(a)" WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" - WRITE(*,*)' WRITE(*,*) "#define H5_FORTRAN_HAS_REAL_NATIVE_"'//"//ADJUSTL(ichr2)" + WRITE(*,'(A,I0)')" WRITE(jchr2,'(I2)') ",j + WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_REAL_NATIVE_"'// & + "//TRIM(ADJUSTL(ichr2))//"//'"_KIND "'//"//ADJUSTL(jchr2)" WRITE(*,*)" RETURN" WRITE(*,*)"END SUBROUTINE" jd = 0 + j = KIND(1.d0) WRITE(*, "("" SUBROUTINE d"", i2.2,""()"")") jd WRITE(*,*)" IMPLICIT NONE" WRITE(*,*)" DOUBLE PRECISION :: a" WRITE(*,*)" INTEGER :: a_size" - WRITE(*,*)" CHARACTER(LEN=2) :: ichr2" + WRITE(*,*)" CHARACTER(LEN=2) :: ichr2, jchr2" WRITE(*,*)" a_size = SIZEOF(a)" WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" - WRITE(*,*)' WRITE(*,*) "#define H5_FORTRAN_HAS_DOUBLE_NATIVE_"'//"//ADJUSTL(ichr2)" + WRITE(*,'(A,I0)')" WRITE(jchr2,'(I2)') ",j + WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_DOUBLE_NATIVE_"'// & + "//TRIM(ADJUSTL(ichr2))//"//'"_KIND "'//"//ADJUSTL(jchr2)" WRITE(*,*)" RETURN" WRITE(*,*)"END SUBROUTINE" DO i = 1, ii j = ikind_numbers(i) WRITE(*, "("" SUBROUTINE i"", i2.2,""()"")") j WRITE(*,*)" IMPLICIT NONE" - WRITE(*,*)" INTEGER(",j,") :: a" + WRITE(*,'(A,I0,A)')" INTEGER(KIND=",j,") :: a" WRITE(*,*)" INTEGER :: a_size" - WRITE(*,*)" CHARACTER(LEN=2) :: ichr2" + WRITE(*,*)" CHARACTER(LEN=2) :: ichr2, jchr2" WRITE(*,*)" a_size = SIZEOF(a)" WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" - WRITE(*,*)' WRITE(*,*) "#define H5_FORTRAN_HAS_INTEGER_"'//"//ADJUSTL(ichr2)" + WRITE(*,'(A,I0)')" WRITE(jchr2,'(I2)') ",j + WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_INTEGER_"'// & + "//TRIM(ADJUSTL(ichr2))//"//'"_KIND "'//"//ADJUSTL(jchr2)" WRITE(*,*)" RETURN" WRITE(*,*)"END SUBROUTINE" ENDDO @@ -177,12 +191,14 @@ WRITE(*,'(40(A,/))') & j = rkind_numbers(i) WRITE(*, "("" SUBROUTINE r"", i2.2,""()"")") j WRITE(*,*)" IMPLICIT NONE" - WRITE(*,*)" REAL(KIND=",j,") :: a" + WRITE(*,'(A,I0,A)')" REAL(KIND= ",j,") :: a" WRITE(*,*)" INTEGER :: a_size" - WRITE(*,*)" CHARACTER(LEN=2) :: ichr2" + WRITE(*,*)" CHARACTER(LEN=2) :: ichr2, jchr2" WRITE(*,*)" a_size = SIZEOF(a)" WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" - WRITE(*,*)' WRITE(*,*) "#define H5_FORTRAN_HAS_REAL_"'//"//ADJUSTL(ichr2)" + WRITE(*,'(A,I0)')" WRITE(jchr2,'(I2)') ", j + WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_REAL_"'// & + "//TRIM(ADJUSTL(ichr2))//"//'"_KIND "'//"//ADJUSTL(jchr2)" WRITE(*,*)" RETURN" WRITE(*,*)"END SUBROUTINE" ENDDO |