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