1 | !> @file mod_kinds.f90 |
---|
2 | !--------------------------------------------------------------------------------------------------! |
---|
3 | ! This file is part of the PALM model system. |
---|
4 | ! |
---|
5 | ! PALM is free software: you can redistribute it and/or modify it under the terms of the GNU General |
---|
6 | ! Public License as published by the Free Software Foundation, either version 3 of the License, or |
---|
7 | ! (at your option) any later version. |
---|
8 | ! |
---|
9 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the |
---|
10 | ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
---|
11 | ! Public License for more details. |
---|
12 | ! |
---|
13 | ! You should have received a copy of the GNU General Public License along with PALM. If not, see |
---|
14 | ! <http://www.gnu.org/licenses/>. |
---|
15 | ! |
---|
16 | ! Copyright 1997-2021 Leibniz Universitaet Hannover |
---|
17 | !--------------------------------------------------------------------------------------------------! |
---|
18 | ! |
---|
19 | ! Current revisions: |
---|
20 | ! ------------------ |
---|
21 | ! |
---|
22 | ! |
---|
23 | ! Former revisions: |
---|
24 | ! ----------------- |
---|
25 | ! $Id: mod_kinds.f90 4828 2021-01-05 11:21:41Z forkel $ |
---|
26 | ! file re-formatted to follow the PALM coding standard |
---|
27 | ! |
---|
28 | ! 4360 2020-01-07 11:25:50Z suehring |
---|
29 | ! Corrected "Former revisions" section |
---|
30 | ! |
---|
31 | ! 4000 2019-05-24 07:20:44Z raasch |
---|
32 | ! preprocessor switch added for choosing the real precision |
---|
33 | ! |
---|
34 | ! 3655 2019-01-07 16:51:22Z knoop |
---|
35 | ! Corrected "Former revisions" section |
---|
36 | ! |
---|
37 | ! 1306 2014-03-13 14:30:59Z raasch |
---|
38 | ! Initial revision |
---|
39 | ! |
---|
40 | ! Description: |
---|
41 | ! ------------ |
---|
42 | !> Standard kind definitions |
---|
43 | !> wp (working precision) and iwp (integer working precision) are the kinds used by default in all |
---|
44 | !> variable declarations. |
---|
45 | !> By default, PALM is using wp = dp (64bit), and iwp = isp (32bit). |
---|
46 | !> If you like to switch to other precision, then please set wp/iwp appropriately by assigning other |
---|
47 | !> kinds below. |
---|
48 | !--------------------------------------------------------------------------------------------------! |
---|
49 | MODULE kinds |
---|
50 | |
---|
51 | |
---|
52 | IMPLICIT NONE |
---|
53 | |
---|
54 | ! |
---|
55 | !-- Floating point kinds |
---|
56 | INTEGER, PARAMETER :: sp = 4 !< single precision (32 bit) |
---|
57 | INTEGER, PARAMETER :: dp = 8 !< double precision (64 bit) |
---|
58 | |
---|
59 | ! |
---|
60 | !-- Integer kinds |
---|
61 | INTEGER, PARAMETER :: isp = SELECTED_INT_KIND( 9 ) !< single precision (32 bit) |
---|
62 | INTEGER, PARAMETER :: idp = SELECTED_INT_KIND( 14 ) !< double precision (64 bit) |
---|
63 | |
---|
64 | ! |
---|
65 | !-- Set kinds to be used as defaults |
---|
66 | #if defined( __single_precision ) |
---|
67 | INTEGER, PARAMETER :: wp = sp !< default real kind |
---|
68 | #else |
---|
69 | INTEGER, PARAMETER :: wp = dp !< default real kind |
---|
70 | #endif |
---|
71 | INTEGER, PARAMETER :: iwp = isp !< default integer kind |
---|
72 | |
---|
73 | SAVE |
---|
74 | |
---|
75 | END MODULE kinds |
---|