Debian Codegraph @

src/atlas_f/util/atlas_kinds_module.F90

raw
1 ! (C) Copyright 2013 ECMWF.
2 !
3 ! This software is licensed under the terms of the Apache Licence Version 2.0
4 ! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
5 ! In applying this licence, ECMWF does not waive the privileges and immunities
6 ! granted to it by virtue of its status as an intergovernmental organisation nor
7 ! does it submit to any jurisdiction.
8
9 #include "atlas/atlas_f.h"
10
11 module atlas_kinds_module
12
13 use, intrinsic :: iso_c_binding, only: &
14 & c_int, c_long, c_double, c_float
15
16 implicit none
17 private
18
19 private :: c_long, c_int, c_double, c_float
20
21 public :: ATLAS_KIND_GIDX
22 public :: ATLAS_KIND_IDX
23
24 public :: ATLAS_KIND_REAL64
25 public :: ATLAS_KIND_REAL32
26 public :: ATLAS_KIND_INT64
27 public :: ATLAS_KIND_INT32
28
29
30 #if ATLAS_BITS_GLOBAL == 32
31 integer, parameter :: ATLAS_KIND_GIDX = c_int
32 #elif ATLAS_BITS_GLOBAL == 64
33 integer, parameter :: ATLAS_KIND_GIDX = c_long
34 #else
35 #error ATLAS_BITS_GLOBAL must be either 32 or 64
36 #endif
37
38 #if ATLAS_BITS_LOCAL == 32
39 integer, parameter :: ATLAS_KIND_IDX = c_int
40 #elif ATLAS_BITS_LOCAL == 64
41 integer, parameter :: ATLAS_KIND_IDX = c_long
42 #else
43 #error ATLAS_BITS_LOCAL must be either 32 or 64
44 #endif
45
46 integer, parameter :: ATLAS_KIND_REAL64 = c_double
47 integer, parameter :: ATLAS_KIND_REAL32 = c_float
48 integer, parameter :: ATLAS_KIND_INT64 = c_long
49 integer, parameter :: ATLAS_KIND_INT32 = c_int
50
51 ENUM, bind(c)
52 enumerator :: openmode
53 enumerator :: app = 1
54 enumerator :: out = 16
55 end ENUM
56
57 ! =============================================================================
58 CONTAINS
59 ! =============================================================================
60
61
62 ! -----------------------------------------------------------------------------
63
64 end module atlas_kinds_module