1 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/Lambert.f90"
4 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/Lambert.f90"
53 pref = sqrt(6.0_preal/
pi), &
54 a =
pi**(5.0_preal/6.0_preal)/6.0_preal**(1.0_preal/6.0_preal), &
55 ap =
pi**(2.0_preal/3.0_preal), &
58 r1 = (3.0_preal*
pi/4.0_preal)**(1.0_preal/3.0_preal), &
59 r2 = sqrt(2.0_preal), &
61 prek =
r1 * 2.0_preal**(1.0_preal/4.0_preal)/
beta
77 real(
preal),
intent(in),
dimension(3) :: cube
78 real(
preal),
dimension(3) :: ball, lamxyz, xyz
79 real(
preal),
dimension(2) :: t
80 real(
preal) :: c, s, q
81 real(
preal),
parameter :: eps = 1.0e-8_preal
82 integer,
dimension(3) :: p
83 integer,
dimension(2) :: order
85 if (maxval(abs(cube)) >
ap/2.0+eps)
then
86 ball = ieee_value(cube,ieee_positive_inf)
91 center:
if (all(
deq0(cube)))
then
99 special:
if (all(
deq0(xyz(1:2))))
then
100 lamxyz = [ 0.0_preal, 0.0_preal,
pref * xyz(3) ]
102 order = merge( [2,1], [1,2], abs(xyz(2)) <= abs(xyz(1)))
103 q =
pi12 * xyz(order(1))/xyz(order(2))
106 q =
prek * xyz(order(2))/ sqrt(
r2-c)
107 t = [ (
r2*c - 1.0),
r2 * s] * q
112 s =
pi * c/(24.0*xyz(3)**2)
113 c =
spi * c / sqrt(24.0_preal) / xyz(3)
115 lamxyz = [ t(order(2)) * q, t(order(1)) * q,
pref * xyz(3) - c ]
133 real(
preal),
intent(in),
dimension(3) :: xyz
134 real(
preal),
dimension(3) :: cube, xyz1, xyz3
135 real(
preal),
dimension(2) :: tinv, xyz2
136 real(
preal) :: rs, qxy, q2, sq2, q, tt
137 integer,
dimension(3) :: p
141 cube = ieee_value(cube,ieee_positive_inf)
145 center:
if (all(
deq0(xyz)))
then
152 xyz2 = xyz3(1:2) * sqrt( 2.0*rs/(rs+abs(xyz3(3))) )
157 special:
if (
deq0(qxy))
then
160 q2 = qxy + maxval(abs(xyz2))**2
162 q = (
beta/
r2/
r1) * sqrt(q2*qxy/(q2-maxval(abs(xyz2))*sq2))
163 tt = (minval(abs(xyz2))**2+maxval(abs(xyz2))*sq2)/
r2/qxy
164 tinv = q * sign(1.0_preal,xyz2) * merge([ 1.0_preal, acos(
math_clip(tt,-1.0_preal,1.0_preal))/
pi12], &
165 [ acos(
math_clip(tt,-1.0_preal,1.0_preal))/
pi12, 1.0_preal], &
166 abs(xyz2(2)) <= abs(xyz2(1)))
170 xyz1 = [ tinv(1), tinv(2), sign(1.0_preal,xyz3(3)) * rs /
pref ] /
sc
187 real(
preal),
intent(in),
dimension(3) :: xyz
190 if (((abs(xyz(1)) <= xyz(3)).and.(abs(xyz(2)) <= xyz(3))) .or. &
191 ((abs(xyz(1)) <= -xyz(3)).and.(abs(xyz(2)) <= -xyz(3))))
then
193 else if (((abs(xyz(3)) <= xyz(1)).and.(abs(xyz(2)) <= xyz(1))) .or. &
194 ((abs(xyz(3)) <= -xyz(1)).and.(abs(xyz(2)) <= -xyz(1))))
then
196 else if (((abs(xyz(1)) <= xyz(2)).and.(abs(xyz(3)) <= xyz(2))) .or. &
197 ((abs(xyz(1)) <= -xyz(2)).and.(abs(xyz(3)) <= -xyz(2))))
then