Module_The_Kinds¶
Copyright 2018 IRD
This file is part of statpack.
statpack is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
statpack is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You can find a copy of the GNU Lesser General Public License in the statpack/doc directory.
Authors: Pascal Terray (LOCEAN/IPSL, Paris, France)
MODULE EXPORTING SYMBOLIC NAMES FOR KINDS OF LOGICAL, INTEGER, REAL AND COMPLEX TYPES AVAILABLE ON THE COMPUTER.
THE SYMBOLIC NAMES AVAILABLE AND EXPORTED BY THIS MODULE ARE DEFINED AS FOLLOW:
SYMBOLIC NAME FOR DEFAULT KIND OF LOGICAL:
integer, parameter :: logic = kind( .true. )
SYMBOLIC NAMES FOR KIND TYPES OF LOGICAL:
- integer, parameter :: logic0 = 0
- integer, parameter :: logic1 = 1
- integer, parameter :: logic2 = 2
- integer, parameter :: logic4 = 4
SYMBOLIC NAMES FOR KIND TYPES OF 1-, 2-, 4- and 8-BYTES INTEGERS:
- integer, parameter :: i1b = selected_int_kind( 2 )
- integer, parameter :: i2b = selected_int_kind( 4 )
- integer, parameter :: i4b = selected_int_kind( 9 )
- integer, parameter :: i8b = selected_int_kind( 10 )
SYMBOLIC NAMES FOR KIND TYPES OF SINGLE-, DOUBLE- and QUADRUPLE-PRECISION REAL AND COMPLEX NUMBERS:
- integer, parameter :: sp = kind( 1.0 )
- integer, parameter :: dp = kind( 1.0d0 )
- integer, parameter :: qp = selected_real_kind( precision( 1.0d0 ) + 1 )
THE qp KIND TYPE MAY NOT BE AVAILABLE ON YOUR COMPUTER.
PRECISION SPECIFICATIONS FOR REAL AND COMPLEX COMPUTATIONS:
- integer, parameter :: low = selected_real_kind( 6, 35 )
- integer, parameter :: normal = selected_real_kind( 12, 50 )
- integer, parameter :: extended = selected_real_kind( 20, 80 )
THESE PRECISION SPECIFICATIONS REQUEST, RESPECTIVELY, 6, 12, 20 DECIMAL DIGITS OF PRECISION AND AN EXPONENT RANGE OF AT LEAST 10 ^ +- 35, 10 ^ +- 50 AND 10 ^ +- 80. THE extended PRECISION MAY NOT BE AVAILABLE ON YOUR COMPUTER.
TO TEST THE AVAILABLE KIND TYPES AND PRECISIONS ON YOUR COMPUTER, YOU CAN USE THE PROGRAM test_kind.F90 (e.g. TYPE THE COMMAND “make test_kind” IN THE MAIN STATPACK DIRECTORY).
THE CHOICE BETWEEN THESE DIFFERENT KIND TYPES FOR COMPILING A VERSION OF STATPACK IS DONE IN THE MODULE Select_Parameters (AVAILABLE IN THE SOURCE FILE Module_Select_Parameters.F90).
LATEST REVISION : 23/04/2018