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