|
DAMASK with grid solvers
Revision: v2.0.3-2204-gdb1f2151
The Düsseldorf Advanced Material Simulation Kit with Grid Solvers
|
|
Go to the documentation of this file. 1 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/prec.f90"
4 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/prec.f90"
14 use,
intrinsic :: ieee_arithmetic
20 integer,
parameter ::
preal = ieee_selected_real_kind(15,307)
24 integer,
parameter ::
pint = selected_int_kind(9)
26 integer,
parameter ::
plongint = selected_int_kind(18)
34 real(
preal),
dimension(:),
pointer :: p
38 integer,
dimension(:),
pointer :: p
44 sizestate = 0, & !< size of state
46 offsetdeltastate = 0, &
48 real(
preal),
pointer,
dimension(:),
contiguous :: &
50 real(
preal),
pointer,
dimension(:,:),
contiguous :: &
53 dotstate, & !< rate of state change
55 real(
preal),
allocatable,
dimension(:,:) :: &
60 real(
preal),
allocatable,
dimension(:,:,:) :: &
68 real(
preal),
pointer,
dimension(:,:) :: &
69 sliprate, & !< slip rate
74 type(
tstate),
dimension(:),
allocatable :: p
78 integer,
pointer,
dimension(:,:) :: p
84 integer,
dimension(0),
parameter :: &
86 real(
preal),
dimension(0),
parameter :: &
88 character(len=pStringLen),
dimension(0),
parameter :: &
102 write(6,
'(/,a)')
' <<<+- prec init -+>>>'
104 write(6,
'(a,i3)')
' Size of integer in bit: ',bit_size(0)
105 write(6,
'(a,i19)')
' Maximum value: ',huge(0)
106 write(6,
'(/,a,i3)')
' Size of float in bit: ',storage_size(0.0_preal)
107 write(6,
'(a,e10.3)')
' Maximum value: ',huge(0.0_preal)
108 write(6,
'(a,e10.3)')
' Minimum value: ',tiny(0.0_preal)
109 write(6,
'(a,i3)')
' Decimal precision: ',precision(0.0_preal)
122 logical elemental pure function dEq(a,b,tol)
124 real(
preal),
intent(in) :: a,b
125 real(
preal),
intent(in),
optional :: tol
128 if (
present(tol))
then
134 deq = merge(.true.,.false.,abs(a-b) <= eps)
145 logical elemental pure function
dneq(a,b,tol)
147 real(
preal),
intent(in) :: a,b
148 real(
preal),
intent(in),
optional :: tol
150 if (
present(tol))
then
165 logical elemental pure function
deq0(a,tol)
167 real(
preal),
intent(in) :: a
168 real(
preal),
intent(in),
optional :: tol
171 if (
present(tol))
then
177 deq0 = merge(.true.,.false.,abs(a) <= eps)
188 logical elemental pure function
dneq0(a,tol)
190 real(
preal),
intent(in) :: a
191 real(
preal),
intent(in),
optional :: tol
193 if (
present(tol))
then
209 logical elemental pure function
ceq(a,b,tol)
211 complex(pReal),
intent(in) :: a,b
212 real(
preal),
intent(in),
optional :: tol
215 if (
present(tol))
then
221 ceq = merge(.true.,.false.,abs(a-b) <= eps)
233 logical elemental pure function
cneq(a,b,tol)
235 complex(pReal),
intent(in) :: a,b
236 real(
preal),
intent(in),
optional :: tol
238 if (
present(tol))
then
252 integer,
allocatable,
dimension(:) :: realloc_lhs_test
253 real(
preal),
dimension(2) :: r
257 call random_number(r)
260 if(
deq(r(1),r(2)) .and.
dneq(r(1),r(2)))
call quit(9000)
263 realloc_lhs_test = [1,2]
264 if (any(realloc_lhs_test/=[1,2]))
call quit(9000)
subroutine, private unittest
check correctness of some prec functions
logical elemental pure function deq(a, b, tol)
equality comparison for float with double precision
real(preal), dimension(0), parameter emptyrealarray
real(preal), parameter tol_math_check
tolerance for internal math self-checks (rotation)
integer, parameter plongint
number with at least up to +-1e18 (typically 64 bit)
integer, parameter ppathlen
maximum length of a path name on linux
character(len=pstringlen), dimension(0), parameter emptystringarray
real(preal), parameter, private preal_epsilon
minimum positive number such that 1.0 + EPSILON /= 1.0.
setting precision for real and int type
integer, parameter pstringlen
default string length
subroutine prec_init
reporting precision
logical elemental pure function dneq0(a, tol)
inequality to 0 comparison for float with double precision
integer, parameter preal
number with 15 significant digits, up to 1e+-307 (typically 64 bit)
subroutine quit(stop_id)
quit subroutine
logical elemental pure function ceq(a, b, tol)
equality comparison for complex with double precision
logical elemental pure function cneq(a, b, tol)
inequality comparison for complex with double precision
logical elemental pure function dneq(a, b, tol)
inequality comparison for float with double precision
variable length datatype used for storage of state
integer, dimension(0), parameter emptyintarray
integer, parameter pint
number with at least up to +-1e9 (typically 32 bit)
logical elemental pure function deq0(a, tol)
equality to 0 comparison for float with double precision
real(preal), parameter, private preal_min
smallest normalized floating point number