63  use mpi_f08, 
only: mpi_min, mpi_max, mpi_sum, mpi_in_place, mpi_integer, &
 
   69  real(kind=
rp), 
public, 
parameter :: 
neko_eps = epsilon(1.0_rp)
 
   75  real(kind=
rp), 
public, 
parameter :: 
pi = 4._rp*atan(1._rp)
 
  103       vcross, 
vdot2, 
vdot3, 
vlsc3, 
vlsc2, 
add2, 
add3, 
add4, 
sub2, 
sub3, &
 
  117    real(kind=
sp), 
intent(in) :: x
 
  118    real(kind=
sp), 
intent(in) :: y
 
  119    real(kind=
sp), 
intent(in), 
optional :: tol
 
  122    if (
present(tol)) 
then 
 
  132    real(kind=
dp), 
intent(in) :: x
 
  133    real(kind=
dp), 
intent(in) :: y
 
  134    real(kind=
dp), 
intent(in), 
optional :: tol
 
  137    if (
present(tol)) 
then 
 
  147    real(kind=
qp), 
intent(in) :: x
 
  148    real(kind=
qp), 
intent(in) :: y
 
  149    real(kind=
qp), 
intent(in), 
optional :: tol
 
  152    if (
present(tol)) 
then 
 
  162    real(kind=
sp), 
intent(in) :: x
 
  163    real(kind=
sp), 
intent(in) :: y
 
  164    real(kind=
sp), 
intent(in), 
optional :: eps
 
  166    if (
present(eps)) 
then 
  167       srelcmp = abs(x - y) .le. eps*abs(y)
 
 
  176    real(kind=
dp), 
intent(in) :: x
 
  177    real(kind=
dp), 
intent(in) :: y
 
  178    real(kind=
dp), 
intent(in), 
optional :: eps
 
  180    if (
present(eps)) 
then 
  181       drelcmp = abs(x - y) .le. eps*abs(y)
 
 
  191    real(kind=
qp), 
intent(in) :: x
 
  192    real(kind=
qp), 
intent(in) :: y
 
  193    real(kind=
qp), 
intent(in), 
optional :: eps
 
  195    if (
present(eps)) 
then 
  196       qrelcmp = abs(x - y)/abs(y) .lt. eps
 
 
  205    integer, 
intent(in) :: n
 
  206    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
 
  216    integer, 
intent(in) :: n
 
  217    integer, 
dimension(n), 
intent(inout) :: a
 
 
  227    integer, 
intent(in) :: m, n, e
 
  228    real(kind=
rp), 
intent(inout) :: a(m,n)
 
 
  238    integer, 
intent(in) :: n
 
  239    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
 
  249    integer, 
intent(in) :: n
 
  250    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
  251    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
 
  268    integer, 
intent(in) :: n, n_mask
 
  269    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
  270    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  271    integer, 
dimension(0:n_mask) :: 
mask 
 
  289    integer, 
intent(in) :: n, n_mask
 
  290    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
  291    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  292    integer, 
dimension(n_mask) :: 
mask 
 
  312    integer, 
intent(in) :: n, n_mask
 
  313    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
  314    real(kind=
rp), 
dimension(n_mask), 
intent(inout) :: a
 
  315    integer, 
dimension(0:n_mask) :: 
mask 
 
  335    integer, 
intent(in) :: n, n_mask
 
  336    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
  337    real(kind=
rp), 
dimension(n_mask), 
intent(inout) :: a
 
  338    integer, 
dimension(n_mask) :: 
mask 
 
  358    integer, 
intent(in) :: n, n_mask
 
  359    real(kind=
rp), 
dimension(n_mask), 
intent(in) :: b
 
  360    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  361    integer, 
dimension(0:n_mask) :: 
mask 
 
  381    integer, 
intent(in) :: n, n_mask
 
  382    real(kind=
rp), 
dimension(n_mask), 
intent(in) :: b
 
  383    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  384    integer, 
dimension(n_mask) :: 
mask 
 
  397    integer, 
intent(in) :: n, n_mask
 
  398    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  399    real(kind=
rp), 
intent(in) :: c
 
  400    integer, 
dimension(n_mask), 
intent(in) :: 
mask 
 
  411    integer, 
intent(in) :: n
 
  412    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  413    real(kind=
rp), 
intent(in) :: c
 
 
  423    integer, 
intent(in) :: n
 
  424    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  425    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
  426    real(kind=
rp), 
intent(in) :: c
 
 
  437    integer, 
intent(in) :: n
 
  438    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  439    real(kind=
rp), 
intent(in) :: c
 
 
  449    integer, 
intent(in) :: n
 
  450    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  451    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
  452    real(kind=
rp), 
intent(in) :: c
 
 
  462    integer, 
intent(in) :: n
 
  463    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  464    real(kind=
rp), 
intent(in) :: s
 
 
  474    integer, 
intent(in) :: n
 
  475    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  476    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
  477    real(kind=
rp), 
intent(in) :: s
 
 
  487    integer, 
intent(in) :: n
 
  488    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  489    real(kind=
rp), 
intent(in) :: c
 
 
  499    integer, 
intent(in) :: n
 
  500    real(kind=
rp), 
dimension(n) :: a
 
  508    call mpi_allreduce(mpi_in_place, tmp, 1, &
 
 
  516    integer, 
intent(in) :: n
 
  517    real(kind=
rp), 
dimension(n) :: a
 
  525    call mpi_allreduce(tmp, 
glmax, 1, &
 
 
  531    integer, 
intent(in) :: n
 
  532    integer, 
dimension(n) :: a
 
  540    call mpi_allreduce(tmp, 
glimax, 1, &
 
 
  546    integer, 
intent(in) :: n
 
  547    real(kind=
rp), 
dimension(n) :: a
 
  555    call mpi_allreduce(tmp, 
glmin, 1, &
 
 
  561    integer, 
intent(in) :: n
 
  562    integer, 
dimension(n) :: a
 
  570    call mpi_allreduce(tmp, 
glimin, 1, &
 
 
  579    integer, 
intent(in) :: n
 
  580    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
 
  592    real(kind=
rp), 
intent(in) :: vec(n)
 
  593    real(kind=
rp) :: tmax
 
  596       tmax = 
max(tmax, vec(i))
 
 
  602    integer, 
intent(in) :: n
 
  603    real(kind=
rp), 
intent(in) :: vec(n)
 
  604    real(kind=
rp) :: tmin
 
  608       tmin = min(tmin, vec(i))
 
 
  614    integer, 
intent(in) :: n
 
  615    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  619       a(i) = 1.0_xp / 
real(a(i),
xp)
 
 
  626    integer, 
intent(in) :: n
 
  627    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  628    real(kind=
rp), 
dimension(n), 
intent(in) :: b,c
 
  632       a(i) = 
real(b(i),
xp) / c(i)
 
 
  639    integer, 
intent(in) :: n
 
  640    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  641    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
  645       a(i) = 1.0_xp / 
real(b(i),
xp)
 
 
  652  subroutine vcross(u1, u2, u3, v1, v2, v3, w1, w2, w3, n)
 
  653    integer, 
intent(in) :: n
 
  654    real(kind=
rp), 
dimension(n), 
intent(in) :: v1, v2, v3
 
  655    real(kind=
rp), 
dimension(n), 
intent(in) :: w1, w2, w3
 
  656    real(kind=
rp), 
dimension(n), 
intent(out) :: u1, u2, u3
 
  660       u1(i) = v2(i)*w3(i) - v3(i)*w2(i)
 
  661       u2(i) = v3(i)*w1(i) - v1(i)*w3(i)
 
  662       u3(i) = v1(i)*w2(i) - v2(i)*w1(i)
 
 
  669  subroutine vdot2(dot, u1, u2, v1, v2, n)
 
  670    integer, 
intent(in) :: n
 
  671    real(kind=
rp), 
dimension(n), 
intent(in) :: u1, u2
 
  672    real(kind=
rp), 
dimension(n), 
intent(in) :: v1, v2
 
  673    real(kind=
rp), 
dimension(n), 
intent(out) :: dot
 
  676       dot(i) = u1(i)*v1(i) + u2(i)*v2(i)
 
 
  683  subroutine vdot3(dot, u1, u2, u3, v1, v2, v3, n)
 
  684    integer, 
intent(in) :: n
 
  685    real(kind=
rp), 
dimension(n), 
intent(in) :: u1, u2, u3
 
  686    real(kind=
rp), 
dimension(n), 
intent(in) :: v1, v2, v3
 
  687    real(kind=
rp), 
dimension(n), 
intent(out) :: dot
 
  691       dot(i) = u1(i)*v1(i) + u2(i)*v2(i) + u3(i)*v3(i)
 
 
  697  function vlsc3(u, v, w, n) 
result(s)
 
  698    integer, 
intent(in) :: n
 
  699    real(kind=
rp), 
dimension(n), 
intent(in) :: u, v, w
 
  705       s = s + u(i)*v(i)*w(i)
 
 
  712    integer, 
intent(in) :: n
 
  713    real(kind=
rp), 
dimension(n), 
intent(in) :: u, v
 
 
  726    integer, 
intent(in) :: n
 
  727    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  728    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
 
  739    integer, 
intent(in) :: n
 
  740    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  741    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
  742    real(kind=
rp), 
dimension(n), 
intent(in) :: c
 
 
  753    integer, 
intent(in) :: n
 
  754    real(kind=
rp), 
dimension(n), 
intent(out) :: a
 
  755    real(kind=
rp), 
dimension(n), 
intent(in) :: d
 
  756    real(kind=
rp), 
dimension(n), 
intent(in) :: c
 
  757    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
  761       a(i) = b(i) + c(i) + d(i)
 
 
  768    integer, 
intent(in) :: n
 
  769    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  770    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
 
  781    integer, 
intent(in) :: n
 
  782    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  783    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
  784    real(kind=
rp), 
dimension(n), 
intent(in) :: c
 
 
  797    integer, 
intent(in) :: n
 
  798    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  799    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
  800    real(kind=
rp), 
intent(in) :: c1
 
  804       a(i) = c1 * a(i) + b(i)
 
 
  812    integer, 
intent(in) :: n
 
  813    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  814    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
  815    real(kind=
rp), 
intent(in) :: c1
 
  819       a(i) = a(i) + c1 * b(i)
 
 
  826    integer, 
intent(in) :: n
 
  827    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  828    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
  829    real(kind=
rp), 
intent(in) :: c1
 
  833       a(i) = a(i) + c1 * ( b(i) * b(i) )
 
 
  840    integer, 
intent(in) :: n
 
  841    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  842    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
  846       a(i) = 
real(a(i),
xp) /b(i)
 
 
  854    integer, 
intent(in) :: n
 
  855    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  856    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
 
  867    integer, 
intent(in) :: n
 
  868    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  869    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
  870    real(kind=
rp), 
dimension(n), 
intent(in) :: c
 
 
  881    integer, 
intent(in) :: n
 
  882    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  883    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
  884    real(kind=
rp), 
dimension(n), 
intent(in) :: c
 
  888       a(i) = a(i) - b(i) * c(i)
 
 
  895    integer, 
intent(in) :: n
 
  896    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  897    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
  898    real(kind=
rp), 
dimension(n), 
intent(in) :: c
 
  899    real(kind=
rp), 
intent(in) :: c1, c2
 
  903       a(i) = c1 * b(i) + c2 * c(i)
 
 
  909  subroutine add4s3(a, b, c, d, c1, c2, c3, n)
 
  910    integer, 
intent(in) :: n
 
  911    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  912    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
  913    real(kind=
rp), 
dimension(n), 
intent(in) :: c
 
  914    real(kind=
rp), 
dimension(n), 
intent(in) :: d
 
  915    real(kind=
rp), 
intent(in) :: c1, c2, c3
 
  919       a(i) = c1 * b(i) + c2 * c(i) + c3 * d(i)
 
 
  925  subroutine add5s4(a, b, c, d, e, c1, c2, c3, c4, n)
 
  926    integer, 
intent(in) :: n
 
  927    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  928    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
  929    real(kind=
rp), 
dimension(n), 
intent(in) :: c
 
  930    real(kind=
rp), 
dimension(n), 
intent(in) :: d
 
  931    real(kind=
rp), 
dimension(n), 
intent(in) :: e
 
  932    real(kind=
rp), 
intent(in) :: c1, c2, c3, c4
 
  936       a(i) = a(i) + c1 * b(i) + c2 * c(i) + c3 * d(i) + c4 * e(i)
 
 
  943    integer, 
intent(in) :: n
 
  944    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  945    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
  946    real(kind=
rp), 
dimension(n), 
intent(in) :: c
 
  947    real(kind=
rp), 
dimension(n), 
intent(in) :: d
 
  951       a(i) = a(i) - b(i) * c(i) * d(i)
 
 
  958    integer, 
intent(in) :: n
 
  959    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  960    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
  961    real(kind=
rp), 
dimension(n), 
intent(in) :: c
 
  965       a(i) = a(i) + b(i) * c(i)
 
 
  972    integer, 
intent(in) :: n
 
  973    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  974    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
  975    real(kind=
rp), 
dimension(n), 
intent(in) :: c
 
  976    real(kind=
rp), 
dimension(n), 
intent(in) :: d
 
  980       a(i) = a(i) + b(i) * c(i) * d(i)
 
 
  987    integer, 
intent(in) :: n
 
  988    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
  989    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
  990    real(kind=
rp), 
dimension(n), 
intent(in) :: c
 
  991    real(kind=
rp), 
intent(in) :: s
 
  995       a(i) = a(i) + s * b(i) * c(i)
 
 
 1002    integer, 
intent(in) :: n
 
 1003    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
 1004    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
 1005    real(kind=
rp), 
dimension(n), 
intent(in) :: c
 
 1006    real(kind=
rp), 
dimension(n), 
intent(in) :: d
 
 1007    real(kind=
rp), 
dimension(n), 
intent(in) :: e
 
 1011       a(i) = b(i)*c(i)-d(i)*e(i)
 
 
 1018    integer, 
intent(in) :: n
 
 1019    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
 1020    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
 1021    real(kind=
rp), 
dimension(n), 
intent(in) :: c
 
 1022    real(kind=
rp), 
intent(in) :: c1, c2
 
 1026       a(i) = b(i) + c1*(a(i)-c2*c(i))
 
 
 1033    integer, 
intent(in) :: n
 
 1034    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
 1035    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
 1036    real(kind=
rp), 
dimension(n), 
intent(in) :: c
 
 1037    real(kind=
rp), 
intent(in) :: c1, c2
 
 1041       a(i) = a(i) + c1*b(i)+c2*c(i)
 
 
 1048    integer, 
intent(in) :: n
 
 1049    real(kind=
rp), 
dimension(n), 
intent(in) :: a
 
 1050    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
 1052    real(kind=
xp) :: tmp
 
 1057       tmp = tmp + a(i) * b(i)
 
 1060    call mpi_allreduce(mpi_in_place, tmp, 1, &
 
 
 1067    integer, 
intent(in) :: n
 
 1068    real(kind=
rp), 
dimension(n), 
intent(in) :: a
 
 1069    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
 1070    real(kind=
rp), 
dimension(n), 
intent(in) :: c
 
 1072    real(kind=
xp) :: tmp
 
 1077       tmp = tmp + a(i) * b(i) * c(i)
 
 1080    call mpi_allreduce(mpi_in_place, tmp, 1, &
 
 
 1086    integer, 
intent(in) :: n
 
 1087    real(kind=
rp), 
dimension(n), 
intent(in) :: a
 
 1088    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
 1089    real(kind=
rp), 
dimension(n), 
intent(in) :: c
 
 1090    real(kind=
rp), 
dimension(n), 
intent(in) :: d
 
 1092    real(kind=
xp) :: tmp
 
 1097       tmp = tmp + a(i) * b(i) * c(i) * d(i)
 
 1100    call mpi_allreduce(mpi_in_place, tmp, 1, &
 
 
 1109    integer, 
intent(in) :: n
 
 1110    real(kind=
rp), 
dimension(n), 
intent(in) :: a
 
 1111    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
 1113    real(kind=
xp) :: tmp
 
 1118       tmp = tmp + (a(i) - b(i))**2
 
 1121    call mpi_allreduce(mpi_in_place, tmp, 1, &
 
 
 1133    integer, 
intent(in) :: n
 
 1134    real(kind=
rp), 
intent(inout) :: a(n)
 
 1135    integer, 
intent(out) :: ind(n)
 
 1137    integer :: j, ir, i, ii, l
 
 1143    if (n .le. 1) 
return 
 1167       do while (j .le. ir)
 
 1169             if ( a(j) .lt. a(j+1) ) j = j + 1
 
 1171          if (aa .lt. a(j)) 
then 
 
 1191    integer, 
intent(in) :: n
 
 1192    integer(i4), 
intent(inout) :: a(n)
 
 1193    integer, 
intent(out) :: ind(n)
 
 1195    integer :: j, ir, i, ii, l
 
 1201    if (n .le. 1) 
return 
 1224       do while (j .le. ir)
 
 1226             if ( a(j) .lt. a(j + 1) ) j = j + 1
 
 1228          if (aa .lt. a(j)) 
then 
 
 1247    integer, 
intent(in) :: n
 
 1248    real(kind=
rp), 
intent(inout) :: b(n)
 
 1249    integer, 
intent(in) :: ind(n)
 
 1250    real(kind=
rp) :: temp(n)
 
 
 1267    integer, 
intent(in) :: n
 
 1268    integer(i4), 
intent(inout) :: b(n)
 
 1269    integer, 
intent(in) :: ind(n)
 
 1270    integer(i4) :: temp(n)
 
 
 1287    integer, 
intent(in) :: n
 
 1288    real(kind=
rp), 
intent(inout) :: b(n)
 
 1289    integer, 
intent(in) :: ind(n)
 
 1290    real(kind=
rp) :: temp(n)
 
 
 1307    integer, 
intent(in) :: n
 
 1308    integer(i4), 
intent(inout) :: b(n)
 
 1309    integer, 
intent(in) :: ind(n)
 
 1310    integer(i4) :: temp(n)
 
 
 1327    integer, 
intent(in) :: n
 
 1328    real(kind=
rp), 
intent(inout) :: b(n)
 
 1329    integer, 
intent(inout) :: ind(n)
 
 1330    real(kind=
rp) :: temp(n)
 
 1331    integer :: tempind(n)
 
 1337       tempind(jj) = ind(i)
 
 
 1350    integer, 
intent(in) :: n
 
 1351    integer(i4), 
intent(inout) :: b(n)
 
 1352    integer, 
intent(inout) :: ind(n)
 
 1353    integer(i4) :: temp(n)
 
 1354    integer :: tempind(n)
 
 1360       tempind(jj) = ind(i)
 
 
 1372    integer, 
intent(in) :: n
 
 1373    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
 
 1385    integer, 
intent(in) :: n
 
 1386    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
 1387    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
 1391       a(i) = 
max(a(i), b(i))
 
 
 1397    integer, 
intent(in) :: n
 
 1398    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
 1399    real(kind=
rp), 
dimension(n), 
intent(in) :: b, c
 
 1403       a(i) = 
max(b(i), c(i))
 
 
 1409    integer, 
intent(in) :: n
 
 1410    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
 1411    real(kind=
rp), 
intent(in) :: b
 
 
 1421    integer, 
intent(in) :: n
 
 1422    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
 1423    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
 1424    real(kind=
rp), 
intent(in) :: c
 
 
 1434    integer, 
intent(in) :: n
 
 1435    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
 1436    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
 1440       a(i) = min(a(i), b(i))
 
 
 1446    integer, 
intent(in) :: n
 
 1447    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
 1448    real(kind=
rp), 
dimension(n), 
intent(in) :: b, c
 
 1452       a(i) = min(b(i), c(i))
 
 
 1458    integer, 
intent(in) :: n
 
 1459    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
 1460    real(kind=
rp), 
intent(in) :: b
 
 
 1470    integer, 
intent(in) :: n
 
 1471    real(kind=
rp), 
dimension(n), 
intent(inout) :: a
 
 1472    real(kind=
rp), 
dimension(n), 
intent(in) :: b
 
 1473    real(kind=
rp), 
intent(in) :: c
 
 
 1484  function matinv39(a11, a12, a13, a21, a22, a23, a31, a32, a33) &
 
 1486    real(kind=
rp), 
intent(in) :: a11, a12, a13, a21, a22, a23, a31, a32, a33
 
 
 1507    real(kind=
xp), 
intent(in) :: a(3,3) 
 
 1508    real(kind=
xp) :: b(3,3) 
 
 1509    real(kind=
xp) :: detinv
 
 1513    detinv = 1.0_xp/
real(a(1,1)*a(2,2)*a(3,3) - a(1,1)*a(2,3)*a(3,2)&
 
 1514         - a(1,2)*a(2,1)*a(3,3) + a(1,2)*a(2,3)*a(3,1)&
 
 1515         + a(1,3)*a(2,1)*a(3,2) - a(1,3)*a(2,2)*a(3,1),
xp)
 
 1518    b(1,1) = +detinv * (a(2,2)*a(3,3) - a(2,3)*a(3,2))
 
 1519    b(2,1) = -detinv * (a(2,1)*a(3,3) - a(2,3)*a(3,1))
 
 1520    b(3,1) = +detinv * (a(2,1)*a(3,2) - a(2,2)*a(3,1))
 
 1521    b(1,2) = -detinv * (a(1,2)*a(3,3) - a(1,3)*a(3,2))
 
 1522    b(2,2) = +detinv * (a(1,1)*a(3,3) - a(1,3)*a(3,1))
 
 1523    b(3,2) = -detinv * (a(1,1)*a(3,2) - a(1,2)*a(3,1))
 
 1524    b(1,3) = +detinv * (a(1,2)*a(2,3) - a(1,3)*a(2,2))
 
 1525    b(2,3) = -detinv * (a(1,1)*a(2,3) - a(1,3)*a(2,1))
 
 1526    b(3,3) = +detinv * (a(1,1)*a(2,2) - a(1,2)*a(2,1))
 
 
type(mpi_datatype), public mpi_real_precision
MPI type for working precision of REAL types.
 
type(mpi_comm), public neko_comm
MPI communicator.
 
type(mpi_datatype), public mpi_extra_precision
 
Object for handling masks in Neko.
 
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 .
 
pure logical function, public dabscmp(x, y, tol)
Return double precision absolute comparison .
 
real(kind=rp), parameter, public pi
 
pure logical function qabscmp(x, y, tol)
Return double precision absolute comparison .
 
real(kind=rp) function, public glsc3(a, b, c, n)
Weighted inner product .
 
subroutine, public ascol5(a, b, c, d, e, n)
Returns .
 
subroutine, public addcol3s2(a, b, c, s, n)
Returns .
 
subroutine, public masked_scatter_copy(a, b, mask, n, n_mask)
Scatter a contigous vector to masked positions in a target array .
 
subroutine, public invers2(a, b, n)
Compute inverted vector .
 
subroutine, public cadd2(a, b, s, n)
Add a scalar to vector .
 
real(rp) function, dimension(3, 3), public matinv39(a11, a12, a13, a21, a22, a23, a31, a32, a33)
 
subroutine, public cadd(a, s, n)
Add a scalar to vector .
 
subroutine, public masked_copy(a, b, mask, n, n_mask)
Copy a masked vector .
 
subroutine reorddp(b, ind, n)
reorder double precision array - inverse of swap
 
subroutine, public addsqr2s2(a, b, c1, n)
Returns .
 
real(kind=rp) function, public glsc4(a, b, c, d, n)
 
subroutine, public cdiv2(a, b, c, n)
Division of constant c by elements of a .
 
subroutine swapdp(b, ind, n)
sort double precision array acording to ind vector
 
subroutine flipvi4(b, ind, n)
Flip single integer vector b and ind.
 
subroutine, public add2s1(a, b, c1, n)
Vector addition with scalar multiplication  (multiplication on first argument)
 
subroutine, public cpwmin2(a, b, n)
Point-wise minimum of scalar and vector .
 
real(kind=rp) function, public glsc2(a, b, n)
Weighted inner product .
 
subroutine, public masked_scatter_copy_0(a, b, mask, n, n_mask)
Scatter a contigous vector to masked positions in a target array .
 
subroutine, public subcol3(a, b, c, n)
Returns .
 
subroutine, public rone(a, n)
Set all elements to one.
 
subroutine flipvdp(b, ind, n)
Flip double precision vector b and ind.
 
subroutine, public cpwmin3(a, b, c, n)
Point-wise minimum of scalar and vector .
 
subroutine, public pwmax3(a, b, c, n)
Point-wise maximum of two vectors .
 
subroutine, public masked_gather_copy(a, b, mask, n, n_mask)
Gather a masked vector to reduced contigous vector .
 
subroutine, public x_update(a, b, c, c1, c2, n)
Returns .
 
subroutine, public add3(a, b, c, n)
Vector addition .
 
subroutine swapi4(b, ind, n)
sort single integer array acording to ind vector
 
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 absval(a, n)
Take the absolute value of an array.
 
subroutine, public invcol3(a, b, c, n)
Invert a vector .
 
subroutine, public add3s2(a, b, c, c1, c2, n)
Returns .
 
real(kind=xp) function, dimension(3, 3), public matinv3(a)
Performs a direct calculation of the inverse of a 3×3 matrix. M33INV and M44INV by David G....
 
subroutine, public pwmax2(a, b, n)
Point-wise maximum of two vectors .
 
subroutine, public pwmin2(a, b, n)
Point-wise minimum of two vectors .
 
subroutine, public masked_gather_copy_0(a, b, mask, n, n_mask)
Gather a masked vector to reduced contigous vector .
 
subroutine, public subcol4(a, b, c, d, n)
Returns .
 
subroutine sorti4(a, ind, n)
Heap Sort for single integer arrays.
 
subroutine, public addcol3(a, b, c, n)
Returns .
 
subroutine, public invcol1(a, n)
Invert a vector .
 
subroutine, public cdiv(a, c, n)
Division of constant c by elements of a .
 
real(kind=rp), parameter, public neko_m_ln2
 
subroutine, public chsign(a, n)
Change sign of vector .
 
subroutine, public cpwmax3(a, b, c, n)
Point-wise maximum of scalar and 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 copy(a, b, n)
Copy a vector .
 
subroutine, public add4s3(a, b, c, d, c1, c2, c3, n)
Returns .
 
subroutine, public add4(a, b, c, d, n)
Vector addition .
 
subroutine, public col3(a, b, c, n)
Vector multiplication with 3 vectors .
 
subroutine, public add5s4(a, b, c, d, e, c1, c2, c3, c4, n)
Returns .
 
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, public sabscmp(x, y, tol)
Return single precision absolute comparison .
 
pure logical function qrelcmp(x, y, eps)
Return quad precision relative comparison .
 
subroutine, public rzero(a, n)
Zero a real vector.
 
real(kind=rp) function, public glsubnorm(a, b, n)
Returns the norm of the difference of two vectors .
 
subroutine, public vdot2(dot, u1, u2, v1, v2, n)
Compute a dot product  (2-d version) assuming vector components  etc.
 
subroutine, public cpwmax2(a, b, n)
Point-wise maximum of scalar and vector .
 
real(kind=rp) function, public vlmin(vec, n)
minimun value of a vector of length n
 
subroutine, public cfill_mask(a, c, n, mask, n_mask)
Fill a constant to a masked vector. .
 
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 sortrp(a, ind, n)
Heap Sort for double precision arrays.
 
subroutine, public sub2(a, b, n)
Vector substraction .
 
subroutine, public pwmin3(a, b, c, n)
Point-wise minimum of two vectors .
 
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 masked_copy_0(a, b, mask, n, n_mask)
Copy a masked vector .
 
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 reordi4(b, ind, n)
reorder single integer array - inverse of swap
 
subroutine, public p_update(a, b, c, c1, c2, n)
Returns .
 
integer, parameter, public qp
 
integer, parameter, public i4
 
integer, parameter, public xp
 
integer, parameter, public dp
 
integer, parameter, public sp
 
integer, parameter, public rp
Global precision used in computations.