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
141 tmp = tmp + dx(i,k) * u(k,j,1,e)
152 tmp = tmp + dy(j,l) * u(i,l,k,e)
163 tmp = tmp + dz(k,l) * u(i,1,l,e)
169 do i = 1, lx * lx * lx
170 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
171 + ct(i,e) * ut(i,1,1)
173 idx = (e-1) * xh_gll%lxyz+1
174 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
176 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
177 call col2(du, coef_gll%Binv, n_gll)
179 end subroutine cpu_convect_scalar_lx
181 subroutine cpu_convect_scalar_lx18(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
182 coef_GLL, GLL_to_GL, nelv)
183 integer,
parameter :: lx = 18
184 integer,
intent(in) :: nelv
185 type(space_t),
intent(in) :: Xh_GLL
186 type(coef_t),
intent(in) :: coef_GLL
187 type(interpolator_t),
intent(inout) :: GLL_to_GL
188 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
189 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
190 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
191 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
192 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
193 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
194 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
195 real(kind=rp) :: ud(lx*lx*lx)
197 integer :: e, i, j, k, l, idx, n_GLL
199 n_gll = nelv * xh_gll%lxyz
206 tmp = tmp + dx(i,k) * u(k,j,1,e)
217 tmp = tmp + dy(j,l) * u(i,l,k,e)
228 tmp = tmp + dz(k,l) * u(i,1,l,e)
234 do i = 1, lx * lx * lx
235 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
236 + ct(i,e) * ut(i,1,1)
238 idx = (e-1) * xh_gll%lxyz+1
239 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
241 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
242 call col2(du, coef_gll%Binv, n_gll)
244 end subroutine cpu_convect_scalar_lx18
246 subroutine cpu_convect_scalar_lx17(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
247 coef_GLL, GLL_to_GL, nelv)
248 integer,
parameter :: lx = 17
249 integer,
intent(in) :: nelv
250 type(space_t),
intent(in) :: Xh_GLL
251 type(coef_t),
intent(in) :: coef_GLL
252 type(interpolator_t),
intent(inout) :: GLL_to_GL
253 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
254 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
255 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
256 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
257 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
258 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
259 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
260 real(kind=rp) :: ud(lx*lx*lx)
262 integer :: e, i, j, k, l, idx, n_GLL
264 n_gll = nelv * xh_gll%lxyz
271 tmp = tmp + dx(i,k) * u(k,j,1,e)
282 tmp = tmp + dy(j,l) * u(i,l,k,e)
293 tmp = tmp + dz(k,l) * u(i,1,l,e)
299 do i = 1, lx * lx * lx
300 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
301 + ct(i,e) * ut(i,1,1)
303 idx = (e-1) * xh_gll%lxyz+1
304 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
306 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
307 call col2(du, coef_gll%Binv, n_gll)
309 end subroutine cpu_convect_scalar_lx17
311 subroutine cpu_convect_scalar_lx16(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
312 coef_GLL, GLL_to_GL, nelv)
313 integer,
parameter :: lx = 16
314 integer,
intent(in) :: nelv
315 type(space_t),
intent(in) :: Xh_GLL
316 type(coef_t),
intent(in) :: coef_GLL
317 type(interpolator_t),
intent(inout) :: GLL_to_GL
318 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
319 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
320 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
321 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
322 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
323 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
324 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
325 real(kind=rp) :: ud(lx*lx*lx)
327 integer :: e, i, j, k, l, idx, n_GLL
329 n_gll = nelv * xh_gll%lxyz
336 tmp = tmp + dx(i,k) * u(k,j,1,e)
347 tmp = tmp + dy(j,l) * u(i,l,k,e)
358 tmp = tmp + dz(k,l) * u(i,1,l,e)
364 do i = 1, lx * lx * lx
365 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
366 + ct(i,e) * ut(i,1,1)
368 idx = (e-1) * xh_gll%lxyz+1
369 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
371 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
372 call col2(du, coef_gll%Binv, n_gll)
374 end subroutine cpu_convect_scalar_lx16
376 subroutine cpu_convect_scalar_lx15(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
377 coef_GLL, GLL_to_GL, nelv)
378 integer,
parameter :: lx = 15
379 integer,
intent(in) :: nelv
380 type(space_t),
intent(in) :: Xh_GLL
381 type(coef_t),
intent(in) :: coef_GLL
382 type(interpolator_t),
intent(inout) :: GLL_to_GL
383 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
384 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
385 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
386 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
387 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
388 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
389 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
390 real(kind=rp) :: ud(lx*lx*lx)
392 integer :: e, i, j, k, l, idx, n_GLL
394 n_gll = nelv * xh_gll%lxyz
401 tmp = tmp + dx(i,k) * u(k,j,1,e)
412 tmp = tmp + dy(j,l) * u(i,l,k,e)
423 tmp = tmp + dz(k,l) * u(i,1,l,e)
429 do i = 1, lx * lx * lx
430 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
431 + ct(i,e) * ut(i,1,1)
433 idx = (e-1) * xh_gll%lxyz+1
434 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
436 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
437 call col2(du, coef_gll%Binv, n_gll)
439 end subroutine cpu_convect_scalar_lx15
441 subroutine cpu_convect_scalar_lx14(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
442 coef_GLL, GLL_to_GL, nelv)
443 integer,
parameter :: lx = 14
444 integer,
intent(in) :: nelv
445 type(space_t),
intent(in) :: Xh_GLL
446 type(coef_t),
intent(in) :: coef_GLL
447 type(interpolator_t),
intent(inout) :: GLL_to_GL
448 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
449 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
450 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
451 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
452 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
453 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
454 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
455 real(kind=rp) :: ud(lx*lx*lx)
457 integer :: e, i, j, k, l, idx, n_GLL
459 n_gll = nelv * xh_gll%lxyz
466 tmp = tmp + dx(i,k) * u(k,j,1,e)
477 tmp = tmp + dy(j,l) * u(i,l,k,e)
488 tmp = tmp + dz(k,l) * u(i,1,l,e)
494 do i = 1, lx * lx * lx
495 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
496 + ct(i,e) * ut(i,1,1)
498 idx = (e-1) * xh_gll%lxyz+1
499 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
501 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
502 call col2(du, coef_gll%Binv, n_gll)
504 end subroutine cpu_convect_scalar_lx14
506 subroutine cpu_convect_scalar_lx13(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
507 coef_GLL, GLL_to_GL, nelv)
508 integer,
parameter :: lx = 13
509 integer,
intent(in) :: nelv
510 type(space_t),
intent(in) :: Xh_GLL
511 type(coef_t),
intent(in) :: coef_GLL
512 type(interpolator_t),
intent(inout) :: GLL_to_GL
513 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
514 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
515 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
516 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
517 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
518 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
519 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
520 real(kind=rp) :: ud(lx*lx*lx)
522 integer :: e, i, j, k, l, idx, n_GLL
524 n_gll = nelv * xh_gll%lxyz
531 tmp = tmp + dx(i,k) * u(k,j,1,e)
542 tmp = tmp + dy(j,l) * u(i,l,k,e)
553 tmp = tmp + dz(k,l) * u(i,1,l,e)
559 do i = 1, lx * lx * lx
560 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
561 + ct(i,e) * ut(i,1,1)
563 idx = (e-1) * xh_gll%lxyz+1
564 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
566 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
567 call col2(du, coef_gll%Binv, n_gll)
569 end subroutine cpu_convect_scalar_lx13
571 subroutine cpu_convect_scalar_lx12(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
572 coef_GLL, GLL_to_GL, nelv)
573 integer,
parameter :: lx = 12
574 integer,
intent(in) :: nelv
575 type(space_t),
intent(in) :: Xh_GLL
576 type(coef_t),
intent(in) :: coef_GLL
577 type(interpolator_t),
intent(inout) :: GLL_to_GL
578 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
579 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
580 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
581 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
582 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
583 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
584 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
585 real(kind=rp) :: ud(lx*lx*lx)
587 integer :: e, i, j, k, l, idx, n_GLL
589 n_gll = nelv * xh_gll%lxyz
596 tmp = tmp + dx(i,k) * u(k,j,1,e)
607 tmp = tmp + dy(j,l) * u(i,l,k,e)
618 tmp = tmp + dz(k,l) * u(i,1,l,e)
624 do i = 1, lx * lx * lx
625 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
626 + ct(i,e) * ut(i,1,1)
628 idx = (e-1) * xh_gll%lxyz+1
629 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
631 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
632 call col2(du, coef_gll%Binv, n_gll)
634 end subroutine cpu_convect_scalar_lx12
636 subroutine cpu_convect_scalar_lx11(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
637 coef_GLL, GLL_to_GL, nelv)
638 integer,
parameter :: lx = 11
639 integer,
intent(in) :: nelv
640 type(space_t),
intent(in) :: Xh_GLL
641 type(coef_t),
intent(in) :: coef_GLL
642 type(interpolator_t),
intent(inout) :: GLL_to_GL
643 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
644 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
645 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
646 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
647 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
648 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
649 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
650 real(kind=rp) :: ud(lx*lx*lx)
652 integer :: e, i, j, k, l, idx, n_GLL
654 n_gll = nelv * xh_gll%lxyz
661 tmp = tmp + dx(i,k) * u(k,j,1,e)
672 tmp = tmp + dy(j,l) * u(i,l,k,e)
683 tmp = tmp + dz(k,l) * u(i,1,l,e)
689 do i = 1, lx * lx * lx
690 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
691 + ct(i,e) * ut(i,1,1)
693 idx = (e-1) * xh_gll%lxyz+1
694 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
696 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
697 call col2(du, coef_gll%Binv, n_gll)
699 end subroutine cpu_convect_scalar_lx11
701 subroutine cpu_convect_scalar_lx10(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
702 coef_GLL, GLL_to_GL, nelv)
703 integer,
parameter :: lx = 10
704 integer,
intent(in) :: nelv
705 type(space_t),
intent(in) :: Xh_GLL
706 type(coef_t),
intent(in) :: coef_GLL
707 type(interpolator_t),
intent(inout) :: GLL_to_GL
708 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
709 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
710 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
711 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
712 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
713 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
714 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
715 real(kind=rp) :: ud(lx*lx*lx)
717 integer :: e, i, j, k, l, idx, n_GLL
719 n_gll = nelv * xh_gll%lxyz
726 tmp = tmp + dx(i,k) * u(k,j,1,e)
737 tmp = tmp + dy(j,l) * u(i,l,k,e)
748 tmp = tmp + dz(k,l) * u(i,1,l,e)
754 do i = 1, lx * lx * lx
755 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
756 + ct(i,e) * ut(i,1,1)
758 idx = (e-1) * xh_gll%lxyz+1
759 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
761 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
762 call col2(du, coef_gll%Binv, n_gll)
764 end subroutine cpu_convect_scalar_lx10
766 subroutine cpu_convect_scalar_lx9(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
767 coef_GLL, GLL_to_GL, nelv)
768 integer,
parameter :: lx = 9
769 integer,
intent(in) :: nelv
770 type(space_t),
intent(in) :: Xh_GLL
771 type(coef_t),
intent(in) :: coef_GLL
772 type(interpolator_t),
intent(inout) :: GLL_to_GL
773 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
774 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
775 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
776 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
777 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
778 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
779 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
780 real(kind=rp) :: ud(lx*lx*lx)
782 integer :: e, i, j, k, l, idx, n_GLL
784 n_gll = nelv * xh_gll%lxyz
791 tmp = tmp + dx(i,k) * u(k,j,1,e)
802 tmp = tmp + dy(j,l) * u(i,l,k,e)
813 tmp = tmp + dz(k,l) * u(i,1,l,e)
819 do i = 1, lx * lx * lx
820 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
821 + ct(i,e) * ut(i,1,1)
823 idx = (e-1) * xh_gll%lxyz+1
824 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
826 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
827 call col2(du, coef_gll%Binv, n_gll)
829 end subroutine cpu_convect_scalar_lx9
831 subroutine cpu_convect_scalar_lx8(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
832 coef_GLL, GLL_to_GL, nelv)
833 integer,
parameter :: lx = 8
834 integer,
intent(in) :: nelv
835 type(space_t),
intent(in) :: Xh_GLL
836 type(coef_t),
intent(in) :: coef_GLL
837 type(interpolator_t),
intent(inout) :: GLL_to_GL
838 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
839 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
840 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
841 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
842 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
843 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
844 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
845 real(kind=rp) :: ud(lx*lx*lx)
847 integer :: e, i, j, k, l, idx, n_GLL
849 n_gll = nelv * xh_gll%lxyz
856 tmp = tmp + dx(i,k) * u(k,j,1,e)
867 tmp = tmp + dy(j,l) * u(i,l,k,e)
878 tmp = tmp + dz(k,l) * u(i,1,l,e)
884 do i = 1, lx * lx * lx
885 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
886 + ct(i,e) * ut(i,1,1)
888 idx = (e-1) * xh_gll%lxyz+1
889 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
891 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
892 call col2(du, coef_gll%Binv, n_gll)
894 end subroutine cpu_convect_scalar_lx8
896 subroutine cpu_convect_scalar_lx7(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
897 coef_GLL, GLL_to_GL, nelv)
898 integer,
parameter :: lx = 7
899 integer,
intent(in) :: nelv
900 type(space_t),
intent(in) :: Xh_GLL
901 type(coef_t),
intent(in) :: coef_GLL
902 type(interpolator_t),
intent(inout) :: GLL_to_GL
903 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
904 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
905 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
906 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
907 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
908 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
909 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
910 real(kind=rp) :: ud(lx*lx*lx)
912 integer :: e, i, j, k, l, idx, n_GLL
914 n_gll = nelv * xh_gll%lxyz
921 tmp = tmp + dx(i,k) * u(k,j,1,e)
932 tmp = tmp + dy(j,l) * u(i,l,k,e)
943 tmp = tmp + dz(k,l) * u(i,1,l,e)
949 do i = 1, lx * lx * lx
950 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
951 + ct(i,e) * ut(i,1,1)
953 idx = (e-1) * xh_gll%lxyz+1
954 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
956 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
957 call col2(du, coef_gll%Binv, n_gll)
959 end subroutine cpu_convect_scalar_lx7
961 subroutine cpu_convect_scalar_lx6(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
962 coef_GLL, GLL_to_GL, nelv)
963 integer,
parameter :: lx = 6
964 integer,
intent(in) :: nelv
965 type(space_t),
intent(in) :: Xh_GLL
966 type(coef_t),
intent(in) :: coef_GLL
967 type(interpolator_t),
intent(inout) :: GLL_to_GL
968 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
969 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
970 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
971 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
972 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
973 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
974 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
975 real(kind=rp) :: ud(lx*lx*lx)
977 integer :: e, i, j, k, l, idx, n_GLL
979 n_gll = nelv * xh_gll%lxyz
986 tmp = tmp + dx(i,k) * u(k,j,1,e)
997 tmp = tmp + dy(j,l) * u(i,l,k,e)
1008 tmp = tmp + dz(k,l) * u(i,1,l,e)
1014 do i = 1, lx * lx * lx
1015 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
1016 + ct(i,e) * ut(i,1,1)
1018 idx = (e-1) * xh_gll%lxyz+1
1019 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
1021 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
1022 call col2(du, coef_gll%Binv, n_gll)
1024 end subroutine cpu_convect_scalar_lx6
1026 subroutine cpu_convect_scalar_lx5(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
1027 coef_GLL, GLL_to_GL, nelv)
1028 integer,
parameter :: lx = 5
1029 integer,
intent(in) :: nelv
1030 type(space_t),
intent(in) :: Xh_GLL
1031 type(coef_t),
intent(in) :: coef_GLL
1032 type(interpolator_t),
intent(inout) :: GLL_to_GL
1033 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
1034 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
1035 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
1036 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
1037 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
1038 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
1039 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
1040 real(kind=rp) :: ud(lx*lx*lx)
1041 real(kind=rp) :: tmp
1042 integer :: e, i, j, k, l, idx, n_GLL
1044 n_gll = nelv * xh_gll%lxyz
1051 tmp = tmp + dx(i,k) * u(k,j,1,e)
1062 tmp = tmp + dy(j,l) * u(i,l,k,e)
1073 tmp = tmp + dz(k,l) * u(i,1,l,e)
1079 do i = 1, lx * lx * lx
1080 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
1081 + ct(i,e) * ut(i,1,1)
1083 idx = (e-1) * xh_gll%lxyz+1
1084 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
1086 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
1087 call col2(du, coef_gll%Binv, n_gll)
1089 end subroutine cpu_convect_scalar_lx5
1091 subroutine cpu_convect_scalar_lx4(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
1092 coef_GLL, GLL_to_GL, nelv)
1093 integer,
parameter :: lx = 4
1094 integer,
intent(in) :: nelv
1095 type(space_t),
intent(in) :: Xh_GLL
1096 type(coef_t),
intent(in) :: coef_GLL
1097 type(interpolator_t),
intent(inout) :: GLL_to_GL
1098 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
1099 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
1100 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
1101 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
1102 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
1103 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
1104 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
1105 real(kind=rp) :: ud(lx*lx*lx)
1106 real(kind=rp) :: tmp
1107 integer :: e, i, j, k, l, idx, n_GLL
1109 n_gll = nelv * xh_gll%lxyz
1116 tmp = tmp + dx(i,k) * u(k,j,1,e)
1127 tmp = tmp + dy(j,l) * u(i,l,k,e)
1138 tmp = tmp + dz(k,l) * u(i,1,l,e)
1144 do i = 1, lx * lx * lx
1145 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
1146 + ct(i,e) * ut(i,1,1)
1148 idx = (e-1) * xh_gll%lxyz+1
1149 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
1151 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
1152 call col2(du, coef_gll%Binv, n_gll)
1154 end subroutine cpu_convect_scalar_lx4
1156 subroutine cpu_convect_scalar_lx3(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
1157 coef_GLL, GLL_to_GL, nelv)
1158 integer,
parameter :: lx = 3
1159 integer,
intent(in) :: nelv
1160 type(space_t),
intent(in) :: Xh_GLL
1161 type(coef_t),
intent(in) :: coef_GLL
1162 type(interpolator_t),
intent(inout) :: GLL_to_GL
1163 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
1164 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
1165 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
1166 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
1167 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
1168 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
1169 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
1170 real(kind=rp) :: ud(lx*lx*lx)
1171 real(kind=rp) :: tmp
1172 integer :: e, i, j, k, l, idx, n_GLL
1174 n_gll = nelv * xh_gll%lxyz
1181 tmp = tmp + dx(i,k) * u(k,j,1,e)
1192 tmp = tmp + dy(j,l) * u(i,l,k,e)
1203 tmp = tmp + dz(k,l) * u(i,1,l,e)
1209 do i = 1, lx * lx * lx
1210 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
1211 + ct(i,e) * ut(i,1,1)
1213 idx = (e-1) * xh_gll%lxyz+1
1214 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
1216 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
1217 call col2(du, coef_gll%Binv, n_gll)
1219 end subroutine cpu_convect_scalar_lx3
1221 subroutine cpu_convect_scalar_lx2(du, u, cr, cs, ct, dx, dy, dz, Xh_GLL, &
1222 coef_GLL, GLL_to_GL, nelv)
1223 integer,
parameter :: lx = 2
1224 integer,
intent(in) :: nelv
1225 type(space_t),
intent(in) :: Xh_GLL
1226 type(coef_t),
intent(in) :: coef_GLL
1227 type(interpolator_t),
intent(inout) :: GLL_to_GL
1228 real(kind=rp),
intent(inout) :: du(xh_gll%lx, xh_gll%lx, xh_gll%lx, nelv)
1229 real(kind=rp),
intent(in) :: u(lx, lx, lx, nelv)
1230 real(kind=rp),
intent(in) :: cr(lx*lx*lx, nelv)
1231 real(kind=rp),
intent(in) :: cs(lx*lx*lx, nelv)
1232 real(kind=rp),
intent(in) :: ct(lx*lx*lx, nelv)
1233 real(kind=rp),
dimension(lx, lx),
intent(in) :: dx, dy, dz
1234 real(kind=rp),
dimension(lx, lx, lx) :: ur, us, ut
1235 real(kind=rp) :: ud(lx*lx*lx)
1236 real(kind=rp) :: tmp
1237 integer :: e, i, j, k, l, idx, n_GLL
1239 n_gll = nelv * xh_gll%lxyz
1246 tmp = tmp + dx(i,k) * u(k,j,1,e)
1257 tmp = tmp + dy(j,l) * u(i,l,k,e)
1268 tmp = tmp + dz(k,l) * u(i,1,l,e)
1274 do i = 1, lx * lx * lx
1275 ud(i) = cr(i,e) * ur(i,1,1) + cs(i,e) * us(i,1,1) &
1276 + ct(i,e) * ut(i,1,1)
1278 idx = (e-1) * xh_gll%lxyz+1
1279 call gll_to_gl%map(du(idx,1,1,1), ud, 1, xh_gll)
1281 call coef_gll%gs_h%op(du, n_gll, gs_op_add)
1282 call col2(du, coef_gll%Binv, n_gll)
1284 end subroutine cpu_convect_scalar_lx2
1286end submodule cpu_convect_scalar
subroutine, public col2(a, b, n)
Vector multiplication .