summaryrefslogtreecommitdiffstats
path: root/fortran/src/H5fortran_detect.f90
blob: 3ddcc3c3a2234f5578180893a8e71680d56afcb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
 program int_kind
 write(*,*) " /*generating header file*/ "
 call i01()
 call i02()
 call i04()
 call i08()
 end program int_kind
 subroutine i01()
    implicit none
    integer( 1 ) :: a
    integer :: a_size
    a_size = bit_size(a)
    if (a_size .eq. 8) then
        write(*,*) "#define H5_FORTRAN_HAS_INTEGER_1" 
    endif
    if (a_size .eq. 16) then
        write(*,*) "#define H5_FORTRAN_HAS_INTEGER_2" 
    endif
    if (a_size .eq. 32) then
        write(*,*) "#define H5_FORTRAN_HAS_INTEGER_4" 
    endif
    if (a_size .eq. 64) then
        write(*,*) "#define H5_FORTRAN_HAS_INTEGER_8" 
    endif
    if (a_size .eq. 128) then
        write(*,*) "#define H5_FORTRAN_HAS_INTEGER_16" 
    endif
    return
    end subroutine
 subroutine i02()
    implicit none
    integer( 2 ) :: a
    integer :: a_size
    a_size = bit_size(a)
    if (a_size .eq. 8) then
        write(*,*) "#define H5_FORTRAN_HAS_INTEGER_1" 
    endif
    if (a_size .eq. 16) then
        write(*,*) "#define H5_FORTRAN_HAS_INTEGER_2" 
    endif
    if (a_size .eq. 32) then
        write(*,*) "#define H5_FORTRAN_HAS_INTEGER_4" 
    endif
    if (a_size .eq. 64) then
        write(*,*) "#define H5_FORTRAN_HAS_INTEGER_8" 
    endif
    if (a_size .eq. 128) then
        write(*,*) "#define H5_FORTRAN_HAS_INTEGER_16" 
    endif
    return
    end subroutine
 subroutine i04()
    implicit none
    integer( 4 ) :: a
    integer :: a_size
    a_size = bit_size(a)
    if (a_size .eq. 8) then
        write(*,*) "#define H5_FORTRAN_HAS_INTEGER_1" 
    endif
    if (a_size .eq. 16) then
        write(*,*) "#define H5_FORTRAN_HAS_INTEGER_2" 
    endif
    if (a_size .eq. 32) then
        write(*,*) "#define H5_FORTRAN_HAS_INTEGER_4" 
    endif
    if (a_size .eq. 64) then
        write(*,*) "#define H5_FORTRAN_HAS_INTEGER_8" 
    endif
    if (a_size .eq. 128) then
        write(*,*) "#define H5_FORTRAN_HAS_INTEGER_16" 
    endif
    return
    end subroutine
 subroutine i08()
    implicit none
    integer( 8 ) :: a
    integer :: a_size
    a_size = bit_size(a)
    if (a_size .eq. 8) then
        write(*,*) "#define H5_FORTRAN_HAS_INTEGER_1" 
    endif
    if (a_size .eq. 16) then
        write(*,*) "#define H5_FORTRAN_HAS_INTEGER_2" 
    endif
    if (a_size .eq. 32) then
        write(*,*) "#define H5_FORTRAN_HAS_INTEGER_4" 
    endif
    if (a_size .eq. 64) then
        write(*,*) "#define H5_FORTRAN_HAS_INTEGER_8" 
    endif
    if (a_size .eq. 128) then
        write(*,*) "#define H5_FORTRAN_HAS_INTEGER_16" 
    endif
    return
    end subroutine