34submodule(
opr_cpu) cpu_convect_scalar
40 module subroutine opr_cpu_convect_scalar(du, u, cr, cs, ct, xh_gll, xh_gl, &
41 coef_gll, coef_gl, gll_to_gl)
42 type(space_t),
intent(in) :: Xh_GL
43 type(space_t),
intent(in) :: Xh_GLL
44 type(coef_t),
intent(in) :: coef_GLL
45 type(coef_t),
intent(in) :: coef_GL
46 type(interpolator_t),
intent(inout) :: GLL_to_GL
47 real(kind=rp),
intent(inout) :: &
48 du(xh_gll%lx, xh_gll%ly, xh_gll%lz, coef_gl%msh%nelv)
49 real(kind=rp),
intent(inout) :: &
50 u(xh_gl%lx, xh_gl%lx, xh_gl%lx, coef_gl%msh%nelv)
51 real(kind=rp),
intent(inout) :: cr(xh_gl%lxyz, coef_gl%msh%nelv)
52 real(kind=rp),
intent(inout) :: cs(xh_gl%lxyz, coef_gl%msh%nelv)
53 real(kind=rp),
intent(inout) :: ct(xh_gl%lxyz, coef_gl%msh%nelv)
54 associate(dx => xh_gl%dx, dy => xh_gl%dy, dz => xh_gl%dz, &
55 lx => xh_gl%lx, nelv => coef_gl%msh%nelv)
59 call cpu_convect_scalar_lx18(du, u, cr, cs, ct, dx, dy, dz, &
60 xh_gll, coef_gll, gll_to_gl, nelv)
62 call cpu_convect_scalar_lx17(du, u, cr, cs, ct, dx, dy, dz, &
63 xh_gll, coef_gll, gll_to_gl, nelv)
65 call cpu_convect_scalar_lx16(du, u, cr, cs, ct, dx, dy, dz, &
66 xh_gll, coef_gll, gll_to_gl, nelv)
68 call cpu_convect_scalar_lx15(du, u, cr, cs, ct, dx, dy, dz, &
69 xh_gll, coef_gll, gll_to_gl, nelv)
71 call cpu_convect_scalar_lx14(du, u, cr, cs, ct, dx, dy, dz, &
72 xh_gll, coef_gll, gll_to_gl, nelv)
74 call cpu_convect_scalar_lx13(du, u, cr, cs, ct, dx, dy, dz, &
75 xh_gll, coef_gll, gll_to_gl, nelv)
77 call cpu_convect_scalar_lx12(du, u, cr, cs, ct, dx, dy, dz, &
78 xh_gll, coef_gll, gll_to_gl, nelv)
80 call cpu_convect_scalar_lx11(du, u, cr, cs, ct, dx, dy, dz, &
81 xh_gll, coef_gll, gll_to_gl, nelv)
83 call cpu_convect_scalar_lx10(du, u, cr, cs, ct, dx, dy, dz, &
84 xh_gll, coef_gll, gll_to_gl, nelv)
86 call cpu_convect_scalar_lx9(du, u, cr, cs, ct, dx, dy, dz, &
87 xh_gll, coef_gll, gll_to_gl, nelv)
89 call cpu_convect_scalar_lx8(du, u, cr, cs, ct, dx, dy, dz, &
90 xh_gll, coef_gll, gll_to_gl, nelv)
92 call cpu_convect_scalar_lx7(du, u, cr, cs, ct, dx, dy, dz, &
93 xh_gll, coef_gll, gll_to_gl, nelv)
95 call cpu_convect_scalar_lx6(du, u, cr, cs, ct, dx, dy, dz, &
96 xh_gll, coef_gll, gll_to_gl, nelv)
98 call cpu_convect_scalar_lx5(du, u, cr, cs, ct, dx, dy, dz, &
99 xh_gll, coef_gll, gll_to_gl, nelv)
101 call cpu_convect_scalar_lx4(du, u, cr, cs, ct, dx, dy, dz, &
102 xh_gll, coef_gll, gll_to_gl, nelv)
104 call cpu_convect_scalar_lx3(du, u, cr, cs, ct, dx, dy, dz, &
105 xh_gll, coef_gll, gll_to_gl, nelv)
107 call cpu_convect_scalar_lx2(du, u, cr, cs, ct, dx, dy, dz, &
108 xh_gll, coef_gll, gll_to_gl, nelv)
110 call cpu_convect_scalar_lx(du, u, cr, cs, ct, dx, dy, dz, &
111 xh_gll, coef_gll, gll_to_gl, nelv, lx)
115 end subroutine opr_cpu_convect_scalar
117 subroutine cpu_convect_scalar_lx(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
118 coef_GLL, GLL_to_GL, nelv, lx)
119 integer,
intent(in) :: nelv, lx
120 type(space_t),
intent(in) :: Xh_GLL
121 type(coef_t),
intent(in) :: coef_GLL
122 type(interpolator_t),
intent(inout) :: GLL_to_GL
123 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
124 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
125 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
126 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
127 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
128 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
129 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
130 real(kind=rp) :: ud(lx*lx*lx)
132 integer :: e, i, j, k, l, idx, n_GLL
134 n_gll = nelv * xh_gll%lxyz
142 tmp = tmp + dx(i,k) * u(k,j,1,e)
153 tmp = tmp + dy(j,l) * u(i,l,k,e)
164 tmp = tmp + dz(k,l) * u(i,1,l,e)
170 do i = 1, lx * lx * lx
171 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
172 + ct(i,e) * ut(i,1,1)
174 idx = (e-1) * xh_gll%lxyz+1
175 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
178 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
179 call col2(du, coef_gll%Binv, n_gll)
181 end subroutine cpu_convect_scalar_lx
183 subroutine cpu_convect_scalar_lx18(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
184 coef_GLL, GLL_to_GL, nelv)
185 integer,
parameter :: lx = 18
186 integer,
intent(in) :: nelv
187 type(space_t),
intent(in) :: Xh_GLL
188 type(coef_t),
intent(in) :: coef_GLL
189 type(interpolator_t),
intent(inout) :: GLL_to_GL
190 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
191 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
192 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
193 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
194 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
195 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
196 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
197 real(kind=rp) :: ud(lx*lx*lx)
199 integer :: e, i, j, k, l, idx, n_GLL
201 n_gll = nelv * xh_gll%lxyz
209 tmp = tmp + dx(i,k) * u(k,j,1,e)
220 tmp = tmp + dy(j,l) * u(i,l,k,e)
231 tmp = tmp + dz(k,l) * u(i,1,l,e)
237 do i = 1, lx * lx * lx
238 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
239 + ct(i,e) * ut(i,1,1)
241 idx = (e-1) * xh_gll%lxyz+1
242 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
245 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
246 call col2(du, coef_gll%Binv, n_gll)
248 end subroutine cpu_convect_scalar_lx18
250 subroutine cpu_convect_scalar_lx17(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
251 coef_GLL, GLL_to_GL, nelv)
252 integer,
parameter :: lx = 17
253 integer,
intent(in) :: nelv
254 type(space_t),
intent(in) :: Xh_GLL
255 type(coef_t),
intent(in) :: coef_GLL
256 type(interpolator_t),
intent(inout) :: GLL_to_GL
257 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
258 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
259 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
260 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
261 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
262 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
263 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
264 real(kind=rp) :: ud(lx*lx*lx)
266 integer :: e, i, j, k, l, idx, n_GLL
268 n_gll = nelv * xh_gll%lxyz
276 tmp = tmp + dx(i,k) * u(k,j,1,e)
287 tmp = tmp + dy(j,l) * u(i,l,k,e)
298 tmp = tmp + dz(k,l) * u(i,1,l,e)
304 do i = 1, lx * lx * lx
305 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
306 + ct(i,e) * ut(i,1,1)
308 idx = (e-1) * xh_gll%lxyz+1
309 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
312 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
313 call col2(du, coef_gll%Binv, n_gll)
315 end subroutine cpu_convect_scalar_lx17
317 subroutine cpu_convect_scalar_lx16(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
318 coef_GLL, GLL_to_GL, nelv)
319 integer,
parameter :: lx = 16
320 integer,
intent(in) :: nelv
321 type(space_t),
intent(in) :: Xh_GLL
322 type(coef_t),
intent(in) :: coef_GLL
323 type(interpolator_t),
intent(inout) :: GLL_to_GL
324 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
325 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
326 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
327 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
328 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
329 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
330 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
331 real(kind=rp) :: ud(lx*lx*lx)
333 integer :: e, i, j, k, l, idx, n_GLL
335 n_gll = nelv * xh_gll%lxyz
343 tmp = tmp + dx(i,k) * u(k,j,1,e)
354 tmp = tmp + dy(j,l) * u(i,l,k,e)
365 tmp = tmp + dz(k,l) * u(i,1,l,e)
371 do i = 1, lx * lx * lx
372 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
373 + ct(i,e) * ut(i,1,1)
375 idx = (e-1) * xh_gll%lxyz+1
376 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
379 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
380 call col2(du, coef_gll%Binv, n_gll)
382 end subroutine cpu_convect_scalar_lx16
384 subroutine cpu_convect_scalar_lx15(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
385 coef_GLL, GLL_to_GL, nelv)
386 integer,
parameter :: lx = 15
387 integer,
intent(in) :: nelv
388 type(space_t),
intent(in) :: Xh_GLL
389 type(coef_t),
intent(in) :: coef_GLL
390 type(interpolator_t),
intent(inout) :: GLL_to_GL
391 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
392 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
393 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
394 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
395 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
396 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
397 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
398 real(kind=rp) :: ud(lx*lx*lx)
400 integer :: e, i, j, k, l, idx, n_GLL
402 n_gll = nelv * xh_gll%lxyz
410 tmp = tmp + dx(i,k) * u(k,j,1,e)
421 tmp = tmp + dy(j,l) * u(i,l,k,e)
432 tmp = tmp + dz(k,l) * u(i,1,l,e)
438 do i = 1, lx * lx * lx
439 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
440 + ct(i,e) * ut(i,1,1)
442 idx = (e-1) * xh_gll%lxyz+1
443 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
446 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
447 call col2(du, coef_gll%Binv, n_gll)
449 end subroutine cpu_convect_scalar_lx15
451 subroutine cpu_convect_scalar_lx14(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
452 coef_GLL, GLL_to_GL, nelv)
453 integer,
parameter :: lx = 14
454 integer,
intent(in) :: nelv
455 type(space_t),
intent(in) :: Xh_GLL
456 type(coef_t),
intent(in) :: coef_GLL
457 type(interpolator_t),
intent(inout) :: GLL_to_GL
458 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
459 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
460 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
461 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
462 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
463 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
464 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
465 real(kind=rp) :: ud(lx*lx*lx)
467 integer :: e, i, j, k, l, idx, n_GLL
469 n_gll = nelv * xh_gll%lxyz
477 tmp = tmp + dx(i,k) * u(k,j,1,e)
488 tmp = tmp + dy(j,l) * u(i,l,k,e)
499 tmp = tmp + dz(k,l) * u(i,1,l,e)
505 do i = 1, lx * lx * lx
506 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
507 + ct(i,e) * ut(i,1,1)
509 idx = (e-1) * xh_gll%lxyz+1
510 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
513 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
514 call col2(du, coef_gll%Binv, n_gll)
516 end subroutine cpu_convect_scalar_lx14
518 subroutine cpu_convect_scalar_lx13(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
519 coef_GLL, GLL_to_GL, nelv)
520 integer,
parameter :: lx = 13
521 integer,
intent(in) :: nelv
522 type(space_t),
intent(in) :: Xh_GLL
523 type(coef_t),
intent(in) :: coef_GLL
524 type(interpolator_t),
intent(inout) :: GLL_to_GL
525 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
526 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
527 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
528 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
529 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
530 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
531 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
532 real(kind=rp) :: ud(lx*lx*lx)
534 integer :: e, i, j, k, l, idx, n_GLL
536 n_gll = nelv * xh_gll%lxyz
544 tmp = tmp + dx(i,k) * u(k,j,1,e)
555 tmp = tmp + dy(j,l) * u(i,l,k,e)
566 tmp = tmp + dz(k,l) * u(i,1,l,e)
572 do i = 1, lx * lx * lx
573 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
574 + ct(i,e) * ut(i,1,1)
576 idx = (e-1) * xh_gll%lxyz+1
577 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
580 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
581 call col2(du, coef_gll%Binv, n_gll)
583 end subroutine cpu_convect_scalar_lx13
585 subroutine cpu_convect_scalar_lx12(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
586 coef_GLL, GLL_to_GL, nelv)
587 integer,
parameter :: lx = 12
588 integer,
intent(in) :: nelv
589 type(space_t),
intent(in) :: Xh_GLL
590 type(coef_t),
intent(in) :: coef_GLL
591 type(interpolator_t),
intent(inout) :: GLL_to_GL
592 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
593 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
594 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
595 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
596 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
597 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
598 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
599 real(kind=rp) :: ud(lx*lx*lx)
601 integer :: e, i, j, k, l, idx, n_GLL
603 n_gll = nelv * xh_gll%lxyz
611 tmp = tmp + dx(i,k) * u(k,j,1,e)
622 tmp = tmp + dy(j,l) * u(i,l,k,e)
633 tmp = tmp + dz(k,l) * u(i,1,l,e)
639 do i = 1, lx * lx * lx
640 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
641 + ct(i,e) * ut(i,1,1)
643 idx = (e-1) * xh_gll%lxyz+1
644 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
647 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
648 call col2(du, coef_gll%Binv, n_gll)
650 end subroutine cpu_convect_scalar_lx12
652 subroutine cpu_convect_scalar_lx11(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
653 coef_GLL, GLL_to_GL, nelv)
654 integer,
parameter :: lx = 11
655 integer,
intent(in) :: nelv
656 type(space_t),
intent(in) :: Xh_GLL
657 type(coef_t),
intent(in) :: coef_GLL
658 type(interpolator_t),
intent(inout) :: GLL_to_GL
659 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
660 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
661 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
662 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
663 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
664 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
665 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
666 real(kind=rp) :: ud(lx*lx*lx)
668 integer :: e, i, j, k, l, idx, n_GLL
670 n_gll = nelv * xh_gll%lxyz
678 tmp = tmp + dx(i,k) * u(k,j,1,e)
689 tmp = tmp + dy(j,l) * u(i,l,k,e)
700 tmp = tmp + dz(k,l) * u(i,1,l,e)
706 do i = 1, lx * lx * lx
707 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
708 + ct(i,e) * ut(i,1,1)
710 idx = (e-1) * xh_gll%lxyz+1
711 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
714 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
715 call col2(du, coef_gll%Binv, n_gll)
717 end subroutine cpu_convect_scalar_lx11
719 subroutine cpu_convect_scalar_lx10(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
720 coef_GLL, GLL_to_GL, nelv)
721 integer,
parameter :: lx = 10
722 integer,
intent(in) :: nelv
723 type(space_t),
intent(in) :: Xh_GLL
724 type(coef_t),
intent(in) :: coef_GLL
725 type(interpolator_t),
intent(inout) :: GLL_to_GL
726 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
727 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
728 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
729 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
730 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
731 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
732 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
733 real(kind=rp) :: ud(lx*lx*lx)
735 integer :: e, i, j, k, l, idx, n_GLL
737 n_gll = nelv * xh_gll%lxyz
745 tmp = tmp + dx(i,k) * u(k,j,1,e)
756 tmp = tmp + dy(j,l) * u(i,l,k,e)
767 tmp = tmp + dz(k,l) * u(i,1,l,e)
773 do i = 1, lx * lx * lx
774 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
775 + ct(i,e) * ut(i,1,1)
777 idx = (e-1) * xh_gll%lxyz+1
778 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
781 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
782 call col2(du, coef_gll%Binv, n_gll)
784 end subroutine cpu_convect_scalar_lx10
786 subroutine cpu_convect_scalar_lx9(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
787 coef_GLL, GLL_to_GL, nelv)
788 integer,
parameter :: lx = 9
789 integer,
intent(in) :: nelv
790 type(space_t),
intent(in) :: Xh_GLL
791 type(coef_t),
intent(in) :: coef_GLL
792 type(interpolator_t),
intent(inout) :: GLL_to_GL
793 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
794 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
795 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
796 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
797 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
798 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
799 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
800 real(kind=rp) :: ud(lx*lx*lx)
802 integer :: e, i, j, k, l, idx, n_GLL
804 n_gll = nelv * xh_gll%lxyz
812 tmp = tmp + dx(i,k) * u(k,j,1,e)
823 tmp = tmp + dy(j,l) * u(i,l,k,e)
834 tmp = tmp + dz(k,l) * u(i,1,l,e)
840 do i = 1, lx * lx * lx
841 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
842 + ct(i,e) * ut(i,1,1)
844 idx = (e-1) * xh_gll%lxyz+1
845 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
848 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
849 call col2(du, coef_gll%Binv, n_gll)
851 end subroutine cpu_convect_scalar_lx9
853 subroutine cpu_convect_scalar_lx8(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
854 coef_GLL, GLL_to_GL, nelv)
855 integer,
parameter :: lx = 8
856 integer,
intent(in) :: nelv
857 type(space_t),
intent(in) :: Xh_GLL
858 type(coef_t),
intent(in) :: coef_GLL
859 type(interpolator_t),
intent(inout) :: GLL_to_GL
860 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
861 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
862 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
863 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
864 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
865 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
866 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
867 real(kind=rp) :: ud(lx*lx*lx)
869 integer :: e, i, j, k, l, idx, n_GLL
871 n_gll = nelv * xh_gll%lxyz
879 tmp = tmp + dx(i,k) * u(k,j,1,e)
890 tmp = tmp + dy(j,l) * u(i,l,k,e)
901 tmp = tmp + dz(k,l) * u(i,1,l,e)
907 do i = 1, lx * lx * lx
908 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
909 + ct(i,e) * ut(i,1,1)
911 idx = (e-1) * xh_gll%lxyz+1
912 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
915 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
916 call col2(du, coef_gll%Binv, n_gll)
918 end subroutine cpu_convect_scalar_lx8
920 subroutine cpu_convect_scalar_lx7(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
921 coef_GLL, GLL_to_GL, nelv)
922 integer,
parameter :: lx = 7
923 integer,
intent(in) :: nelv
924 type(space_t),
intent(in) :: Xh_GLL
925 type(coef_t),
intent(in) :: coef_GLL
926 type(interpolator_t),
intent(inout) :: GLL_to_GL
927 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
928 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
929 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
930 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
931 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
932 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
933 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
934 real(kind=rp) :: ud(lx*lx*lx)
936 integer :: e, i, j, k, l, idx, n_GLL
938 n_gll = nelv * xh_gll%lxyz
946 tmp = tmp + dx(i,k) * u(k,j,1,e)
957 tmp = tmp + dy(j,l) * u(i,l,k,e)
968 tmp = tmp + dz(k,l) * u(i,1,l,e)
974 do i = 1, lx * lx * lx
975 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
976 + ct(i,e) * ut(i,1,1)
978 idx = (e-1) * xh_gll%lxyz+1
979 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
982 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
983 call col2(du, coef_gll%Binv, n_gll)
985 end subroutine cpu_convect_scalar_lx7
987 subroutine cpu_convect_scalar_lx6(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
988 coef_GLL, GLL_to_GL, nelv)
989 integer,
parameter :: lx = 6
990 integer,
intent(in) :: nelv
991 type(space_t),
intent(in) :: Xh_GLL
992 type(coef_t),
intent(in) :: coef_GLL
993 type(interpolator_t),
intent(inout) :: GLL_to_GL
994 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
995 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
996 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
997 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
998 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
999 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
1000 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
1001 real(kind=rp) :: ud(lx*lx*lx)
1002 real(kind=rp) :: tmp
1003 integer :: e, i, j, k, l, idx, n_GLL
1005 n_gll = nelv * xh_gll%lxyz
1013 tmp = tmp + dx(i,k) * u(k,j,1,e)
1024 tmp = tmp + dy(j,l) * u(i,l,k,e)
1035 tmp = tmp + dz(k,l) * u(i,1,l,e)
1041 do i = 1, lx * lx * lx
1042 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
1043 + ct(i,e) * ut(i,1,1)
1045 idx = (e-1) * xh_gll%lxyz+1
1046 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
1049 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
1050 call col2(du, coef_gll%Binv, n_gll)
1052 end subroutine cpu_convect_scalar_lx6
1054 subroutine cpu_convect_scalar_lx5(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
1055 coef_GLL, GLL_to_GL, nelv)
1056 integer,
parameter :: lx = 5
1057 integer,
intent(in) :: nelv
1058 type(space_t),
intent(in) :: Xh_GLL
1059 type(coef_t),
intent(in) :: coef_GLL
1060 type(interpolator_t),
intent(inout) :: GLL_to_GL
1061 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
1062 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
1063 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
1064 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
1065 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
1066 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
1067 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
1068 real(kind=rp) :: ud(lx*lx*lx)
1069 real(kind=rp) :: tmp
1070 integer :: e, i, j, k, l, idx, n_GLL
1072 n_gll = nelv * xh_gll%lxyz
1080 tmp = tmp + dx(i,k) * u(k,j,1,e)
1091 tmp = tmp + dy(j,l) * u(i,l,k,e)
1102 tmp = tmp + dz(k,l) * u(i,1,l,e)
1108 do i = 1, lx * lx * lx
1109 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
1110 + ct(i,e) * ut(i,1,1)
1112 idx = (e-1) * xh_gll%lxyz+1
1113 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
1116 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
1117 call col2(du, coef_gll%Binv, n_gll)
1119 end subroutine cpu_convect_scalar_lx5
1121 subroutine cpu_convect_scalar_lx4(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
1122 coef_GLL, GLL_to_GL, nelv)
1123 integer,
parameter :: lx = 4
1124 integer,
intent(in) :: nelv
1125 type(space_t),
intent(in) :: Xh_GLL
1126 type(coef_t),
intent(in) :: coef_GLL
1127 type(interpolator_t),
intent(inout) :: GLL_to_GL
1128 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
1129 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
1130 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
1131 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
1132 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
1133 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
1134 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
1135 real(kind=rp) :: ud(lx*lx*lx)
1136 real(kind=rp) :: tmp
1137 integer :: e, i, j, k, l, idx, n_GLL
1139 n_gll = nelv * xh_gll%lxyz
1147 tmp = tmp + dx(i,k) * u(k,j,1,e)
1158 tmp = tmp + dy(j,l) * u(i,l,k,e)
1169 tmp = tmp + dz(k,l) * u(i,1,l,e)
1175 do i = 1, lx * lx * lx
1176 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
1177 + ct(i,e) * ut(i,1,1)
1179 idx = (e-1) * xh_gll%lxyz+1
1180 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
1183 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
1184 call col2(du, coef_gll%Binv, n_gll)
1186 end subroutine cpu_convect_scalar_lx4
1188 subroutine cpu_convect_scalar_lx3(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
1189 coef_GLL, GLL_to_GL, nelv)
1190 integer,
parameter :: lx = 3
1191 integer,
intent(in) :: nelv
1192 type(space_t),
intent(in) :: Xh_GLL
1193 type(coef_t),
intent(in) :: coef_GLL
1194 type(interpolator_t),
intent(inout) :: GLL_to_GL
1195 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
1196 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
1197 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
1198 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
1199 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
1200 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
1201 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
1202 real(kind=rp) :: ud(lx*lx*lx)
1203 real(kind=rp) :: tmp
1204 integer :: e, i, j, k, l, idx, n_GLL
1206 n_gll = nelv * xh_gll%lxyz
1214 tmp = tmp + dx(i,k) * u(k,j,1,e)
1225 tmp = tmp + dy(j,l) * u(i,l,k,e)
1236 tmp = tmp + dz(k,l) * u(i,1,l,e)
1242 do i = 1, lx * lx * lx
1243 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
1244 + ct(i,e) * ut(i,1,1)
1246 idx = (e-1) * xh_gll%lxyz+1
1247 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
1250 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
1251 call col2(du, coef_gll%Binv, n_gll)
1253 end subroutine cpu_convect_scalar_lx3
1255 subroutine cpu_convect_scalar_lx2(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
1256 coef_GLL, GLL_to_GL, nelv)
1257 integer,
parameter :: lx = 2
1258 integer,
intent(in) :: nelv
1259 type(space_t),
intent(in) :: Xh_GLL
1260 type(coef_t),
intent(in) :: coef_GLL
1261 type(interpolator_t),
intent(inout) :: GLL_to_GL
1262 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
1263 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
1264 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
1265 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
1266 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
1267 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
1268 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
1269 real(kind=rp) :: ud(lx*lx*lx)
1270 real(kind=rp) :: tmp
1271 integer :: e, i, j, k, l, idx, n_GLL
1273 n_gll = nelv * xh_gll%lxyz
1281 tmp = tmp + dx(i,k) * u(k,j,1,e)
1292 tmp = tmp + dy(j,l) * u(i,l,k,e)
1303 tmp = tmp + dz(k,l) * u(i,1,l,e)
1309 do i = 1, lx * lx * lx
1310 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
1311 + ct(i,e) * ut(i,1,1)
1313 idx = (e-1) * xh_gll%lxyz+1
1314 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
1317 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
1318 call col2(du, coef_gll%Binv, n_gll)
1320 end subroutine cpu_convect_scalar_lx2
1322end submodule cpu_convect_scalar
subroutine, public col2(a, b, n)
Vector multiplication .