-
Notifications
You must be signed in to change notification settings - Fork 1
/
modprecision-dp.f90
38 lines (31 loc) · 1.59 KB
/
modprecision-dp.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
!> \file modprecision.f90
!>
!! Declare all precisions used throughout DALES
!>
!! We will start with the precision on a per-file basis
!! \author Victor Azizi, Escience Center
!! \par Revision list
!! Notes
!! Real(4) does not (necessarily) means a 4-byte single precision floating point
!! this is up to the compiler to decide.
!! please use the iso_fortran_env real32, real64 etc. or use the
!! selected_real_kind intrinsic to select a suitable kind
module modprecision
use iso_fortran_env, only : real32, real64, real128, int16, int32, int64
integer, parameter :: longint = int64
!< double precision kind for lacz_gamma
INTEGER, PARAMETER :: dp = SELECTED_REAL_KIND(12, 60)
!< Parameter kinds, for rrtmg radiation scheme
integer, parameter :: kind_rb = real64 !selected_real_kind(12) ! 8 byte real
integer, parameter :: kind_im = int32 !selected_int_kind(6) ! 4 byte integer
integer, parameter :: SHR_KIND_R4 = real32 !selected_real_kind( 6) ! 4 byte real
integer, parameter :: SHR_KIND_IN = kind(1) ! native integer
!! Module specific precisions
integer, parameter :: field_r = real64 ! Precision for the most common fields u, v, w
! And all other fields that do not have
! their own kind and need to interoperate
integer, parameter :: pois_r = real64 ! Precision for the poisson solver,
! Precision for p and Fp fields
! Precision for all internal fields in
! the old fft and fftw module
end module