FE-Project
Loading...
Searching...
No Matches
Data Types | Functions/Subroutines
scale_file_common_meshfield Module Reference

module FElib / File / Common More...

Data Types

type  file_common_meshfield_diminfo
 
interface  file_common_meshfield_get_axis
 
interface  file_common_meshfield_get_dims
 

Functions/Subroutines

subroutine, public file_common_meshfield_get_dims1d (mesh1d, dimsinfo)
 
subroutine, public file_common_meshfield_get_axis1d (mesh1d, dimsinfo, x, force_uniform_grid)
 
subroutine, public file_common_meshfield_put_field1d_cartesbuf (mesh1d, field1d, buf, force_uniform_grid)
 
subroutine, public file_common_meshfield_set_cartesbuf_field1d (mesh1d, buf, field1d)
 
subroutine, public file_common_meshfield_set_cartesbuf_field1d_local (lcmesh, buf, i0_s, val)
 
subroutine, public file_common_meshfield_get_dims2d (mesh2d, dimsinfo)
 
subroutine, public file_common_meshfield_get_axis2d (mesh2d, dimsinfo, x, y, force_uniform_grid)
 
subroutine, public file_common_meshfield_put_field2d_cartesbuf (mesh2d, field2d, buf, force_uniform_grid)
 
subroutine, public file_common_meshfield_put_field2d_cubedsphere_cartesbuf (mesh2d, field2d, buf)
 
subroutine, public file_common_meshfield_set_cartesbuf_field2d (mesh2d, buf, field2d)
 
subroutine, public file_common_meshfield_set_cartesbuf_field2d_local (lcmesh, buf, i0_s, j0_s, val)
 
subroutine, public file_common_meshfield_set_cartesbuf_field2d_cubedsphere (mesh2d, buf, field2d)
 
subroutine, public file_common_meshfield_get_dims3d (mesh3d, dimsinfo)
 
subroutine, public file_common_meshfield_get_axis3d (mesh3d, dimsinfo, x, y, z, force_uniform_grid)
 
subroutine, public file_common_meshfield_put_field3d_cartesbuf (mesh3d, field3d, buf, force_uniform_grid)
 
subroutine, public file_common_meshfield_put_field3d_cubedsphere_cartesbuf (mesh3d, field3d, buf)
 
subroutine, public file_common_meshfield_set_cartesbuf_field3d (mesh3d, buf, field3d)
 
subroutine, public file_common_meshfield_set_cartesbuf_field3d_cubedsphere (mesh3d, buf, field3d)
 
subroutine, public file_common_meshfield_set_cartesbuf_field3d_local (lcmesh, buf, i0_s, j0_s, k0_s, val)
 
integer function, public file_common_meshfield_get_dtype (datatype)
 

Detailed Description

module FElib / File / Common

Description
A common module for outputing field data
Author
Yuta Kawai, Team SCALE

Function/Subroutine Documentation

◆ file_common_meshfield_get_dims1d()

subroutine, public scale_file_common_meshfield::file_common_meshfield_get_dims1d ( class(meshbase1d), intent(in), target mesh1d,
type(file_common_meshfield_diminfo), dimension(meshbase1d_dimtype_num), intent(out) dimsinfo )

Definition at line 128 of file scale_file_common_meshfield.F90.

129 implicit none
130
131 class(MeshBase1D), target, intent(in) :: mesh1D
132 type(FILE_common_meshfield_diminfo), intent(out) :: dimsinfo(MeshBase1D_DIMTYPE_NUM)
133
134 integer :: i_size
135 type(MeshDimInfo), pointer :: diminfo
136 type(MeshDimInfo), pointer :: diminfo_x
137 !-------------------------------------------------
138
139 i_size = mesh1d%NeG * mesh1d%refElem1D%Np
140
141 diminfo_x => mesh1d%dimInfo(meshbase1d_dimtypeid_x)
142 call set_dimension( dimsinfo(meshbase1d_dimtypeid_x), &
143 diminfo_x, "X", 1, (/ diminfo_x%name /), (/ i_size /) )
144
145 diminfo => mesh1d%dimInfo(meshbase1d_dimtypeid_xt)
146 call set_dimension( dimsinfo(meshbase1d_dimtypeid_xt), &
147 diminfo, "XT", 1, (/ diminfo_x%name /), (/ i_size /) )
148
149 return

Referenced by scale_file_history_meshfield::file_history_meshfield_in::file_history_meshfield_in3d().

◆ file_common_meshfield_get_axis1d()

subroutine, public scale_file_common_meshfield::file_common_meshfield_get_axis1d ( class(meshbase1d), intent(in), target mesh1d,
type(file_common_meshfield_diminfo), dimension(meshbase1d_dimtype_num), intent(in) dimsinfo,
real(rp), dimension(dimsinfo(meshbase1d_dimtypeid_x)%size), intent(out) x,
logical, intent(in), optional force_uniform_grid )

Definition at line 153 of file scale_file_common_meshfield.F90.

155 implicit none
156
157 class(MeshBase1D), target, intent(in) :: mesh1D
158 type(FILE_common_meshfield_diminfo), intent(in) :: dimsinfo(MeshBase1D_DIMTYPE_NUM)
159 real(RP), intent(out) :: x(dimsinfo(MeshBase1D_DIMTYPEID_X)%size)
160 logical, intent(in), optional :: force_uniform_grid
161
162 integer :: n
163 integer :: i
164 integer :: is, ie
165 type(ElementBase1D), pointer :: refElem
166 type(LocalMesh1D), pointer :: lcmesh
167
168 logical :: uniform_grid = .false.
169 real(RP), allocatable :: x_local(:)
170 !-------------------------------------------------
171
172 if ( present(force_uniform_grid) ) uniform_grid = force_uniform_grid
173
174 do n=1,mesh1d%LOCAL_MESH_NUM
175 lcmesh => mesh1d%lcmesh_list(n)
176 refelem => lcmesh%refElem1D
177
178 allocate( x_local(refelem%Np) )
179
180 do i=1,mesh1d%NeG
181 x_local(:) = lcmesh%pos_en(:,i,1)
182 if ( uniform_grid ) call get_uniform_grid1d( x_local, refelem%Nfp )
183
184 is = 1 + (i-1)*refelem%Np + (n-1)*refelem%Np*lcmesh%Ne
185 ie = is + refelem%Np -1
186 x(is:ie) = x_local(:)
187 end do
188
189 deallocate( x_local )
190 end do
191
192 return

Referenced by scale_file_history_meshfield::file_history_meshfield_in::file_history_meshfield_in3d().

◆ file_common_meshfield_put_field1d_cartesbuf()

subroutine, public scale_file_common_meshfield::file_common_meshfield_put_field1d_cartesbuf ( class(meshbase1d), intent(in), target mesh1d,
class(meshfield1d), intent(in) field1d,
real(rp), dimension(:), intent(inout) buf,
logical, intent(in), optional force_uniform_grid )

Definition at line 196 of file scale_file_common_meshfield.F90.

198 use scale_polynominal, only: &
200 implicit none
201 class(MeshBase1D), target, intent(in) :: mesh1D
202 class(MeshField1D), intent(in) :: field1d
203 real(RP), intent(inout) :: buf(:)
204 logical, intent(in), optional :: force_uniform_grid
205
206 integer :: n, kelem1, p
207 integer :: i, i2
208 type(LocalMesh1D), pointer :: lcmesh
209 type(ElementBase1D), pointer :: refElem
210 integer :: i0_s
211
212 logical :: uniform_grid = .false.
213 integer :: Np
214 real(RP), allocatable :: x_local(:)
215 real(RP) :: x_local0, delx
216 real(RP) :: ox(1)
217 real(RP), allocatable :: spectral_coef(:)
218 real(RP), allocatable :: P1D_ori_x(:,:)
219 !------------------------------------------------
220
221 if ( present(force_uniform_grid) ) uniform_grid = force_uniform_grid
222
223 i0_s = 0
224 do n=1, mesh1d%LOCAL_MESH_NUM
225 lcmesh => mesh1d%lcmesh_list(n)
226 refelem => lcmesh%refElem1D
227 np = refelem%Np
228
229 if ( uniform_grid ) then
230 allocate( x_local(np) )
231 allocate( spectral_coef(np) )
232 allocate( p1d_ori_x(1,np) )
233 end if
234
235 do kelem1=lcmesh%NeS, lcmesh%NeE
236 if ( uniform_grid ) then
237 x_local(:) = lcmesh%pos_en(:,kelem1,1)
238 x_local0 = x_local(1); delx = x_local(np) - x_local0
239 call get_uniform_grid1d( x_local, np )
240
241 spectral_coef(:) = matmul(refelem%invV(:,:), field1d%local(n)%val(:,kelem1))
242 do i2=1, np
243 ox = - 1.0_rp + 2.0_rp * (x_local(i2) - x_local0) / delx
244 call polynominal_genlegendrepoly_sub( refelem%PolyOrder, ox, p1d_ori_x(:,:) )
245
246 i = i0_s + i2 + (kelem1-1)*np
247 buf(i) = 0.0_rp
248 do p=1, np
249 buf(i) = buf(i) + &
250 p1d_ori_x(1,p) * sqrt( dble(p-1) + 0.5_rp ) * spectral_coef(p)
251 end do
252 end do
253 else
254 do i2=1, np
255 i = i0_s + i2 + (kelem1-1)*np
256 buf(i) = field1d%local(n)%val(i2,kelem1)
257 end do
258 end if
259 end do
260
261 i0_s = i0_s + lcmesh%Ne * refelem%Np
262 if ( uniform_grid ) then
263 deallocate( x_local )
264 deallocate( spectral_coef )
265 deallocate( p1d_ori_x )
266 end if
267 end do
268
269 return
module common / Polynominal
subroutine, public polynominal_genlegendrepoly_sub(nord, x, p)
A function to obtain the values of Legendre polynominals which are evaluated at aribitary points.

References scale_polynominal::polynominal_genlegendrepoly_sub().

Referenced by scale_file_base_meshfield::file_base_meshfield_init(), and scale_file_history_meshfield::file_history_meshfield_put::file_history_meshfield_put1d().

◆ file_common_meshfield_set_cartesbuf_field1d()

subroutine, public scale_file_common_meshfield::file_common_meshfield_set_cartesbuf_field1d ( class(meshbase1d), intent(in), target mesh1d,
real(rp), dimension(:), intent(in) buf,
class(meshfield1d), intent(inout) field1d )

Definition at line 273 of file scale_file_common_meshfield.F90.

275 implicit none
276 class(MeshBase1D), target, intent(in) :: mesh1D
277 real(RP), intent(in) :: buf(:)
278 class(MeshField1D), intent(inout) :: field1d
279
280 integer :: n
281 integer :: i0
282 type(LocalMesh1D), pointer :: lcmesh
283 type(ElementBase1D), pointer :: refElem
284 integer :: i0_s
285 !----------------------------------------------------
286
287 i0_s = 0
288
289 do i0=1, mesh1d%LOCAL_MESH_NUM
290 n = i0
291 lcmesh => mesh1d%lcmesh_list(n)
292 refelem => lcmesh%refElem1D
293
294 call file_common_meshfield_set_cartesbuf_field1d_local( &
295 lcmesh, buf(:), i0_s, &
296 field1d%local(n)%val(:,:) )
297
298 i0_s = i0_s + lcmesh%Ne * refelem%Np
299 end do
300
301 return

References file_common_meshfield_set_cartesbuf_field1d_local().

Referenced by scale_file_base_meshfield::file_base_meshfield_init().

◆ file_common_meshfield_set_cartesbuf_field1d_local()

subroutine, public scale_file_common_meshfield::file_common_meshfield_set_cartesbuf_field1d_local ( type(localmesh1d), intent(in) lcmesh,
real(rp), dimension(:), intent(in) buf,
integer, intent(in) i0_s,
real(rp), dimension(lcmesh%refelem1d%np,lcmesh%nea), intent(inout) val )

Definition at line 305 of file scale_file_common_meshfield.F90.

308 implicit none
309 type(LocalMesh1D), intent(in) :: lcmesh
310 real(RP), intent(in) :: buf(:)
311 integer, intent(in) :: i0_s
312 real(RP), intent(inout) :: val(lcmesh%refElem1D%Np,lcmesh%NeA)
313
314 integer :: kelem1
315 integer :: i, i1, i2
316 type(ElementBase1D), pointer :: refElem
317 integer :: indx
318 !----------------------------------------------------
319
320 refelem => lcmesh%refElem1D
321
322 do i1=1, lcmesh%Ne
323 kelem1 = i1
324 do i2=1, refelem%Np
325 i = i0_s + i2 + (i1-1)*refelem%Np
326 indx = i2
327 val(indx,kelem1) = buf(i)
328 end do
329 end do
330
331 return

Referenced by scale_file_base_meshfield::file_base_meshfield_init(), and file_common_meshfield_set_cartesbuf_field1d().

◆ file_common_meshfield_get_dims2d()

subroutine, public scale_file_common_meshfield::file_common_meshfield_get_dims2d ( class(meshrectdom2d), intent(in), target mesh2d,
type(file_common_meshfield_diminfo), dimension(meshbase2d_dimtype_num), intent(out) dimsinfo )

Definition at line 337 of file scale_file_common_meshfield.F90.

338 implicit none
339
340 class(MeshRectDom2D), target, intent(in) :: mesh2D
341 type(FILE_common_meshfield_diminfo), intent(out) :: dimsinfo(MeshBase2D_DIMTYPE_NUM)
342
343 type(LocalMesh2D), pointer :: lcmesh
344 integer :: i, j, n
345
346 integer :: i_size, j_size
347 type(MeshDimInfo), pointer :: diminfo
348 type(MeshDimInfo), pointer :: diminfo_x
349 type(MeshDimInfo), pointer :: diminfo_y
350 !-------------------------------------------------
351
352 i_size = 0
353 do i=1, size(mesh2d%rcdomIJ2LCMeshID,1)
354 n = mesh2d%rcdomIJ2LCMeshID(i,1)
355 lcmesh => mesh2d%lcmesh_list(n)
356 i_size =i_size + lcmesh%NeX * lcmesh%refElem2D%Nfp
357 end do
358
359 j_size = 0
360 do j=1, size(mesh2d%rcdomIJ2LCMeshID,2)
361 n = mesh2d%rcdomIJ2LCMeshID(1,j)
362 lcmesh => mesh2d%lcmesh_list(n)
363 j_size = j_size + lcmesh%NeY * lcmesh%refElem2D%Nfp
364 end do
365
366 diminfo_x => mesh2d%dimInfo(meshbase2d_dimtypeid_x)
367 call set_dimension( dimsinfo(meshbase2d_dimtypeid_x), &
368 diminfo_x, "X", 1, (/ diminfo_x%name /), (/ i_size /) )
369
370 diminfo_y => mesh2d%dimInfo(meshbase2d_dimtypeid_y)
371 call set_dimension( dimsinfo(meshbase2d_dimtypeid_y), &
372 diminfo_y, "Y", 1, (/ diminfo_y%name /), (/ j_size /) )
373
374 diminfo => mesh2d%dimInfo(meshbase2d_dimtypeid_xy)
375 call set_dimension( dimsinfo(meshbase2d_dimtypeid_xy), &
376 diminfo, "XY", 2, (/ diminfo_x%name, diminfo_y%name /), &
377 (/ i_size, j_size /) )
378
379 diminfo => mesh2d%dimInfo(meshbase2d_dimtypeid_xyt)
380 call set_dimension( dimsinfo(meshbase2d_dimtypeid_xyt), &
381 diminfo, "XYT", 2, (/ diminfo_x%name, diminfo_y%name /), &
382 (/ i_size, j_size /) )
383
384 return

Referenced by scale_file_history_meshfield::file_history_meshfield_in::file_history_meshfield_in3d().

◆ file_common_meshfield_get_axis2d()

subroutine, public scale_file_common_meshfield::file_common_meshfield_get_axis2d ( class(meshrectdom2d), intent(in), target mesh2d,
type(file_common_meshfield_diminfo), dimension(meshbase2d_dimtype_num), intent(in) dimsinfo,
real(rp), dimension(dimsinfo(meshbase2d_dimtypeid_x)%size), intent(out) x,
real(rp), dimension(dimsinfo(meshbase2d_dimtypeid_y)%size), intent(out) y,
logical, intent(in), optional force_uniform_grid )

Definition at line 442 of file scale_file_common_meshfield.F90.

444 implicit none
445
446 class(MeshRectDom2D), target, intent(in) :: mesh2D
447 type(FILE_common_meshfield_diminfo), intent(in) :: dimsinfo(MeshBase2D_DIMTYPE_NUM)
448 real(RP), intent(out) :: x(dimsinfo(MeshBase2D_DIMTYPEID_X)%size)
449 real(RP), intent(out) :: y(dimsinfo(MeshBase2D_DIMTYPEID_Y)%size)
450 logical, intent(in), optional :: force_uniform_grid
451
452 integer :: n
453 integer :: ni, nj
454 integer :: k
455 integer :: i, j
456 type(ElementBase2D), pointer :: refElem
457 type(LocalMesh2D), pointer :: lcmesh
458
459 integer :: is, js, ie, je, igs, jgs
460
461 logical :: uniform_grid = .false.
462 real(RP), allocatable :: x_local(:)
463 real(RP), allocatable :: y_local(:)
464 !-------------------------------------------------
465
466 if ( present(force_uniform_grid) ) uniform_grid = force_uniform_grid
467
468 igs = 0; jgs = 0
469 do nj=1, size(mesh2d%rcdomIJ2LCMeshID,2)
470 do ni=1, size(mesh2d%rcdomIJ2LCMeshID,1)
471 n = mesh2d%rcdomIJ2LCMeshID(ni,nj)
472 lcmesh => mesh2d%lcmesh_list(n)
473 refelem => lcmesh%refElem2D
474
475 allocate( x_local(refelem%Nfp), y_local(refelem%Nfp) )
476
477 do j=1, lcmesh%NeY
478 do i=1, lcmesh%NeX
479 k = i + (j-1) * lcmesh%NeX
480 if ( j==1 .and. nj == 1 ) then
481 x_local(:) = lcmesh%pos_en(refelem%Fmask(:,1),k,1)
482 if ( uniform_grid ) call get_uniform_grid1d( x_local, refelem%Nfp )
483
484 is = igs + 1 + (i-1)*refelem%Nfp
485 ie = is + refelem%Nfp - 1
486 x(is:ie) = x_local(:)
487 end if
488 if ( i==1 .and. ni == 1 ) then
489 y_local(:) = lcmesh%pos_en(refelem%Fmask(:,4),k,2)
490 if ( uniform_grid ) call get_uniform_grid1d( y_local, refelem%Nfp )
491
492 js = jgs + 1 + (j-1)*refelem%Nfp
493 je = js + refelem%Nfp - 1
494 y(js:je) = y_local(:)
495 end if
496 end do
497 end do
498
499 igs = ie; jgs = je
500 deallocate( x_local, y_local )
501 end do
502 end do
503
504 return

Referenced by scale_file_history_meshfield::file_history_meshfield_in::file_history_meshfield_in3d().

◆ file_common_meshfield_put_field2d_cartesbuf()

subroutine, public scale_file_common_meshfield::file_common_meshfield_put_field2d_cartesbuf ( class(meshrectdom2d), intent(in), target mesh2d,
class(meshfield2d), intent(in) field2d,
real(rp), dimension(:,:), intent(inout) buf,
logical, intent(in), optional force_uniform_grid )

Definition at line 573 of file scale_file_common_meshfield.F90.

575 use scale_polynominal, only: &
577 implicit none
578 class(MeshRectDom2D), target, intent(in) :: mesh2D
579 class(MeshField2D), intent(in) :: field2d
580 real(RP), intent(inout) :: buf(:,:)
581 logical, intent(in), optional :: force_uniform_grid
582
583 integer :: n, kelem1
584 integer :: i0, j0, i1, j1, i2, j2, i, j
585 type(LocalMesh2D), pointer :: lcmesh
586 type(ElementBase2D), pointer :: refElem
587 integer :: i0_s, j0_s
588
589 logical :: uniform_grid = .false.
590 integer :: Nfp
591 real(RP), allocatable :: x_local(:)
592 real(RP) :: x_local0, delx
593 real(RP), allocatable :: y_local(:)
594 real(RP) :: y_local0, dely
595 real(RP) :: ox(1), oy(1)
596 real(RP), allocatable :: spectral_coef(:)
597 real(RP), allocatable :: P1D_ori_x(:,:)
598 real(RP), allocatable :: P1D_ori_y(:,:)
599 integer :: l, p1, p2
600 !------------------------------------------------
601
602 if ( present(force_uniform_grid) ) uniform_grid = force_uniform_grid
603
604 i0_s = 0; j0_s = 0
605
606 do j0=1, size(mesh2d%rcdomIJ2LCMeshID,2)
607 do i0=1, size(mesh2d%rcdomIJ2LCMeshID,1)
608 n = mesh2d%rcdomIJ2LCMeshID(i0,j0)
609
610 lcmesh => mesh2d%lcmesh_list(n)
611 refelem => lcmesh%refElem2D
612 nfp = refelem%Nfp
613
614 if ( uniform_grid ) then
615 allocate( x_local(nfp), y_local(nfp) )
616 allocate( spectral_coef(refelem%Np) )
617 allocate( p1d_ori_x(1,nfp), p1d_ori_y(1,nfp) )
618 end if
619
620 do j1=1, lcmesh%NeY
621 do i1=1, lcmesh%NeX
622 kelem1 = i1 + (j1-1)*lcmesh%NeX
623
624 if ( uniform_grid ) then
625 x_local(:) = lcmesh%pos_en(refelem%Fmask(1:nfp,1),kelem1,1)
626 x_local0 = x_local(1); delx = x_local(nfp) - x_local0
627 y_local(:) = lcmesh%pos_en(refelem%Fmask(1:nfp,4),kelem1,2)
628 y_local0 = y_local(1); dely = y_local(nfp) - y_local0
629 call get_uniform_grid1d( x_local, nfp )
630 call get_uniform_grid1d( y_local, nfp )
631
632 spectral_coef(:) = matmul(refelem%invV(:,:), field2d%local(n)%val(:,kelem1))
633 do j2=1, nfp
634 do i2=1, nfp
635 ox(1) = - 1.0_rp + 2.0_rp * (x_local(i2) - x_local0) / delx
636 oy(1) = - 1.0_rp + 2.0_rp * (y_local(j2) - y_local0) / dely
637
638 call polynominal_genlegendrepoly_sub( refelem%PolyOrder, ox, p1d_ori_x(:,:) )
639 call polynominal_genlegendrepoly_sub( refelem%PolyOrder, oy, p1d_ori_y(:,:) )
640
641 i = i0_s + i2 + (i1-1)*nfp
642 j = j0_s + j2 + (j1-1)*nfp
643 buf(i,j) = 0.0_rp
644 do p2=1, nfp
645 do p1=1, nfp
646 l = p1 + (p2-1)*nfp
647 buf(i,j) = buf(i,j) + &
648 ( p1d_ori_x(1,p1) * p1d_ori_y(1,p2) ) &
649 * sqrt((dble(p1-1) + 0.5_rp)*(dble(p2-1) + 0.5_rp)) &
650 * spectral_coef(l)
651 end do
652 end do
653 end do
654 end do
655
656 else
657
658 do j2=1, nfp
659 do i2=1, nfp
660 i = i0_s + i2 + (i1-1)*nfp
661 j = j0_s + j2 + (j1-1)*nfp
662 buf(i,j) = field2d%local(n)%val(i2+(j2-1)*nfp,kelem1)
663 end do
664 end do
665
666 end if
667 end do
668 end do
669
670 if ( uniform_grid ) then
671 deallocate( x_local, y_local )
672 deallocate( spectral_coef )
673 deallocate( p1d_ori_x, p1d_ori_y )
674 end if
675
676 i0_s = i0_s + lcmesh%NeX * refelem%Nfp
677 end do
678 j0_s = j0_s + lcmesh%NeY * refelem%Nfp
679 end do
680
681 return

References scale_polynominal::polynominal_genlegendrepoly_sub().

Referenced by scale_file_base_meshfield::file_base_meshfield_init(), and scale_file_history_meshfield::file_history_meshfield_put::file_history_meshfield_put2d().

◆ file_common_meshfield_put_field2d_cubedsphere_cartesbuf()

subroutine, public scale_file_common_meshfield::file_common_meshfield_put_field2d_cubedsphere_cartesbuf ( class(meshcubedspheredom2d), intent(in), target mesh2d,
class(meshfield2d), intent(in) field2d,
real(rp), dimension(:,:), intent(inout) buf )

Definition at line 685 of file scale_file_common_meshfield.F90.

687 use scale_polynominal, only: &
689 implicit none
690 class(MeshCubedSphereDom2D), target, intent(in) :: mesh2D
691 class(MeshField2D), intent(in) :: field2d
692 real(RP), intent(inout) :: buf(:,:)
693
694 integer :: n, kelem1
695 integer :: i0, j0, p0, i1, j1, i2, j2, i, j
696 type(LocalMesh2D), pointer :: lcmesh
697 type(ElementBase2D), pointer :: refElem
698 integer :: i0_s, j0_s
699 integer :: Nfp
700 !------------------------------------------------
701
702 i0_s = 0; j0_s = 0
703
704 do p0=1, size(mesh2d%rcdomIJP2LCMeshID,3)
705 do j0=1, size(mesh2d%rcdomIJP2LCMeshID,2)
706 do i0=1, size(mesh2d%rcdomIJP2LCMeshID,1)
707 n = mesh2d%rcdomIJP2LCMeshID(i0,j0,p0)
708
709 lcmesh => mesh2d%lcmesh_list(n)
710 refelem => lcmesh%refElem2D
711 nfp = refelem%Nfp
712
713 do j1=1, lcmesh%NeY
714 do i1=1, lcmesh%NeX
715 kelem1 = i1 + (j1-1)*lcmesh%NeX
716
717 do j2=1, nfp
718 do i2=1, nfp
719 i = i0_s + i2 + (i1-1)*nfp
720 j = j0_s + j2 + (j1-1)*nfp
721 buf(i,j) = field2d%local(n)%val(i2+(j2-1)*nfp,kelem1)
722 end do
723 end do
724
725 end do
726 end do
727
728 i0_s = i0_s + lcmesh%NeX * refelem%Nfp
729 end do
730 j0_s = j0_s + lcmesh%NeY * refelem%Nfp
731 end do
732 i0_s = 0
733 end do
734
735 return
real(rp) function, dimension(size(x), nord+1), public polynominal_genlegendrepoly(nord, x)
A function to obtain the values of Legendre polynominals which are evaluated at aribitary points.

References scale_polynominal::polynominal_genlegendrepoly().

Referenced by scale_file_base_meshfield::file_base_meshfield_init(), and scale_file_history_meshfield::file_history_meshfield_put::file_history_meshfield_put2d().

◆ file_common_meshfield_set_cartesbuf_field2d()

subroutine, public scale_file_common_meshfield::file_common_meshfield_set_cartesbuf_field2d ( class(meshrectdom2d), intent(in), target mesh2d,
real(rp), dimension(:,:), intent(in) buf,
class(meshfield2d), intent(inout) field2d )

Definition at line 739 of file scale_file_common_meshfield.F90.

741 implicit none
742 class(MeshRectDom2D), target, intent(in) :: mesh2D
743 real(RP), intent(in) :: buf(:,:)
744 class(MeshField2D), intent(inout) :: field2d
745
746 integer :: n
747 integer :: i0, j0
748 type(LocalMesh2D), pointer :: lcmesh
749 type(ElementBase2D), pointer :: refElem
750 integer :: i0_s, j0_s
751 !----------------------------------------------------
752
753 i0_s = 0; j0_s = 0
754
755 do j0=1, size(mesh2d%rcdomIJ2LCMeshID,2)
756 do i0=1, size(mesh2d%rcdomIJ2LCMeshID,1)
757 n = mesh2d%rcdomIJ2LCMeshID(i0,j0)
758 lcmesh => mesh2d%lcmesh_list(n)
759 refelem => lcmesh%refElem2D
760
761 call file_common_meshfield_set_cartesbuf_field2d_local( &
762 lcmesh, buf(:,:), i0_s, j0_s, &
763 field2d%local(n)%val(:,:) )
764
765 i0_s = i0_s + lcmesh%NeX * refelem%Nfp
766 end do
767 j0_s = j0_s + lcmesh%NeY * refelem%Nfp
768 i0_s = 0
769 end do
770
771 return

References file_common_meshfield_set_cartesbuf_field2d_local().

Referenced by scale_file_base_meshfield::file_base_meshfield_init().

◆ file_common_meshfield_set_cartesbuf_field2d_local()

subroutine, public scale_file_common_meshfield::file_common_meshfield_set_cartesbuf_field2d_local ( type(localmesh2d), intent(in) lcmesh,
real(rp), dimension(:,:), intent(in) buf,
integer, intent(in) i0_s,
integer, intent(in) j0_s,
real(rp), dimension(lcmesh%refelem2d%np,lcmesh%nea), intent(inout) val )

Definition at line 775 of file scale_file_common_meshfield.F90.

778 implicit none
779 type(LocalMesh2D), intent(in) :: lcmesh
780 real(RP), intent(in) :: buf(:,:)
781 integer, intent(in) :: i0_s, j0_s
782 real(RP), intent(inout) :: val(lcmesh%refElem2D%Np,lcmesh%NeA)
783
784 integer :: kelem1
785 integer :: i1, j1, i2, j2, i, j
786 type(ElementBase2D), pointer :: refElem
787 integer :: indx
788 !----------------------------------------------------
789
790 refelem => lcmesh%refElem2D
791
792 do j1=1, lcmesh%NeY
793 do i1=1, lcmesh%NeX
794 kelem1 = i1 + (j1-1)*lcmesh%NeX
795 do j2=1, refelem%Nfp
796 do i2=1, refelem%Nfp
797 i = i0_s + i2 + (i1-1)*refelem%Nfp
798 j = j0_s + j2 + (j1-1)*refelem%Nfp
799 indx = i2 + (j2-1)*refelem%Nfp
800 val(indx,kelem1) = buf(i,j)
801 end do
802 end do
803 end do
804 end do
805
806 return

Referenced by scale_file_base_meshfield::file_base_meshfield_init(), file_common_meshfield_set_cartesbuf_field2d(), and file_common_meshfield_set_cartesbuf_field2d_cubedsphere().

◆ file_common_meshfield_set_cartesbuf_field2d_cubedsphere()

subroutine, public scale_file_common_meshfield::file_common_meshfield_set_cartesbuf_field2d_cubedsphere ( class(meshcubedspheredom2d), intent(in), target mesh2d,
real(rp), dimension(:,:), intent(in) buf,
class(meshfield2d), intent(inout) field2d )

Definition at line 810 of file scale_file_common_meshfield.F90.

812 implicit none
813 class(MeshCubedSphereDom2D), target, intent(in) :: mesh2D
814 real(RP), intent(in) :: buf(:,:)
815 class(MeshField2D), intent(inout) :: field2d
816
817 integer :: n
818 integer :: i0, j0, p0
819 type(LocalMesh2D), pointer :: lcmesh
820 type(ElementBase2D), pointer :: refElem
821 integer :: i0_s, j0_s, p0_s
822 !----------------------------------------------------
823
824 i0_s = 0; j0_s = 0; p0_s = 0
825
826 do p0=1, size(mesh2d%rcdomIJP2LCMeshID,3)
827 do j0=1, size(mesh2d%rcdomIJP2LCMeshID,2)
828 do i0=1, size(mesh2d%rcdomIJP2LCMeshID,1)
829 n = mesh2d%rcdomIJP2LCMeshID(i0,j0,p0)
830 lcmesh => mesh2d%lcmesh_list(n)
831 refelem => lcmesh%refElem2D
832
833 call file_common_meshfield_set_cartesbuf_field2d_local( &
834 lcmesh, buf(:,:), i0_s, j0_s, &
835 field2d%local(n)%val(:,:) )
836
837 i0_s = i0_s + lcmesh%NeX * refelem%Nfp
838 end do
839 j0_s = j0_s + lcmesh%NeY * refelem%Nfp
840 i0_s = 0
841 end do
842 end do
843
844 return

References file_common_meshfield_set_cartesbuf_field2d_local().

Referenced by scale_file_base_meshfield::file_base_meshfield_init().

◆ file_common_meshfield_get_dims3d()

subroutine, public scale_file_common_meshfield::file_common_meshfield_get_dims3d ( class(meshcubedom3d), intent(in), target mesh3d,
type(file_common_meshfield_diminfo), dimension(meshbase3d_dimtype_num), intent(out) dimsinfo )

Definition at line 850 of file scale_file_common_meshfield.F90.

851 implicit none
852
853 class(MeshCubeDom3D), target, intent(in) :: mesh3D
854 type(FILE_common_meshfield_diminfo), intent(out) :: dimsinfo(MESHBASE3D_DIMTYPE_NUM)
855
856 type(LocalMesh3D), pointer :: lcmesh
857 integer :: i, j, k, n
858 integer :: i_size, j_size, k_size
859
860 type(MeshDimInfo), pointer :: dimInfo
861 type(MeshDimInfo), pointer :: dimInfo_x
862 type(MeshDimInfo), pointer :: dimInfo_y
863 type(MeshDimInfo), pointer :: dimInfo_z
864 !-------------------------------------------------
865
866 i_size = 0
867 do i=1, size(mesh3d%rcdomIJK2LCMeshID,1)
868 n = mesh3d%rcdomIJK2LCMeshID(i,1,1)
869 lcmesh => mesh3d%lcmesh_list(n)
870 i_size = i_size + lcmesh%NeX * lcmesh%refElem3D%Nnode_h1D
871 end do
872
873 j_size = 0
874 do j=1, size(mesh3d%rcdomIJK2LCMeshID,2)
875 n = mesh3d%rcdomIJK2LCMeshID(1,j,1)
876 lcmesh => mesh3d%lcmesh_list(n)
877 j_size = j_size + lcmesh%NeY * lcmesh%refElem3D%Nnode_h1D
878 end do
879
880 k_size = 0
881 do k=1, size(mesh3d%rcdomIJK2LCMeshID,3)
882 n = mesh3d%rcdomIJK2LCMeshID(1,1,k)
883 lcmesh => mesh3d%lcmesh_list(n)
884 k_size = k_size + lcmesh%NeZ * lcmesh%refElem3D%Nnode_v
885 end do
886
887 diminfo_x => mesh3d%dimInfo(meshbase3d_dimtypeid_x)
888 call set_dimension( dimsinfo(meshbase3d_dimtypeid_x), &
889 diminfo_x, "X", 1, (/ diminfo_x%name /), (/ i_size /) )
890
891 diminfo_y => mesh3d%dimInfo(meshbase3d_dimtypeid_y)
892 call set_dimension( dimsinfo(meshbase3d_dimtypeid_y), &
893 diminfo_y, "Y", 1, (/ diminfo_y%name /), (/ j_size /) )
894
895 diminfo_z => mesh3d%dimInfo(meshbase3d_dimtypeid_z)
896 call set_dimension( dimsinfo(meshbase3d_dimtypeid_z), &
897 diminfo_z, "Z", 1, (/ diminfo_z%name /), (/ k_size /), &
898 positive_down=(/ diminfo_z%positive_down /) )
899
900 diminfo => mesh3d%dimInfo(meshbase3d_dimtypeid_zt)
901 call set_dimension( dimsinfo(meshbase3d_dimtypeid_zt), &
902 diminfo, "ZT", 1, (/ diminfo_z%name /), (/ k_size /) )
903
904 diminfo => mesh3d%dimInfo(meshbase3d_dimtypeid_xy)
905 call set_dimension( dimsinfo(meshbase3d_dimtypeid_xy), &
906 diminfo, "XY", 2, (/ diminfo_x%name, diminfo_y%name /), &
907 (/ i_size, j_size /) )
908
909 diminfo => mesh3d%dimInfo(meshbase3d_dimtypeid_xyt)
910 call set_dimension( dimsinfo(meshbase3d_dimtypeid_xyt), &
911 diminfo, "XY", 2, (/ diminfo_x%name, diminfo_y%name /), &
912 (/ i_size, j_size /) )
913
914 diminfo => mesh3d%dimInfo(meshbase3d_dimtypeid_xyz)
915 call set_dimension( dimsinfo(meshbase3d_dimtypeid_xyz), &
916 diminfo, "XYZ", 3, (/ diminfo_x%name, diminfo_y%name, diminfo_z%name /), &
917 (/ i_size, j_size, k_size /) )
918
919 diminfo => mesh3d%dimInfo(meshbase3d_dimtypeid_xyzt)
920 call set_dimension( dimsinfo(meshbase3d_dimtypeid_xyzt), &
921 diminfo, "XYZT", 3, (/ diminfo_x%name, diminfo_y%name, diminfo_z%name /), &
922 (/ i_size, j_size, k_size /) )
923
924 return

Referenced by scale_file_history_meshfield::file_history_meshfield_in::file_history_meshfield_in3d().

◆ file_common_meshfield_get_axis3d()

subroutine, public scale_file_common_meshfield::file_common_meshfield_get_axis3d ( class(meshcubedom3d), intent(in), target mesh3d,
type(file_common_meshfield_diminfo), dimension(meshbase3d_dimtype_num), intent(in) dimsinfo,
real(rp), dimension(dimsinfo(meshbase3d_dimtypeid_x)%size), intent(out) x,
real(rp), dimension(dimsinfo(meshbase3d_dimtypeid_y)%size), intent(out) y,
real(rp), dimension(dimsinfo(meshbase3d_dimtypeid_z)%size), intent(out) z,
logical, intent(in), optional force_uniform_grid )

Definition at line 1009 of file scale_file_common_meshfield.F90.

1011 implicit none
1012
1013 class(MeshCubeDom3D), target, intent(in) :: mesh3D
1014 type(FILE_common_meshfield_diminfo), intent(in) :: dimsinfo(MESHBASE3D_DIMTYPE_NUM)
1015 real(RP), intent(out) :: x(dimsinfo(MeshBase3D_DIMTYPEID_X)%size)
1016 real(RP), intent(out) :: y(dimsinfo(MeshBase3D_DIMTYPEID_Y)%size)
1017 real(RP), intent(out) :: z(dimsinfo(MeshBase3D_DIMTYPEID_Z)%size)
1018 logical, intent(in), optional :: force_uniform_grid
1019
1020 integer :: n, kelem
1021 integer :: i, j, k
1022 type(ElementBase3D), pointer :: refElem
1023 type(LocalMesh3D), pointer :: lcmesh
1024
1025 integer :: is, js, ks, ie, je, ke, igs, jgs, kgs
1026 integer :: Nnode_h1D, Nnode_v
1027
1028 logical :: uniform_grid = .false.
1029 real(RP), allocatable :: x_local(:)
1030 real(RP), allocatable :: y_local(:)
1031 real(RP), allocatable :: z_local(:)
1032 !------------------------------------------------------------------------------------------
1033
1034 if ( present(force_uniform_grid) ) uniform_grid = force_uniform_grid
1035
1036 igs = 0; jgs = 0; kgs = 0
1037
1038 do n=1 ,mesh3d%LOCAL_MESH_NUM
1039 lcmesh => mesh3d%lcmesh_list(n)
1040 refelem => lcmesh%refElem3D
1041 nnode_h1d = refelem%Nnode_h1D
1042 nnode_v = refelem%Nnode_v
1043
1044 allocate( x_local(nnode_h1d), y_local(nnode_h1d) )
1045 allocate( z_local(nnode_v) )
1046
1047 do k=1, lcmesh%NeZ
1048 do j=1, lcmesh%NeY
1049 do i=1, lcmesh%NeX
1050 kelem = i + (j-1)*lcmesh%NeX + (k-1)*lcmesh%NeX*lcmesh%NeY
1051 if ( j==1 .and. k==1) then
1052 x_local(:) = lcmesh%pos_en(refelem%Fmask_h(1:nnode_h1d,1),kelem,1)
1053 if ( uniform_grid ) call get_uniform_grid1d( x_local, nnode_h1d )
1054
1055 is = igs + 1 + (i-1)*nnode_h1d
1056 ie = is + nnode_h1d - 1
1057 x(is:ie) = x_local(:)
1058 end if
1059 if ( i==1 .and. k==1) then
1060 y_local(:) = lcmesh%pos_en(refelem%Fmask_h(1:nnode_h1d,4),kelem,2)
1061 if ( uniform_grid ) call get_uniform_grid1d( y_local, nnode_h1d )
1062
1063 js = jgs + 1 + (j-1)*nnode_h1d
1064 je = js + nnode_h1d - 1
1065 y(js:je) = y_local(:)
1066 end if
1067 if ( i==1 .and. j==1) then
1068 z_local(:) = lcmesh%pos_en(refelem%Colmask(:,1),kelem,3)
1069 if ( uniform_grid ) call get_uniform_grid1d( z_local, nnode_v )
1070
1071 ks = kgs + 1 + (k-1)*nnode_v
1072 ke = ks + nnode_v - 1
1073 z(ks:ke) = z_local(:)
1074 end if
1075 end do
1076 end do
1077 end do
1078
1079 igs = ie; jgs = je; kgs = ke
1080 deallocate( x_local, y_local )
1081 deallocate( z_local )
1082 end do
1083
1084 return

Referenced by scale_file_history_meshfield::file_history_meshfield_in::file_history_meshfield_in3d().

◆ file_common_meshfield_put_field3d_cartesbuf()

subroutine, public scale_file_common_meshfield::file_common_meshfield_put_field3d_cartesbuf ( class(meshcubedom3d), intent(in), target mesh3d,
class(meshfield3d), intent(in) field3d,
real(rp), dimension(:,:,:), intent(inout) buf,
logical, intent(in), optional force_uniform_grid )

Definition at line 1164 of file scale_file_common_meshfield.F90.

1166 use scale_polynominal, only: &
1168 implicit none
1169 class(MeshCubeDom3D), target, intent(in) :: mesh3D
1170 class(MeshField3D), intent(in) :: field3d
1171 real(RP), intent(inout) :: buf(:,:,:)
1172 logical, intent(in), optional :: force_uniform_grid
1173
1174 integer :: n, kelem1
1175 integer :: i0, j0, k0, i1, j1, k1, i2, j2, k2, i, j, k
1176 type(LocalMesh3D), pointer :: lcmesh
1177 type(ElementBase3D), pointer :: refElem
1178 integer :: i0_s, j0_s, k0_s, indx
1179
1180 logical :: uniform_grid = .false.
1181 integer :: Nnode_h1D, Nnode_v
1182 real(RP), allocatable :: x_local(:)
1183 real(RP) :: x_local0, delx
1184 real(RP), allocatable :: y_local(:)
1185 real(RP) :: y_local0, dely
1186 real(RP), allocatable :: z_local(:)
1187 real(RP) :: z_local0, delz
1188 real(RP) :: ox(1), oy(1), oz(1)
1189 real(RP), allocatable :: spectral_coef(:)
1190 real(RP), allocatable :: P1D_ori_x(:,:)
1191 real(RP), allocatable :: P1D_ori_y(:,:)
1192 real(RP), allocatable :: P1D_ori_z(:,:)
1193 integer :: l, p1, p2, p3
1194 !----------------------------------------------------
1195
1196 if ( present(force_uniform_grid) ) uniform_grid = force_uniform_grid
1197
1198 i0_s = 0; j0_s = 0; k0_s = 0
1199
1200 do k0=1, size(mesh3d%rcdomIJK2LCMeshID,3)
1201 do j0=1, size(mesh3d%rcdomIJK2LCMeshID,2)
1202 do i0=1, size(mesh3d%rcdomIJK2LCMeshID,1)
1203 n = mesh3d%rcdomIJK2LCMeshID(i0,j0,k0)
1204
1205 lcmesh => mesh3d%lcmesh_list(n)
1206 refelem => lcmesh%refElem3D
1207 nnode_h1d = refelem%Nnode_h1D
1208 nnode_v = refelem%Nnode_v
1209
1210 if ( uniform_grid ) then
1211 allocate( x_local(nnode_h1d), y_local(nnode_h1d) )
1212 allocate( z_local(nnode_v) )
1213 allocate( spectral_coef(refelem%Np) )
1214 allocate( p1d_ori_x(1,nnode_h1d), p1d_ori_y(1,nnode_h1d) )
1215 allocate( p1d_ori_z(1,nnode_v) )
1216 end if
1217
1218 !$omp parallel do collapse(2) private( kelem1, &
1219 !$omp i, i1, i2, j, j2, k, k2, indx, &
1220 !$omp x_local, x_local0, y_local, y_local0, z_local, z_local0, &
1221 !$omp delx, dely, delz, ox, oy, oz, &
1222 !$omp spectral_coef, P1D_ori_x, P1D_ori_y, P1D_ori_z, &
1223 !$omp p1, p2, p3, l )
1224 do k1=1, lcmesh%NeZ
1225 do j1=1, lcmesh%NeY
1226 do i1=1, lcmesh%NeX
1227 kelem1 = i1 + (j1-1)*lcmesh%NeX + (k1-1)*lcmesh%NeX*lcmesh%NeY
1228
1229 if ( uniform_grid ) then
1230 x_local(:) = lcmesh%pos_en(refelem%Fmask_h(1:nnode_h1d,1),kelem1,1)
1231 x_local0 = x_local(1); delx = x_local(nnode_h1d) - x_local0
1232 y_local(:) = lcmesh%pos_en(refelem%Fmask_h(1:nnode_h1d,4),kelem1,2)
1233 y_local0 = y_local(1); dely = y_local(nnode_h1d) - y_local0
1234 z_local(:) = lcmesh%pos_en(refelem%Colmask(:,1),kelem1,3)
1235 z_local0 = z_local(1); delz = z_local(nnode_v ) - z_local0
1236 call get_uniform_grid1d( x_local, nnode_h1d )
1237 call get_uniform_grid1d( y_local, nnode_h1d )
1238 call get_uniform_grid1d( z_local, nnode_v )
1239
1240 spectral_coef(:) = matmul(refelem%invV(:,:), field3d%local(n)%val(:,kelem1))
1241 do k2=1, nnode_v
1242 do j2=1, nnode_h1d
1243 do i2=1, nnode_h1d
1244 ox(1) = - 1.0_rp + 2.0_rp * (x_local(i2) - x_local0) / delx
1245 oy(1) = - 1.0_rp + 2.0_rp * (y_local(j2) - y_local0) / dely
1246 oz(1) = - 1.0_rp + 2.0_rp * (z_local(k2) - z_local0) / delz
1247
1248 call polynominal_genlegendrepoly_sub( refelem%PolyOrder_h, ox, p1d_ori_x )
1249 call polynominal_genlegendrepoly_sub( refelem%PolyOrder_h, oy, p1d_ori_y )
1250 call polynominal_genlegendrepoly_sub( refelem%PolyOrder_v, oz, p1d_ori_z )
1251
1252 i = i0_s + i2 + (i1-1)*nnode_h1d
1253 j = j0_s + j2 + (j1-1)*nnode_h1d
1254 k = k0_s + k2 + (k1-1)*nnode_v
1255 buf(i,j,k) = 0.0_rp
1256 do p3=1, nnode_v
1257 do p2=1, nnode_h1d
1258 do p1=1, nnode_h1d
1259 l = p1 + (p2-1)*nnode_h1d + (p3-1)*nnode_h1d**2
1260 buf(i,j,k) = buf(i,j,k) + &
1261 ( p1d_ori_x(1,p1) * p1d_ori_y(1,p2) * p1d_ori_z(1,p3) ) &
1262 * sqrt((dble(p1-1) + 0.5_rp)*(dble(p2-1) + 0.5_rp)*(dble(p3-1) + 0.5_rp)) &
1263 * spectral_coef(l)
1264 end do
1265 end do
1266 end do
1267 end do
1268 end do
1269 end do
1270 else
1271 do k2=1, nnode_v
1272 do j2=1, nnode_h1d
1273 do i2=1, nnode_h1d
1274 i = i0_s + i2 + (i1-1)*nnode_h1d
1275 j = j0_s + j2 + (j1-1)*nnode_h1d
1276 k = k0_s + k2 + (k1-1)*nnode_v
1277 indx = i2 + (j2-1)*nnode_h1d + (k2-1)*nnode_h1d**2
1278 buf(i,j,k) = field3d%local(n)%val(indx,kelem1)
1279 end do
1280 end do
1281 end do
1282 end if
1283 end do
1284 end do
1285 end do
1286
1287 if ( uniform_grid ) then
1288 deallocate( x_local, y_local )
1289 deallocate( z_local )
1290 deallocate( spectral_coef )
1291 end if
1292
1293 i0_s = i0_s + lcmesh%NeX * refelem%Nnode_h1D
1294 end do
1295 j0_s = j0_s + lcmesh%NeY * refelem%Nnode_h1D
1296 i0_s = 0
1297 end do
1298 k0_s = k0_s + lcmesh%NeZ * refelem%Nnode_v
1299 j0_s = 0
1300 end do
1301
1302 return

References scale_polynominal::polynominal_genlegendrepoly_sub().

Referenced by scale_file_base_meshfield::file_base_meshfield_init(), and scale_file_history_meshfield::file_history_meshfield_put::file_history_meshfield_put3d().

◆ file_common_meshfield_put_field3d_cubedsphere_cartesbuf()

subroutine, public scale_file_common_meshfield::file_common_meshfield_put_field3d_cubedsphere_cartesbuf ( class(meshcubedspheredom3d), intent(in), target mesh3d,
class(meshfield3d), intent(in) field3d,
real(rp), dimension(:,:,:), intent(inout) buf )

Definition at line 1306 of file scale_file_common_meshfield.F90.

1308 implicit none
1309 class(MeshCubedSphereDom3D), target, intent(in) :: mesh3D
1310 class(MeshField3D), intent(in) :: field3d
1311 real(RP), intent(inout) :: buf(:,:,:)
1312
1313 integer :: kelem1
1314 integer :: n, i0, j0, k0, p0
1315 integer :: i1, j1, k1, i2, j2, k2, i, j, k
1316 type(LocalMesh3D), pointer :: lcmesh
1317 type(ElementBase3D), pointer :: refElem
1318 integer :: i0_s, j0_s, k0_s
1319 integer :: Nnode_h1D
1320 integer :: Nnode_v
1321 !------------------------------------------------
1322
1323 i0_s = 0; j0_s = 0; k0_s = 0
1324
1325 do p0=1, size(mesh3d%rcdomIJKP2LCMeshID,4)
1326 do k0=1, size(mesh3d%rcdomIJKP2LCMeshID,3)
1327 do j0=1, size(mesh3d%rcdomIJKP2LCMeshID,2)
1328 do i0=1, size(mesh3d%rcdomIJKP2LCMeshID,1)
1329 n = mesh3d%rcdomIJKP2LCMeshID(i0,j0,k0,p0)
1330
1331 lcmesh => mesh3d%lcmesh_list(n)
1332 refelem => lcmesh%refElem3D
1333 nnode_h1d = refelem%Nnode_h1D
1334 nnode_v = refelem%Nnode_v
1335
1336 do k1=1, lcmesh%NeZ
1337 do j1=1, lcmesh%NeY
1338 do i1=1, lcmesh%NeX
1339 kelem1 = i1 + (j1-1)*lcmesh%NeX + (k1-1)*lcmesh%NeX*lcmesh%NeY
1340
1341 do k2=1, nnode_v
1342 do j2=1, nnode_h1d
1343 do i2=1, nnode_h1d
1344 i = i0_s + i2 + (i1-1)*nnode_h1d
1345 j = j0_s + j2 + (j1-1)*nnode_h1d
1346 k = k0_s + k2 + (k1-1)*nnode_v
1347 buf(i,j,k) = field3d%local(n)%val(i2+(j2-1)*nnode_h1d+(k2-1)*nnode_h1d**2,kelem1)
1348 end do
1349 end do
1350 end do
1351 end do
1352 end do
1353 end do
1354
1355 i0_s = i0_s + lcmesh%NeX * refelem%Nnode_h1D
1356 end do
1357 j0_s = j0_s + lcmesh%NeY * refelem%Nnode_h1D
1358 i0_s = 0
1359 end do
1360 k0_s = k0_s + lcmesh%NeZ * refelem%Nnode_v
1361 j0_s = 0
1362 end do
1363 end do
1364
1365 return

Referenced by scale_file_base_meshfield::file_base_meshfield_init(), and scale_file_history_meshfield::file_history_meshfield_put::file_history_meshfield_put3d().

◆ file_common_meshfield_set_cartesbuf_field3d()

subroutine, public scale_file_common_meshfield::file_common_meshfield_set_cartesbuf_field3d ( class(meshcubedom3d), intent(in), target mesh3d,
real(rp), dimension(:,:,:), intent(in) buf,
class(meshfield3d), intent(inout) field3d )

Definition at line 1368 of file scale_file_common_meshfield.F90.

1370 implicit none
1371 class(MeshCubeDom3D), target, intent(in) :: mesh3D
1372 real(RP), intent(in) :: buf(:,:,:)
1373 class(MeshField3D), intent(inout) :: field3d
1374
1375 integer :: n
1376 integer :: i0, j0, k0
1377 type(LocalMesh3D), pointer :: lcmesh
1378 type(ElementBase3D), pointer :: refElem
1379 integer :: i0_s, j0_s, k0_s
1380 !----------------------------------------------------
1381
1382 i0_s = 0; j0_s = 0; k0_s = 0
1383
1384 do k0=1, size(mesh3d%rcdomIJK2LCMeshID,3)
1385 do j0=1, size(mesh3d%rcdomIJK2LCMeshID,2)
1386 do i0=1, size(mesh3d%rcdomIJK2LCMeshID,1)
1387 n = mesh3d%rcdomIJK2LCMeshID(i0,j0,k0)
1388 lcmesh => mesh3d%lcmesh_list(n)
1389 refelem => lcmesh%refElem3D
1390
1391 call file_common_meshfield_set_cartesbuf_field3d_local( &
1392 lcmesh, buf(:,:,:), i0_s, j0_s, k0_s, &
1393 field3d%local(n)%val(:,:) )
1394
1395 i0_s = i0_s + lcmesh%NeX * refelem%Nnode_h1D
1396 end do
1397 j0_s = j0_s + lcmesh%NeY * refelem%Nnode_h1D
1398 i0_s = 0
1399 end do
1400 k0_s = k0_s + lcmesh%NeZ * refelem%Nnode_v
1401 j0_s = 0
1402 end do
1403
1404 return

References file_common_meshfield_set_cartesbuf_field3d_local().

Referenced by scale_file_base_meshfield::file_base_meshfield_init().

◆ file_common_meshfield_set_cartesbuf_field3d_cubedsphere()

subroutine, public scale_file_common_meshfield::file_common_meshfield_set_cartesbuf_field3d_cubedsphere ( class(meshcubedspheredom3d), intent(in), target mesh3d,
real(rp), dimension(:,:,:), intent(in) buf,
class(meshfield3d), intent(inout) field3d )

Definition at line 1408 of file scale_file_common_meshfield.F90.

1410 implicit none
1411 class(MeshCubedSphereDom3D), target, intent(in) :: mesh3D
1412 real(RP), intent(in) :: buf(:,:,:)
1413 class(MeshField3D), intent(inout) :: field3d
1414
1415 integer :: n
1416 integer :: i0, j0, k0, p0
1417 type(LocalMesh3D), pointer :: lcmesh
1418 type(ElementBase3D), pointer :: refElem
1419 integer :: i0_s, j0_s, k0_s, p0_s
1420 !----------------------------------------------------
1421
1422 i0_s = 0; j0_s = 0; k0_s = 0; p0_s = 0
1423
1424 do p0=1, size(mesh3d%rcdomIJKP2LCMeshID,4)
1425 do k0=1, size(mesh3d%rcdomIJKP2LCMeshID,3)
1426 do j0=1, size(mesh3d%rcdomIJKP2LCMeshID,2)
1427 do i0=1, size(mesh3d%rcdomIJKP2LCMeshID,1)
1428 n = mesh3d%rcdomIJKP2LCMeshID(i0,j0,k0,p0)
1429 lcmesh => mesh3d%lcmesh_list(n)
1430 refelem => lcmesh%refElem3D
1431
1432 call file_common_meshfield_set_cartesbuf_field3d_local( &
1433 lcmesh, buf(:,:,:), i0_s, j0_s, k0_s, &
1434 field3d%local(n)%val(:,:) )
1435
1436 i0_s = i0_s + lcmesh%NeX * refelem%Nnode_h1D
1437 end do
1438 j0_s = j0_s + lcmesh%NeY * refelem%Nnode_h1D
1439 i0_s = 0
1440 end do
1441 k0_s = k0_s + lcmesh%NeZ * refelem%Nnode_v
1442 j0_s = 0
1443 end do
1444 end do
1445
1446 return

References file_common_meshfield_set_cartesbuf_field3d_local().

Referenced by scale_file_base_meshfield::file_base_meshfield_init().

◆ file_common_meshfield_set_cartesbuf_field3d_local()

subroutine, public scale_file_common_meshfield::file_common_meshfield_set_cartesbuf_field3d_local ( type(localmesh3d), intent(in) lcmesh,
real(rp), dimension(:,:,:), intent(in) buf,
integer, intent(in) i0_s,
integer, intent(in) j0_s,
integer, intent(in) k0_s,
real(rp), dimension(lcmesh%refelem3d%np,lcmesh%nea), intent(inout) val )

Definition at line 1450 of file scale_file_common_meshfield.F90.

1453 implicit none
1454 type(LocalMesh3D), intent(in) :: lcmesh
1455 real(RP), intent(in) :: buf(:,:,:)
1456 integer, intent(in) :: i0_s, j0_s, k0_s
1457 real(RP), intent(inout) :: val(lcmesh%refElem3D%Np,lcmesh%NeA)
1458
1459 integer :: kelem1
1460 integer :: i1, j1, k1, i2, j2, k2, i, j, k
1461 type(ElementBase3D), pointer :: refElem
1462 integer :: indx
1463 !----------------------------------------------------
1464
1465 refelem => lcmesh%refElem3D
1466
1467 !$omp parallel do collapse(3) private( &
1468 !$omp kelem1, k2,j2,i2, i,j,k, indx )
1469 do k1=1, lcmesh%NeZ
1470 do j1=1, lcmesh%NeY
1471 do i1=1, lcmesh%NeX
1472 kelem1 = i1 + (j1-1)*lcmesh%NeX + (k1-1)*lcmesh%NeX*lcmesh%NeY
1473 do k2=1, refelem%Nnode_v
1474 do j2=1, refelem%Nnode_h1D
1475 do i2=1, refelem%Nnode_h1D
1476 i = i0_s + i2 + (i1-1)*refelem%Nnode_h1D
1477 j = j0_s + j2 + (j1-1)*refelem%Nnode_h1D
1478 k = k0_s + k2 + (k1-1)*refelem%Nnode_v
1479 indx = i2 + (j2-1)*refelem%Nnode_h1D + (k2-1)*refelem%Nnode_h1D**2
1480 val(indx,kelem1) = buf(i,j,k)
1481 end do
1482 end do
1483 end do
1484 end do
1485 end do
1486 end do
1487
1488 return

Referenced by scale_file_base_meshfield::file_base_meshfield_init(), file_common_meshfield_set_cartesbuf_field3d(), and file_common_meshfield_set_cartesbuf_field3d_cubedsphere().

◆ file_common_meshfield_get_dtype()

integer function, public scale_file_common_meshfield::file_common_meshfield_get_dtype ( character(*), intent(in) datatype)

Definition at line 1491 of file scale_file_common_meshfield.F90.

1492 use scale_file_h, only: &
1493 file_real8, file_real4
1494 use scale_prc, &
1495 only: prc_abort
1496
1497 implicit none
1498
1499 character(*), intent(in) :: datatype
1500 integer :: dtype
1501 !--------------------------
1502
1503 ! dtype is used to define the data type of axis variables in file
1504 if ( datatype == 'REAL8' ) then
1505 dtype = file_real8
1506 elseif( datatype == 'REAL4' ) then
1507 dtype = file_real4
1508 else
1509 if ( rp == 8 ) then
1510 dtype = file_real8
1511 elseif( rp == 4 ) then
1512 dtype = file_real4
1513 else
1514 log_error("file_restart_meshfield_get_dtype",*) 'unsupported data type. Check!', trim(datatype)
1515 call prc_abort
1516 endif
1517 endif
1518
1519 return