1 | !< $HeadURL$ |
---|
2 | !< $Date$ |
---|
3 | !< $Author$ |
---|
4 | !< $Revision$ |
---|
5 | !- |
---|
6 | PROGRAM getprec |
---|
7 | !--------------------------------------------------------------------- |
---|
8 | !- This program verifies that that the number representation |
---|
9 | !- between the different components of the model are compatible |
---|
10 | !--------------------------------------------------------------------- |
---|
11 | USE defprec |
---|
12 | !- |
---|
13 | IMPLICIT NONE |
---|
14 | !- |
---|
15 | INTEGER :: i |
---|
16 | REAL :: r |
---|
17 | !- |
---|
18 | INTEGER :: range_int,range_real,precision_real |
---|
19 | !--------------------------------------------------------------------- |
---|
20 | range_int = RANGE(i) |
---|
21 | range_real = RANGE(r) |
---|
22 | precision_real = PRECISION(r) |
---|
23 | !- |
---|
24 | WRITE(*,*) 'The following ranges and precisions are standard' |
---|
25 | WRITE(*,*) 'on this computer with your compiler options :' |
---|
26 | WRITE(*,*) ' INTEGER range :',range_int |
---|
27 | WRITE(*,*) ' REAL range :',range_real |
---|
28 | WRITE(*,*) ' REAL precision :',precision_real |
---|
29 | !- |
---|
30 | WRITE(*,*) 'The corresponding kinds are :' |
---|
31 | WRITE(*,*) ' KIND for integer :', & |
---|
32 | & SELECTED_INT_KIND(range_int) |
---|
33 | WRITE(*,*) ' KIND for real :', & |
---|
34 | & SELECTED_REAL_KIND(precision_real,range_real) |
---|
35 | !- |
---|
36 | WRITE(*,*) 'We test if this corresponds to what is used' |
---|
37 | WRITE(*,*) 'in various parts of the code :' |
---|
38 | !- |
---|
39 | ! Real : |
---|
40 | !- |
---|
41 | IF (SELECTED_REAL_KIND(precision_real,range_real) /= r_std) THEN |
---|
42 | WRITE(*,*) ' REAL : ERROR, the wrong kind is specified.' |
---|
43 | WRITE(*,*) ' Use the value above.' |
---|
44 | ELSE |
---|
45 | WRITE(*,*) ' REAL : OK' |
---|
46 | ENDIF |
---|
47 | !- |
---|
48 | ! Integer : |
---|
49 | !- |
---|
50 | IF (SELECTED_INT_KIND(range_int) /= i_std) THEN |
---|
51 | WRITE(*,*) ' INTEGER : ERROR, the wrong kind is specified.' |
---|
52 | WRITE(*,*) ' Use the value above.' |
---|
53 | ELSE |
---|
54 | WRITE(*,*) ' INTEGER : OK' |
---|
55 | ENDIF |
---|
56 | !------------------ |
---|
57 | END PROGRAM getprec |
---|