From ad9237f81c1e9b6cb085f40a60bd43cd3345dc34 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sat, 6 Apr 2024 17:42:26 -0400 Subject: [PATCH] Fix indentation now that we have more directives and ifdefs (#388) --- src/common/include/inline_conversions.fpp | 4 +- src/common/include/macros.fpp | 8 ++-- src/common/m_variables_conversion.fpp | 10 ++--- src/simulation/m_bubbles.fpp | 4 +- src/simulation/m_cbc.fpp | 14 +++---- src/simulation/m_compute_cbc.fpp | 16 ++++---- src/simulation/m_data_output.fpp | 4 +- src/simulation/m_derived_variables.f90 | 2 +- src/simulation/m_fftw.fpp | 8 ++-- src/simulation/m_global_parameters.fpp | 36 ++++++++--------- src/simulation/m_hypoelastic.fpp | 4 +- src/simulation/m_ibm.fpp | 4 +- src/simulation/m_monopole.fpp | 4 +- src/simulation/m_mpi_proxy.fpp | 6 +-- src/simulation/m_qbmm.fpp | 16 ++++---- src/simulation/m_rhs.fpp | 48 +++++++++++------------ src/simulation/m_riemann_solvers.fpp | 32 +++++++-------- src/simulation/m_time_steppers.fpp | 4 +- src/simulation/m_viscous.fpp | 8 ++-- src/simulation/m_weno.fpp | 10 ++--- toolchain/indenter.py | 9 +++-- 21 files changed, 126 insertions(+), 125 deletions(-) diff --git a/src/common/include/inline_conversions.fpp b/src/common/include/inline_conversions.fpp index 81ce0fa9b..4f455c511 100644 --- a/src/common/include/inline_conversions.fpp +++ b/src/common/include/inline_conversions.fpp @@ -1,9 +1,9 @@ #:def s_compute_speed_of_sound() subroutine s_compute_speed_of_sound(pres, rho, gamma, pi_inf, H, adv, vel_sum, c) #ifdef CRAY_ACC_WAR -!DIR$ INLINEALWAYS s_compute_speed_of_sound + !DIR$ INLINEALWAYS s_compute_speed_of_sound #else -!$acc routine seq + !$acc routine seq #endif real(kind(0d0)), intent(IN) :: pres real(kind(0d0)), intent(IN) :: rho, gamma, pi_inf diff --git a/src/common/include/macros.fpp b/src/common/include/macros.fpp index 10f1a678f..3fc809e76 100644 --- a/src/common/include/macros.fpp +++ b/src/common/include/macros.fpp @@ -33,11 +33,11 @@ #:for arg in args ${re.sub('\(.*\)','',arg)}$ => ${ 'p_' + re.sub('\(.*\)','',arg.strip()) }$ #:endfor -!$acc enter data create(${', '.join(('p_' + re.sub('\(.*\)','',arg.strip()) for arg in args))}$) & -!$acc& attach(${', '.join(map(lambda x: re.sub('\(.*\)','',x), args))}$) + !$acc enter data create(${', '.join(('p_' + re.sub('\(.*\)','',arg.strip()) for arg in args))}$) & + !$acc& attach(${', '.join(map(lambda x: re.sub('\(.*\)','',x), args))}$) #else allocate (${', '.join(args)}$) -!$acc enter data create(${', '.join(args)}$) + !$acc enter data create(${', '.join(args)}$) #endif #:enddef ALLOCATE_GLOBAL @@ -53,7 +53,7 @@ deallocate (${', '.join(('p_' + arg.strip() for arg in args))}$) #else deallocate (${', '.join(args)}$) -!$acc exit data delete(${', '.join(args)}$) + !$acc exit data delete(${', '.join(args)}$) #endif #:enddef DEALLOCATE_GLOBAL diff --git a/src/common/m_variables_conversion.fpp b/src/common/m_variables_conversion.fpp index d1b9a008f..80b678926 100644 --- a/src/common/m_variables_conversion.fpp +++ b/src/common/m_variables_conversion.fpp @@ -86,19 +86,19 @@ module m_variables_conversion !! In simulation, gammas, pi_infs, and qvs are already declared in m_global_variables #ifndef MFC_SIMULATION real(kind(0d0)), allocatable, public, dimension(:) :: gammas, gs_min, pi_infs, ps_inf, cvs, qvs, qvps -!$acc declare create(gammas, gs_min, pi_infs, ps_inf, cvs, qvs, qvps) + !$acc declare create(gammas, gs_min, pi_infs, ps_inf, cvs, qvs, qvps) #endif #ifdef CRAY_ACC_WAR @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:), Gs) @:CRAY_DECLARE_GLOBAL(integer, dimension(:), bubrs) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :), Res) -!$acc declare link(bubrs, Gs, Res) + !$acc declare link(bubrs, Gs, Res) #else real(kind(0d0)), allocatable, dimension(:) :: Gs integer, allocatable, dimension(:) :: bubrs real(kind(0d0)), allocatable, dimension(:, :) :: Res -!$acc declare create(bubrs, Gs, Res) + !$acc declare create(bubrs, Gs, Res) #endif integer :: is1b, is2b, is3b, is1e, is2e, is3e !$acc declare create(is1b, is2b, is3b, is1e, is2e, is3e) @@ -458,7 +458,7 @@ contains #ifdef CRAY_ACC_WAR !DIR$ INLINEALWAYS s_convert_species_to_mixture_variables_acc #else -!$acc routine seq + !$acc routine seq #endif real(kind(0d0)), intent(OUT) :: rho_K, gamma_K, pi_inf_K, qv_K @@ -540,7 +540,7 @@ contains #ifdef CRAY_ACC_WAR !DIR$ INLINEALWAYS s_convert_species_to_mixture_variables_bubbles_acc #else -!$acc routine seq + !$acc routine seq #endif real(kind(0d0)), intent(INOUT) :: rho_K, gamma_K, pi_inf_K, qv_K diff --git a/src/simulation/m_bubbles.fpp b/src/simulation/m_bubbles.fpp index 971541770..0654ed5fe 100644 --- a/src/simulation/m_bubbles.fpp +++ b/src/simulation/m_bubbles.fpp @@ -40,7 +40,7 @@ module m_bubbles !$acc declare create(divu) @:CRAY_DECLARE_GLOBAL(integer, dimension(:), rs, vs, ms, ps) -!$acc declare link(rs, vs, ms, ps) + !$acc declare link(rs, vs, ms, ps) #else real(kind(0d0)), allocatable, dimension(:, :, :) :: bub_adv_src real(kind(0d0)), allocatable, dimension(:, :, :, :) :: bub_r_src, bub_v_src, bub_p_src, bub_m_src @@ -50,7 +50,7 @@ module m_bubbles !$acc declare create(divu) integer, allocatable, dimension(:) :: rs, vs, ms, ps -!$acc declare create(rs, vs, ms, ps) + !$acc declare create(rs, vs, ms, ps) #endif contains diff --git a/src/simulation/m_cbc.fpp b/src/simulation/m_cbc.fpp index febf24695..521bf879c 100644 --- a/src/simulation/m_cbc.fpp +++ b/src/simulation/m_cbc.fpp @@ -44,7 +44,7 @@ module m_cbc @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), q_prim_rsx_vf) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), q_prim_rsy_vf) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), q_prim_rsz_vf) -!$acc declare link(q_prim_rsx_vf, q_prim_rsy_vf, q_prim_rsz_vf) + !$acc declare link(q_prim_rsx_vf, q_prim_rsy_vf, q_prim_rsz_vf) #else real(kind(0d0)), allocatable, dimension(:, :, :, :) :: q_prim_rsx_vf real(kind(0d0)), allocatable, dimension(:, :, :, :) :: q_prim_rsy_vf @@ -53,7 +53,7 @@ module m_cbc #ifdef CRAY_ACC_WAR @:CRAY_DECLARE_GLOBAL(type(scalar_field), dimension(:), F_rs_vf, F_src_rs_vf) -!$acc declare link(F_rs_vf, F_src_rs_vf) + !$acc declare link(F_rs_vf, F_src_rs_vf) #else type(scalar_field), allocatable, dimension(:) :: F_rs_vf, F_src_rs_vf !< #endif @@ -64,7 +64,7 @@ module m_cbc @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), F_rsx_vf, F_src_rsx_vf) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), F_rsy_vf, F_src_rsy_vf) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), F_rsz_vf, F_src_rsz_vf) -!$acc declare link(F_rsx_vf, F_src_rsx_vf, F_rsy_vf, F_src_rsy_vf, F_rsz_vf, F_src_rsz_vf) + !$acc declare link(F_rsx_vf, F_src_rsx_vf, F_rsy_vf, F_src_rsy_vf, F_rsz_vf, F_src_rsz_vf) #else real(kind(0d0)), allocatable, dimension(:, :, :, :) :: F_rsx_vf, F_src_rsx_vf !< real(kind(0d0)), allocatable, dimension(:, :, :, :) :: F_rsy_vf, F_src_rsy_vf !< @@ -75,7 +75,7 @@ module m_cbc @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), flux_rsx_vf, flux_src_rsx_vf) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), flux_rsy_vf, flux_src_rsy_vf) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), flux_rsz_vf, flux_src_rsz_vf) -!$acc declare link(flux_rsx_vf, flux_src_rsx_vf, flux_rsy_vf, flux_src_rsy_vf, flux_rsz_vf, flux_src_rsz_vf) + !$acc declare link(flux_rsx_vf, flux_src_rsx_vf, flux_rsy_vf, flux_src_rsy_vf, flux_rsz_vf, flux_src_rsz_vf) #else real(kind(0d0)), allocatable, dimension(:, :, :, :) :: flux_rsx_vf, flux_src_rsx_vf !< real(kind(0d0)), allocatable, dimension(:, :, :, :) :: flux_rsy_vf, flux_src_rsy_vf @@ -90,7 +90,7 @@ module m_cbc !$acc declare create(dpres_ds) #ifdef CRAY_ACC_WAR @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:), ds) -!$acc declare link(ds) + !$acc declare link(ds) #else real(kind(0d0)), allocatable, dimension(:) :: ds !< Cell-width distribution in the s-direction #endif @@ -100,7 +100,7 @@ module m_cbc @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :), fd_coef_x) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :), fd_coef_y) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :), fd_coef_z) -!$acc declare link(fd_coef_x, fd_coef_y, fd_coef_z) + !$acc declare link(fd_coef_x, fd_coef_y, fd_coef_z) #else real(kind(0d0)), allocatable, dimension(:, :) :: fd_coef_x !< Finite diff. coefficients x-dir real(kind(0d0)), allocatable, dimension(:, :) :: fd_coef_y !< Finite diff. coefficients y-dir @@ -115,7 +115,7 @@ module m_cbc @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :), pi_coef_x) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :), pi_coef_y) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :), pi_coef_z) -!$acc declare link(pi_coef_x, pi_coef_y, pi_coef_z) + !$acc declare link(pi_coef_x, pi_coef_y, pi_coef_z) #else real(kind(0d0)), allocatable, dimension(:, :, :) :: pi_coef_x !< Polynominal interpolant coefficients in x-dir real(kind(0d0)), allocatable, dimension(:, :, :) :: pi_coef_y !< Polynominal interpolant coefficients in y-dir diff --git a/src/simulation/m_compute_cbc.fpp b/src/simulation/m_compute_cbc.fpp index 0b893d34f..d323c8b89 100644 --- a/src/simulation/m_compute_cbc.fpp +++ b/src/simulation/m_compute_cbc.fpp @@ -31,7 +31,7 @@ contains #ifdef CRAY_ACC_WAR !DIR$ INLINEALWAYS s_compute_slip_wall_L #else -!$acc routine seq + !$acc routine seq #endif real(kind(0d0)), dimension(3), intent(IN) :: lambda real(kind(0d0)), dimension(num_fluids), intent(IN) :: mf, dalpha_rho_ds, dadv_ds @@ -59,7 +59,7 @@ contains #ifdef CRAY_ACC_WAR !DIR$ INLINEALWAYS s_compute_nonreflecting_subsonic_buffer_L #else -!$acc routine seq + !$acc routine seq #endif real(kind(0d0)), dimension(3), intent(IN) :: lambda real(kind(0d0)), dimension(num_fluids), intent(IN) :: mf, dalpha_rho_ds, dadv_ds @@ -100,7 +100,7 @@ contains #ifdef CRAY_ACC_WAR !DIR$ INLINEALWAYS ss_compute_nonreflecting_subsonic_inflow_L #else -!$acc routine seq + !$acc routine seq #endif real(kind(0d0)), dimension(3), intent(IN) :: lambda real(kind(0d0)), dimension(num_fluids), intent(IN) :: mf, dalpha_rho_ds, dadv_ds @@ -126,7 +126,7 @@ contains #ifdef CRAY_ACC_WAR !DIR$ INLINEALWAYS s_compute_nonreflecting_subsonic_outflow_L #else -!$acc routine seq + !$acc routine seq #endif real(kind(0d0)), dimension(3), intent(IN) :: lambda real(kind(0d0)), dimension(num_fluids), intent(IN) :: mf, dalpha_rho_ds, dadv_ds @@ -166,7 +166,7 @@ contains #ifdef CRAY_ACC_WAR !DIR$ INLINEALWAYS s_compute_force_free_subsonic_outflow_L #else -!$acc routine seq + !$acc routine seq #endif real(kind(0d0)), dimension(3), intent(IN) :: lambda real(kind(0d0)), dimension(num_fluids), intent(IN) :: mf, dalpha_rho_ds, dadv_ds @@ -202,7 +202,7 @@ contains #ifdef CRAY_ACC_WAR !DIR$ INLINEALWAYS s_compute_constant_pressure_subsonic_outflow_L #else -!$acc routine seq + !$acc routine seq #endif real(kind(0d0)), dimension(3), intent(IN) :: lambda real(kind(0d0)), dimension(num_fluids), intent(IN) :: mf, dalpha_rho_ds, dadv_ds @@ -239,7 +239,7 @@ contains #ifdef CRAY_ACC_WAR !DIR$ INLINEALWAYS s_compute_supersonic_inflow_L #else -!$acc routine seq + !$acc routine seq #endif real(kind(0d0)), dimension(3), intent(IN) :: lambda real(kind(0d0)), dimension(num_fluids), intent(IN) :: mf, dalpha_rho_ds, dadv_ds @@ -263,7 +263,7 @@ contains #ifdef CRAY_ACC_WAR !DIR$ INLINEALWAYS s_compute_supersonic_outflow_L #else -!$acc routine seq + !$acc routine seq #endif real(kind(0d0)), dimension(3), intent(IN) :: lambda real(kind(0d0)), dimension(num_fluids), intent(IN) :: mf, dalpha_rho_ds, dadv_ds diff --git a/src/simulation/m_data_output.fpp b/src/simulation/m_data_output.fpp index 2eca61fbb..a7f9c908b 100644 --- a/src/simulation/m_data_output.fpp +++ b/src/simulation/m_data_output.fpp @@ -72,13 +72,13 @@ module m_data_output @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :), vcfl_sf) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :), ccfl_sf) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :), Rc_sf) -!$acc declare link(icfl_sf, vcfl_sf, ccfl_sf, Rc_sf) + !$acc declare link(icfl_sf, vcfl_sf, ccfl_sf, Rc_sf) #else real(kind(0d0)), allocatable, dimension(:, :, :) :: icfl_sf !< ICFL stability criterion real(kind(0d0)), allocatable, dimension(:, :, :) :: vcfl_sf !< VCFL stability criterion real(kind(0d0)), allocatable, dimension(:, :, :) :: ccfl_sf !< CCFL stability criterion real(kind(0d0)), allocatable, dimension(:, :, :) :: Rc_sf !< Rc stability criterion -!$acc declare create(icfl_sf, vcfl_sf, ccfl_sf, Rc_sf) + !$acc declare create(icfl_sf, vcfl_sf, ccfl_sf, Rc_sf) #endif real(kind(0d0)) :: icfl_max_loc, icfl_max_glb !< ICFL stability extrema on local and global grids diff --git a/src/simulation/m_derived_variables.f90 b/src/simulation/m_derived_variables.f90 index ce615ea80..d60711739 100644 --- a/src/simulation/m_derived_variables.f90 +++ b/src/simulation/m_derived_variables.f90 @@ -177,7 +177,7 @@ end subroutine s_compute_derived_variables ! --------------------------- !! @param q_sf Acceleration component subroutine s_derive_acceleration_component(i, q_prim_vf0, q_prim_vf1, & q_prim_vf2, q_prim_vf3, q_sf) ! ---------- -!DIR$ INLINEALWAYS s_derive_acceleration_component + !DIR$ INLINEALWAYS s_derive_acceleration_component integer, intent(IN) :: i type(scalar_field), dimension(sys_size), intent(IN) :: q_prim_vf0 diff --git a/src/simulation/m_fftw.fpp b/src/simulation/m_fftw.fpp index 9dd955c22..603d65ce1 100644 --- a/src/simulation/m_fftw.fpp +++ b/src/simulation/m_fftw.fpp @@ -55,12 +55,12 @@ module m_fftw @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:), data_real_gpu) @:CRAY_DECLARE_GLOBAL(complex(kind(0d0)), dimension(:), data_cmplx_gpu) @:CRAY_DECLARE_GLOBAL(complex(kind(0d0)), dimension(:), data_fltr_cmplx_gpu) -!$acc declare link(data_real_gpu, data_cmplx_gpu, data_fltr_cmplx_gpu) + !$acc declare link(data_real_gpu, data_cmplx_gpu, data_fltr_cmplx_gpu) #else real(kind(0d0)), allocatable :: data_real_gpu(:) complex(kind(0d0)), allocatable :: data_cmplx_gpu(:) complex(kind(0d0)), allocatable :: data_fltr_cmplx_gpu(:) -!$acc declare create(data_real_gpu, data_cmplx_gpu, data_fltr_cmplx_gpu) + !$acc declare create(data_real_gpu, data_cmplx_gpu, data_fltr_cmplx_gpu) #endif #if defined(__PGI) @@ -99,8 +99,8 @@ contains gpu_fft_size(1) = real_size; iembed(1) = 0 oembed(1) = 0 -!$acc enter data copyin(real_size, cmplx_size, x_size, sys_size, batch_size, Nfq) -!$acc update device(real_size, cmplx_size, x_size, sys_size, batch_size) + !$acc enter data copyin(real_size, cmplx_size, x_size, sys_size, batch_size, Nfq) + !$acc update device(real_size, cmplx_size, x_size, sys_size, batch_size) #else ! Allocate input and output DFT data sizes fftw_real_data = fftw_alloc_real(int(real_size, c_size_t)) diff --git a/src/simulation/m_global_parameters.fpp b/src/simulation/m_global_parameters.fpp index 64a56c5e5..4b79e741b 100644 --- a/src/simulation/m_global_parameters.fpp +++ b/src/simulation/m_global_parameters.fpp @@ -88,10 +88,10 @@ module m_global_parameters real(kind(0d0)) :: dt !< Size of the time-step #ifdef CRAY_ACC_WAR -!$acc declare link(x_cb, y_cb, z_cb, x_cc, y_cc, z_cc, dx, dy, dz) -!$acc declare create(m, n, p, dt) + !$acc declare link(x_cb, y_cb, z_cb, x_cc, y_cc, z_cc, dx, dy, dz) + !$acc declare create(m, n, p, dt) #else -!$acc declare create(x_cb, y_cb, z_cb, x_cc, y_cc, z_cc, dx, dy, dz, dt, m, n, p) + !$acc declare create(x_cb, y_cb, z_cb, x_cc, y_cc, z_cc, dx, dy, dz, dt, m, n, p) #endif !> @name Starting time-step iteration, stopping time-step iteration and the number !! of time-step iterations between successive solution backups, respectively @@ -212,10 +212,10 @@ module m_global_parameters #endif !> @} #ifdef CRAY_ACC_WAR -!$acc declare create(Re_size) -!$acc declare link(Re_idx) + !$acc declare create(Re_size) + !$acc declare link(Re_idx) #else -!$acc declare create(Re_size, Re_idx) + !$acc declare create(Re_size, Re_idx) #endif ! The WENO average (WA) flag regulates whether the calculation of any cell- @@ -321,12 +321,12 @@ module m_global_parameters @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:), weight) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:), R0) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:), V0) -!$acc declare link(weight, R0, V0) + !$acc declare link(weight, R0, V0) #else real(kind(0d0)), dimension(:), allocatable :: weight !< Simpson quadrature weights real(kind(0d0)), dimension(:), allocatable :: R0 !< Bubble sizes real(kind(0d0)), dimension(:), allocatable :: V0 !< Bubble velocities -!$acc declare create(weight, R0, V0) + !$acc declare create(weight, R0, V0) #endif logical :: bubbles !< Bubbles on/off logical :: polytropic !< Polytropic switch @@ -336,10 +336,10 @@ module m_global_parameters integer :: thermal !< Thermal behavior. 1 = adiabatic, 2 = isotherm, 3 = transfer #ifdef CRAY_ACC_WAR @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :), ptil) -!$acc declare link(ptil) + !$acc declare link(ptil) #else real(kind(0d0)), allocatable, dimension(:, :, :) :: ptil !< Pressure modification -!$acc declare create(ptil) + !$acc declare create(ptil) #endif real(kind(0d0)) :: poly_sigma !< log normal sigma for polydisperse PDF @@ -358,11 +358,11 @@ module m_global_parameters #ifdef CRAY_ACC_WAR @:CRAY_DECLARE_GLOBAL(type(scalar_field), dimension(:), mom_sp) @:CRAY_DECLARE_GLOBAL(type(scalar_field), dimension(:, :, :), mom_3d) -!$acc declare link(mom_sp, mom_3d) + !$acc declare link(mom_sp, mom_3d) #else type(scalar_field), allocatable, dimension(:) :: mom_sp type(scalar_field), allocatable, dimension(:, :, :) :: mom_3d -!$acc declare create(mom_sp, mom_3d) + !$acc declare create(mom_sp, mom_3d) #endif !> @} @@ -373,11 +373,11 @@ module m_global_parameters #ifdef CRAY_ACC_WAR @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:), k_n, k_v, pb0, mass_n0, mass_v0, Pe_T) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:), Re_trans_T, Re_trans_c, Im_trans_T, Im_trans_c, omegaN) -!$acc declare link( k_n, k_v, pb0, mass_n0, mass_v0, Pe_T, Re_trans_T, Re_trans_c, Im_trans_T, Im_trans_c, omegaN) + !$acc declare link( k_n, k_v, pb0, mass_n0, mass_v0, Pe_T, Re_trans_T, Re_trans_c, Im_trans_T, Im_trans_c, omegaN) #else real(kind(0d0)), dimension(:), allocatable :: k_n, k_v, pb0, mass_n0, mass_v0, Pe_T real(kind(0d0)), dimension(:), allocatable :: Re_trans_T, Re_trans_c, Im_trans_T, Im_trans_c, omegaN -!$acc declare create( k_n, k_v, pb0, mass_n0, mass_v0, Pe_T, Re_trans_T, Re_trans_c, Im_trans_T, Im_trans_c, omegaN) + !$acc declare create( k_n, k_v, pb0, mass_n0, mass_v0, Pe_T, Re_trans_T, Re_trans_c, Im_trans_T, Im_trans_c, omegaN) #endif real(kind(0d0)) :: mul0, ss, gamma_v, mu_v real(kind(0d0)) :: gamma_m, gamma_n, mu_n @@ -404,10 +404,10 @@ module m_global_parameters #ifdef CRAY_ACC_WAR @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:), gammas, gs_min, pi_infs, ps_inf, cvs, qvs, qvps) -!$acc declare link(gammas, gs_min, pi_infs, ps_inf, cvs, qvs, qvps) + !$acc declare link(gammas, gs_min, pi_infs, ps_inf, cvs, qvs, qvps) #else real(kind(0d0)), allocatable, dimension(:) :: gammas, gs_min, pi_infs, ps_inf, cvs, qvs, qvps -!$acc declare create(gammas, gs_min, pi_infs, ps_inf, cvs, qvs, qvps) + !$acc declare create(gammas, gs_min, pi_infs, ps_inf, cvs, qvs, qvps) #endif real(kind(0d0)) :: mytime !< Current simulation time @@ -419,13 +419,13 @@ module m_global_parameters @:CRAY_DECLARE_GLOBAL(type(pres_field), dimension(:), mv_ts) -!$acc declare link(pb_ts, mv_ts) + !$acc declare link(pb_ts, mv_ts) #else type(pres_field), allocatable, dimension(:) :: pb_ts type(pres_field), allocatable, dimension(:) :: mv_ts -!$acc declare create(pb_ts, mv_ts) + !$acc declare create(pb_ts, mv_ts) #endif ! ====================================================================== diff --git a/src/simulation/m_hypoelastic.fpp b/src/simulation/m_hypoelastic.fpp index 5e8f9d2e9..48951541e 100644 --- a/src/simulation/m_hypoelastic.fpp +++ b/src/simulation/m_hypoelastic.fpp @@ -32,7 +32,7 @@ module m_hypoelastic !$acc declare link(du_dx,du_dy,du_dz,dv_dx,dv_dy,dv_dz,dw_dx,dw_dy,dw_dz) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :), rho_K_field, G_K_field) -!$acc declare link(rho_K_field, G_K_field) + !$acc declare link(rho_K_field, G_K_field) #else real(kind(0d0)), allocatable, dimension(:) :: Gs !$acc declare create(Gs) @@ -43,7 +43,7 @@ module m_hypoelastic !$acc declare create(du_dx,du_dy,du_dz,dv_dx,dv_dy,dv_dz,dw_dx,dw_dy,dw_dz) real(kind(0d0)), allocatable, dimension(:, :, :) :: rho_K_field, G_K_field -!$acc declare create(rho_K_field, G_K_field) + !$acc declare create(rho_K_field, G_K_field) #endif diff --git a/src/simulation/m_ibm.fpp b/src/simulation/m_ibm.fpp index e9620352b..446038197 100644 --- a/src/simulation/m_ibm.fpp +++ b/src/simulation/m_ibm.fpp @@ -44,7 +44,7 @@ module m_ibm @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :, :), levelset_norm) @:CRAY_DECLARE_GLOBAL(type(ghost_point), dimension(:), ghost_points) -!$acc declare link(levelset, levelset_norm, ghost_points) + !$acc declare link(levelset, levelset_norm, ghost_points) #else !! Marker for solid cells. 0 if liquid, the patch id of its IB if solid @@ -55,7 +55,7 @@ module m_ibm type(ghost_point), dimension(:), allocatable :: ghost_points !! Matrix of normal vector to IB -!$acc declare create(levelset, levelset_norm, ghost_points) + !$acc declare create(levelset, levelset_norm, ghost_points) #endif integer :: gp_layers !< Number of ghost point layers diff --git a/src/simulation/m_monopole.fpp b/src/simulation/m_monopole.fpp index 431e14a18..3c316d07e 100644 --- a/src/simulation/m_monopole.fpp +++ b/src/simulation/m_monopole.fpp @@ -37,7 +37,7 @@ module m_monopole !$acc declare link(mono_mass_src, mono_e_src) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), mono_mom_src) -!$acc declare link(mono_mom_src) + !$acc declare link(mono_mom_src) #else integer, allocatable, dimension(:) :: pulse, support @@ -57,7 +57,7 @@ module m_monopole real(kind(0d0)), allocatable, dimension(:, :, :) :: mono_mass_src, mono_e_src real(kind(0d0)), allocatable, dimension(:, :, :, :) :: mono_mom_src !> @} -!$acc declare create(mono_mass_src, mono_e_src, mono_mom_src) + !$acc declare create(mono_mass_src, mono_e_src, mono_mom_src) #endif diff --git a/src/simulation/m_mpi_proxy.fpp b/src/simulation/m_mpi_proxy.fpp index 2ca830bad..7245af395 100644 --- a/src/simulation/m_mpi_proxy.fpp +++ b/src/simulation/m_mpi_proxy.fpp @@ -34,7 +34,7 @@ module m_mpi_proxy @:CRAY_DECLARE_GLOBAL(integer, dimension(:), ib_buff_send) @:CRAY_DECLARE_GLOBAL(integer, dimension(:), ib_buff_recv) -!$acc declare link(q_cons_buff_recv, q_cons_buff_send, ib_buff_send, ib_buff_recv) + !$acc declare link(q_cons_buff_recv, q_cons_buff_send, ib_buff_send, ib_buff_recv) #else real(kind(0d0)), private, allocatable, dimension(:) :: q_cons_buff_send !< !! This variable is utilized to pack and send the buffer of the cell-average @@ -56,7 +56,7 @@ module m_mpi_proxy !! immersed boundary markers, for a single computational domain boundary !! at the time, from the relevant neighboring processor. -!$acc declare create(q_cons_buff_send, q_cons_buff_recv, ib_buff_send, ib_buff_recv) + !$acc declare create(q_cons_buff_send, q_cons_buff_recv, ib_buff_send, ib_buff_recv) #endif !> @name Generic flags used to identify and report MPI errors !> @{ @@ -120,7 +120,7 @@ contains v_size = sys_size end if -!$acc update device(v_size) + !$acc update device(v_size) #endif diff --git a/src/simulation/m_qbmm.fpp b/src/simulation/m_qbmm.fpp index 02b9f2075..5e91d24cb 100644 --- a/src/simulation/m_qbmm.fpp +++ b/src/simulation/m_qbmm.fpp @@ -28,10 +28,10 @@ module m_qbmm #ifdef CRAY_ACC_WAR @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :, :), momrhs) -!$acc declare link(momrhs) + !$acc declare link(momrhs) #else real(kind(0d0)), allocatable, dimension(:, :, :, :, :) :: momrhs -!$acc declare create(momrhs) + !$acc declare create(momrhs) #endif #:if MFC_CASE_OPTIMIZATION integer, parameter :: nterms = ${nterms}$ @@ -46,11 +46,11 @@ module m_qbmm #ifdef CRAY_ACC_WAR @:CRAY_DECLARE_GLOBAL(integer, dimension(:), bubrs) @:CRAY_DECLARE_GLOBAL(integer, dimension(:, :), bubmoms) -!$acc declare link(bubrs, bubmoms) + !$acc declare link(bubrs, bubmoms) #else integer, allocatable, dimension(:) :: bubrs integer, allocatable, dimension(:, :) :: bubmoms -!$acc declare create(bubrs, bubmoms) + !$acc declare create(bubrs, bubmoms) #endif contains @@ -668,7 +668,7 @@ contains #ifdef CRAY_ACC_WAR !DIR$ INLINEALWAYS s_coeff_nonpoly #else -!$acc routine seq + !$acc routine seq #endif real(kind(0.d0)), intent(IN) :: pres, rho, c real(kind(0.d0)), dimension(nterms, 0:2, 0:2), intent(OUT) :: coeffs @@ -740,7 +740,7 @@ contains #ifdef CRAY_ACC_WAR !DIR$ INLINEALWAYS s_coeff #else -!$acc routine seq + !$acc routine seq #endif real(kind(0.d0)), intent(INOUT) :: pres, rho, c @@ -1018,7 +1018,7 @@ contains #ifdef CRAY_ACC_WAR !DIR$ INLINEALWAYS s_chyqmom #else -!$acc routine seq + !$acc routine seq #endif real(kind(0d0)), dimension(nnode), intent(INOUT) :: wght, abscX, abscY real(kind(0d0)), dimension(nmom), intent(IN) :: momin @@ -1085,7 +1085,7 @@ contains #ifdef CRAY_ACC_WAR !DIR$ INLINEALWAYS s_hyqmom #else -!$acc routine seq + !$acc routine seq #endif real(kind(0d0)), dimension(2), intent(INOUT) :: frho, fup real(kind(0d0)), dimension(3), intent(IN) :: fmom diff --git a/src/simulation/m_rhs.fpp b/src/simulation/m_rhs.fpp index 62b61aceb..ac90d20b9 100644 --- a/src/simulation/m_rhs.fpp +++ b/src/simulation/m_rhs.fpp @@ -79,10 +79,10 @@ module m_rhs !> @{ #ifdef CRAY_ACC_WAR @:CRAY_DECLARE_GLOBAL(type(vector_field), dimension(:), dq_prim_dx_qp, dq_prim_dy_qp, dq_prim_dz_qp) -!$acc declare link(dq_prim_dx_qp, dq_prim_dy_qp, dq_prim_dz_qp) + !$acc declare link(dq_prim_dx_qp, dq_prim_dy_qp, dq_prim_dz_qp) #else type(vector_field), allocatable, dimension(:) :: dq_prim_dx_qp, dq_prim_dy_qp, dq_prim_dz_qp -!$acc declare create(dq_prim_dx_qp, dq_prim_dy_qp, dq_prim_dz_qp) + !$acc declare create(dq_prim_dx_qp, dq_prim_dy_qp, dq_prim_dz_qp) #endif !> @name The left and right WENO-reconstructed cell-boundary values of the cell- @@ -93,13 +93,13 @@ module m_rhs #ifdef CRAY_ACC_WAR @:CRAY_DECLARE_GLOBAL(type(vector_field), dimension(:), dqL_prim_dx_n, dqL_prim_dy_n, dqL_prim_dz_n) @:CRAY_DECLARE_GLOBAL(type(vector_field), dimension(:), dqR_prim_dx_n, dqR_prim_dy_n, dqR_prim_dz_n) -!$acc declare link(dqL_prim_dx_n, dqL_prim_dy_n, dqL_prim_dz_n) -!$acc declare link(dqR_prim_dx_n, dqR_prim_dy_n, dqR_prim_dz_n) + !$acc declare link(dqL_prim_dx_n, dqL_prim_dy_n, dqL_prim_dz_n) + !$acc declare link(dqR_prim_dx_n, dqR_prim_dy_n, dqR_prim_dz_n) #else type(vector_field), allocatable, dimension(:) :: dqL_prim_dx_n, dqL_prim_dy_n, dqL_prim_dz_n type(vector_field), allocatable, dimension(:) :: dqR_prim_dx_n, dqR_prim_dy_n, dqR_prim_dz_n -!$acc declare create(dqL_prim_dx_n, dqL_prim_dy_n, dqL_prim_dz_n) -!$acc declare create(dqR_prim_dx_n, dqR_prim_dy_n, dqR_prim_dz_n) + !$acc declare create(dqL_prim_dx_n, dqL_prim_dy_n, dqL_prim_dz_n) + !$acc declare create(dqR_prim_dx_n, dqR_prim_dy_n, dqR_prim_dz_n) #endif !> @} @@ -116,11 +116,11 @@ module m_rhs #ifdef CRAY_ACC_WAR @:CRAY_DECLARE_GLOBAL(type(vector_field), dimension(:), gm_alphaL_n) @:CRAY_DECLARE_GLOBAL(type(vector_field), dimension(:), gm_alphaR_n) -!$acc declare link(gm_alphaL_n, gm_alphaR_n) + !$acc declare link(gm_alphaL_n, gm_alphaR_n) #else type(vector_field), allocatable, dimension(:) :: gm_alphaL_n type(vector_field), allocatable, dimension(:) :: gm_alphaR_n -!$acc declare create(gm_alphaL_n, gm_alphaR_n) + !$acc declare create(gm_alphaL_n, gm_alphaR_n) #endif !> @} @@ -132,21 +132,21 @@ module m_rhs @:CRAY_DECLARE_GLOBAL(type(vector_field), dimension(:), flux_n) @:CRAY_DECLARE_GLOBAL(type(vector_field), dimension(:), flux_src_n) @:CRAY_DECLARE_GLOBAL(type(vector_field), dimension(:), flux_gsrc_n) -!$acc declare link(flux_n, flux_src_n, flux_gsrc_n) + !$acc declare link(flux_n, flux_src_n, flux_gsrc_n) #else type(vector_field), allocatable, dimension(:) :: flux_n type(vector_field), allocatable, dimension(:) :: flux_src_n type(vector_field), allocatable, dimension(:) :: flux_gsrc_n -!$acc declare create(flux_n, flux_src_n, flux_gsrc_n) + !$acc declare create(flux_n, flux_src_n, flux_gsrc_n) #endif !> @} #ifdef CRAY_ACC_WAR @:CRAY_DECLARE_GLOBAL(type(vector_field), dimension(:), qL_prim, qR_prim) -!$acc declare link(qL_prim, qR_prim) + !$acc declare link(qL_prim, qR_prim) #else type(vector_field), allocatable, dimension(:) :: qL_prim, qR_prim -!$acc declare create(qL_prim, qR_prim) + !$acc declare create(qL_prim, qR_prim) #endif type(int_bounds_info) :: iv !< Vector field indical bounds @@ -174,41 +174,41 @@ module m_rhs @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :), blkmod1, blkmod2, alpha1, alpha2, Kterm) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), qL_rsx_vf, qL_rsy_vf, qL_rsz_vf, qR_rsx_vf, qR_rsy_vf, qR_rsz_vf) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), dqL_rsx_vf, dqL_rsy_vf, dqL_rsz_vf, dqR_rsx_vf, dqR_rsy_vf, dqR_rsz_vf) -!$acc declare link(blkmod1, blkmod2, alpha1, alpha2, Kterm) -!$acc declare link(qL_rsx_vf, qL_rsy_vf, qL_rsz_vf, qR_rsx_vf, qR_rsy_vf, qR_rsz_vf) -!$acc declare link(dqL_rsx_vf, dqL_rsy_vf, dqL_rsz_vf, dqR_rsx_vf, dqR_rsy_vf, dqR_rsz_vf) + !$acc declare link(blkmod1, blkmod2, alpha1, alpha2, Kterm) + !$acc declare link(qL_rsx_vf, qL_rsy_vf, qL_rsz_vf, qR_rsx_vf, qR_rsy_vf, qR_rsz_vf) + !$acc declare link(dqL_rsx_vf, dqL_rsy_vf, dqL_rsz_vf, dqR_rsx_vf, dqR_rsy_vf, dqR_rsz_vf) #else real(kind(0d0)), allocatable, dimension(:, :, :) :: blkmod1, blkmod2, alpha1, alpha2, Kterm real(kind(0d0)), allocatable, dimension(:, :, :, :) :: qL_rsx_vf, qL_rsy_vf, qL_rsz_vf, qR_rsx_vf, qR_rsy_vf, qR_rsz_vf real(kind(0d0)), allocatable, dimension(:, :, :, :) :: dqL_rsx_vf, dqL_rsy_vf, dqL_rsz_vf, dqR_rsx_vf, dqR_rsy_vf, dqR_rsz_vf -!$acc declare create(blkmod1, blkmod2, alpha1, alpha2, Kterm) -!$acc declare create(qL_rsx_vf, qL_rsy_vf, qL_rsz_vf, qR_rsx_vf, qR_rsy_vf, qR_rsz_vf) -!$acc declare create(dqL_rsx_vf, dqL_rsy_vf, dqL_rsz_vf, dqR_rsx_vf, dqR_rsy_vf, dqR_rsz_vf) + !$acc declare create(blkmod1, blkmod2, alpha1, alpha2, Kterm) + !$acc declare create(qL_rsx_vf, qL_rsy_vf, qL_rsz_vf, qR_rsx_vf, qR_rsy_vf, qR_rsz_vf) + !$acc declare create(dqL_rsx_vf, dqL_rsy_vf, dqL_rsz_vf, dqR_rsx_vf, dqR_rsy_vf, dqR_rsz_vf) #endif #ifdef CRAY_ACC_WAR @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:), gamma_min, pres_inf) -!$acc declare link(gamma_min, pres_inf) + !$acc declare link(gamma_min, pres_inf) #else real(kind(0d0)), allocatable, dimension(:) :: gamma_min, pres_inf -!$acc declare create(gamma_min, pres_inf) + !$acc declare create(gamma_min, pres_inf) #endif #ifdef CRAY_ACC_WAR @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :), Res) -!$acc declare link(Res) + !$acc declare link(Res) #else real(kind(0d0)), allocatable, dimension(:, :) :: Res -!$acc declare create(Res) + !$acc declare create(Res) #endif #ifdef CRAY_ACC_WAR @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :), nbub) -!$acc declare link(nbub) + !$acc declare link(nbub) #else real(kind(0d0)), allocatable, dimension(:, :, :) :: nbub !< Bubble number density -!$acc declare create(nbub) + !$acc declare create(nbub) #endif contains diff --git a/src/simulation/m_riemann_solvers.fpp b/src/simulation/m_riemann_solvers.fpp index 34268775b..d7b85e3f6 100644 --- a/src/simulation/m_riemann_solvers.fpp +++ b/src/simulation/m_riemann_solvers.fpp @@ -160,14 +160,14 @@ module m_riemann_solvers @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), flux_rsx_vf, flux_src_rsx_vf) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), flux_rsy_vf, flux_src_rsy_vf) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), flux_rsz_vf, flux_src_rsz_vf) -!$acc declare link( flux_rsx_vf, flux_src_rsx_vf, flux_rsy_vf, & -!$acc flux_src_rsy_vf, flux_rsz_vf, flux_src_rsz_vf ) + !$acc declare link( flux_rsx_vf, flux_src_rsx_vf, flux_rsy_vf, & + !$acc flux_src_rsy_vf, flux_rsz_vf, flux_src_rsz_vf ) #else real(kind(0d0)), allocatable, dimension(:, :, :, :) :: flux_rsx_vf, flux_src_rsx_vf real(kind(0d0)), allocatable, dimension(:, :, :, :) :: flux_rsy_vf, flux_src_rsy_vf real(kind(0d0)), allocatable, dimension(:, :, :, :) :: flux_rsz_vf, flux_src_rsz_vf -!$acc declare create( flux_rsx_vf, flux_src_rsx_vf, flux_rsy_vf, & -!$acc flux_src_rsy_vf, flux_rsz_vf, flux_src_rsz_vf ) + !$acc declare create( flux_rsx_vf, flux_src_rsx_vf, flux_rsy_vf, & + !$acc flux_src_rsy_vf, flux_rsz_vf, flux_src_rsz_vf ) #endif !> @} @@ -179,12 +179,12 @@ module m_riemann_solvers @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), flux_gsrc_rsx_vf) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), flux_gsrc_rsy_vf) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), flux_gsrc_rsz_vf) -!$acc declare link( flux_gsrc_rsx_vf, flux_gsrc_rsy_vf, flux_gsrc_rsz_vf ) + !$acc declare link( flux_gsrc_rsx_vf, flux_gsrc_rsy_vf, flux_gsrc_rsz_vf ) #else real(kind(0d0)), allocatable, dimension(:, :, :, :) :: flux_gsrc_rsx_vf !< real(kind(0d0)), allocatable, dimension(:, :, :, :) :: flux_gsrc_rsy_vf !< real(kind(0d0)), allocatable, dimension(:, :, :, :) :: flux_gsrc_rsz_vf !< -!$acc declare create( flux_gsrc_rsx_vf, flux_gsrc_rsy_vf, flux_gsrc_rsz_vf ) + !$acc declare create( flux_gsrc_rsx_vf, flux_gsrc_rsy_vf, flux_gsrc_rsz_vf ) #endif !> @} @@ -194,36 +194,36 @@ module m_riemann_solvers @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), vel_src_rsx_vf) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), vel_src_rsy_vf) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), vel_src_rsz_vf) -!$acc declare link(vel_src_rsx_vf, vel_src_rsy_vf, vel_src_rsz_vf) + !$acc declare link(vel_src_rsx_vf, vel_src_rsy_vf, vel_src_rsz_vf) #else real(kind(0d0)), allocatable, dimension(:, :, :, :) :: vel_src_rsx_vf real(kind(0d0)), allocatable, dimension(:, :, :, :) :: vel_src_rsy_vf real(kind(0d0)), allocatable, dimension(:, :, :, :) :: vel_src_rsz_vf -!$acc declare create(vel_src_rsx_vf, vel_src_rsy_vf, vel_src_rsz_vf) + !$acc declare create(vel_src_rsx_vf, vel_src_rsy_vf, vel_src_rsz_vf) #endif #ifdef CRAY_ACC_WAR @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), mom_sp_rsx_vf) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), mom_sp_rsy_vf) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), mom_sp_rsz_vf) -!$acc declare link(mom_sp_rsx_vf, mom_sp_rsy_vf, mom_sp_rsz_vf) + !$acc declare link(mom_sp_rsx_vf, mom_sp_rsy_vf, mom_sp_rsz_vf) #else real(kind(0d0)), allocatable, dimension(:, :, :, :) :: mom_sp_rsx_vf real(kind(0d0)), allocatable, dimension(:, :, :, :) :: mom_sp_rsy_vf real(kind(0d0)), allocatable, dimension(:, :, :, :) :: mom_sp_rsz_vf -!$acc declare create(mom_sp_rsx_vf, mom_sp_rsy_vf, mom_sp_rsz_vf) + !$acc declare create(mom_sp_rsx_vf, mom_sp_rsy_vf, mom_sp_rsz_vf) #endif #ifdef CRAY_ACC_WAR @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), Re_avg_rsx_vf) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), Re_avg_rsy_vf) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), Re_avg_rsz_vf) -!$acc declare link(Re_avg_rsx_vf, Re_avg_rsy_vf, Re_avg_rsz_vf) + !$acc declare link(Re_avg_rsx_vf, Re_avg_rsy_vf, Re_avg_rsz_vf) #else real(kind(0d0)), allocatable, dimension(:, :, :, :) :: Re_avg_rsx_vf real(kind(0d0)), allocatable, dimension(:, :, :, :) :: Re_avg_rsy_vf real(kind(0d0)), allocatable, dimension(:, :, :, :) :: Re_avg_rsz_vf -!$acc declare link(Re_avg_rsx_vf, Re_avg_rsy_vf, Re_avg_rsz_vf) + !$acc declare link(Re_avg_rsx_vf, Re_avg_rsy_vf, Re_avg_rsz_vf) #endif procedure(s_abstract_riemann_solver), & @@ -246,18 +246,18 @@ module m_riemann_solvers #ifdef CRAY_ACC_WAR @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:), Gs) -!$acc declare link(Gs) + !$acc declare link(Gs) #else real(kind(0d0)), allocatable, dimension(:) :: Gs -!$acc declare create(Gs) + !$acc declare create(Gs) #endif #ifdef CRAY_ACC_WAR @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :), Res) -!$acc declare link(Res) + !$acc declare link(Res) #else real(kind(0d0)), allocatable, dimension(:, :) :: Res -!$acc declare create(Res) + !$acc declare create(Res) #endif contains diff --git a/src/simulation/m_time_steppers.fpp b/src/simulation/m_time_steppers.fpp index 7d820a026..0cd9610cb 100644 --- a/src/simulation/m_time_steppers.fpp +++ b/src/simulation/m_time_steppers.fpp @@ -54,7 +54,7 @@ module m_time_steppers integer, private :: num_ts !< !! Number of time stages in the time-stepping scheme -!$acc declare link(q_cons_ts,q_prim_vf,rhs_vf,q_prim_ts, rhs_mv, rhs_pb) + !$acc declare link(q_cons_ts,q_prim_vf,rhs_vf,q_prim_ts, rhs_mv, rhs_pb) #else type(vector_field), allocatable, dimension(:) :: q_cons_ts !< !! Cell-average conservative variables at each time-stage (TS) @@ -75,7 +75,7 @@ module m_time_steppers integer, private :: num_ts !< !! Number of time stages in the time-stepping scheme -!$acc declare create(q_cons_ts,q_prim_vf,rhs_vf,q_prim_ts, rhs_mv, rhs_pb) + !$acc declare create(q_cons_ts,q_prim_vf,rhs_vf,q_prim_ts, rhs_mv, rhs_pb) #endif contains diff --git a/src/simulation/m_viscous.fpp b/src/simulation/m_viscous.fpp index bce3fa8df..3851a289a 100644 --- a/src/simulation/m_viscous.fpp +++ b/src/simulation/m_viscous.fpp @@ -29,18 +29,18 @@ module m_viscous #ifdef CRAY_ACC_WAR @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :), Res_viscous) -!$acc declare link(Res_viscous) + !$acc declare link(Res_viscous) #else real(kind(0d0)), allocatable, dimension(:, :) :: Res_viscous -!$acc declare create(Re_viscous) + !$acc declare create(Re_viscous) #endif #ifdef CRAY_ACC_WAR @:CRAY_DECLARE_GLOBAL(type(scalar_field), dimension(:), tau_Re_vf) -!$acc declare link(tau_Re_vf) + !$acc declare link(tau_Re_vf) #else type(scalar_field), allocatable, dimension(:) :: tau_Re_vf -!$acc declare create(tau_Re_vf) + !$acc declare create(tau_Re_vf) #endif contains diff --git a/src/simulation/m_weno.fpp b/src/simulation/m_weno.fpp index 21b0ea1e1..4c27f3db2 100644 --- a/src/simulation/m_weno.fpp +++ b/src/simulation/m_weno.fpp @@ -42,7 +42,7 @@ module m_weno #ifdef CRAY_ACC_WAR @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :, :), v_rs_ws_x, v_rs_ws_y, v_rs_ws_z) -!$acc declare link(v_rs_ws_x, v_rs_ws_y, v_rs_ws_z) + !$acc declare link(v_rs_ws_x, v_rs_ws_y, v_rs_ws_z) #else real(kind(0d0)), allocatable, dimension(:, :, :, :) :: v_rs_ws_x, v_rs_ws_y, v_rs_ws_z #endif @@ -64,8 +64,8 @@ module m_weno @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :), poly_coef_cbR_x) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :), poly_coef_cbR_y) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :), poly_coef_cbR_z) -!$acc declare link(poly_coef_cbL_x, poly_coef_cbL_y, poly_coef_cbL_z) -!$acc declare link(poly_coef_cbR_x, poly_coef_cbR_y, poly_coef_cbR_z) + !$acc declare link(poly_coef_cbL_x, poly_coef_cbL_y, poly_coef_cbL_z) + !$acc declare link(poly_coef_cbR_x, poly_coef_cbR_y, poly_coef_cbR_z) #else real(kind(0d0)), target, allocatable, dimension(:, :, :) :: poly_coef_cbL_x real(kind(0d0)), target, allocatable, dimension(:, :, :) :: poly_coef_cbL_y @@ -93,7 +93,7 @@ module m_weno @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :), d_cbR_x) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :), d_cbR_y) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :), d_cbR_z) -!$acc declare link(d_cbL_x, d_cbL_y, d_cbL_z, d_cbR_x, d_cbR_y, d_cbR_z) + !$acc declare link(d_cbL_x, d_cbL_y, d_cbL_z, d_cbR_x, d_cbR_y, d_cbR_z) #else real(kind(0d0)), target, allocatable, dimension(:, :) :: d_cbL_x real(kind(0d0)), target, allocatable, dimension(:, :) :: d_cbL_y @@ -116,7 +116,7 @@ module m_weno @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :), beta_coef_x) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :), beta_coef_y) @:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :), beta_coef_z) -!$acc declare link(beta_coef_x, beta_coef_y, beta_coef_z) + !$acc declare link(beta_coef_x, beta_coef_y, beta_coef_z) #else real(kind(0d0)), target, allocatable, dimension(:, :, :) :: beta_coef_x real(kind(0d0)), target, allocatable, dimension(:, :, :) :: beta_coef_y diff --git a/toolchain/indenter.py b/toolchain/indenter.py index f09e29b0a..bea485c18 100644 --- a/toolchain/indenter.py +++ b/toolchain/indenter.py @@ -15,9 +15,10 @@ def main(): adjust_indentation(filepath, temp_filepath) os.replace(temp_filepath, filepath) -BLOCK_STARTERS = ('if', 'do', '#:if', '#:else') -BLOCK_ENDERS = ('end', 'contains', 'else', '#:end', '#:else') +BLOCK_STARTERS = ('if', 'do', '#:if', '#:else', "#ifdef", "#else") +BLOCK_ENDERS = ('end', 'contains', 'else', '#:end', '#:else', '#else', '#endif') LOOP_DIRECTIVES = ('!$acc loop', '!$acc parallel loop') +INDENTERS = ('!DIR', '!$acc') # pylint: disable=too-many-branches def adjust_indentation(input_file, output_file): @@ -33,7 +34,7 @@ def adjust_indentation(input_file, output_file): # loop through file # pylint: disable=consider-using-enumerate for i in range(len(lines)): - if lines[i].lstrip().startswith('!$acc') and i + 1 < len(lines): + if lines[i].lstrip().startswith(INDENTERS) and i + 1 < len(lines): j = i + 1 empty_lines = 0 # look down to see how to indent a line @@ -45,7 +46,7 @@ def adjust_indentation(input_file, output_file): elif lines[j].strip() == '': empty_lines += 1 # indent acc lines - elif not lines[j].lstrip().startswith('!$acc'): + elif not lines[j].lstrip().startswith(INDENTERS): indent = len(lines[j]) - len(lines[j].lstrip()) lines[i] = ' ' * indent + lines[i].lstrip() break