@@ -43,6 +43,9 @@ module m_global_parameters
4343 integer :: m, n, p
4444 !> @}
4545
46+ !> @name Max and min number of cells in a direction of each combination of x- ,y- , and z-
47+ type(cell_num_bounds) :: cells_bounds
48+
4649 !> @name Global number of cells in each direction
4750 !> @{
4851 integer :: m_glb, n_glb, p_glb
@@ -273,10 +276,11 @@ module m_global_parameters
273276 !! numbers, will be non- negligible.
274277 !> @{
275278 integer , dimension (2 ) :: Re_size
279+ integer :: Re_size_max
276280 integer , allocatable, dimension (:, :) :: Re_idx
277281 !> @}
278282
279- $:GPU_DECLARE(create= ' [Re_size,Re_idx]' )
283+ $:GPU_DECLARE(create= ' [Re_size,Re_size_max, Re_idx]' )
280284
281285 ! The WENO average (WA) flag regulates whether the calculation of any cell-
282286 ! average spatial derivatives is carried out in each cell by utilizing the
@@ -525,6 +529,7 @@ contains
525529
526530 ! Computational domain parameters
527531 m = dflt_int; n = 0; p = 0
532+ call s_update_cell_bounds(cells_bounds, m, n, p)
528533
529534 cyl_coord = .false.
530535
@@ -809,6 +814,7 @@ contains
809814 ! of fluids for which the physical and geometric curvatures of the
810815 ! interfaces will be computed
811816 Re_size = 0
817+ Re_size_max = 0
812818
813819 ! Gamma/Pi_inf Model
814820 if (model_eqns == 1) then
@@ -1036,13 +1042,15 @@ contains
10361042 if (Re_size(1) > 0._wp) shear_stress = .true.
10371043 if (Re_size(2) > 0._wp) bulk_stress = .true.
10381044
1039- $:GPU_UPDATE(device=' [Re_size,viscous,shear_stress,bulk_stress]' )
1045+ Re_size_max = maxval(Re_size)
1046+
1047+ $:GPU_UPDATE(device=' [Re_size,Re_size_max,viscous,shear_stress,bulk_stress]' )
10401048
10411049 ! Bookkeeping the indexes of any viscous fluids and any pairs of
10421050 ! fluids whose interface will support effects of surface tension
10431051 if (viscous) then
10441052
1045- @:ALLOCATE(Re_idx(1:2, 1:maxval(Re_size) ))
1053+ @:ALLOCATE(Re_idx(1:2, 1:Re_size_max ))
10461054
10471055 k = 0
10481056 do i = 1, num_fluids
@@ -1169,8 +1177,6 @@ contains
11691177 if (ib) allocate (MPI_IO_IB_DATA%var%sf(0:m, 0:n, 0:p))
11701178 Np = 0
11711179
1172- $:GPU_UPDATE(device=' [Re_size]' )
1173-
11741180 if (elasticity) then
11751181 fd_number = max(1, fd_order/2)
11761182 end if
0 commit comments