45 REAL (rprec),
DIMENSION(3),
INTENT(in) :: cart
48 cart_to_cyl(1) = sqrt(dot_product(cart(1:2), cart(1:2)))
72 REAL (rprec),
DIMENSION(3),
INTENT(in) :: cyl
100 REAL (rprec),
DIMENSION(3),
INTENT(in) :: cyl
101 REAL (rprec),
DIMENSION(3),
INTENT(in) :: vec
131 REAL (rprec),
DIMENSION(3),
INTENT(in) :: cart
132 REAL (rprec),
DIMENSION(3),
INTENT(in) :: vec
138 r = sqrt(dot_product(cart(1:2), cart(1:2)))
164 REAL (rprec),
DIMENSION(3) :: result
177 result =
cart_to_cyl((/ -1.0d+0, 0.0d+0, 0.0d+0 /))
186 result =
cart_to_cyl((/ 0.0d+0, 1.0d+0, -1.0d+0 /))
214 result =
cyl_to_cart((/ 1.0d+0, pi/2.0d+0, -1.0d+0 /))
216 &
check(cos(pi/2.0d+0), result(1), 7,
"cyl_to_cart")
225 & (/ 1.0d+0, 0.0d+0, 0.0d+0 /))
235 & (/ 0.0d+0, 1.0d+0, 0.0d+0 /))
245 & (/ 0.0d+0, 0.0d+0, 1.0d+0 /))
270 FUNCTION check(expected, received, testNum, name)
276 REAL (rprec),
INTENT(in) :: expected
277 REAL (rprec),
INTENT(in) :: received
278 INTEGER,
INTENT(in) :: testnum
279 CHARACTER (LEN=*),
INTENT(in) :: name
282 REAL(rprec),
PARAMETER :: range = 1.0e-15_dp
285 check = (expected .eq. received) .or.
286 & ((expected .lt. received + range) .and.
287 & (expected .gt. received - range))
289 write(*,*)
"coordinate_utilities.f: ", name,
" test", testnum,
291 write(*,*)
"Expected", expected,
"Received", received