[1682] | 1 | !> @file mod_kinds.f90 |
---|
[2000] | 2 | !------------------------------------------------------------------------------! |
---|
[2696] | 3 | ! This file is part of the PALM model system. |
---|
[1306] | 4 | ! |
---|
[2000] | 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. |
---|
[1306] | 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 | ! |
---|
[3655] | 17 | ! Copyright 1997-2019 Leibniz Universitaet Hannover |
---|
[2000] | 18 | !------------------------------------------------------------------------------! |
---|
[1306] | 19 | ! |
---|
| 20 | ! Current revisions: |
---|
| 21 | ! ------------------ |
---|
[1683] | 22 | ! |
---|
[2001] | 23 | ! |
---|
[1306] | 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: mod_kinds.f90 4182 2019-08-22 15:20:23Z suehring $ |
---|
[4182] | 27 | ! Corrected "Former revisions" section |
---|
| 28 | ! |
---|
| 29 | ! 4000 2019-05-24 07:20:44Z raasch |
---|
[4000] | 30 | ! preprocessor switch added for choosing the real precision |
---|
| 31 | ! |
---|
| 32 | ! 3655 2019-01-07 16:51:22Z knoop |
---|
[2716] | 33 | ! Corrected "Former revisions" section |
---|
| 34 | ! |
---|
[4182] | 35 | ! 1306 2014-03-13 14:30:59Z raasch |
---|
| 36 | ! Initial revision |
---|
[1306] | 37 | ! |
---|
| 38 | ! Description: |
---|
| 39 | ! ------------ |
---|
[1682] | 40 | !> Standard kind definitions |
---|
| 41 | !> wp (working precision) and iwp (integer working precision) are the kinds |
---|
| 42 | !> used by default in all variable declarations. |
---|
| 43 | !> By default, PALM is using wp = dp (64bit), and iwp = isp (32bit). |
---|
| 44 | !> If you like to switch to other precision, then please set wp/iwp |
---|
| 45 | !> appropriately by assigning other kinds below. |
---|
[1306] | 46 | !------------------------------------------------------------------------------! |
---|
[1682] | 47 | MODULE kinds |
---|
| 48 | |
---|
[1306] | 49 | |
---|
| 50 | IMPLICIT NONE |
---|
| 51 | |
---|
| 52 | ! |
---|
| 53 | !-- Floating point kinds |
---|
[1682] | 54 | INTEGER, PARAMETER :: sp = 4 !< single precision (32 bit) |
---|
| 55 | INTEGER, PARAMETER :: dp = 8 !< double precision (64 bit) |
---|
[1306] | 56 | |
---|
| 57 | ! |
---|
| 58 | !-- Integer kinds |
---|
[1682] | 59 | INTEGER, PARAMETER :: isp = SELECTED_INT_KIND( 9 ) !< single precision (32 bit) |
---|
| 60 | INTEGER, PARAMETER :: idp = SELECTED_INT_KIND( 14 ) !< double precision (64 bit) |
---|
[1306] | 61 | |
---|
| 62 | ! |
---|
| 63 | !-- Set kinds to be used as defaults |
---|
[4000] | 64 | #if defined( __single_precision ) |
---|
| 65 | INTEGER, PARAMETER :: wp = sp !< default real kind |
---|
| 66 | #else |
---|
[1682] | 67 | INTEGER, PARAMETER :: wp = dp !< default real kind |
---|
[4000] | 68 | #endif |
---|
[1682] | 69 | INTEGER, PARAMETER :: iwp = isp !< default integer kind |
---|
[1306] | 70 | |
---|
| 71 | SAVE |
---|
| 72 | |
---|
| 73 | END MODULE kinds |
---|