FE-Project
Loading...
Searching...
No Matches
scale_meshfieldcomm_cubedspheredom2d.F90
Go to the documentation of this file.
1!-------------------------------------------------------------------------------
2!> module FElib / Data / Communication in 2D cubed-sphere domain
3!!
4!! @par Description
5!! A module to manage data communication with 2D cubed-sphere domain for element-based methods
6!!
7!! @author Yuta Kawai, Team SCALE
8!<
9#include "scaleFElib.h"
11
12 !-----------------------------------------------------------------------------
13 !
14 !++ used modules
15 !
16 use scale_precision
17 use scale_io
18
22 use scale_meshfieldcomm_base, only: &
33
34 !-----------------------------------------------------------------------------
35 implicit none
36 private
37
38 !-----------------------------------------------------------------------------
39 !
40 !++ Public type & procedure
41 !
42
43 !> Derived type to represent covariant vector components
44 type :: veccovariantcomp
45 type(MeshField2D), pointer :: u1 => null()
46 type(MeshField2D), pointer :: u2 => null()
47 end type
48
49 !> Base derived type to manage data communication with 2D cubed-sphere domain
51 class(meshcubedspheredom2d), pointer :: mesh2d !< Pointer to an object representing 2D cubed-sphere computational mesh
52 type(veccovariantcomp), allocatable :: vec_covariant_comp_ptrlist(:)
53
54 integer :: halosize_1d !< Halo size for 1D direction
55 contains
56 procedure, public :: init => meshfieldcommcubedspheredom2d_init
57 procedure, public :: put => meshfieldcommcubedspheredom2d_put
58 procedure, public :: get => meshfieldcommcubedspheredom2d_get
59 procedure, public :: exchange => meshfieldcommcubedspheredom2d_exchange
60 procedure, public :: setcovariantvec => meshfieldcommcubedspheredom2d_set_covariantvec
61 procedure, public :: final => meshfieldcommcubedspheredom2d_final
63
64 !-----------------------------------------------------------------------------
65 !
66 !++ Public parameters & variables
67 !
68
69 !-----------------------------------------------------------------------------
70 !
71 !++ Private type & procedure
72 !
73 private :: post_exchange_core
74 private :: push_localsendbuf
75
76 !-----------------------------------------------------------------------------
77 !
78 !++ Private parameters & variables
79 !
80 integer, parameter :: comm_face_num = 4
81
82contains
83!> Initialize an object to manage data communication with 2D cubed-sphere computational mesh
84 subroutine meshfieldcommcubedspheredom2d_init( this, &
85 sfield_num, hvfield_num, htensorfield_num, mesh2d, &
86 haloSize_1D )
87
88 use scale_meshutil_cubedsphere2d, only: meshutilcubedsphere2d_genpatchboundarymap_wide
89 implicit none
90
91 class(meshfieldcommcubedspheredom2d), intent(inout) :: this
92 integer, intent(in) :: sfield_num
93 integer, intent(in) :: hvfield_num
94 integer, intent(in) :: htensorfield_num
95 class(meshcubedspheredom2d), intent(in), target :: mesh2d
96 integer, intent(in), optional :: halosize_1d
97
98 type(localmesh2d), pointer :: lcmesh
99 type(elementbase2d), pointer :: elem
100 integer :: n
101 integer :: nnode_lcmeshface(comm_face_num,mesh2d%local_mesh_num)
102 !-----------------------------------------------------------------------------
103
104 this%mesh2d => mesh2d
105 lcmesh => mesh2d%lcmesh_list(1)
106 elem => lcmesh%refElem2D
107
108 !-
109 if ( present(halosize_1d) ) then
110 this%haloSize_1D = halosize_1d
111 else
112 this%haloSize_1D = 1
113 end if
114
115 !-
116 allocate( this%VMapB_size(this%mesh2d%LOCAL_MESH_NUM) )
117
118 this%bufsize_per_field = 2*(lcmesh%NeX + lcmesh%NeY) * elem%Nfp*this%haloSize_1D
119
120 do n=1, this%mesh2d%LOCAL_MESH_NUM
121 lcmesh => this%mesh2d%lcmesh_list(n)
122 nnode_lcmeshface(:,n) = (/ lcmesh%NeX, lcmesh%NeY, lcmesh%NeX, lcmesh%NeY /) * lcmesh%refElem2D%Nfp*this%haloSize_1D
123 end do
124
125 call meshfieldcommbase_init( this, sfield_num, hvfield_num, htensorfield_num, this%bufsize_per_field, comm_face_num, nnode_lcmeshface, mesh2d)
126
127 !-
128 if ( this%haloSize_1D > 1 ) then
129 this%use_vmap_wide_flag = .true.
130 allocate( this%VMapB2(this%bufsize_per_field) )
131
132 lcmesh => this%mesh2d%lcmesh_list(1)
133 call meshutilcubedsphere2d_genpatchboundarymap_wide( this%VMapB2, &
134 lcmesh%VMapB, this%haloSize_1D, &
135 lcmesh%NeX, lcmesh%NeY, &
136 elem%Nfp )
137 !$acc enter data copyin(this%VMapB2)
138 else
139 this%use_vmap_wide_flag = .false.
140 end if
141
142 do n=1, this%mesh2d%LOCAL_MESH_NUM
143 lcmesh => this%mesh2d%lcmesh_list(n)
144 if ( this%use_vmap_wide_flag ) then
145 this%VMapB_size(n) = size(this%VMapB2)
146 else
147 this%VMapB_size(n) = size(lcmesh%VMapB)
148 end if
149 end do
150 !$acc enter data copyin(this%VMapB_size)
151
152 !-
153 if (hvfield_num > 0) then
154 allocate( this%vec_covariant_comp_ptrlist(hvfield_num) )
155 end if
156
157 return
158 end subroutine meshfieldcommcubedspheredom2d_init
159
160!> Finalize an object to manage data communication with 2D cubed-sphere computational mesh
161 subroutine meshfieldcommcubedspheredom2d_final( this )
162 implicit none
163
164 class(meshfieldcommcubedspheredom2d), intent(inout) :: this
165 !-----------------------------------------------------------------------------
166
167 if ( this%hvfield_num > 0 ) then
168 deallocate( this%vec_covariant_comp_ptrlist )
169 end if
170
171 call meshfieldcommbase_final( this )
172 return
173 end subroutine meshfieldcommcubedspheredom2d_final
174
175!> Register objects to manage covariant vector components
176 subroutine meshfieldcommcubedspheredom2d_set_covariantvec( &
177 this, hvfield_ID, u1, u2 )
178 implicit none
179 class(meshfieldcommcubedspheredom2d), intent(inout) :: this
180 integer, intent(in) :: hvfield_id
181 type(meshfield2d), intent(in), target :: u1
182 type(meshfield2d), intent(in), target :: u2
183 !--------------------------------------------------------------
184
185 this%vec_covariant_comp_ptrlist(hvfield_id)%u1 => u1
186 this%vec_covariant_comp_ptrlist(hvfield_id)%u2 => u2
187 return
188 end subroutine meshfieldcommcubedspheredom2d_set_covariantvec
189
190!> Put field data into temporary buffers
191 subroutine meshfieldcommcubedspheredom2d_put(this, field_list, varid_s)
192 implicit none
193 class(meshfieldcommcubedspheredom2d), intent(inout) :: this
194 type(meshfieldcontainer), intent(in) :: field_list(:)
195 integer, intent(in) :: varid_s
196 !-----------------------------------------------------------------------------
197
198! call PROF_rapstart( 'comm_put', 2)
199
200 if ( this%use_vmap_wide_flag ) then
201 call meshfieldcommbase_extract_bounddata_3( field_list, 2, varid_s, this%mesh2d%lcmesh_list, this%VMapB2, this%VMapB_size(1), this%send_buf )
202 else
204 field_list, 2, varid_s, this%mesh2d%lcmesh_list, size(this%mesh2d%lcmesh_list(1)%VMapB), & !(in)
205 this%send_buf ) ! (out)
206 end if
207
208! call PROF_rapend( 'comm_put', 2)
209 return
210 end subroutine meshfieldcommcubedspheredom2d_put
211
212!> Extract field data from temporary buffers
213 subroutine meshfieldcommcubedspheredom2d_get(this, field_list, varid_s)
214 use scale_meshfieldcomm_base, only: &
216 implicit none
217
218 class(meshfieldcommcubedspheredom2d), intent(inout) :: this
219 type(meshfieldcontainer), intent(inout) :: field_list(:)
220 integer, intent(in) :: varid_s
221
222 integer :: i
223 integer :: n
224 type(localmesh2d), pointer :: lcmesh
225
226 integer :: varnum
227 integer :: varid_e
228 integer :: varid_vec_s
229
230 integer, allocatable :: vmapb(:)
231 !-----------------------------------------------------------------------------
232! call PROF_rapstart( 'comm_get', 2)
233 varnum = size(field_list)
234
235 !--
236 if ( this%call_wait_flag_sub_get ) then
237 ! This workflow should be reconsidered in near future.
238 ! The coordinate convresions for horizontal vector/tensor fields in post_exchange_core are applied for the received data (this%recv_buf).
239 ! However, MeshFieldCommBase_wait_core does not store the communication data into this%recv_buf, but directly into the field_list.
240 call meshfieldcommbase_wait_core( this, this%commdata_list )
241 call post_exchange_core( this )
242 else
243 do i=1, varnum
244 do n=1, this%mesh2d%LOCAL_MESH_NUM
245 lcmesh => this%mesh2d%lcmesh_list(n)
246 if ( this%use_vmap_wide_flag ) then
247 call meshfieldcommbase_set_bounddata_3( this%recv_buf(:,varid_s+i-1,n), lcmesh%refElem, lcmesh, & ! (in)
248 this%VMapB2, this%VMapB_size(1), & ! (in)
249 field_list(i)%field2d%local(n)%val ) ! (inout)
250 else
251 call meshfieldcommbase_set_bounddata( this%recv_buf(:,varid_s+i-1,n), lcmesh%refElem, lcmesh, & !(in)
252 field_list(i)%field2d%local(n)%val ) !(out)
253 end if
254 end do
255 end do
256 end if
257
258 varid_e = varid_s + varnum - 1
259 if ( varid_e > this%sfield_num ) then
260 do i=1, this%hvfield_num
261
262 varid_vec_s = this%sfield_num + 2*i - 1
263 if ( varid_vec_s > varid_e ) exit
264
265 if ( associated(this%vec_covariant_comp_ptrlist(i)%u1 ) &
266 .and. associated(this%vec_covariant_comp_ptrlist(i)%u2 ) ) then
267
268 do n=1, this%mesh2d%LOCAL_MESH_NUM
269 lcmesh => this%mesh2d%lcmesh_list(n)
270
271 if ( this%use_vmap_wide_flag ) then
272 allocate(vmapb(this%VMapB_size(n)))
273 vmapb(:) = this%VMapB2(:)
274 else
275 allocate(vmapb(size(lcmesh%VMapB)))
276 vmapb(:) = lcmesh%VMapB(:)
277 end if
278 !$acc enter data copyin(VMapB) async(1)
279 call set_boundary_data2d_u1u2( &
280 this%recv_buf(:,varid_vec_s,n), this%recv_buf(:,varid_vec_s+1,n), & ! (in)
281 this%bufsize_per_field, lcmesh%refElem2D, lcmesh, lcmesh%G_ij, vmapb, & ! (in)
282 this%vec_covariant_comp_ptrlist(i)%u1%local(n)%val, & ! (out)
283 this%vec_covariant_comp_ptrlist(i)%u2%local(n)%val ) ! (out)
284 !$acc exit data delete(VMapB) async(1)
285 deallocate( vmapb )
286 end do
287 end if
288 end do
289 end if
290 !$acc wait(1)
291
292! call PROF_rapend( 'comm_get', 2)
293 return
294 end subroutine meshfieldcommcubedspheredom2d_get
295
296 !> Exchange field data between neighboring MPI processes
297 !!
298 !! @param do_wait Flag whether MPI_waitall is called and move tmp data of LocalMeshCommData object to a recv buffer
299!OCL SERIAL
300 subroutine meshfieldcommcubedspheredom2d_exchange( this, do_wait )
301 use scale_meshfieldcomm_base, only: &
304 use scale_cubedsphere_coord_cnv, only: &
307 use scale_prc, only: prc_abort
308 implicit none
309
310 class(meshfieldcommcubedspheredom2d), intent(inout), target :: this
311 logical, intent(in), optional :: do_wait
312
313 integer :: n, f
314 integer :: varid
315 integer :: i
316
317 real(rp), allocatable :: fpos2d(:,:)
318 real(rp), allocatable :: lcfpos2d(:,:)
319 real(rp), allocatable :: unity_fac(:)
320 real(rp), allocatable :: tmp_svec2d(:,:)
321
322 class(elementbase2d), pointer :: elem
323 type(localmesh2d), pointer :: lcmesh
324 type(localmeshcommdata), pointer :: commdata
325
326 integer, pointer :: vmapb(:)
327 !-----------------------------------------------------------------------------
328
329 ! call PROF_rapstart( 'comm_exchange', 2)
330
331 if ( present(do_wait) ) then
332 if ( .not. do_wait ) then
333 log_info("MeshFieldCommCubedSphereDom2D_exchange",*) "do_wait=False is not currently supported. Check!"
334 call prc_abort
335 end if
336 end if
337
338 do n=1, this%mesh%LOCAL_MESH_NUM
339 lcmesh => this%mesh2d%lcmesh_list(n)
340 elem => lcmesh%refElem2D
341
342 allocate( fpos2d(this%Nnode_LCMeshAllFace(n),2) )
343
344 if ( this%use_vmap_wide_flag ) then
345 vmapb => this%VMapB2
346 else
347 vmapb => lcmesh%VMapB
348 end if
349 !$acc data create(fpos2D) copyin(VMapB)
350
351 call meshfieldcommbase_extract_bounddata2( lcmesh%pos_en(:,:,1), vmapb, size(vmapb), elem%Np*lcmesh%Ne, fpos2d(:,1) )
352 call meshfieldcommbase_extract_bounddata2( lcmesh%pos_en(:,:,2), vmapb, size(vmapb), elem%Np*lcmesh%Ne, fpos2d(:,2) )
353
354 do f=1, this%nfaces_comm
355 commdata => this%commdata_list(f,n)
356
357 call push_localsendbuf( commdata%send_buf, & ! (inout)
358 this%send_buf(:,:,n), commdata%s_faceID, this%is_f(f,n), & ! (in)
359 commdata%Nnode_LCMeshFace, this%bufsize_per_field, & ! (in)
360 this%field_num_tot, lcmesh, this%HaloSize_1D ) ! (in)
361
362 if ( commdata%s_panelID /= lcmesh%panelID &
363 .and. ( this%hvfield_num > 0 .or. this%htensorfield_num > 0 ) ) then
364
365 allocate( lcfpos2d(commdata%Nnode_LCMeshFace,2), unity_fac(commdata%Nnode_LCMeshFace) )
366 unity_fac(:) = 1.0_rp
367 !$acc enter data create(lcfpos2D) copyin(unity_fac) async(1)
368
369 call push_localsendbuf( lcfpos2d, &
370 fpos2d, commdata%s_faceID, this%is_f(f,n), &
371 commdata%Nnode_LCMeshFace, this%Nnode_LCMeshAllFace(n), 2, &
372 lcmesh, this%HaloSize_1D )
373 end if
374
375 if ( commdata%s_panelID /= lcmesh%panelID ) then
376 if ( this%hvfield_num > 0 ) then
377 allocate( tmp_svec2d(commdata%Nnode_LCMeshFace,2) )
378 !$acc enter data create(tmp_svec2D) async(1)
379
380 do varid=this%sfield_num+1, this%field_num_tot-1,2
381 !$acc parallel loop present(tmp_svec2D, commdata%send_buf) async(1)
382 do i=1, size(tmp_svec2d,1)
383 tmp_svec2d(i,1) = commdata%send_buf(i,varid )
384 tmp_svec2d(i,2) = commdata%send_buf(i,varid+1)
385 end do
386
388 lcmesh%panelID, lcfpos2d(:,1), lcfpos2d(:,2), unity_fac, & ! (in)
389 commdata%Nnode_LCMeshFace, & ! (in)
390 tmp_svec2d(:,1), tmp_svec2d(:,2), & ! (in)
391 commdata%send_buf(:,varid), commdata%send_buf(:,varid+1), & ! (out)
392 gpu_async_id=1 ) ! (in)
393 end do
394 !$acc exit data delete(tmp_svec2D) async(1)
395 deallocate( tmp_svec2d )
396 end if
397 end if
398
399
400 if ( allocated(lcfpos2d) ) then
401 !$acc exit data delete(lcfpos2D, unity_fac) async(1)
402 deallocate( lcfpos2d, unity_fac )
403 end if
404 end do
405 !$acc end data
406 deallocate( fpos2d )
407 end do
408 !$acc wait(1)
409
410 !-----------------------
411
412 call meshfieldcommbase_exchange_core(this, this%commdata_list, do_wait )
413 if ( .not. this%call_wait_flag_sub_get ) &
414 call post_exchange_core( this )
415
416 ! call PROF_rapend( 'comm_exchange', 2)
417
418 return
419 end subroutine meshfieldcommcubedspheredom2d_exchange
420
421!- Private ---------------------------
422
423 subroutine post_exchange_core( this )
425 use scale_cubedsphere_coord_cnv, only: &
427 implicit none
428
429 class(meshfieldcommcubedspheredom2d), intent(inout), target :: this
430
431 integer :: n, f
432 integer :: varid
433
434 real(rp), allocatable :: fpos2d(:,:)
435 real(rp), allocatable :: lcfpos2d(:,:)
436 real(rp), allocatable :: unity_fac(:)
437
438 class(elementbase2d), pointer :: elem
439 type(localmesh2d), pointer :: lcmesh
440 type(localmeshcommdata), pointer :: commdata
441
442 integer :: irs, ire
443 integer, pointer :: vmapb(:)
444 !-----------------------------------------------------------------------------
445
446 do n=1, this%mesh%LOCAL_MESH_NUM
447 lcmesh => this%mesh2d%lcmesh_list(n)
448 elem => lcmesh%refElem2D
449
450 allocate( fpos2d(this%Nnode_LCMeshAllFace(n),2) )
451 if ( this%use_vmap_wide_flag ) then
452 vmapb => this%VMapB2
453 else
454 vmapb => lcmesh%VMapB
455 end if
456 !$acc data create(fpos2D) copyin(VMapB)
457
458 call meshfieldcommbase_extract_bounddata2( lcmesh%pos_en(:,:,1), vmapb, size(vmapb), elem%Np*lcmesh%Ne, fpos2d(:,1) )
459 call meshfieldcommbase_extract_bounddata2( lcmesh%pos_en(:,:,2), vmapb, size(vmapb), elem%Np*lcmesh%Ne, fpos2d(:,2) )
460
461 irs = 1
462 do f=1, this%nfaces_comm
463 commdata => this%commdata_list(f,n)
464 ire = irs + commdata%Nnode_LCMeshFace - 1
465
466 if ( commdata%s_panelID /= lcmesh%panelID &
467 .and. ( this%hvfield_num > 0 .or. this%htensorfield_num > 0 ) ) then
468
469 allocate( lcfpos2d(commdata%Nnode_LCMeshFace,2), unity_fac(commdata%Nnode_LCMeshFace) )
470 unity_fac(:) = 1.0_rp
471 !$acc enter data create(lcfpos2D) copyin(unity_fac) async(1)
472
473 call push_localsendbuf( lcfpos2d, &
474 fpos2d, f, this%is_f(f,n), &
475 commdata%Nnode_LCMeshFace, this%Nnode_LCMeshAllFace(n), 2, &
476 lcmesh, this%HaloSize_1D )
477 end if
478
479
480 if ( commdata%s_panelID /= lcmesh%panelID ) then
481 if ( this%hvfield_num > 0 ) then
482 do varid=this%sfield_num+1, this%field_num_tot-1, 2
484 lcmesh%panelID, lcfpos2d(:,1), lcfpos2d(:,2), unity_fac(:), &
485 commdata%Nnode_LCMeshFace, &
486 commdata%recv_buf(:,varid), commdata%recv_buf(:,varid+1), &
487 this%recv_buf(irs:ire,varid,n), this%recv_buf(irs:ire,varid+1,n) )
488 end do
489 end if
490 end if
491
492 irs = ire + 1
493 if ( allocated(lcfpos2d) ) then
494 !$acc exit data delete(lcfpos2D, unity_fac) async(1)
495 deallocate( lcfpos2d, unity_fac )
496 end if
497 end do
498
499 !$acc end data
500 deallocate( fpos2d )
501 end do
502 !$acc wait(1)
503
504 return
505 end subroutine post_exchange_core
506
507 !> Push temporary buffer of the local send data to the communication buffer
508 subroutine push_localsendbuf( lc_send_buf, &
509 send_buf, s_faceID, is, Nnode_LCMeshFace, bufsize_per_field, var_num, &
510 lcmesh, haloSize_1D )
511 implicit none
512
513 integer, intent(in) :: var_num
514 integer, intent(in) :: nnode_lcmeshface
515 integer, intent(in) :: bufsize_per_field
516 real(rp), intent(inout) :: lc_send_buf(nnode_lcmeshface,var_num)
517 real(rp), intent(in) :: send_buf(bufsize_per_field,var_num)
518 integer, intent(in) :: s_faceid, is
519 type(localmesh2d), intent(in) :: lcmesh
520 integer, intent(in) :: halosize_1d
521
522 integer :: i, v
523 integer :: ne_h1d
524 integer :: nfp
525 !-----------------------------------------------------------------------------
526
527 if ( s_faceid > 0 ) then
528 !$omp parallel do
529 !$acc parallel loop collapse(2) present(lc_send_buf, send_buf) async(1)
530 do v=1, var_num
531 do i=1, nnode_lcmeshface
532 lc_send_buf(i,v) = send_buf(is+i-1,v)
533 end do
534 end do
535 else if ( s_faceid < 0 ) then
536 nfp = lcmesh%refElem2D%Nfp
537 ne_h1d = nnode_lcmeshface / ( nfp * halosize_1d )
538 call revert_hori( lc_send_buf, &
539 send_buf, is, ne_h1d, halosize_1d, nfp )
540 end if
541
542 return
543 contains
544 !> Revert the horizontal ordering of the local send buffer for negative s_faceID
545 subroutine revert_hori( revert, ori, is_, Ne_h1D_, haloSize_1D_, Nfp_ )
546 implicit none
547 integer, intent(in) :: is_
548 integer, intent(in) :: ne_h1d_
549 integer, intent(in) :: halosize_1d_
550 integer, intent(in) :: nfp_
551
552 real(rp), intent(out) :: revert(nfp_, halosize_1d_, ne_h1d_, var_num)
553 real(rp), intent(in) :: ori(bufsize_per_field,var_num)
554
555 integer :: p, ph, i, v
556 integer :: p_, i_
557 integer :: id_src
558 !---------------------------------------------------------------------------
559
560 !$acc parallel loop collapse(4) present(revert, ori) async(1)
561 do v=1, var_num
562 do i=1, ne_h1d_
563 do ph=1, halosize_1d_
564 do p=1, nfp_
565 ! reverse orientation along the face
566 i_ = ne_h1d_ - i + 1
567 p_ = nfp_ - p + 1
568 ! source ordering: (p, ph, i)
569 id_src = is_ - 1 &
570 + p_ &
571 + (ph-1) * nfp_ &
572 + (i_-1) * nfp_ * halosize_1d_
573
574 revert(p,ph,i,v) = ori(id_src,v)
575 end do
576 end do
577 end do
578 end do
579 return
580 end subroutine revert_hori
581 end subroutine push_localsendbuf
582
583 subroutine set_boundary_data2d_u1u2( buf_U, buf_V, &
584 bufsize_per_field, elem, mesh, G_ij, VMapB, &
585 u1, u2)
586
587 implicit none
588 integer, intent(in) :: bufsize_per_field
589 type(elementbase2d), intent(in) :: elem
590 type(localmesh2d), intent(in) :: mesh
591 real(dp), intent(in) :: buf_u(bufsize_per_field)
592 real(dp), intent(in) :: buf_v(bufsize_per_field)
593 real(dp), intent(in) :: g_ij(elem%np * mesh%ne,2,2)
594 integer, intent(in) :: vmapb(bufsize_per_field)
595 real(dp), intent(inout) :: u1(elem%np * mesh%nea)
596 real(dp), intent(inout) :: u2(elem%np * mesh%nea)
597
598 integer :: ii, iis
599 integer :: vmap_b
600 !------------------------------------------------------------
601
602#ifdef _OPENACC
603 iis = elem%Np*mesh%NeE
604 !$acc parallel loop present(buf_U, buf_V, G_ij, u1, u2, VMapB)
605 do ii=1, bufsize_per_field
606 vmap_b = vmapb(ii)
607 u1(iis+ii) = g_ij(vmap_b,1,1) * buf_u(ii) + g_ij(vmap_b,1,2) * buf_v(ii)
608 u2(iis+ii) = g_ij(vmap_b,2,1) * buf_u(ii) + g_ij(vmap_b,2,2) * buf_v(ii)
609 end do
610#else
611 u1(elem%Np*mesh%NeE+1:elem%Np*mesh%NeE+bufsize_per_field) &
612 = g_ij(vmapb,1,1) * buf_u(:) + g_ij(vmapb,1,2) * buf_v(:)
613 u2(elem%Np*mesh%NeE+1:elem%Np*mesh%NeE+bufsize_per_field) &
614 = g_ij(vmapb,2,1) * buf_u(:) + g_ij(vmapb,2,2) * buf_v(:)
615#endif
616 return
617 end subroutine set_boundary_data2d_u1u2
618
Module common / Coordinate conversion with cubed-sphere projection.
subroutine, public cubedspherecoordcnv_lonlat2csvec(panelid, alpha, beta, gam, np, veclon, veclat, vecalpha, vecbeta, lat, gpu_async_id)
Convert the components of a vector in longitude and latitude coordinates to those in local coordinate...
subroutine, public cubedspherecoordcnv_cs2lonlatvec(panelid, alpha, beta, gam, np, vecalpha, vecbeta, veclon, veclat, lat, gpu_async_id)
Convert the components of a vector in local coordinates with an equiangular gnomonic cubed-sphere pro...
module FElib / Element / Base
module FElib / Mesh / Local 2D
module FElib / Mesh / Cubed-sphere 2D domain
module FElib / Data / base
module FElib / Data / Communication base
subroutine, public meshfieldcommbase_extract_bounddata(var, refelem, mesh, buf)
Extract halo data from data array with MeshField object and set it to the receiving buffer.
subroutine, public meshfieldcommbase_extract_bounddata_3(field_list, dim, varid_s, lcmesh_list, vmapb2, vmapb2_size, buf)
Extract halo data from data array with MeshField object and set it to the recieving buffer.
subroutine, public meshfieldcommbase_final(this)
Finalize a base object to manage data communication of fields.
subroutine, public meshfieldcommbase_wait_core(this, commdata_list, field_list, dim, varid_s, lcmesh_list)
Wait data communication and move tmp data of LocalMeshCommData object to a recv buffer.
subroutine, public meshfieldcommbase_set_bounddata(buf, refelem, mesh, var)
Extract halo data from the receiving buffer and set it to data array with MeshField object.
subroutine, public meshfieldcommbase_set_bounddata_3(buf, refelem, mesh, vmapb, vmapb_size, var)
Extract halo data from the recieving buffer and set it to data array with MeshField object.
subroutine, public meshfieldcommbase_init(this, sfield_num, hvfield_num, htensorfield_num, bufsize_per_field, comm_face_num, nnode_lcmeshface, mesh)
Initialize a base object to manage data communication of fields.
subroutine, public meshfieldcommbase_extract_bounddata_2(field_list, dim, varid_s, lcmesh_list, vmapb_size, buf)
Extract halo data from data array with MeshField object and set it to the receiving buffer.
subroutine, public meshfieldcommbase_extract_bounddata2(var, vmapb, vmapb_size, npxnea, buf)
Extract halo data from data array with MeshField object and set it to the receiving buffer.
subroutine, public meshfieldcommbase_exchange_core(this, commdata_list, do_wait)
Exchange halo data.
module FElib / Data / Communication in 2D cubed-sphere domain
module FElib / Mesh / utility for 2D cubed-sphere mesh
Derived type representing a 2D reference element.
Derived type representing an arbitrary finite element.
Derived type representing a local mesh for 2D domain.
Derived type to manage a cubed-sphere 2D computational domain.
Derived type representing a field with 2D mesh.
Derived type to manage data communication at a face between adjacent local meshes.
Base derived type to manage data communication.
Container to save a pointer of MeshField(1D, 2D, 3D) object.
Base derived type to manage data communication with 2D cubed-sphere domain.