67 real(kind=
rp),
public,
parameter ::
neko_eps = epsilon(1.0_rp)
73 real(kind=
rp),
public,
parameter ::
pi = 4._rp*atan(1._rp)
84 glsum,
glmax,
glmin,
chsign,
vlmax,
vlmin,
invcol1,
invcol3,
invers2,
vcross, &
85 vdot2,
vdot3,
vlsc3,
vlsc2,
add2,
add3,
add4,
sub2,
sub3,
add2s1,
add2s2, &
94 real(kind=
sp),
intent(in) :: x
95 real(kind=
sp),
intent(in) :: y
104 real(kind=
dp),
intent(in) :: x
105 real(kind=
dp),
intent(in) :: y
114 real(kind=
qp),
intent(in) :: x
115 real(kind=
qp),
intent(in) :: y
124 real(kind=
sp),
intent(in) :: x
125 real(kind=
sp),
intent(in) :: y
126 real(kind=
sp),
intent(in),
optional :: eps
128 if (
present(eps))
then
129 srelcmp = abs(x - y) .le. eps*abs(y)
138 real(kind=
dp),
intent(in) :: x
139 real(kind=
dp),
intent(in) :: y
140 real(kind=
dp),
intent(in),
optional :: eps
142 if (
present(eps))
then
143 drelcmp = abs(x - y) .le. eps*abs(y)
153 real(kind=
qp),
intent(in) :: x
154 real(kind=
qp),
intent(in) :: y
155 real(kind=
qp),
intent(in),
optional :: eps
157 if (
present(eps))
then
158 qrelcmp = abs(x - y)/abs(y) .lt. eps
167 integer,
intent(in) :: n
168 real(kind=
rp),
dimension(n),
intent(inout) :: a
178 integer,
intent(in) :: n
179 integer,
dimension(n),
intent(inout) :: a
189 integer,
intent(in) :: m, n, e
190 real(kind=
rp),
intent(inout) :: a(m,n)
200 integer,
intent(in) :: n
201 real(kind=
rp),
dimension(n),
intent(inout) :: a
211 integer,
intent(in) :: n
212 real(kind=
rp),
dimension(n),
intent(in) :: b
213 real(kind=
rp),
dimension(n),
intent(inout) :: a
230 integer,
intent(in) :: n, m
231 real(kind=
rp),
dimension(n),
intent(in) :: b
232 real(kind=
rp),
dimension(n),
intent(inout) :: a
233 integer,
dimension(0:m) :: mask
246 integer,
intent(in) :: n
247 real(kind=
rp),
dimension(n),
intent(inout) :: a
248 real(kind=
rp),
intent(in) :: c
258 integer,
intent(in) :: n
259 real(kind=
rp),
dimension(n),
intent(inout) :: a
260 real(kind=
rp),
intent(in) :: s
270 integer,
intent(in) :: n
271 real(kind=
rp),
dimension(n),
intent(inout) :: a
272 real(kind=
rp),
intent(in) :: c
282 integer,
intent(in) :: n
283 real(kind=
rp),
dimension(n) :: a
290 call mpi_allreduce(tmp,
glsum, 1, &
297 integer,
intent(in) :: n
298 real(kind=
rp),
dimension(n) :: a
305 call mpi_allreduce(tmp,
glmax, 1, &
311 integer,
intent(in) :: n
312 integer,
dimension(n) :: a
319 call mpi_allreduce(tmp,
glimax, 1, &
325 integer,
intent(in) :: n
326 real(kind=
rp),
dimension(n) :: a
333 call mpi_allreduce(tmp,
glmin, 1, &
339 integer,
intent(in) :: n
340 integer,
dimension(n) :: a
347 call mpi_allreduce(tmp,
glimin, 1, &
356 integer,
intent(in) :: n
357 real(kind=
rp),
dimension(n),
intent(inout) :: a
369 real(kind=
rp),
intent(in) :: vec(n)
370 real(kind=
rp) :: tmax
373 tmax =
max(tmax,vec(i))
379 integer,
intent(in) :: n
380 real(kind=
rp),
intent(in) :: vec(n)
381 real(kind=
rp) :: tmin
385 tmin = min(tmin,vec(i))
391 integer,
intent(in) :: n
392 real(kind=
rp),
dimension(n),
intent(inout) :: a
403 integer,
intent(in) :: n
404 real(kind=
rp),
dimension(n),
intent(inout) :: a
405 real(kind=
rp),
dimension(n),
intent(in) :: b,c
416 integer,
intent(in) :: n
417 real(kind=
rp),
dimension(n),
intent(inout) :: a
418 real(kind=
rp),
dimension(n),
intent(in) :: b
429 subroutine vcross(u1, u2, u3, v1, v2, v3, w1, w2, w3, n)
430 integer,
intent(in) :: n
431 real(kind=
rp),
dimension(n),
intent(in) :: v1, v2, v3
432 real(kind=
rp),
dimension(n),
intent(in) :: w1, w2, w3
433 real(kind=
rp),
dimension(n),
intent(out) :: u1, u2, u3
437 u1(i) = v2(i)*w3(i) - v3(i)*w2(i)
438 u2(i) = v3(i)*w1(i) - v1(i)*w3(i)
439 u3(i) = v1(i)*w2(i) - v2(i)*w1(i)
446 subroutine vdot2(dot, u1, u2, v1, v2, n)
447 integer,
intent(in) :: n
448 real(kind=
rp),
dimension(n),
intent(in) :: u1, u2
449 real(kind=
rp),
dimension(n),
intent(in) :: v1, v2
450 real(kind=
rp),
dimension(n),
intent(out) :: dot
453 dot(i) = u1(i)*v1(i) + u2(i)*v2(i)
460 subroutine vdot3(dot, u1, u2, u3, v1, v2, v3, n)
461 integer,
intent(in) :: n
462 real(kind=
rp),
dimension(n),
intent(in) :: u1, u2, u3
463 real(kind=
rp),
dimension(n),
intent(in) :: v1, v2, v3
464 real(kind=
rp),
dimension(n),
intent(out) :: dot
468 dot(i) = u1(i)*v1(i) + u2(i)*v2(i) + u3(i)*v3(i)
474 function vlsc3(u, v, w, n)
result(s)
475 integer,
intent(in) :: n
476 real(kind=
rp),
dimension(n),
intent(in) :: u, v, w
482 s = s + u(i)*v(i)*w(i)
489 integer,
intent(in) :: n
490 real(kind=
rp),
dimension(n),
intent(in) :: u, v
503 integer,
intent(in) :: n
504 real(kind=
rp),
dimension(n),
intent(inout) :: a
505 real(kind=
rp),
dimension(n),
intent(in) :: b
516 integer,
intent(in) :: n
517 real(kind=
rp),
dimension(n),
intent(inout) :: c
518 real(kind=
rp),
dimension(n),
intent(inout) :: b
519 real(kind=
rp),
dimension(n),
intent(out) :: a
530 integer,
intent(in) :: n
531 real(kind=
rp),
dimension(n),
intent(inout) :: d
532 real(kind=
rp),
dimension(n),
intent(inout) :: c
533 real(kind=
rp),
dimension(n),
intent(inout) :: b
534 real(kind=
rp),
dimension(n),
intent(out) :: a
538 a(i) = b(i) + c(i) + d(i)
545 integer,
intent(in) :: n
546 real(kind=
rp),
dimension(n),
intent(inout) :: a
547 real(kind=
rp),
dimension(n),
intent(inout) :: b
558 integer,
intent(in) :: n
559 real(kind=
rp),
dimension(n),
intent(inout) :: c
560 real(kind=
rp),
dimension(n),
intent(inout) :: b
561 real(kind=
rp),
dimension(n),
intent(out) :: a
574 integer,
intent(in) :: n
575 real(kind=
rp),
dimension(n),
intent(inout) :: a
576 real(kind=
rp),
dimension(n),
intent(inout) :: b
577 real(kind=
rp),
intent(in) :: c1
581 a(i) = c1 * a(i) + b(i)
589 integer,
intent(in) :: n
590 real(kind=
rp),
dimension(n),
intent(inout) :: a
591 real(kind=
rp),
dimension(n),
intent(inout) :: b
592 real(kind=
rp),
intent(in) :: c1
596 a(i) = a(i) + c1 * b(i)
603 integer,
intent(in) :: n
604 real(kind=
rp),
dimension(n),
intent(inout) :: a
605 real(kind=
rp),
dimension(n),
intent(in) :: b
606 real(kind=
rp),
intent(in) :: c1
610 a(i) = a(i) + c1 * ( b(i) * b(i) )
617 integer,
intent(in) :: n
618 real(kind=
rp),
dimension(n),
intent(inout) :: a
619 real(kind=
rp),
dimension(n),
intent(in) :: b
620 real(kind=
rp),
intent(in) :: c
631 integer,
intent(in) :: n
632 real(kind=
rp),
dimension(n),
intent(inout) :: a
633 real(kind=
rp),
dimension(n),
intent(in) :: b
645 integer,
intent(in) :: n
646 real(kind=
rp),
dimension(n),
intent(inout) :: a
647 real(kind=
rp),
dimension(n),
intent(in) :: b
658 integer,
intent(in) :: n
659 real(kind=
rp),
dimension(n),
intent(inout) :: a
660 real(kind=
rp),
dimension(n),
intent(in) :: b
661 real(kind=
rp),
dimension(n),
intent(in) :: c
672 integer,
intent(in) :: n
673 real(kind=
rp),
dimension(n),
intent(inout) :: a
674 real(kind=
rp),
dimension(n),
intent(in) :: b
675 real(kind=
rp),
dimension(n),
intent(in) :: c
679 a(i) = a(i) - b(i) * c(i)
686 integer,
intent(in) :: n
687 real(kind=
rp),
dimension(n),
intent(inout) :: a
688 real(kind=
rp),
dimension(n),
intent(in) :: b
689 real(kind=
rp),
dimension(n),
intent(in) :: c
690 real(kind=
rp),
intent(in) :: c1, c2
694 a(i) = c1 * b(i) + c2 * c(i)
702 integer,
intent(in) :: n
703 real(kind=
rp),
dimension(n),
intent(inout) :: a
704 real(kind=
rp),
dimension(n),
intent(in) :: b
705 real(kind=
rp),
dimension(n),
intent(in) :: c
706 real(kind=
rp),
dimension(n),
intent(in) :: d
710 a(i) = a(i) - b(i) * c(i) * d(i)
717 integer,
intent(in) :: n
718 real(kind=
rp),
dimension(n),
intent(inout) :: a
719 real(kind=
rp),
dimension(n),
intent(in) :: b
720 real(kind=
rp),
dimension(n),
intent(in) :: c
724 a(i) = a(i) + b(i) * c(i)
731 integer,
intent(in) :: n
732 real(kind=
rp),
dimension(n),
intent(inout) :: a
733 real(kind=
rp),
dimension(n),
intent(in) :: b
734 real(kind=
rp),
dimension(n),
intent(in) :: c
735 real(kind=
rp),
dimension(n),
intent(in) :: d
739 a(i) = a(i) + b(i) * c(i) * d(i)
746 integer,
intent(in) :: n
747 real(kind=
rp),
dimension(n),
intent(inout) :: a
748 real(kind=
rp),
dimension(n),
intent(in) :: b
749 real(kind=
rp),
dimension(n),
intent(in) :: c
750 real(kind=
rp),
dimension(n),
intent(in) :: d
751 real(kind=
rp),
dimension(n),
intent(in) :: e
755 a(i) = b(i)*c(i)-d(i)*e(i)
762 integer,
intent(in) :: n
763 real(kind=
rp),
dimension(n),
intent(inout) :: a
764 real(kind=
rp),
dimension(n),
intent(in) :: b
765 real(kind=
rp),
dimension(n),
intent(in) :: c
766 real(kind=
rp),
intent(in) :: c1, c2
770 a(i) = b(i) + c1*(a(i)-c2*c(i))
777 integer,
intent(in) :: n
778 real(kind=
rp),
dimension(n),
intent(inout) :: a
779 real(kind=
rp),
dimension(n),
intent(in) :: b
780 real(kind=
rp),
dimension(n),
intent(in) :: c
781 real(kind=
rp),
intent(in) :: c1, c2
785 a(i) = a(i) + c1*b(i)+c2*c(i)
792 integer,
intent(in) :: n
793 real(kind=
rp),
dimension(n),
intent(in) :: a
794 real(kind=
rp),
dimension(n),
intent(in) :: b
800 tmp = tmp + a(i) * b(i)
803 call mpi_allreduce(tmp,
glsc2, 1, &
810 integer,
intent(in) :: n
811 real(kind=
rp),
dimension(n),
intent(in) :: a
812 real(kind=
rp),
dimension(n),
intent(in) :: b
813 real(kind=
rp),
dimension(n),
intent(in) :: c
819 tmp = tmp + a(i) * b(i) * c(i)
822 call mpi_allreduce(tmp,
glsc3, 1, &
827 integer,
intent(in) :: n
828 real(kind=
rp),
dimension(n),
intent(in) :: a
829 real(kind=
rp),
dimension(n),
intent(in) :: b
830 real(kind=
rp),
dimension(n),
intent(in) :: c
831 real(kind=
rp),
dimension(n),
intent(in) :: d
837 tmp = tmp + a(i) * b(i) * c(i) * d(i)
840 call mpi_allreduce(tmp,
glsc4, 1, &
846 integer,
intent(in) :: n
847 real(kind=
rp),
intent(inout) :: a(n)
848 integer,
intent(inout) :: ind(n)
850 integer :: j, ir, i, ii, l
880 if ( a(j).lt.a(j+1) ) j=j+1
type(mpi_comm) neko_comm
MPI communicator.
type(mpi_datatype) mpi_real_precision
MPI type for working precision of REAL types.
subroutine, public cmult(a, c, n)
Multiplication by constant c .
subroutine, public cmult2(a, b, c, n)
Multiplication by constant c .
subroutine, public row_zero(a, m, n, e)
Sets row e to 0 in matrix a.
subroutine, public invcol2(a, b, n)
Vector division .
real(kind=rp) function, public vlsc2(u, v, n)
Compute multiplication sum .
real(kind=rp), parameter, public pi
real(kind=rp) function, public glsc3(a, b, c, n)
Weighted inner product .
pure logical function qabscmp(x, y)
Return double precision absolute comparison .
subroutine, public ascol5(a, b, c, d, e, n)
Returns .
subroutine, public invers2(a, b, n)
Compute inverted vector .
subroutine, public cadd(a, s, n)
Add a scalar to vector .
subroutine, public addsqr2s2(a, b, c1, n)
Returns .
real(kind=rp) function, public glsc4(a, b, c, d, n)
subroutine, public add2s1(a, b, c1, n)
Vector addition with scalar multiplication (multiplication on first argument)
real(kind=rp) function, public glsc2(a, b, n)
Weighted inner product .
subroutine, public subcol3(a, b, c, n)
Returns .
subroutine, public rone(a, n)
Set all elements to one.
subroutine, public x_update(a, b, c, c1, c2, n)
Returns .
subroutine, public add3(a, b, c, n)
Vector addition .
integer function, public glimin(a, n)
Min of an integer vector of length n.
real(kind=rp) function, public glsum(a, n)
Sum a vector of length n.
subroutine, public sub3(a, b, c, n)
Vector subtraction .
subroutine, public addcol4(a, b, c, d, n)
Returns .
subroutine, public add2(a, b, n)
Vector addition .
subroutine, public cfill(a, c, n)
Set all elements to a constant c .
subroutine, public invcol3(a, b, c, n)
Invert a vector .
pure logical function sabscmp(x, y)
Return single precision absolute comparison .
subroutine, public add3s2(a, b, c, c1, c2, n)
Returns .
subroutine, public subcol4(a, b, c, d, n)
Returns .
subroutine, public addcol3(a, b, c, n)
Returns .
pure logical function dabscmp(x, y)
Return double precision absolute comparison .
subroutine, public invcol1(a, n)
Invert a vector .
subroutine, public masked_copy(a, b, mask, n, m)
Copy a masked vector .
real(kind=rp), parameter, public neko_m_ln2
subroutine, public chsign(a, n)
Change sign of vector .
subroutine, public col2(a, b, n)
Vector multiplication .
subroutine, public izero(a, n)
Zero an integer vector.
real(kind=rp) function, public glmax(a, n)
Max of a vector of length n.
subroutine, public sort(a, ind, n)
Use Heap Sort (p 231 Num. Rec., 1st Ed.)
subroutine, public copy(a, b, n)
Copy a vector .
subroutine, public add4(a, b, c, d, n)
Vector addition .
subroutine, public col3(a, b, c, n)
Vector multiplication with 3 vectors .
pure logical function drelcmp(x, y, eps)
Return double precision relative comparison .
real(kind=rp), parameter, public neko_eps
Machine epsilon .
subroutine, public vdot3(dot, u1, u2, u3, v1, v2, v3, n)
Compute a dot product (3-d version) assuming vector components etc.
pure logical function qrelcmp(x, y, eps)
Return quad precision relative comparison .
subroutine, public rzero(a, n)
Zero a real vector.
subroutine, public vdot2(dot, u1, u2, v1, v2, n)
Compute a dot product (2-d version) assuming vector components etc.
real(kind=rp) function, public vlmin(vec, n)
minimun value of a vector of length n
real(kind=rp) function, public vlmax(vec, n)
maximum value of a vector of length n
integer function, public glimax(a, n)
Max of an integer vector of length n.
subroutine, public sub2(a, b, n)
Vector substraction .
subroutine, public add2s2(a, b, c1, n)
Vector addition with scalar multiplication (multiplication on second argument)
real(kind=rp) function, public glmin(a, n)
Min of a vector of length n.
subroutine, public vcross(u1, u2, u3, v1, v2, v3, w1, w2, w3, n)
Compute a cross product assuming vector components etc.
pure logical function srelcmp(x, y, eps)
Return single precision relative comparison .
real(kind=rp) function, public vlsc3(u, v, w, n)
Compute multiplication sum .
subroutine, public p_update(a, b, c, c1, c2, n)
Returns .
integer, parameter, public qp
integer, parameter, public dp
integer, parameter, public sp
integer, parameter, public rp
Global precision used in computations.