1 | !---------------------------------------------------------------------- |
---|
2 | ! NEMO system team, System and Interface for oceanic RElocable Nesting |
---|
3 | !---------------------------------------------------------------------- |
---|
4 | ! |
---|
5 | ! MODULE: kind |
---|
6 | ! |
---|
7 | ! DESCRIPTION: |
---|
8 | !> This module defines the F90 kind parameter for common data types. |
---|
9 | !> |
---|
10 | ! |
---|
11 | !> @author |
---|
12 | !> G. Madec |
---|
13 | ! REVISION HISTORY: |
---|
14 | !> @date June, 2006 - Initial Version |
---|
15 | !> @date December, 2012 - G. Madec |
---|
16 | !> - add a standard length of character strings |
---|
17 | ! |
---|
18 | !> @note Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
19 | ! |
---|
20 | !> @todo |
---|
21 | !> - check i8 max value |
---|
22 | !---------------------------------------------------------------------- |
---|
23 | MODULE kind |
---|
24 | IMPLICIT NONE |
---|
25 | PRIVATE |
---|
26 | ! NOTE_avoid_public_variables_if_possible |
---|
27 | |
---|
28 | ! !!** Floating point ** |
---|
29 | ! SELECTED_REAL_KIND(P,R) returns the kind value of a real data type |
---|
30 | ! with decimal precision of at least P digits, exponent range of at least R |
---|
31 | INTEGER, PUBLIC, PARAMETER :: sp = SELECTED_REAL_KIND( 6, 37) !< single precision (real 4) |
---|
32 | INTEGER, PUBLIC, PARAMETER :: dp = SELECTED_REAL_KIND(12,307) !< double precision (real 8) |
---|
33 | INTEGER, PUBLIC, PARAMETER :: wp = dp !< working precision |
---|
34 | |
---|
35 | ! !!** Integer ** |
---|
36 | ! SELECTED_INT_KIND(R) return the kind value of the smallest integer type |
---|
37 | ! that can represent all values ranging ] -10^R , 10^R [ |
---|
38 | INTEGER, PUBLIC, PARAMETER :: i1 = SELECTED_INT_KIND( 1) !< single precision (integer 1) |
---|
39 | INTEGER, PUBLIC, PARAMETER :: i2 = SELECTED_INT_KIND( 4) !< single precision (integer 2) |
---|
40 | INTEGER, PUBLIC, PARAMETER :: i4 = SELECTED_INT_KIND( 9) !< single precision (integer 4) |
---|
41 | INTEGER, PUBLIC, PARAMETER :: i8 = SELECTED_INT_KIND(14) !< double precision (integer 8) |
---|
42 | |
---|
43 | ! !!** Integer ** |
---|
44 | INTEGER, PUBLIC, PARAMETER :: lc = 256 !< Length of Character strings |
---|
45 | |
---|
46 | END MODULE kind |
---|
47 | |
---|