From 3e85540bbe454cb23649d711c4e17115b7ac14c5 Mon Sep 17 00:00:00 2001 From: Anand Date: Mon, 11 Nov 2024 12:08:45 -0500 Subject: [PATCH 1/3] Removing global --- src/common/include/macros.fpp | 14 ---- src/common/m_helper.fpp | 6 +- src/common/m_variables_conversion.fpp | 24 +++--- src/simulation/m_acoustic_src.fpp | 12 +-- src/simulation/m_body_forces.fpp | 8 +- src/simulation/m_bubbles.fpp | 18 ++--- src/simulation/m_cbc.fpp | 100 ++++++++++++------------ src/simulation/m_data_output.fpp | 10 +-- src/simulation/m_fftw.fpp | 8 +- src/simulation/m_global_parameters.fpp | 36 ++++----- src/simulation/m_hypoelastic.fpp | 12 +-- src/simulation/m_ibm.fpp | 12 +-- src/simulation/m_mpi_proxy.fpp | 38 ++++----- src/simulation/m_qbmm.fpp | 6 +- src/simulation/m_rhs.fpp | 104 ++++++++++++------------- src/simulation/m_riemann_solvers.fpp | 76 +++++++++--------- src/simulation/m_surface_tension.fpp | 22 +++--- src/simulation/m_time_steppers.fpp | 30 +++---- src/simulation/m_viscous.fpp | 4 +- src/simulation/m_weno.fpp | 60 +++++++------- 20 files changed, 293 insertions(+), 307 deletions(-) diff --git a/src/common/include/macros.fpp b/src/common/include/macros.fpp index bcf7eaf78..c1f447a26 100644 --- a/src/common/include/macros.fpp +++ b/src/common/include/macros.fpp @@ -22,20 +22,6 @@ !$acc exit data delete(${', '.join(args)}$) #:enddef DEALLOCATE -#:def ALLOCATE_GLOBAL(*args) - @:LOG({'@:ALLOCATE_GLOBAL(${re.sub(' +', ' ', ', '.join(args))}$)'}) - - allocate (${', '.join(args)}$) - -#:enddef ALLOCATE_GLOBAL - -#:def DEALLOCATE_GLOBAL(*args) - @:LOG({'@:DEALLOCATE_GLOBAL(${re.sub(' +', ' ', ', '.join(args))}$)'}) - - deallocate (${', '.join(args)}$) - -#:enddef DEALLOCATE_GLOBAL - #:def ACC_SETUP_VFs(*args) #ifdef _CRAYFTN block diff --git a/src/common/m_helper.fpp b/src/common/m_helper.fpp index fc26005fd..dce271120 100644 --- a/src/common/m_helper.fpp +++ b/src/common/m_helper.fpp @@ -121,9 +121,9 @@ contains rhol0 = rhoref pl0 = pref #ifdef MFC_SIMULATION - @:ALLOCATE_GLOBAL(pb0(nb), mass_n0(nb), mass_v0(nb), Pe_T(nb)) - @:ALLOCATE_GLOBAL(k_n(nb), k_v(nb), omegaN(nb)) - @:ALLOCATE_GLOBAL(Re_trans_T(nb), Re_trans_c(nb), Im_trans_T(nb), Im_trans_c(nb)) + @:ALLOCATE(pb0(nb), mass_n0(nb), mass_v0(nb), Pe_T(nb)) + @:ALLOCATE(k_n(nb), k_v(nb), omegaN(nb)) + @:ALLOCATE(Re_trans_T(nb), Re_trans_c(nb), Im_trans_T(nb), Im_trans_c(nb)) #else @:ALLOCATE(pb0(nb), mass_n0(nb), mass_v0(nb), Pe_T(nb)) @:ALLOCATE(k_n(nb), k_v(nb), omegaN(nb)) diff --git a/src/common/m_variables_conversion.fpp b/src/common/m_variables_conversion.fpp index b919d6e0b..ffc6e02ba 100644 --- a/src/common/m_variables_conversion.fpp +++ b/src/common/m_variables_conversion.fpp @@ -621,14 +621,14 @@ contains !$acc enter data copyin(is1b, is1e, is2b, is2e, is3b, is3e) #ifdef MFC_SIMULATION - @:ALLOCATE_GLOBAL(gammas (1:num_fluids)) - @:ALLOCATE_GLOBAL(gs_min (1:num_fluids)) - @:ALLOCATE_GLOBAL(pi_infs(1:num_fluids)) - @:ALLOCATE_GLOBAL(ps_inf(1:num_fluids)) - @:ALLOCATE_GLOBAL(cvs (1:num_fluids)) - @:ALLOCATE_GLOBAL(qvs (1:num_fluids)) - @:ALLOCATE_GLOBAL(qvps (1:num_fluids)) - @:ALLOCATE_GLOBAL(Gs (1:num_fluids)) + @:ALLOCATE(gammas (1:num_fluids)) + @:ALLOCATE(gs_min (1:num_fluids)) + @:ALLOCATE(pi_infs(1:num_fluids)) + @:ALLOCATE(ps_inf(1:num_fluids)) + @:ALLOCATE(cvs (1:num_fluids)) + @:ALLOCATE(qvs (1:num_fluids)) + @:ALLOCATE(qvps (1:num_fluids)) + @:ALLOCATE(Gs (1:num_fluids)) #else @:ALLOCATE(gammas (1:num_fluids)) @:ALLOCATE(gs_min (1:num_fluids)) @@ -655,7 +655,7 @@ contains #ifdef MFC_SIMULATION if (viscous) then - @:ALLOCATE_GLOBAL(Res(1:2, 1:maxval(Re_size))) + @:ALLOCATE(Res(1:2, 1:maxval(Re_size))) do i = 1, 2 do j = 1, Re_size(i) Res(i, j) = fluid_pp(Re_idx(i, j))%Re(i) @@ -668,7 +668,7 @@ contains if (bubbles) then #ifdef MFC_SIMULATION - @:ALLOCATE_GLOBAL(bubrs(1:nb)) + @:ALLOCATE(bubrs(1:nb)) #else @:ALLOCATE(bubrs(1:nb)) #endif @@ -1361,9 +1361,9 @@ contains #endif #ifdef MFC_SIMULATION - @:DEALLOCATE_GLOBAL(gammas, gs_min, pi_infs, ps_inf, cvs, qvs, qvps, Gs) + @:DEALLOCATE(gammas, gs_min, pi_infs, ps_inf, cvs, qvs, qvps, Gs) if (bubbles) then - @:DEALLOCATE_GLOBAL(bubrs) + @:DEALLOCATE(bubrs) end if #else @:DEALLOCATE(gammas, gs_min, pi_infs, ps_inf, cvs, qvs, qvps, Gs) diff --git a/src/simulation/m_acoustic_src.fpp b/src/simulation/m_acoustic_src.fpp index 6f78f2edc..c933251f9 100644 --- a/src/simulation/m_acoustic_src.fpp +++ b/src/simulation/m_acoustic_src.fpp @@ -63,7 +63,7 @@ contains subroutine s_initialize_acoustic_src integer :: i, j !< generic loop variables - @:ALLOCATE_GLOBAL(loc_acoustic(1:3, 1:num_source), mag(1:num_source), dipole(1:num_source), support(1:num_source), length(1:num_source), height(1:num_source), wavelength(1:num_source), frequency(1:num_source), gauss_sigma_dist(1:num_source), gauss_sigma_time(1:num_source), foc_length(1:num_source), aperture(1:num_source), npulse(1:num_source), pulse(1:num_source), dir(1:num_source), delay(1:num_source), element_polygon_ratio(1:num_source), rotate_angle(1:num_source), element_spacing_angle(1:num_source), num_elements(1:num_source), element_on(1:num_source)) + @:ALLOCATE(loc_acoustic(1:3, 1:num_source), mag(1:num_source), dipole(1:num_source), support(1:num_source), length(1:num_source), height(1:num_source), wavelength(1:num_source), frequency(1:num_source), gauss_sigma_dist(1:num_source), gauss_sigma_time(1:num_source), foc_length(1:num_source), aperture(1:num_source), npulse(1:num_source), pulse(1:num_source), dir(1:num_source), delay(1:num_source), element_polygon_ratio(1:num_source), rotate_angle(1:num_source), element_spacing_angle(1:num_source), num_elements(1:num_source), element_on(1:num_source)) do i = 1, num_source do j = 1, 3 loc_acoustic(j, i) = acoustic(i)%loc(j) @@ -103,9 +103,9 @@ contains end do !$acc update device(loc_acoustic, mag, dipole, support, length, height, wavelength, frequency, gauss_sigma_dist, gauss_sigma_time, foc_length, aperture, npulse, pulse, dir, delay, element_polygon_ratio, rotate_angle, element_spacing_angle, num_elements, element_on) - @:ALLOCATE_GLOBAL(mass_src(0:m, 0:n, 0:p)) - @:ALLOCATE_GLOBAL(mom_src(1:num_dims, 0:m, 0:n, 0:p)) - @:ALLOCATE_GLOBAL(E_src(0:m, 0:n, 0:p)) + @:ALLOCATE(mass_src(0:m, 0:n, 0:p)) + @:ALLOCATE(mom_src(1:num_dims, 0:m, 0:n, 0:p)) + @:ALLOCATE(E_src(0:m, 0:n, 0:p)) end subroutine s_initialize_acoustic_src @@ -370,8 +370,8 @@ contains dim = 3 end if - @:ALLOCATE_GLOBAL(source_spatials_num_points(1:num_source)) - @:ALLOCATE_GLOBAL(source_spatials(1:num_source)) + @:ALLOCATE(source_spatials_num_points(1:num_source)) + @:ALLOCATE(source_spatials(1:num_source)) do ai = 1, num_source ! First pass: Count the number of points for each source diff --git a/src/simulation/m_body_forces.fpp b/src/simulation/m_body_forces.fpp index 719a4f56a..7368fc046 100644 --- a/src/simulation/m_body_forces.fpp +++ b/src/simulation/m_body_forces.fpp @@ -37,18 +37,18 @@ contains if (n > 0) then ! Simulation is 3D if (p > 0) then - @:ALLOCATE_GLOBAL (rhoM(-buff_size:buff_size + m, & + @:ALLOCATE (rhoM(-buff_size:buff_size + m, & -buff_size:buff_size + n, & -buff_size:buff_size + p)) ! Simulation is 2D else - @:ALLOCATE_GLOBAL (rhoM(-buff_size:buff_size + m, & + @:ALLOCATE (rhoM(-buff_size:buff_size + m, & -buff_size:buff_size + n, & 0:0)) end if ! Simulation is 1D else - @:ALLOCATE_GLOBAL (rhoM(-buff_size:buff_size + m, & + @:ALLOCATE (rhoM(-buff_size:buff_size + m, & 0:0, & 0:0)) end if @@ -173,7 +173,7 @@ contains subroutine s_finalize_body_forces_module - @:DEALLOCATE_GLOBAL(rhoM) + @:DEALLOCATE(rhoM) end subroutine s_finalize_body_forces_module diff --git a/src/simulation/m_bubbles.fpp b/src/simulation/m_bubbles.fpp index f5de71cd6..b0027f42c 100644 --- a/src/simulation/m_bubbles.fpp +++ b/src/simulation/m_bubbles.fpp @@ -42,11 +42,11 @@ contains integer :: l - @:ALLOCATE_GLOBAL(rs(1:nb)) - @:ALLOCATE_GLOBAL(vs(1:nb)) + @:ALLOCATE(rs(1:nb)) + @:ALLOCATE(vs(1:nb)) if (.not. polytropic) then - @:ALLOCATE_GLOBAL(ps(1:nb)) - @:ALLOCATE_GLOBAL(ms(1:nb)) + @:ALLOCATE(ps(1:nb)) + @:ALLOCATE(ms(1:nb)) end if do l = 1, nb @@ -66,11 +66,11 @@ contains @:ALLOCATE(divu%sf(idwbuff(1)%beg:idwbuff(1)%end, idwbuff(2)%beg:idwbuff(2)%end, idwbuff(3)%beg:idwbuff(3)%end)) @:ACC_SETUP_SFs(divu) - @:ALLOCATE_GLOBAL(bub_adv_src(0:m, 0:n, 0:p)) - @:ALLOCATE_GLOBAL(bub_r_src(0:m, 0:n, 0:p, 1:nb)) - @:ALLOCATE_GLOBAL(bub_v_src(0:m, 0:n, 0:p, 1:nb)) - @:ALLOCATE_GLOBAL(bub_p_src(0:m, 0:n, 0:p, 1:nb)) - @:ALLOCATE_GLOBAL(bub_m_src(0:m, 0:n, 0:p, 1:nb)) + @:ALLOCATE(bub_adv_src(0:m, 0:n, 0:p)) + @:ALLOCATE(bub_r_src(0:m, 0:n, 0:p, 1:nb)) + @:ALLOCATE(bub_v_src(0:m, 0:n, 0:p, 1:nb)) + @:ALLOCATE(bub_p_src(0:m, 0:n, 0:p, 1:nb)) + @:ALLOCATE(bub_m_src(0:m, 0:n, 0:p, 1:nb)) end subroutine s_initialize_bubbles_module diff --git a/src/simulation/m_cbc.fpp b/src/simulation/m_cbc.fpp index 07e01d41d..ad36267b5 100644 --- a/src/simulation/m_cbc.fpp +++ b/src/simulation/m_cbc.fpp @@ -138,27 +138,27 @@ contains end if is3%end = p - is3%beg - @:ALLOCATE_GLOBAL(q_prim_rsx_vf(0:buff_size, & + @:ALLOCATE(q_prim_rsx_vf(0:buff_size, & is2%beg:is2%end, & is3%beg:is3%end, 1:sys_size)) if (weno_order > 1) then - @:ALLOCATE_GLOBAL(F_rsx_vf(0:buff_size, & + @:ALLOCATE(F_rsx_vf(0:buff_size, & is2%beg:is2%end, & is3%beg:is3%end, 1:adv_idx%end)) - @:ALLOCATE_GLOBAL(F_src_rsx_vf(0:buff_size, & + @:ALLOCATE(F_src_rsx_vf(0:buff_size, & is2%beg:is2%end, & is3%beg:is3%end, adv_idx%beg:adv_idx%end)) end if - @:ALLOCATE_GLOBAL(flux_rsx_vf_l(-1:buff_size, & + @:ALLOCATE(flux_rsx_vf_l(-1:buff_size, & is2%beg:is2%end, & is3%beg:is3%end, 1:adv_idx%end)) - @:ALLOCATE_GLOBAL(flux_src_rsx_vf_l(-1:buff_size, & + @:ALLOCATE(flux_src_rsx_vf_l(-1:buff_size, & is2%beg:is2%end, & is3%beg:is3%end, adv_idx%beg:adv_idx%end)) @@ -181,27 +181,27 @@ contains end if is3%end = p - is3%beg - @:ALLOCATE_GLOBAL(q_prim_rsy_vf(0:buff_size, & + @:ALLOCATE(q_prim_rsy_vf(0:buff_size, & is2%beg:is2%end, & is3%beg:is3%end, 1:sys_size)) if (weno_order > 1) then - @:ALLOCATE_GLOBAL(F_rsy_vf(0:buff_size, & + @:ALLOCATE(F_rsy_vf(0:buff_size, & is2%beg:is2%end, & is3%beg:is3%end, 1:adv_idx%end)) - @:ALLOCATE_GLOBAL(F_src_rsy_vf(0:buff_size, & + @:ALLOCATE(F_src_rsy_vf(0:buff_size, & is2%beg:is2%end, & is3%beg:is3%end, adv_idx%beg:adv_idx%end)) end if - @:ALLOCATE_GLOBAL(flux_rsy_vf_l(-1:buff_size, & + @:ALLOCATE(flux_rsy_vf_l(-1:buff_size, & is2%beg:is2%end, & is3%beg:is3%end, 1:adv_idx%end)) - @:ALLOCATE_GLOBAL(flux_src_rsy_vf_l(-1:buff_size, & + @:ALLOCATE(flux_src_rsy_vf_l(-1:buff_size, & is2%beg:is2%end, & is3%beg:is3%end, adv_idx%beg:adv_idx%end)) @@ -226,42 +226,42 @@ contains end if is3%end = m - is3%beg - @:ALLOCATE_GLOBAL(q_prim_rsz_vf(0:buff_size, & + @:ALLOCATE(q_prim_rsz_vf(0:buff_size, & is2%beg:is2%end, & is3%beg:is3%end, 1:sys_size)) if (weno_order > 1) then - @:ALLOCATE_GLOBAL(F_rsz_vf(0:buff_size, & + @:ALLOCATE(F_rsz_vf(0:buff_size, & is2%beg:is2%end, & is3%beg:is3%end, 1:adv_idx%end)) - @:ALLOCATE_GLOBAL(F_src_rsz_vf(0:buff_size, & + @:ALLOCATE(F_src_rsz_vf(0:buff_size, & is2%beg:is2%end, & is3%beg:is3%end, adv_idx%beg:adv_idx%end)) end if - @:ALLOCATE_GLOBAL(flux_rsz_vf_l(-1:buff_size, & + @:ALLOCATE(flux_rsz_vf_l(-1:buff_size, & is2%beg:is2%end, & is3%beg:is3%end, 1:adv_idx%end)) - @:ALLOCATE_GLOBAL(flux_src_rsz_vf_l(-1:buff_size, & + @:ALLOCATE(flux_src_rsz_vf_l(-1:buff_size, & is2%beg:is2%end, & is3%beg:is3%end, adv_idx%beg:adv_idx%end)) end if ! Allocating the cell-width distribution in the s-direction - @:ALLOCATE_GLOBAL(ds(0:buff_size)) + @:ALLOCATE(ds(0:buff_size)) ! Allocating/Computing CBC Coefficients in x-direction ============= if (all((/bc_x%beg, bc_x%end/) <= -5) .and. all((/bc_x%beg, bc_x%end/) >= -13)) then - @:ALLOCATE_GLOBAL(fd_coef_x(0:buff_size, -1:1)) + @:ALLOCATE(fd_coef_x(0:buff_size, -1:1)) if (weno_order > 1) then - @:ALLOCATE_GLOBAL(pi_coef_x(0:weno_polyn - 1, 0:weno_order - 3, -1:1)) + @:ALLOCATE(pi_coef_x(0:weno_polyn - 1, 0:weno_order - 3, -1:1)) end if call s_compute_cbc_coefficients(1, -1) @@ -269,20 +269,20 @@ contains elseif (bc_x%beg <= -5 .and. bc_x%beg >= -13) then - @:ALLOCATE_GLOBAL(fd_coef_x(0:buff_size, -1:-1)) + @:ALLOCATE(fd_coef_x(0:buff_size, -1:-1)) if (weno_order > 1) then - @:ALLOCATE_GLOBAL(pi_coef_x(0:weno_polyn - 1, 0:weno_order - 3, -1:-1)) + @:ALLOCATE(pi_coef_x(0:weno_polyn - 1, 0:weno_order - 3, -1:-1)) end if call s_compute_cbc_coefficients(1, -1) elseif (bc_x%end <= -5 .and. bc_x%end >= -13) then - @:ALLOCATE_GLOBAL(fd_coef_x(0:buff_size, 1:1)) + @:ALLOCATE(fd_coef_x(0:buff_size, 1:1)) if (weno_order > 1) then - @:ALLOCATE_GLOBAL(pi_coef_x(0:weno_polyn - 1, 0:weno_order - 3, 1:1)) + @:ALLOCATE(pi_coef_x(0:weno_polyn - 1, 0:weno_order - 3, 1:1)) end if call s_compute_cbc_coefficients(1, 1) @@ -295,10 +295,10 @@ contains if (all((/bc_y%beg, bc_y%end/) <= -5) .and. all((/bc_y%beg, bc_y%end/) >= -13)) then - @:ALLOCATE_GLOBAL(fd_coef_y(0:buff_size, -1:1)) + @:ALLOCATE(fd_coef_y(0:buff_size, -1:1)) if (weno_order > 1) then - @:ALLOCATE_GLOBAL(pi_coef_y(0:weno_polyn - 1, 0:weno_order - 3, -1:1)) + @:ALLOCATE(pi_coef_y(0:weno_polyn - 1, 0:weno_order - 3, -1:1)) end if call s_compute_cbc_coefficients(2, -1) @@ -306,20 +306,20 @@ contains elseif (bc_y%beg <= -5 .and. bc_y%beg >= -13) then - @:ALLOCATE_GLOBAL(fd_coef_y(0:buff_size, -1:-1)) + @:ALLOCATE(fd_coef_y(0:buff_size, -1:-1)) if (weno_order > 1) then - @:ALLOCATE_GLOBAL(pi_coef_y(0:weno_polyn - 1, 0:weno_order - 3, -1:-1)) + @:ALLOCATE(pi_coef_y(0:weno_polyn - 1, 0:weno_order - 3, -1:-1)) end if call s_compute_cbc_coefficients(2, -1) elseif (bc_y%end <= -5 .and. bc_y%end >= -13) then - @:ALLOCATE_GLOBAL(fd_coef_y(0:buff_size, 1:1)) + @:ALLOCATE(fd_coef_y(0:buff_size, 1:1)) if (weno_order > 1) then - @:ALLOCATE_GLOBAL(pi_coef_y(0:weno_polyn - 1, 0:weno_order - 3, 1:1)) + @:ALLOCATE(pi_coef_y(0:weno_polyn - 1, 0:weno_order - 3, 1:1)) end if call s_compute_cbc_coefficients(2, 1) @@ -334,10 +334,10 @@ contains if (all((/bc_z%beg, bc_z%end/) <= -5) .and. all((/bc_z%beg, bc_z%end/) >= -13)) then - @:ALLOCATE_GLOBAL(fd_coef_z(0:buff_size, -1:1)) + @:ALLOCATE(fd_coef_z(0:buff_size, -1:1)) if (weno_order > 1) then - @:ALLOCATE_GLOBAL(pi_coef_z(0:weno_polyn - 1, 0:weno_order - 3, -1:1)) + @:ALLOCATE(pi_coef_z(0:weno_polyn - 1, 0:weno_order - 3, -1:1)) end if call s_compute_cbc_coefficients(3, -1) @@ -345,20 +345,20 @@ contains elseif (bc_z%beg <= -5 .and. bc_z%beg >= -13) then - @:ALLOCATE_GLOBAL(fd_coef_z(0:buff_size, -1:-1)) + @:ALLOCATE(fd_coef_z(0:buff_size, -1:-1)) if (weno_order > 1) then - @:ALLOCATE_GLOBAL(pi_coef_z(0:weno_polyn - 1, 0:weno_order - 3, -1:-1)) + @:ALLOCATE(pi_coef_z(0:weno_polyn - 1, 0:weno_order - 3, -1:-1)) end if call s_compute_cbc_coefficients(3, -1) elseif (bc_z%end <= -5 .and. bc_z%end >= -13) then - @:ALLOCATE_GLOBAL(fd_coef_z(0:buff_size, 1:1)) + @:ALLOCATE(fd_coef_z(0:buff_size, 1:1)) if (weno_order > 1) then - @:ALLOCATE_GLOBAL(pi_coef_z(0:weno_polyn - 1, 0:weno_order - 3, 1:1)) + @:ALLOCATE(pi_coef_z(0:weno_polyn - 1, 0:weno_order - 3, 1:1)) end if call s_compute_cbc_coefficients(3, 1) @@ -1469,35 +1469,35 @@ contains if (is_cbc .eqv. .false.) return ! Deallocating the cell-average primitive variables - @:DEALLOCATE_GLOBAL(q_prim_rsx_vf) + @:DEALLOCATE(q_prim_rsx_vf) if (weno_order > 1) then - @:DEALLOCATE_GLOBAL(F_rsx_vf, F_src_rsx_vf) + @:DEALLOCATE(F_rsx_vf, F_src_rsx_vf) end if - @:DEALLOCATE_GLOBAL(flux_rsx_vf_l, flux_src_rsx_vf_l) + @:DEALLOCATE(flux_rsx_vf_l, flux_src_rsx_vf_l) if (n > 0) then - @:DEALLOCATE_GLOBAL(q_prim_rsy_vf) + @:DEALLOCATE(q_prim_rsy_vf) if (weno_order > 1) then - @:DEALLOCATE_GLOBAL(F_rsy_vf, F_src_rsy_vf) + @:DEALLOCATE(F_rsy_vf, F_src_rsy_vf) end if - @:DEALLOCATE_GLOBAL(flux_rsy_vf_l, flux_src_rsy_vf_l) + @:DEALLOCATE(flux_rsy_vf_l, flux_src_rsy_vf_l) end if if (p > 0) then - @:DEALLOCATE_GLOBAL(q_prim_rsz_vf) + @:DEALLOCATE(q_prim_rsz_vf) if (weno_order > 1) then - @:DEALLOCATE_GLOBAL(F_rsz_vf, F_src_rsz_vf) + @:DEALLOCATE(F_rsz_vf, F_src_rsz_vf) end if - @:DEALLOCATE_GLOBAL(flux_rsz_vf_l, flux_src_rsz_vf_l) + @:DEALLOCATE(flux_rsz_vf_l, flux_src_rsz_vf_l) end if ! Deallocating the cell-width distribution in the s-direction - @:DEALLOCATE_GLOBAL(ds) + @:DEALLOCATE(ds) ! Deallocating CBC Coefficients in x-direction ===================== if (any((/bc_x%beg, bc_x%end/) <= -5) .and. any((/bc_x%beg, bc_x%end/) >= -13)) then - @:DEALLOCATE_GLOBAL(fd_coef_x) + @:DEALLOCATE(fd_coef_x) if (weno_order > 1) then - @:DEALLOCATE_GLOBAL(pi_coef_x) + @:DEALLOCATE(pi_coef_x) end if end if ! ================================================================== @@ -1505,18 +1505,18 @@ contains ! Deallocating CBC Coefficients in y-direction ===================== if (n > 0 .and. any((/bc_y%beg, bc_y%end/) <= -5) .and. & any((/bc_y%beg, bc_y%end/) >= -13 .and. bc_y%beg /= -14)) then - @:DEALLOCATE_GLOBAL(fd_coef_y) + @:DEALLOCATE(fd_coef_y) if (weno_order > 1) then - @:DEALLOCATE_GLOBAL(pi_coef_y) + @:DEALLOCATE(pi_coef_y) end if end if ! ================================================================== ! Deallocating CBC Coefficients in z-direction ===================== if (p > 0 .and. any((/bc_z%beg, bc_z%end/) <= -5) .and. any((/bc_z%beg, bc_z%end/) >= -13)) then - @:DEALLOCATE_GLOBAL(fd_coef_z) + @:DEALLOCATE(fd_coef_z) if (weno_order > 1) then - @:DEALLOCATE_GLOBAL(pi_coef_z) + @:DEALLOCATE(pi_coef_z) end if end if ! ================================================================== diff --git a/src/simulation/m_data_output.fpp b/src/simulation/m_data_output.fpp index 3a09b6b5c..d51d1d32f 100644 --- a/src/simulation/m_data_output.fpp +++ b/src/simulation/m_data_output.fpp @@ -1568,12 +1568,12 @@ contains subroutine s_initialize_data_output_module ! Allocating/initializing ICFL, VCFL, CCFL and Rc stability criteria - @:ALLOCATE_GLOBAL(icfl_sf(0:m, 0:n, 0:p)) + @:ALLOCATE(icfl_sf(0:m, 0:n, 0:p)) icfl_max = 0d0 if (viscous) then - @:ALLOCATE_GLOBAL(vcfl_sf(0:m, 0:n, 0:p)) - @:ALLOCATE_GLOBAL(Rc_sf (0:m, 0:n, 0:p)) + @:ALLOCATE(vcfl_sf(0:m, 0:n, 0:p)) + @:ALLOCATE(Rc_sf (0:m, 0:n, 0:p)) vcfl_max = 0d0 Rc_min = 1d3 @@ -1585,9 +1585,9 @@ contains subroutine s_finalize_data_output_module ! Deallocating the ICFL, VCFL, CCFL, and Rc stability criteria - @:DEALLOCATE_GLOBAL(icfl_sf) + @:DEALLOCATE(icfl_sf) if (viscous) then - @:DEALLOCATE_GLOBAL(vcfl_sf, Rc_sf) + @:DEALLOCATE(vcfl_sf, Rc_sf) end if end subroutine s_finalize_data_output_module diff --git a/src/simulation/m_fftw.fpp b/src/simulation/m_fftw.fpp index 3ba557a13..c647f593e 100644 --- a/src/simulation/m_fftw.fpp +++ b/src/simulation/m_fftw.fpp @@ -110,9 +110,9 @@ contains #endif #if defined(MFC_OpenACC) - @:ALLOCATE_GLOBAL(data_real_gpu(1:real_size*x_size*sys_size)) - @:ALLOCATE_GLOBAL(data_cmplx_gpu(1:cmplx_size*x_size*sys_size)) - @:ALLOCATE_GLOBAL(data_fltr_cmplx_gpu(1:cmplx_size*x_size*sys_size)) + @:ALLOCATE(data_real_gpu(1:real_size*x_size*sys_size)) + @:ALLOCATE(data_cmplx_gpu(1:cmplx_size*x_size*sys_size)) + @:ALLOCATE(data_fltr_cmplx_gpu(1:cmplx_size*x_size*sys_size)) #if defined(__PGI) ierr = cufftPlanMany(fwd_plan_gpu, rank, gpu_fft_size, iembed, istride, real_size, oembed, ostride, cmplx_size, CUFFT_D2Z, batch_size) @@ -305,7 +305,7 @@ contains subroutine s_finalize_fftw_module #if defined(MFC_OpenACC) - @:DEALLOCATE_GLOBAL(data_real_gpu, data_fltr_cmplx_gpu, data_cmplx_gpu) + @:DEALLOCATE(data_real_gpu, data_fltr_cmplx_gpu, data_cmplx_gpu) #if defined(__PGI) ierr = cufftDestroy(fwd_plan_gpu) diff --git a/src/simulation/m_global_parameters.fpp b/src/simulation/m_global_parameters.fpp index e59f07b09..d464a1011 100644 --- a/src/simulation/m_global_parameters.fpp +++ b/src/simulation/m_global_parameters.fpp @@ -763,7 +763,7 @@ contains sys_size = n_idx end if - @:ALLOCATE_GLOBAL(weight(nb), R0(nb), V0(nb)) + @:ALLOCATE(weight(nb), R0(nb), V0(nb)) @:ALLOCATE(bub_idx%rs(nb), bub_idx%vs(nb)) @:ALLOCATE(bub_idx%ps(nb), bub_idx%ms(nb)) @@ -825,7 +825,7 @@ contains if (polytropic) then pv = fluid_pp(1)%pv pv = pv/pref - @:ALLOCATE_GLOBAL(pb0(nb)) + @:ALLOCATE(pb0(nb)) if ((f_is_default(Web))) then pb0 = pref pb0 = pb0/pref @@ -887,7 +887,7 @@ contains @:ALLOCATE(bub_idx%rs(nb), bub_idx%vs(nb)) @:ALLOCATE(bub_idx%ps(nb), bub_idx%ms(nb)) - @:ALLOCATE_GLOBAL(weight(nb), R0(nb), V0(nb)) + @:ALLOCATE(weight(nb), R0(nb), V0(nb)) do i = 1, nb if (polytropic) then @@ -937,7 +937,7 @@ contains ! fluids whose interface will support effects of surface tension if (viscous) then - @:ALLOCATE_GLOBAL(Re_idx(1:2, 1:maxval(Re_size))) + @:ALLOCATE(Re_idx(1:2, 1:maxval(Re_size))) k = 0 do i = 1, num_fluids @@ -1035,7 +1035,7 @@ contains ! Configuring Coordinate Direction Indexes ========================= if (bubbles) then - @:ALLOCATE_GLOBAL(ptil(& + @:ALLOCATE(ptil(& & idwbuff(1)%beg:idwbuff(1)%end, & & idwbuff(2)%beg:idwbuff(2)%end, & & idwbuff(3)%beg:idwbuff(3)%end)) @@ -1095,19 +1095,19 @@ contains !$acc enter data copyin(relax, relax_model, palpha_eps,ptgalpha_eps) ! Allocating grid variables for the x-, y- and z-directions - @:ALLOCATE_GLOBAL(x_cb(-1 - buff_size:m + buff_size)) - @:ALLOCATE_GLOBAL(x_cc(-buff_size:m + buff_size)) - @:ALLOCATE_GLOBAL(dx(-buff_size:m + buff_size)) + @:ALLOCATE(x_cb(-1 - buff_size:m + buff_size)) + @:ALLOCATE(x_cc(-buff_size:m + buff_size)) + @:ALLOCATE(dx(-buff_size:m + buff_size)) if (n == 0) return; - @:ALLOCATE_GLOBAL(y_cb(-1 - buff_size:n + buff_size)) - @:ALLOCATE_GLOBAL(y_cc(-buff_size:n + buff_size)) - @:ALLOCATE_GLOBAL(dy(-buff_size:n + buff_size)) + @:ALLOCATE(y_cb(-1 - buff_size:n + buff_size)) + @:ALLOCATE(y_cc(-buff_size:n + buff_size)) + @:ALLOCATE(dy(-buff_size:n + buff_size)) if (p == 0) return; - @:ALLOCATE_GLOBAL(z_cb(-1 - buff_size:p + buff_size)) - @:ALLOCATE_GLOBAL(z_cc(-buff_size:p + buff_size)) - @:ALLOCATE_GLOBAL(dz(-buff_size:p + buff_size)) + @:ALLOCATE(z_cb(-1 - buff_size:p + buff_size)) + @:ALLOCATE(z_cc(-buff_size:p + buff_size)) + @:ALLOCATE(dz(-buff_size:p + buff_size)) end subroutine s_initialize_global_parameters_module @@ -1151,7 +1151,7 @@ contains ! fluids and any pairs of fluids whose interfaces supported effects ! of surface tension if (viscous) then - @:DEALLOCATE_GLOBAL(Re_idx) + @:DEALLOCATE(Re_idx) end if deallocate (proc_coords) @@ -1168,13 +1168,13 @@ contains if (ib) MPI_IO_IB_DATA%var%sf => null() ! Deallocating grid variables for the x-, y- and z-directions - @:DEALLOCATE_GLOBAL(x_cb, x_cc, dx) + @:DEALLOCATE(x_cb, x_cc, dx) if (n == 0) return; - @:DEALLOCATE_GLOBAL(y_cb, y_cc, dy) + @:DEALLOCATE(y_cb, y_cc, dy) if (p == 0) return; - @:DEALLOCATE_GLOBAL(z_cb, z_cc, dz) + @:DEALLOCATE(z_cb, z_cc, dz) end subroutine s_finalize_global_parameters_module diff --git a/src/simulation/m_hypoelastic.fpp b/src/simulation/m_hypoelastic.fpp index 94a57b148..43b600cd3 100644 --- a/src/simulation/m_hypoelastic.fpp +++ b/src/simulation/m_hypoelastic.fpp @@ -39,14 +39,14 @@ contains integer :: i - @:ALLOCATE_GLOBAL(Gs(1:num_fluids)) - @:ALLOCATE_GLOBAL(rho_K_field(0:m,0:n,0:p), G_K_field(0:m,0:n,0:p)) - @:ALLOCATE_GLOBAL(du_dx(0:m,0:n,0:p)) + @:ALLOCATE(Gs(1:num_fluids)) + @:ALLOCATE(rho_K_field(0:m,0:n,0:p), G_K_field(0:m,0:n,0:p)) + @:ALLOCATE(du_dx(0:m,0:n,0:p)) if (n > 0) then - @:ALLOCATE_GLOBAL(du_dy(0:m,0:n,0:p), dv_dx(0:m,0:n,0:p), dv_dy(0:m,0:n,0:p)) + @:ALLOCATE(du_dy(0:m,0:n,0:p), dv_dx(0:m,0:n,0:p), dv_dy(0:m,0:n,0:p)) if (p > 0) then - @:ALLOCATE_GLOBAL(du_dz(0:m,0:n,0:p), dv_dz(0:m,0:n,0:p)) - @:ALLOCATE_GLOBAL(dw_dx(0:m,0:n,0:p), dw_dy(0:m,0:n,0:p), dw_dz(0:m,0:n,0:p)) + @:ALLOCATE(du_dz(0:m,0:n,0:p), dv_dz(0:m,0:n,0:p)) + @:ALLOCATE(dw_dx(0:m,0:n,0:p), dw_dy(0:m,0:n,0:p), dw_dz(0:m,0:n,0:p)) end if end if diff --git a/src/simulation/m_ibm.fpp b/src/simulation/m_ibm.fpp index a6dce0fb6..afd565820 100644 --- a/src/simulation/m_ibm.fpp +++ b/src/simulation/m_ibm.fpp @@ -72,8 +72,8 @@ contains @:ACC_SETUP_SFs(ib_markers) ! @:ALLOCATE(ib_markers%sf(0:m, 0:n, 0:p)) - @:ALLOCATE_GLOBAL(levelset(0:m, 0:n, 0:p, num_ibs)) - @:ALLOCATE_GLOBAL(levelset_norm(0:m, 0:n, 0:p, num_ibs, 3)) + @:ALLOCATE(levelset(0:m, 0:n, 0:p, num_ibs)) + @:ALLOCATE(levelset_norm(0:m, 0:n, 0:p, num_ibs, 3)) !$acc enter data copyin(gp_layers, num_gps, num_inner_gps) @@ -93,8 +93,8 @@ contains call s_find_num_ghost_points() !$acc update device(num_gps, num_inner_gps) - @:ALLOCATE_GLOBAL(ghost_points(num_gps)) - @:ALLOCATE_GLOBAL(inner_points(num_inner_gps)) + @:ALLOCATE(ghost_points(num_gps)) + @:ALLOCATE(inner_points(num_inner_gps)) !$acc enter data copyin(ghost_points, inner_points) @@ -925,8 +925,8 @@ contains subroutine s_finalize_ibm_module @:DEALLOCATE(ib_markers%sf) - @:DEALLOCATE_GLOBAL(levelset) - @:DEALLOCATE_GLOBAL(levelset_norm) + @:DEALLOCATE(levelset) + @:DEALLOCATE(levelset_norm) end subroutine s_finalize_ibm_module end module m_ibm diff --git a/src/simulation/m_mpi_proxy.fpp b/src/simulation/m_mpi_proxy.fpp index d2f86e4d9..ab534cdeb 100644 --- a/src/simulation/m_mpi_proxy.fpp +++ b/src/simulation/m_mpi_proxy.fpp @@ -95,39 +95,39 @@ contains if (qbmm .and. .not. polytropic) then if (n > 0) then if (p > 0) then - @:ALLOCATE_GLOBAL(q_cons_buff_send(0:-1 + buff_size*(sys_size + 2*nb*4)* & + @:ALLOCATE(q_cons_buff_send(0:-1 + buff_size*(sys_size + 2*nb*4)* & & (m + 2*buff_size + 1)* & & (n + 2*buff_size + 1)* & & (p + 2*buff_size + 1)/ & & (min(m, n, p) + 2*buff_size + 1))) else - @:ALLOCATE_GLOBAL(q_cons_buff_send(0:-1 + buff_size*(sys_size + 2*nb*4)* & + @:ALLOCATE(q_cons_buff_send(0:-1 + buff_size*(sys_size + 2*nb*4)* & & (max(m, n) + 2*buff_size + 1))) end if else - @:ALLOCATE_GLOBAL(q_cons_buff_send(0:-1 + buff_size*(sys_size + 2*nb*4))) + @:ALLOCATE(q_cons_buff_send(0:-1 + buff_size*(sys_size + 2*nb*4))) end if - @:ALLOCATE_GLOBAL(q_cons_buff_recv(0:ubound(q_cons_buff_send, 1))) + @:ALLOCATE(q_cons_buff_recv(0:ubound(q_cons_buff_send, 1))) v_size = sys_size + 2*nb*4 else if (n > 0) then if (p > 0) then - @:ALLOCATE_GLOBAL(q_cons_buff_send(0:-1 + buff_size*sys_size* & + @:ALLOCATE(q_cons_buff_send(0:-1 + buff_size*sys_size* & & (m + 2*buff_size + 1)* & & (n + 2*buff_size + 1)* & & (p + 2*buff_size + 1)/ & & (min(m, n, p) + 2*buff_size + 1))) else - @:ALLOCATE_GLOBAL(q_cons_buff_send(0:-1 + buff_size*sys_size* & + @:ALLOCATE(q_cons_buff_send(0:-1 + buff_size*sys_size* & & (max(m, n) + 2*buff_size + 1))) end if else - @:ALLOCATE_GLOBAL(q_cons_buff_send(0:-1 + buff_size*sys_size)) + @:ALLOCATE(q_cons_buff_send(0:-1 + buff_size*sys_size)) end if - @:ALLOCATE_GLOBAL(q_cons_buff_recv(0:ubound(q_cons_buff_send, 1))) + @:ALLOCATE(q_cons_buff_recv(0:ubound(q_cons_buff_send, 1))) v_size = sys_size end if @@ -136,20 +136,20 @@ contains nVars = num_dims + 1 if (n > 0) then if (p > 0) then - @:ALLOCATE_GLOBAL(c_divs_buff_send(0:-1 + buff_size*(num_dims+1)* & + @:ALLOCATE(c_divs_buff_send(0:-1 + buff_size*(num_dims+1)* & & (m + 2*buff_size + 1)* & & (n + 2*buff_size + 1)* & & (p + 2*buff_size + 1)/ & & (min(m, n, p) + 2*buff_size + 1))) else - @:ALLOCATE_GLOBAL(c_divs_buff_send(0:-1 + buff_size*(num_dims+1)* & + @:ALLOCATE(c_divs_buff_send(0:-1 + buff_size*(num_dims+1)* & & (max(m, n) + 2*buff_size + 1))) end if else - @:ALLOCATE_GLOBAL(c_divs_buff_send(0:-1 + buff_size*(num_dims+1))) + @:ALLOCATE(c_divs_buff_send(0:-1 + buff_size*(num_dims+1))) end if - @:ALLOCATE_GLOBAL(c_divs_buff_recv(0:ubound(c_divs_buff_send, 1))) + @:ALLOCATE(c_divs_buff_recv(0:ubound(c_divs_buff_send, 1))) end if !$acc update device(v_size, nVars) @@ -1274,19 +1274,19 @@ contains if (n > 0) then if (p > 0) then - @:ALLOCATE_GLOBAL(ib_buff_send(0:-1 + gp_layers * & + @:ALLOCATE(ib_buff_send(0:-1 + gp_layers * & & (m + 2*gp_layers + 1)* & & (n + 2*gp_layers + 1)* & & (p + 2*gp_layers + 1)/ & & (min(m, n, p) + 2*gp_layers + 1))) else - @:ALLOCATE_GLOBAL(ib_buff_send(0:-1 + gp_layers* & + @:ALLOCATE(ib_buff_send(0:-1 + gp_layers* & & (max(m, n) + 2*gp_layers + 1))) end if else - @:ALLOCATE_GLOBAL(ib_buff_send(0:-1 + gp_layers)) + @:ALLOCATE(ib_buff_send(0:-1 + gp_layers)) end if - @:ALLOCATE_GLOBAL(ib_buff_recv(0:ubound(ib_buff_send, 1))) + @:ALLOCATE(ib_buff_recv(0:ubound(ib_buff_send, 1))) !nCalls_time = nCalls_time + 1 @@ -2325,13 +2325,13 @@ contains #ifdef MFC_MPI ! Deallocating q_cons_buff_send and q_cons_buff_recv - @:DEALLOCATE_GLOBAL(q_cons_buff_send, q_cons_buff_recv) + @:DEALLOCATE(q_cons_buff_send, q_cons_buff_recv) if (ib) then - @:DEALLOCATE_GLOBAL(ib_buff_send, ib_buff_recv) + @:DEALLOCATE(ib_buff_send, ib_buff_recv) end if if (surface_tension) then - @:DEALLOCATE_GLOBAL(c_divs_buff_send, c_divs_buff_recv) + @:DEALLOCATE(c_divs_buff_send, c_divs_buff_recv) end if #endif diff --git a/src/simulation/m_qbmm.fpp b/src/simulation/m_qbmm.fpp index 3df5735b3..61e2fdaad 100644 --- a/src/simulation/m_qbmm.fpp +++ b/src/simulation/m_qbmm.fpp @@ -66,7 +66,7 @@ contains #:endif - @:ALLOCATE_GLOBAL(momrhs(3, 0:2, 0:2, nterms, nb)) + @:ALLOCATE(momrhs(3, 0:2, 0:2, nterms, nb)) momrhs = 0d0 ! Assigns the required RHS moments for moment transport equations @@ -398,8 +398,8 @@ contains !$acc update device(momrhs) - @:ALLOCATE_GLOBAL(bubrs(1:nb)) - @:ALLOCATE_GLOBAL(bubmoms(1:nb, 1:nmom)) + @:ALLOCATE(bubrs(1:nb)) + @:ALLOCATE(bubmoms(1:nb, 1:nmom)) do i = 1, nb bubrs(i) = bub_idx%rs(i) diff --git a/src/simulation/m_rhs.fpp b/src/simulation/m_rhs.fpp index 2628b024b..6e1931ff6 100644 --- a/src/simulation/m_rhs.fpp +++ b/src/simulation/m_rhs.fpp @@ -222,7 +222,7 @@ contains end if if (viscous) then - @:ALLOCATE_GLOBAL(tau_Re_vf(1:sys_size)) + @:ALLOCATE(tau_Re_vf(1:sys_size)) do i = 1, num_dims @:ALLOCATE(tau_Re_vf(cont_idx%end + i)%sf(idwbuff(1)%beg:idwbuff(1)%end, & & idwbuff(2)%beg:idwbuff(2)%end, & @@ -238,7 +238,7 @@ contains ! ================================================================== if (qbmm) then - @:ALLOCATE_GLOBAL(mom_sp(1:nmomsp), mom_3d(0:2, 0:2, nb)) + @:ALLOCATE(mom_sp(1:nmomsp), mom_3d(0:2, 0:2, nb)) do i = 0, 2 do j = 0, 2 @@ -262,8 +262,8 @@ contains end if ! Allocation/Association of qK_cons_n and qK_prim_n ========== - @:ALLOCATE_GLOBAL(qL_prim(1:num_dims)) - @:ALLOCATE_GLOBAL(qR_prim(1:num_dims)) + @:ALLOCATE(qL_prim(1:num_dims)) + @:ALLOCATE(qR_prim(1:num_dims)) do i = 1, num_dims @:ALLOCATE(qL_prim(i)%vf(1:sys_size)) @@ -280,42 +280,42 @@ contains end if ! END: Allocation/Association of qK_cons_n and qK_prim_n ====== - @:ALLOCATE_GLOBAL(qL_rsx_vf(idwbuff(1)%beg:idwbuff(1)%end, & + @:ALLOCATE(qL_rsx_vf(idwbuff(1)%beg:idwbuff(1)%end, & idwbuff(2)%beg:idwbuff(2)%end, idwbuff(3)%beg:idwbuff(3)%end, 1:sys_size)) - @:ALLOCATE_GLOBAL(qR_rsx_vf(idwbuff(1)%beg:idwbuff(1)%end, & + @:ALLOCATE(qR_rsx_vf(idwbuff(1)%beg:idwbuff(1)%end, & idwbuff(2)%beg:idwbuff(2)%end, idwbuff(3)%beg:idwbuff(3)%end, 1:sys_size)) if (n > 0) then - @:ALLOCATE_GLOBAL(qL_rsy_vf(idwbuff(2)%beg:idwbuff(2)%end, & + @:ALLOCATE(qL_rsy_vf(idwbuff(2)%beg:idwbuff(2)%end, & idwbuff(1)%beg:idwbuff(1)%end, idwbuff(3)%beg:idwbuff(3)%end, 1:sys_size)) - @:ALLOCATE_GLOBAL(qR_rsy_vf(idwbuff(2)%beg:idwbuff(2)%end, & + @:ALLOCATE(qR_rsy_vf(idwbuff(2)%beg:idwbuff(2)%end, & idwbuff(1)%beg:idwbuff(1)%end, idwbuff(3)%beg:idwbuff(3)%end, 1:sys_size)) else - @:ALLOCATE_GLOBAL(qL_rsy_vf(idwbuff(1)%beg:idwbuff(1)%end, & + @:ALLOCATE(qL_rsy_vf(idwbuff(1)%beg:idwbuff(1)%end, & idwbuff(2)%beg:idwbuff(2)%end, idwbuff(3)%beg:idwbuff(3)%end, 1:sys_size)) - @:ALLOCATE_GLOBAL(qR_rsy_vf(idwbuff(1)%beg:idwbuff(1)%end, & + @:ALLOCATE(qR_rsy_vf(idwbuff(1)%beg:idwbuff(1)%end, & idwbuff(2)%beg:idwbuff(2)%end, idwbuff(3)%beg:idwbuff(3)%end, 1:sys_size)) end if if (p > 0) then - @:ALLOCATE_GLOBAL(qL_rsz_vf(idwbuff(3)%beg:idwbuff(3)%end, & + @:ALLOCATE(qL_rsz_vf(idwbuff(3)%beg:idwbuff(3)%end, & idwbuff(2)%beg:idwbuff(2)%end, idwbuff(1)%beg:idwbuff(1)%end, 1:sys_size)) - @:ALLOCATE_GLOBAL(qR_rsz_vf(idwbuff(3)%beg:idwbuff(3)%end, & + @:ALLOCATE(qR_rsz_vf(idwbuff(3)%beg:idwbuff(3)%end, & idwbuff(2)%beg:idwbuff(2)%end, idwbuff(1)%beg:idwbuff(1)%end, 1:sys_size)) else - @:ALLOCATE_GLOBAL(qL_rsz_vf(idwbuff(1)%beg:idwbuff(1)%end, & + @:ALLOCATE(qL_rsz_vf(idwbuff(1)%beg:idwbuff(1)%end, & idwbuff(2)%beg:idwbuff(2)%end, idwbuff(3)%beg:idwbuff(3)%end, 1:sys_size)) - @:ALLOCATE_GLOBAL(qR_rsz_vf(idwbuff(1)%beg:idwbuff(1)%end, & + @:ALLOCATE(qR_rsz_vf(idwbuff(1)%beg:idwbuff(1)%end, & idwbuff(2)%beg:idwbuff(2)%end, idwbuff(3)%beg:idwbuff(3)%end, 1:sys_size)) end if ! Allocation of dq_prim_ds_qp ====================================== - @:ALLOCATE_GLOBAL(dq_prim_dx_qp(1:1)) - @:ALLOCATE_GLOBAL(dq_prim_dy_qp(1:1)) - @:ALLOCATE_GLOBAL(dq_prim_dz_qp(1:1)) + @:ALLOCATE(dq_prim_dx_qp(1:1)) + @:ALLOCATE(dq_prim_dy_qp(1:1)) + @:ALLOCATE(dq_prim_dz_qp(1:1)) if (viscous) then @:ALLOCATE(dq_prim_dx_qp(1)%vf(1:sys_size)) @@ -376,12 +376,12 @@ contains ! END: Allocation of dq_prim_ds_qp ================================= ! Allocation/Association of dqK_prim_ds_n ======================= - @:ALLOCATE_GLOBAL(dqL_prim_dx_n(1:num_dims)) - @:ALLOCATE_GLOBAL(dqL_prim_dy_n(1:num_dims)) - @:ALLOCATE_GLOBAL(dqL_prim_dz_n(1:num_dims)) - @:ALLOCATE_GLOBAL(dqR_prim_dx_n(1:num_dims)) - @:ALLOCATE_GLOBAL(dqR_prim_dy_n(1:num_dims)) - @:ALLOCATE_GLOBAL(dqR_prim_dz_n(1:num_dims)) + @:ALLOCATE(dqL_prim_dx_n(1:num_dims)) + @:ALLOCATE(dqL_prim_dy_n(1:num_dims)) + @:ALLOCATE(dqL_prim_dz_n(1:num_dims)) + @:ALLOCATE(dqR_prim_dx_n(1:num_dims)) + @:ALLOCATE(dqR_prim_dy_n(1:num_dims)) + @:ALLOCATE(dqR_prim_dz_n(1:num_dims)) if (viscous) then do i = 1, num_dims @@ -437,34 +437,34 @@ contains if (viscous) then if (weno_Re_flux) then - @:ALLOCATE_GLOBAL(dqL_rsx_vf(idwbuff(1)%beg:idwbuff(1)%end, & + @:ALLOCATE(dqL_rsx_vf(idwbuff(1)%beg:idwbuff(1)%end, & idwbuff(2)%beg:idwbuff(2)%end, idwbuff(3)%beg:idwbuff(3)%end, mom_idx%beg:mom_idx%end)) - @:ALLOCATE_GLOBAL(dqR_rsx_vf(idwbuff(1)%beg:idwbuff(1)%end, & + @:ALLOCATE(dqR_rsx_vf(idwbuff(1)%beg:idwbuff(1)%end, & idwbuff(2)%beg:idwbuff(2)%end, idwbuff(3)%beg:idwbuff(3)%end, mom_idx%beg:mom_idx%end)) if (n > 0) then - @:ALLOCATE_GLOBAL(dqL_rsy_vf(idwbuff(2)%beg:idwbuff(2)%end, & + @:ALLOCATE(dqL_rsy_vf(idwbuff(2)%beg:idwbuff(2)%end, & idwbuff(1)%beg:idwbuff(1)%end, idwbuff(3)%beg:idwbuff(3)%end, mom_idx%beg:mom_idx%end)) - @:ALLOCATE_GLOBAL(dqR_rsy_vf(idwbuff(2)%beg:idwbuff(2)%end, & + @:ALLOCATE(dqR_rsy_vf(idwbuff(2)%beg:idwbuff(2)%end, & idwbuff(1)%beg:idwbuff(1)%end, idwbuff(3)%beg:idwbuff(3)%end, mom_idx%beg:mom_idx%end)) else - @:ALLOCATE_GLOBAL(dqL_rsy_vf(idwbuff(1)%beg:idwbuff(1)%end, & + @:ALLOCATE(dqL_rsy_vf(idwbuff(1)%beg:idwbuff(1)%end, & idwbuff(2)%beg:idwbuff(2)%end, idwbuff(3)%beg:idwbuff(3)%end, mom_idx%beg:mom_idx%end)) - @:ALLOCATE_GLOBAL(dqR_rsy_vf(idwbuff(1)%beg:idwbuff(1)%end, & + @:ALLOCATE(dqR_rsy_vf(idwbuff(1)%beg:idwbuff(1)%end, & idwbuff(2)%beg:idwbuff(2)%end, idwbuff(3)%beg:idwbuff(3)%end, mom_idx%beg:mom_idx%end)) end if if (p > 0) then - @:ALLOCATE_GLOBAL(dqL_rsz_vf(idwbuff(3)%beg:idwbuff(3)%end, & + @:ALLOCATE(dqL_rsz_vf(idwbuff(3)%beg:idwbuff(3)%end, & idwbuff(2)%beg:idwbuff(2)%end, idwbuff(1)%beg:idwbuff(1)%end, mom_idx%beg:mom_idx%end)) - @:ALLOCATE_GLOBAL(dqR_rsz_vf(idwbuff(3)%beg:idwbuff(3)%end, & + @:ALLOCATE(dqR_rsz_vf(idwbuff(3)%beg:idwbuff(3)%end, & idwbuff(2)%beg:idwbuff(2)%end, idwbuff(1)%beg:idwbuff(1)%end, mom_idx%beg:mom_idx%end)) else - @:ALLOCATE_GLOBAL(dqL_rsz_vf(idwbuff(1)%beg:idwbuff(1)%end, & + @:ALLOCATE(dqL_rsz_vf(idwbuff(1)%beg:idwbuff(1)%end, & idwbuff(2)%beg:idwbuff(2)%end, idwbuff(3)%beg:idwbuff(3)%end, mom_idx%beg:mom_idx%end)) - @:ALLOCATE_GLOBAL(dqR_rsz_vf(idwbuff(1)%beg:idwbuff(1)%end, & + @:ALLOCATE(dqR_rsz_vf(idwbuff(1)%beg:idwbuff(1)%end, & idwbuff(2)%beg:idwbuff(2)%end, idwbuff(3)%beg:idwbuff(3)%end, mom_idx%beg:mom_idx%end)) end if @@ -474,14 +474,14 @@ contains ! ================================================================== ! Allocation of gm_alphaK_n ===================================== - @:ALLOCATE_GLOBAL(gm_alphaL_n(1:num_dims)) - @:ALLOCATE_GLOBAL(gm_alphaR_n(1:num_dims)) + @:ALLOCATE(gm_alphaL_n(1:num_dims)) + @:ALLOCATE(gm_alphaR_n(1:num_dims)) ! ================================================================== ! Allocation/Association of flux_n, flux_src_n, and flux_gsrc_n === - @:ALLOCATE_GLOBAL(flux_n(1:num_dims)) - @:ALLOCATE_GLOBAL(flux_src_n(1:num_dims)) - @:ALLOCATE_GLOBAL(flux_gsrc_n(1:num_dims)) + @:ALLOCATE(flux_n(1:num_dims)) + @:ALLOCATE(flux_src_n(1:num_dims)) + @:ALLOCATE(flux_gsrc_n(1:num_dims)) do i = 1, num_dims @@ -565,10 +565,10 @@ contains ! END: Allocation/Association of flux_n, flux_src_n, and flux_gsrc_n === if (alt_soundspeed) then - @:ALLOCATE_GLOBAL(blkmod1(0:m, 0:n, 0:p), blkmod2(0:m, 0:n, 0:p), alpha1(0:m, 0:n, 0:p), alpha2(0:m, 0:n, 0:p), Kterm(0:m, 0:n, 0:p)) + @:ALLOCATE(blkmod1(0:m, 0:n, 0:p), blkmod2(0:m, 0:n, 0:p), alpha1(0:m, 0:n, 0:p), alpha2(0:m, 0:n, 0:p), Kterm(0:m, 0:n, 0:p)) end if - @:ALLOCATE_GLOBAL(gamma_min(1:num_fluids), pres_inf(1:num_fluids)) + @:ALLOCATE(gamma_min(1:num_fluids), pres_inf(1:num_fluids)) do i = 1, num_fluids gamma_min(i) = 1d0/fluid_pp(i)%gamma + 1d0 @@ -577,7 +577,7 @@ contains !$acc update device(gamma_min, pres_inf) if (viscous) then - @:ALLOCATE_GLOBAL(Res(1:2, 1:maxval(Re_size))) + @:ALLOCATE(Res(1:2, 1:maxval(Re_size))) end if if (viscous) then @@ -603,7 +603,7 @@ contains end do if (bubbles) then - @:ALLOCATE_GLOBAL(nbub(0:m, 0:n, 0:p)) + @:ALLOCATE(nbub(0:m, 0:n, 0:p)) end if end subroutine s_initialize_rhs_module @@ -2126,25 +2126,25 @@ contains end do @:DEALLOCATE(q_cons_qp%vf, q_prim_qp%vf) - @:DEALLOCATE_GLOBAL(qL_rsx_vf, qR_rsx_vf) + @:DEALLOCATE(qL_rsx_vf, qR_rsx_vf) if (n > 0) then - @:DEALLOCATE_GLOBAL(qL_rsy_vf, qR_rsy_vf) + @:DEALLOCATE(qL_rsy_vf, qR_rsy_vf) end if if (p > 0) then - @:DEALLOCATE_GLOBAL(qL_rsz_vf, qR_rsz_vf) + @:DEALLOCATE(qL_rsz_vf, qR_rsz_vf) end if if (viscous .and. weno_Re_flux) then - @:DEALLOCATE_GLOBAL(dqL_rsx_vf, dqR_rsx_vf) + @:DEALLOCATE(dqL_rsx_vf, dqR_rsx_vf) if (n > 0) then - @:DEALLOCATE_GLOBAL(dqL_rsy_vf, dqR_rsy_vf) + @:DEALLOCATE(dqL_rsy_vf, dqR_rsy_vf) end if if (p > 0) then - @:DEALLOCATE_GLOBAL(dqL_rsz_vf, dqR_rsz_vf) + @:DEALLOCATE(dqL_rsz_vf, dqR_rsz_vf) end if end if @@ -2208,8 +2208,8 @@ contains end do end if - @:DEALLOCATE_GLOBAL(dqL_prim_dx_n, dqL_prim_dy_n, dqL_prim_dz_n) - @:DEALLOCATE_GLOBAL(dqR_prim_dx_n, dqR_prim_dy_n, dqR_prim_dz_n) + @:DEALLOCATE(dqL_prim_dx_n, dqL_prim_dy_n, dqL_prim_dz_n) + @:DEALLOCATE(dqR_prim_dx_n, dqR_prim_dy_n, dqR_prim_dz_n) do i = num_dims, 1, -1 if (i /= 1) then @@ -2246,14 +2246,14 @@ contains @:DEALLOCATE(flux_n(i)%vf, flux_src_n(i)%vf, flux_gsrc_n(i)%vf) end do - @:DEALLOCATE_GLOBAL(flux_n, flux_src_n, flux_gsrc_n) + @:DEALLOCATE(flux_n, flux_src_n, flux_gsrc_n) if (viscous .and. cyl_coord) then do i = 1, num_dims @:DEALLOCATE(tau_re_vf(cont_idx%end + i)%sf) end do @:DEALLOCATE(tau_re_vf(e_idx)%sf) - @:DEALLOCATE_GLOBAL(tau_re_vf) + @:DEALLOCATE(tau_re_vf) end if end subroutine s_finalize_rhs_module diff --git a/src/simulation/m_riemann_solvers.fpp b/src/simulation/m_riemann_solvers.fpp index 54e36435c..1b91bfc84 100644 --- a/src/simulation/m_riemann_solvers.fpp +++ b/src/simulation/m_riemann_solvers.fpp @@ -2501,7 +2501,7 @@ contains ! the Riemann problem solution integer :: i, j - @:ALLOCATE_GLOBAL(Gs(1:num_fluids)) + @:ALLOCATE(Gs(1:num_fluids)) do i = 1, num_fluids Gs(i) = fluid_pp(i)%G @@ -2509,7 +2509,7 @@ contains !$acc update device(Gs) if (viscous) then - @:ALLOCATE_GLOBAL(Res(1:2, 1:maxval(Re_size))) + @:ALLOCATE(Res(1:2, 1:maxval(Re_size))) end if if (viscous) then @@ -2526,24 +2526,24 @@ contains is1%beg = -1; is2%beg = 0; is3%beg = 0 is1%end = m; is2%end = n; is3%end = p - @:ALLOCATE_GLOBAL(flux_rsx_vf(is1%beg:is1%end, & + @:ALLOCATE(flux_rsx_vf(is1%beg:is1%end, & is2%beg:is2%end, & is3%beg:is3%end, 1:sys_size)) - @:ALLOCATE_GLOBAL(flux_gsrc_rsx_vf(is1%beg:is1%end, & + @:ALLOCATE(flux_gsrc_rsx_vf(is1%beg:is1%end, & is2%beg:is2%end, & is3%beg:is3%end, 1:sys_size)) - @:ALLOCATE_GLOBAL(flux_src_rsx_vf(is1%beg:is1%end, & + @:ALLOCATE(flux_src_rsx_vf(is1%beg:is1%end, & is2%beg:is2%end, & is3%beg:is3%end, advxb:sys_size)) - @:ALLOCATE_GLOBAL(vel_src_rsx_vf(is1%beg:is1%end, & + @:ALLOCATE(vel_src_rsx_vf(is1%beg:is1%end, & is2%beg:is2%end, & is3%beg:is3%end, 1:num_dims)) if (qbmm) then - @:ALLOCATE_GLOBAL(mom_sp_rsx_vf(is1%beg:is1%end + 1, is2%beg:is2%end, is3%beg:is3%end, 1:4)) + @:ALLOCATE(mom_sp_rsx_vf(is1%beg:is1%end + 1, is2%beg:is2%end, is3%beg:is3%end, 1:4)) end if if (viscous) then - @:ALLOCATE_GLOBAL(Re_avg_rsx_vf(is1%beg:is1%end, & + @:ALLOCATE(Re_avg_rsx_vf(is1%beg:is1%end, & is2%beg:is2%end, & is3%beg:is3%end, 1:2)) end if @@ -2553,25 +2553,25 @@ contains is1%beg = -1; is2%beg = 0; is3%beg = 0 is1%end = n; is2%end = m; is3%end = p - @:ALLOCATE_GLOBAL(flux_rsy_vf(is1%beg:is1%end, & + @:ALLOCATE(flux_rsy_vf(is1%beg:is1%end, & is2%beg:is2%end, & is3%beg:is3%end, 1:sys_size)) - @:ALLOCATE_GLOBAL(flux_gsrc_rsy_vf(is1%beg:is1%end, & + @:ALLOCATE(flux_gsrc_rsy_vf(is1%beg:is1%end, & is2%beg:is2%end, & is3%beg:is3%end, 1:sys_size)) - @:ALLOCATE_GLOBAL(flux_src_rsy_vf(is1%beg:is1%end, & + @:ALLOCATE(flux_src_rsy_vf(is1%beg:is1%end, & is2%beg:is2%end, & is3%beg:is3%end, advxb:sys_size)) - @:ALLOCATE_GLOBAL(vel_src_rsy_vf(is1%beg:is1%end, & + @:ALLOCATE(vel_src_rsy_vf(is1%beg:is1%end, & is2%beg:is2%end, & is3%beg:is3%end, 1:num_dims)) if (qbmm) then - @:ALLOCATE_GLOBAL(mom_sp_rsy_vf(is1%beg:is1%end + 1, is2%beg:is2%end, is3%beg:is3%end, 1:4)) + @:ALLOCATE(mom_sp_rsy_vf(is1%beg:is1%end + 1, is2%beg:is2%end, is3%beg:is3%end, 1:4)) end if if (viscous) then - @:ALLOCATE_GLOBAL(Re_avg_rsy_vf(is1%beg:is1%end, & + @:ALLOCATE(Re_avg_rsy_vf(is1%beg:is1%end, & is2%beg:is2%end, & is3%beg:is3%end, 1:2)) end if @@ -2581,25 +2581,25 @@ contains is1%beg = -1; is2%beg = 0; is3%beg = 0 is1%end = p; is2%end = n; is3%end = m - @:ALLOCATE_GLOBAL(flux_rsz_vf(is1%beg:is1%end, & + @:ALLOCATE(flux_rsz_vf(is1%beg:is1%end, & is2%beg:is2%end, & is3%beg:is3%end, 1:sys_size)) - @:ALLOCATE_GLOBAL(flux_gsrc_rsz_vf(is1%beg:is1%end, & + @:ALLOCATE(flux_gsrc_rsz_vf(is1%beg:is1%end, & is2%beg:is2%end, & is3%beg:is3%end, 1:sys_size)) - @:ALLOCATE_GLOBAL(flux_src_rsz_vf(is1%beg:is1%end, & + @:ALLOCATE(flux_src_rsz_vf(is1%beg:is1%end, & is2%beg:is2%end, & is3%beg:is3%end, advxb:sys_size)) - @:ALLOCATE_GLOBAL(vel_src_rsz_vf(is1%beg:is1%end, & + @:ALLOCATE(vel_src_rsz_vf(is1%beg:is1%end, & is2%beg:is2%end, & is3%beg:is3%end, 1:num_dims)) if (qbmm) then - @:ALLOCATE_GLOBAL(mom_sp_rsz_vf(is1%beg:is1%end + 1, is2%beg:is2%end, is3%beg:is3%end, 1:4)) + @:ALLOCATE(mom_sp_rsz_vf(is1%beg:is1%end + 1, is2%beg:is2%end, is3%beg:is3%end, 1:4)) end if if (viscous) then - @:ALLOCATE_GLOBAL(Re_avg_rsz_vf(is1%beg:is1%end, & + @:ALLOCATE(Re_avg_rsz_vf(is1%beg:is1%end, & is2%beg:is2%end, & is3%beg:is3%end, 1:2)) end if @@ -4324,40 +4324,40 @@ contains subroutine s_finalize_riemann_solvers_module if (viscous) then - @:DEALLOCATE_GLOBAL(Re_avg_rsx_vf) + @:DEALLOCATE(Re_avg_rsx_vf) end if - @:DEALLOCATE_GLOBAL(vel_src_rsx_vf) - @:DEALLOCATE_GLOBAL(flux_rsx_vf) - @:DEALLOCATE_GLOBAL(flux_src_rsx_vf) - @:DEALLOCATE_GLOBAL(flux_gsrc_rsx_vf) + @:DEALLOCATE(vel_src_rsx_vf) + @:DEALLOCATE(flux_rsx_vf) + @:DEALLOCATE(flux_src_rsx_vf) + @:DEALLOCATE(flux_gsrc_rsx_vf) if (qbmm) then - @:DEALLOCATE_GLOBAL(mom_sp_rsx_vf) + @:DEALLOCATE(mom_sp_rsx_vf) end if if (n == 0) return if (viscous) then - @:DEALLOCATE_GLOBAL(Re_avg_rsy_vf) + @:DEALLOCATE(Re_avg_rsy_vf) end if - @:DEALLOCATE_GLOBAL(vel_src_rsy_vf) - @:DEALLOCATE_GLOBAL(flux_rsy_vf) - @:DEALLOCATE_GLOBAL(flux_src_rsy_vf) - @:DEALLOCATE_GLOBAL(flux_gsrc_rsy_vf) + @:DEALLOCATE(vel_src_rsy_vf) + @:DEALLOCATE(flux_rsy_vf) + @:DEALLOCATE(flux_src_rsy_vf) + @:DEALLOCATE(flux_gsrc_rsy_vf) if (qbmm) then - @:DEALLOCATE_GLOBAL(mom_sp_rsy_vf) + @:DEALLOCATE(mom_sp_rsy_vf) end if if (p == 0) return if (viscous) then - @:DEALLOCATE_GLOBAL(Re_avg_rsz_vf) + @:DEALLOCATE(Re_avg_rsz_vf) end if - @:DEALLOCATE_GLOBAL(vel_src_rsz_vf) - @:DEALLOCATE_GLOBAL(flux_rsz_vf) - @:DEALLOCATE_GLOBAL(flux_src_rsz_vf) - @:DEALLOCATE_GLOBAL(flux_gsrc_rsz_vf) + @:DEALLOCATE(vel_src_rsz_vf) + @:DEALLOCATE(flux_rsz_vf) + @:DEALLOCATE(flux_src_rsz_vf) + @:DEALLOCATE(flux_gsrc_rsz_vf) if (qbmm) then - @:DEALLOCATE_GLOBAL(mom_sp_rsz_vf) + @:DEALLOCATE(mom_sp_rsz_vf) end if end subroutine s_finalize_riemann_solvers_module diff --git a/src/simulation/m_surface_tension.fpp b/src/simulation/m_surface_tension.fpp index 926d90f83..85176a99a 100644 --- a/src/simulation/m_surface_tension.fpp +++ b/src/simulation/m_surface_tension.fpp @@ -49,22 +49,22 @@ contains subroutine s_initialize_surface_tension_module - @:ALLOCATE_GLOBAL(c_divs(1:num_dims + 1)) + @:ALLOCATE(c_divs(1:num_dims + 1)) do j = 1, num_dims + 1 @:ALLOCATE(c_divs(j)%sf(idwbuff(1)%beg:idwbuff(1)%end, idwbuff(2)%beg:idwbuff(2)%end, idwbuff(3)%beg:idwbuff(3)%end)) @:ACC_SETUP_SFs(c_divs(j)) end do - @:ALLOCATE_GLOBAL(gL_x(idwbuff(1)%beg:idwbuff(1)%end, idwbuff(2)%beg:idwbuff(2)%end, idwbuff(3)%beg:idwbuff(3)%end, num_dims + 1)) - @:ALLOCATE_GLOBAL(gR_x(idwbuff(1)%beg:idwbuff(1)%end, idwbuff(2)%beg:idwbuff(2)%end, idwbuff(3)%beg:idwbuff(3)%end, num_dims + 1)) + @:ALLOCATE(gL_x(idwbuff(1)%beg:idwbuff(1)%end, idwbuff(2)%beg:idwbuff(2)%end, idwbuff(3)%beg:idwbuff(3)%end, num_dims + 1)) + @:ALLOCATE(gR_x(idwbuff(1)%beg:idwbuff(1)%end, idwbuff(2)%beg:idwbuff(2)%end, idwbuff(3)%beg:idwbuff(3)%end, num_dims + 1)) - @:ALLOCATE_GLOBAL(gL_y(idwbuff(2)%beg:idwbuff(2)%end, idwbuff(1)%beg:idwbuff(1)%end, idwbuff(3)%beg:idwbuff(3)%end, num_dims + 1)) - @:ALLOCATE_GLOBAL(gR_y(idwbuff(2)%beg:idwbuff(2)%end, idwbuff(1)%beg:idwbuff(1)%end, idwbuff(3)%beg:idwbuff(3)%end, num_dims + 1)) + @:ALLOCATE(gL_y(idwbuff(2)%beg:idwbuff(2)%end, idwbuff(1)%beg:idwbuff(1)%end, idwbuff(3)%beg:idwbuff(3)%end, num_dims + 1)) + @:ALLOCATE(gR_y(idwbuff(2)%beg:idwbuff(2)%end, idwbuff(1)%beg:idwbuff(1)%end, idwbuff(3)%beg:idwbuff(3)%end, num_dims + 1)) if (p > 0) then - @:ALLOCATE_GLOBAL(gL_z(idwbuff(3)%beg:idwbuff(3)%end, idwbuff(2)%beg:idwbuff(2)%end, idwbuff(1)%beg:idwbuff(1)%end, num_dims + 1)) - @:ALLOCATE_GLOBAL(gR_z(idwbuff(3)%beg:idwbuff(3)%end, idwbuff(2)%beg:idwbuff(2)%end, idwbuff(1)%beg:idwbuff(1)%end, num_dims + 1)) + @:ALLOCATE(gL_z(idwbuff(3)%beg:idwbuff(3)%end, idwbuff(2)%beg:idwbuff(2)%end, idwbuff(1)%beg:idwbuff(1)%end, num_dims + 1)) + @:ALLOCATE(gR_z(idwbuff(3)%beg:idwbuff(3)%end, idwbuff(2)%beg:idwbuff(2)%end, idwbuff(1)%beg:idwbuff(1)%end, num_dims + 1)) end if end subroutine s_initialize_surface_tension_module @@ -384,13 +384,13 @@ contains @:DEALLOCATE(c_divs(j)%sf) end do - @:DEALLOCATE_GLOBAL(c_divs) + @:DEALLOCATE(c_divs) - @:DEALLOCATE_GLOBAL(gL_x, gR_x) + @:DEALLOCATE(gL_x, gR_x) - @:DEALLOCATE_GLOBAL(gL_y, gR_y) + @:DEALLOCATE(gL_y, gR_y) if (p > 0) then - @:DEALLOCATE_GLOBAL(gL_z, gR_z) + @:DEALLOCATE(gL_z, gR_z) end if end subroutine s_finalize_surface_tension_module diff --git a/src/simulation/m_time_steppers.fpp b/src/simulation/m_time_steppers.fpp index 288fed105..67147185a 100644 --- a/src/simulation/m_time_steppers.fpp +++ b/src/simulation/m_time_steppers.fpp @@ -84,7 +84,7 @@ contains end if ! Allocating the cell-average conservative variables - @:ALLOCATE_GLOBAL(q_cons_ts(1:num_ts)) + @:ALLOCATE(q_cons_ts(1:num_ts)) do i = 1, num_ts @:ALLOCATE(q_cons_ts(i)%vf(1:sys_size)) @@ -101,7 +101,7 @@ contains ! Allocating the cell-average primitive ts variables if (probe_wrt) then - @:ALLOCATE_GLOBAL(q_prim_ts(0:3)) + @:ALLOCATE(q_prim_ts(0:3)) do i = 0, 3 @:ALLOCATE(q_prim_ts(i)%vf(1:sys_size)) @@ -121,7 +121,7 @@ contains end if ! Allocating the cell-average primitive variables - @:ALLOCATE_GLOBAL(q_prim_vf(1:sys_size)) + @:ALLOCATE(q_prim_vf(1:sys_size)) do i = 1, adv_idx%end @:ALLOCATE(q_prim_vf(i)%sf(idwbuff(1)%beg:idwbuff(1)%end, & @@ -185,7 +185,7 @@ contains @:ACC_SETUP_SFs(q_prim_vf(T_idx)) end if - @:ALLOCATE_GLOBAL(pb_ts(1:2)) + @:ALLOCATE(pb_ts(1:2)) !Initialize bubble variables pb and mv at all quadrature nodes for all R0 bins if (qbmm .and. (.not. polytropic)) then @:ALLOCATE(pb_ts(1)%sf(idwbuff(1)%beg:idwbuff(1)%end, & @@ -198,7 +198,7 @@ contains idwbuff(3)%beg:idwbuff(3)%end, 1:nnode, 1:nb)) @:ACC_SETUP_SFs(pb_ts(2)) - @:ALLOCATE_GLOBAL(rhs_pb(idwbuff(1)%beg:idwbuff(1)%end, & + @:ALLOCATE(rhs_pb(idwbuff(1)%beg:idwbuff(1)%end, & idwbuff(2)%beg:idwbuff(2)%end, & idwbuff(3)%beg:idwbuff(3)%end, 1:nnode, 1:nb)) else if (qbmm .and. polytropic) then @@ -212,12 +212,12 @@ contains idwbuff(3)%beg:idwbuff(3)%beg + 1, 1:nnode, 1:nb)) @:ACC_SETUP_SFs(pb_ts(2)) - @:ALLOCATE_GLOBAL(rhs_pb(idwbuff(1)%beg:idwbuff(1)%beg + 1, & + @:ALLOCATE(rhs_pb(idwbuff(1)%beg:idwbuff(1)%beg + 1, & idwbuff(2)%beg:idwbuff(2)%beg + 1, & idwbuff(3)%beg:idwbuff(3)%beg + 1, 1:nnode, 1:nb)) end if - @:ALLOCATE_GLOBAL(mv_ts(1:2)) + @:ALLOCATE(mv_ts(1:2)) if (qbmm .and. (.not. polytropic)) then @:ALLOCATE(mv_ts(1)%sf(idwbuff(1)%beg:idwbuff(1)%end, & @@ -230,7 +230,7 @@ contains idwbuff(3)%beg:idwbuff(3)%end, 1:nnode, 1:nb)) @:ACC_SETUP_SFs(mv_ts(2)) - @:ALLOCATE_GLOBAL(rhs_mv(idwbuff(1)%beg:idwbuff(1)%end, & + @:ALLOCATE(rhs_mv(idwbuff(1)%beg:idwbuff(1)%end, & idwbuff(2)%beg:idwbuff(2)%end, & idwbuff(3)%beg:idwbuff(3)%end, 1:nnode, 1:nb)) @@ -245,13 +245,13 @@ contains idwbuff(3)%beg:idwbuff(3)%beg + 1, 1:nnode, 1:nb)) @:ACC_SETUP_SFs(mv_ts(2)) - @:ALLOCATE_GLOBAL(rhs_mv(idwbuff(1)%beg:idwbuff(1)%beg + 1, & + @:ALLOCATE(rhs_mv(idwbuff(1)%beg:idwbuff(1)%beg + 1, & idwbuff(2)%beg:idwbuff(2)%beg + 1, & idwbuff(3)%beg:idwbuff(3)%beg + 1, 1:nnode, 1:nb)) end if ! Allocating the cell-average RHS variables - @:ALLOCATE_GLOBAL(rhs_vf(1:sys_size)) + @:ALLOCATE(rhs_vf(1:sys_size)) do i = 1, sys_size @:ALLOCATE(rhs_vf(i)%sf(0:m, 0:n, 0:p)) @@ -264,7 +264,7 @@ contains end if if (cfl_dt) then - @:ALLOCATE_GLOBAL(max_dt(0:m, 0:n, 0:p)) + @:ALLOCATE(max_dt(0:m, 0:n, 0:p)) end if end subroutine s_initialize_time_steppers_module @@ -1006,7 +1006,7 @@ contains end do - @:DEALLOCATE_GLOBAL(q_cons_ts) + @:DEALLOCATE(q_cons_ts) ! Deallocating the cell-average primitive ts variables if (probe_wrt) then @@ -1016,7 +1016,7 @@ contains end do @:DEALLOCATE(q_prim_ts(i)%vf) end do - @:DEALLOCATE_GLOBAL(q_prim_ts) + @:DEALLOCATE(q_prim_ts) end if ! Deallocating the cell-average primitive variables @@ -1042,14 +1042,14 @@ contains end do end if - @:DEALLOCATE_GLOBAL(q_prim_vf) + @:DEALLOCATE(q_prim_vf) ! Deallocating the cell-average RHS variables do i = 1, sys_size @:DEALLOCATE(rhs_vf(i)%sf) end do - @:DEALLOCATE_GLOBAL(rhs_vf) + @:DEALLOCATE(rhs_vf) ! Writing the footer of and closing the run-time information file if (proc_rank == 0 .and. run_time_info) then diff --git a/src/simulation/m_viscous.fpp b/src/simulation/m_viscous.fpp index caa0ff029..afe909ca5 100644 --- a/src/simulation/m_viscous.fpp +++ b/src/simulation/m_viscous.fpp @@ -37,7 +37,7 @@ contains integer :: i, j !< generic loop iterators - @:ALLOCATE_GLOBAL(Res_viscous(1:2, 1:maxval(Re_size))) + @:ALLOCATE(Res_viscous(1:2, 1:maxval(Re_size))) do i = 1, 2 do j = 1, Re_size(i) @@ -1462,7 +1462,7 @@ contains subroutine s_finalize_viscous_module() - @:DEALLOCATE_GLOBAL(Res_viscous) + @:DEALLOCATE(Res_viscous) end subroutine s_finalize_viscous_module diff --git a/src/simulation/m_weno.fpp b/src/simulation/m_weno.fpp index cc54e4e20..6facde03b 100644 --- a/src/simulation/m_weno.fpp +++ b/src/simulation/m_weno.fpp @@ -143,20 +143,20 @@ contains is3_weno%end = p - is3_weno%beg - @:ALLOCATE_GLOBAL(poly_coef_cbL_x(is1_weno%beg + weno_polyn:is1_weno%end - weno_polyn, 0:weno_polyn, & + @:ALLOCATE(poly_coef_cbL_x(is1_weno%beg + weno_polyn:is1_weno%end - weno_polyn, 0:weno_polyn, & 0:weno_polyn - 1)) - @:ALLOCATE_GLOBAL(poly_coef_cbR_x(is1_weno%beg + weno_polyn:is1_weno%end - weno_polyn, 0:weno_polyn, & + @:ALLOCATE(poly_coef_cbR_x(is1_weno%beg + weno_polyn:is1_weno%end - weno_polyn, 0:weno_polyn, & 0:weno_polyn - 1)) - @:ALLOCATE_GLOBAL(d_cbL_x(0:weno_num_stencils, is1_weno%beg + weno_polyn:is1_weno%end - weno_polyn)) - @:ALLOCATE_GLOBAL(d_cbR_x(0:weno_num_stencils, is1_weno%beg + weno_polyn:is1_weno%end - weno_polyn)) + @:ALLOCATE(d_cbL_x(0:weno_num_stencils, is1_weno%beg + weno_polyn:is1_weno%end - weno_polyn)) + @:ALLOCATE(d_cbR_x(0:weno_num_stencils, is1_weno%beg + weno_polyn:is1_weno%end - weno_polyn)) - @:ALLOCATE_GLOBAL(beta_coef_x(is1_weno%beg + weno_polyn:is1_weno%end - weno_polyn, 0:weno_polyn, & + @:ALLOCATE(beta_coef_x(is1_weno%beg + weno_polyn:is1_weno%end - weno_polyn, 0:weno_polyn, & 0:2*(weno_polyn - 1))) call s_compute_weno_coefficients(1, is1_weno) - @:ALLOCATE_GLOBAL(v_rs_ws_x(is1_weno%beg:is1_weno%end, & + @:ALLOCATE(v_rs_ws_x(is1_weno%beg:is1_weno%end, & is2_weno%beg:is2_weno%end, is3_weno%beg:is3_weno%end, 1:sys_size)) ! ================================================================== @@ -175,20 +175,20 @@ contains is3_weno%end = p - is3_weno%beg - @:ALLOCATE_GLOBAL(poly_coef_cbL_y(is2_weno%beg + weno_polyn:is2_weno%end - weno_polyn, 0:weno_polyn, & + @:ALLOCATE(poly_coef_cbL_y(is2_weno%beg + weno_polyn:is2_weno%end - weno_polyn, 0:weno_polyn, & 0:weno_polyn - 1)) - @:ALLOCATE_GLOBAL(poly_coef_cbR_y(is2_weno%beg + weno_polyn:is2_weno%end - weno_polyn, 0:weno_polyn, & + @:ALLOCATE(poly_coef_cbR_y(is2_weno%beg + weno_polyn:is2_weno%end - weno_polyn, 0:weno_polyn, & 0:weno_polyn - 1)) - @:ALLOCATE_GLOBAL(d_cbL_y(0:weno_num_stencils, is2_weno%beg + weno_polyn:is2_weno%end - weno_polyn)) - @:ALLOCATE_GLOBAL(d_cbR_y(0:weno_num_stencils, is2_weno%beg + weno_polyn:is2_weno%end - weno_polyn)) + @:ALLOCATE(d_cbL_y(0:weno_num_stencils, is2_weno%beg + weno_polyn:is2_weno%end - weno_polyn)) + @:ALLOCATE(d_cbR_y(0:weno_num_stencils, is2_weno%beg + weno_polyn:is2_weno%end - weno_polyn)) - @:ALLOCATE_GLOBAL(beta_coef_y(is2_weno%beg + weno_polyn:is2_weno%end - weno_polyn, 0:weno_polyn, & + @:ALLOCATE(beta_coef_y(is2_weno%beg + weno_polyn:is2_weno%end - weno_polyn, 0:weno_polyn, & 0:2*(weno_polyn - 1))) call s_compute_weno_coefficients(2, is2_weno) - @:ALLOCATE_GLOBAL(v_rs_ws_y(is2_weno%beg:is2_weno%end, & + @:ALLOCATE(v_rs_ws_y(is2_weno%beg:is2_weno%end, & is1_weno%beg:is1_weno%end, is3_weno%beg:is3_weno%end, 1:sys_size)) ! ================================================================== @@ -200,20 +200,20 @@ contains is1_weno%beg = -buff_size; is1_weno%end = m - is1_weno%beg is3_weno%beg = -buff_size; is3_weno%end = p - is3_weno%beg - @:ALLOCATE_GLOBAL(poly_coef_cbL_z(is3_weno%beg + weno_polyn:is3_weno%end - weno_polyn, 0:weno_polyn, & + @:ALLOCATE(poly_coef_cbL_z(is3_weno%beg + weno_polyn:is3_weno%end - weno_polyn, 0:weno_polyn, & 0:weno_polyn - 1)) - @:ALLOCATE_GLOBAL(poly_coef_cbR_z(is3_weno%beg + weno_polyn:is3_weno%end - weno_polyn, 0:weno_polyn, & + @:ALLOCATE(poly_coef_cbR_z(is3_weno%beg + weno_polyn:is3_weno%end - weno_polyn, 0:weno_polyn, & 0:weno_polyn - 1)) - @:ALLOCATE_GLOBAL(d_cbL_z(0:weno_num_stencils, is3_weno%beg + weno_polyn:is3_weno%end - weno_polyn)) - @:ALLOCATE_GLOBAL(d_cbR_z(0:weno_num_stencils, is3_weno%beg + weno_polyn:is3_weno%end - weno_polyn)) + @:ALLOCATE(d_cbL_z(0:weno_num_stencils, is3_weno%beg + weno_polyn:is3_weno%end - weno_polyn)) + @:ALLOCATE(d_cbR_z(0:weno_num_stencils, is3_weno%beg + weno_polyn:is3_weno%end - weno_polyn)) - @:ALLOCATE_GLOBAL(beta_coef_z(is3_weno%beg + weno_polyn:is3_weno%end - weno_polyn, 0:weno_polyn, & + @:ALLOCATE(beta_coef_z(is3_weno%beg + weno_polyn:is3_weno%end - weno_polyn, 0:weno_polyn, & 0:2*(weno_polyn - 1))) call s_compute_weno_coefficients(3, is3_weno) - @:ALLOCATE_GLOBAL(v_rs_ws_z(is3_weno%beg:is3_weno%end, & + @:ALLOCATE(v_rs_ws_z(is3_weno%beg:is3_weno%end, & is2_weno%beg:is2_weno%end, is1_weno%beg:is1_weno%end, 1:sys_size)) ! ================================================================== @@ -1219,34 +1219,34 @@ contains ! Deallocating the WENO-stencil of the WENO-reconstructed variables !deallocate(vL_rs_vf_x, vR_rs_vf_x) - @:DEALLOCATE_GLOBAL(v_rs_ws_x) + @:DEALLOCATE(v_rs_ws_x) ! Deallocating WENO coefficients in x-direction ==================== - @:DEALLOCATE_GLOBAL(poly_coef_cbL_x, poly_coef_cbR_x) - @:DEALLOCATE_GLOBAL(d_cbL_x, d_cbR_x) - @:DEALLOCATE_GLOBAL(beta_coef_x) + @:DEALLOCATE(poly_coef_cbL_x, poly_coef_cbR_x) + @:DEALLOCATE(d_cbL_x, d_cbR_x) + @:DEALLOCATE(beta_coef_x) ! ================================================================== ! Deallocating WENO coefficients in y-direction ==================== if (n == 0) return !deallocate(vL_rs_vf_y, vR_rs_vf_y) - @:DEALLOCATE_GLOBAL(v_rs_ws_y) + @:DEALLOCATE(v_rs_ws_y) - @:DEALLOCATE_GLOBAL(poly_coef_cbL_y, poly_coef_cbR_y) - @:DEALLOCATE_GLOBAL(d_cbL_y, d_cbR_y) - @:DEALLOCATE_GLOBAL(beta_coef_y) + @:DEALLOCATE(poly_coef_cbL_y, poly_coef_cbR_y) + @:DEALLOCATE(d_cbL_y, d_cbR_y) + @:DEALLOCATE(beta_coef_y) ! ================================================================== ! Deallocating WENO coefficients in z-direction ==================== if (p == 0) return !deallocate(vL_rs_vf_z, vR_rs_vf_z) - @:DEALLOCATE_GLOBAL(v_rs_ws_z) + @:DEALLOCATE(v_rs_ws_z) - @:DEALLOCATE_GLOBAL(poly_coef_cbL_z, poly_coef_cbR_z) - @:DEALLOCATE_GLOBAL(d_cbL_z, d_cbR_z) - @:DEALLOCATE_GLOBAL(beta_coef_z) + @:DEALLOCATE(poly_coef_cbL_z, poly_coef_cbR_z) + @:DEALLOCATE(d_cbL_z, d_cbR_z) + @:DEALLOCATE(beta_coef_z) ! ================================================================== end subroutine s_finalize_weno_module From 4189aa126bd9d4aa00e481a1fe0ef851d41e27be Mon Sep 17 00:00:00 2001 From: Anand Radhakrishnan Date: Mon, 11 Nov 2024 14:10:22 -0500 Subject: [PATCH 2/3] Frontier tests pass --- src/simulation/m_ibm.fpp | 6 +++--- src/simulation/m_qbmm.fpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/simulation/m_ibm.fpp b/src/simulation/m_ibm.fpp index afd565820..0eec65b00 100644 --- a/src/simulation/m_ibm.fpp +++ b/src/simulation/m_ibm.fpp @@ -73,7 +73,7 @@ contains ! @:ALLOCATE(ib_markers%sf(0:m, 0:n, 0:p)) @:ALLOCATE(levelset(0:m, 0:n, 0:p, num_ibs)) - @:ALLOCATE(levelset_norm(0:m, 0:n, 0:p, num_ibs, 3)) + @:ALLOCATE(levelset_norm(0:m, 0:n, 0:p, 1:num_ibs, 1:3)) !$acc enter data copyin(gp_layers, num_gps, num_inner_gps) @@ -93,8 +93,8 @@ contains call s_find_num_ghost_points() !$acc update device(num_gps, num_inner_gps) - @:ALLOCATE(ghost_points(num_gps)) - @:ALLOCATE(inner_points(num_inner_gps)) + @:ALLOCATE(ghost_points(1:num_gps)) + @:ALLOCATE(inner_points(1:num_inner_gps)) !$acc enter data copyin(ghost_points, inner_points) diff --git a/src/simulation/m_qbmm.fpp b/src/simulation/m_qbmm.fpp index 61e2fdaad..b22163b21 100644 --- a/src/simulation/m_qbmm.fpp +++ b/src/simulation/m_qbmm.fpp @@ -66,7 +66,7 @@ contains #:endif - @:ALLOCATE(momrhs(3, 0:2, 0:2, nterms, nb)) + @:ALLOCATE(momrhs(1:3, 0:2, 0:2, 1:nterms, 1:nb)) momrhs = 0d0 ! Assigns the required RHS moments for moment transport equations From 99d8c0dcf11d6f7446ae0cd805d6056b36d90239 Mon Sep 17 00:00:00 2001 From: Anand Date: Tue, 12 Nov 2024 14:23:39 -0500 Subject: [PATCH 3/3] FORMAT --- src/simulation/m_ibm.fpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/simulation/m_ibm.fpp b/src/simulation/m_ibm.fpp index 158550c17..8421fda52 100644 --- a/src/simulation/m_ibm.fpp +++ b/src/simulation/m_ibm.fpp @@ -869,7 +869,7 @@ contains @:DEALLOCATE(ib_markers%sf) @:DEALLOCATE(levelset%sf) @:DEALLOCATE(levelset_norm%sf) - + end subroutine s_finalize_ibm_module end module m_ibm