Skip to content

Commit 87076dc

Browse files
committed
fix
1 parent 8a09731 commit 87076dc

File tree

7 files changed

+43
-42
lines changed

7 files changed

+43
-42
lines changed

src/common/m_helper.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ contains
526526
!! at x with inputs l and m
527527
!! @param x is the input value
528528
!! @param l is the degree
529-
!! @param m is the order
529+
!! @param m_order is the order
530530
!! @return P is the associated legendre polynomial evaluated at x
531531
pure recursive function associated_legendre(x, l, m_order) result(result_P)
532532

src/pre_process/m_patches.fpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,8 @@ contains
471471
type(scalar_field), dimension(1:sys_size), intent(inout) :: q_prim_vf
472472
logical, optional, intent(in) :: ib_flag
473473

474-
real(wp) :: x0, y0, f, x_act, y_act, ca_in, pa, ma, ta, theta, xa, yt, xu, yu, xl, yl, xc, yc, dycdxc, sin_c, cos_c
474+
real(wp) :: x0, y0, f, x_act, y_act, ca_in, pa, ma, ta, theta
475+
real(wp) :: xa, yt, xu, yu, xl, yl, xc, yc, dycdxc, sin_c, cos_c
475476
integer :: i, j, k
476477
integer :: Np1, Np2
477478

src/simulation/m_cbc.fpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ contains
649649
real(wp), dimension(contxe) :: alpha_rho, dalpha_rho_ds, mf
650650
real(wp), dimension(2) :: Re_cbc
651651
real(wp), dimension(num_vels) :: vel, dvel_ds
652-
real(wp), dimension(num_fluids) :: adv, dadv_ds
652+
real(wp), dimension(num_fluids) :: adv_local, dadv_ds
653653
real(wp), dimension(sys_size) :: L
654654
real(wp), dimension(3) :: lambda
655655
@@ -769,7 +769,7 @@ contains
769769
end if
770770
771771
! FD2 or FD4 of RHS at j = 0
772-
$:GPU_PARALLEL_LOOP(collapse=2, private='[alpha_rho, vel, adv, &
772+
$:GPU_PARALLEL_LOOP(collapse=2, private='[alpha_rho, vel, adv_local, &
773773
& mf, dvel_ds, dadv_ds, Re_cbc, dalpha_rho_ds,dvel_dt, &
774774
& dadv_dt, dalpha_rho_dt, L, lambda, Ys, dYs_dt, &
775775
& dYs_ds, h_k, Cp_i, Gamma_i, Xs]')
@@ -797,13 +797,13 @@ contains
797797
798798
$:GPU_LOOP(parallelism='[seq]')
799799
do i = 1, advxe - E_idx
800-
adv(i) = q_prim_rs${XYZ}$_vf(0, k, r, E_idx + i)
800+
adv_local(i) = q_prim_rs${XYZ}$_vf(0, k, r, E_idx + i)
801801
end do
802802
803803
if (bubbles_euler) then
804-
call s_convert_species_to_mixture_variables_bubbles_acc(rho, gamma, pi_inf, qv, adv, alpha_rho, Re_cbc)
804+
call s_convert_species_to_mixture_variables_bubbles_acc(rho, gamma, pi_inf, qv, adv_local, alpha_rho, Re_cbc)
805805
else
806-
call s_convert_species_to_mixture_variables_acc(rho, gamma, pi_inf, qv, adv, alpha_rho, Re_cbc)
806+
call s_convert_species_to_mixture_variables_acc(rho, gamma, pi_inf, qv, adv_local, alpha_rho, Re_cbc)
807807
end if
808808
809809
$:GPU_LOOP(parallelism='[seq]')
@@ -841,7 +841,7 @@ contains
841841
H = (E + pres)/rho
842842
843843
! Compute mixture sound speed
844-
call s_compute_speed_of_sound(pres, rho, gamma, pi_inf, H, adv, vel_K_sum, 0._wp, c)
844+
call s_compute_speed_of_sound(pres, rho, gamma, pi_inf, H, adv_local, vel_K_sum, 0._wp, c)
845845
846846
! First-Order Spatial Derivatives of Primitive Variables
847847
@@ -934,7 +934,7 @@ contains
934934
end if
935935
$:GPU_LOOP(parallelism='[seq]')
936936
do i = E_idx, advxe - 1
937-
L(i) = c*Ma*(adv(i + 1 - E_idx) - alpha_in(i + 1 - E_idx, ${CBC_DIR}$))/Del_in(${CBC_DIR}$)
937+
L(i) = c*Ma*(adv_local(i + 1 - E_idx) - alpha_in(i + 1 - E_idx, ${CBC_DIR}$))/Del_in(${CBC_DIR}$)
938938
end do
939939
L(advxe) = rho*c**2._wp*(1._wp + Ma)*(vel(dir_idx(1)) + vel_in(${CBC_DIR}$, dir_idx(1))*sign(1, cbc_loc))/Del_in(${CBC_DIR}$) + c*(1._wp + Ma)*(pres - pres_in(${CBC_DIR}$))/Del_in(${CBC_DIR}$)
940940
end if
@@ -1003,7 +1003,7 @@ contains
10031003
if (cyl_coord .and. cbc_dir == 2 .and. cbc_loc == 1) then
10041004
$:GPU_LOOP(parallelism='[seq]')
10051005
do i = 1, advxe - E_idx
1006-
dadv_dt(i) = -L(momxe + i) !+ adv(i) * vel(dir_idx(1))/y_cc(n)
1006+
dadv_dt(i) = -L(momxe + i) !+ adv_local(i) * vel(dir_idx(1))/y_cc(n)
10071007
end do
10081008
else
10091009
$:GPU_LOOP(parallelism='[seq]')

src/simulation/m_data_output.fpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,7 @@ contains
10701070
real(wp) :: max_pres
10711071
real(wp), dimension(2) :: Re
10721072
real(wp), dimension(6) :: tau_e
1073-
real(wp) :: G
1073+
real(wp) :: G_local
10741074
real(wp) :: dyn_p, T
10751075
real(wp) :: damage_state
10761076

@@ -1151,7 +1151,7 @@ contains
11511151
if (elasticity) then
11521152
call s_convert_to_mixture_variables(q_cons_vf, j - 2, k, l, &
11531153
rho, gamma, pi_inf, qv, &
1154-
Re, G, fluid_pp(:)%G)
1154+
Re, G_local, fluid_pp(:)%G)
11551155
else
11561156
call s_convert_to_mixture_variables(q_cons_vf, j - 2, k, l, &
11571157
rho, gamma, pi_inf, qv)
@@ -1165,15 +1165,15 @@ contains
11651165
if (elasticity) then
11661166
if (cont_damage) then
11671167
damage_state = q_cons_vf(damage_idx)%sf(j - 2, k, l)
1168-
G = G*max((1._wp - damage_state), 0._wp)
1168+
G_local = G_local*max((1._wp - damage_state), 0._wp)
11691169
end if
11701170

11711171
call s_compute_pressure( &
11721172
q_cons_vf(1)%sf(j - 2, k, l), &
11731173
q_cons_vf(alf_idx)%sf(j - 2, k, l), &
11741174
dyn_p, pi_inf, gamma, rho, qv, rhoYks(:), pres, T, &
11751175
q_cons_vf(stress_idx%beg)%sf(j - 2, k, l), &
1176-
q_cons_vf(mom_idx%beg)%sf(j - 2, k, l), G)
1176+
q_cons_vf(mom_idx%beg)%sf(j - 2, k, l), G_local)
11771177
else
11781178
call s_compute_pressure( &
11791179
q_cons_vf(1)%sf(j - 2, k, l), &
@@ -1266,7 +1266,7 @@ contains
12661266
! Computing/Sharing necessary state variables
12671267
call s_convert_to_mixture_variables(q_cons_vf, j - 2, k - 2, l, &
12681268
rho, gamma, pi_inf, qv, &
1269-
Re, G, fluid_pp(:)%G)
1269+
Re, G_local, fluid_pp(:)%G)
12701270
do s = 1, num_vels
12711271
vel(s) = q_cons_vf(cont_idx%end + s)%sf(j - 2, k - 2, l)/rho
12721272
end do
@@ -1276,7 +1276,7 @@ contains
12761276
if (elasticity) then
12771277
if (cont_damage) then
12781278
damage_state = q_cons_vf(damage_idx)%sf(j - 2, k - 2, l)
1279-
G = G*max((1._wp - damage_state), 0._wp)
1279+
G_local = G_local*max((1._wp - damage_state), 0._wp)
12801280
end if
12811281

12821282
call s_compute_pressure( &
@@ -1287,7 +1287,7 @@ contains
12871287
pres, &
12881288
T, &
12891289
q_cons_vf(stress_idx%beg)%sf(j - 2, k - 2, l), &
1290-
q_cons_vf(mom_idx%beg)%sf(j - 2, k - 2, l), G)
1290+
q_cons_vf(mom_idx%beg)%sf(j - 2, k - 2, l), G_local)
12911291
else
12921292
call s_compute_pressure(q_cons_vf(E_idx)%sf(j - 2, k - 2, l), &
12931293
q_cons_vf(alf_idx)%sf(j - 2, k - 2, l), &
@@ -1356,7 +1356,7 @@ contains
13561356
! Computing/Sharing necessary state variables
13571357
call s_convert_to_mixture_variables(q_cons_vf, j - 2, k - 2, l - 2, &
13581358
rho, gamma, pi_inf, qv, &
1359-
Re, G, fluid_pp(:)%G)
1359+
Re, G_local, fluid_pp(:)%G)
13601360
do s = 1, num_vels
13611361
vel(s) = q_cons_vf(cont_idx%end + s)%sf(j - 2, k - 2, l - 2)/rho
13621362
end do
@@ -1372,7 +1372,7 @@ contains
13721372
if (elasticity) then
13731373
if (cont_damage) then
13741374
damage_state = q_cons_vf(damage_idx)%sf(j - 2, k - 2, l - 2)
1375-
G = G*max((1._wp - damage_state), 0._wp)
1375+
G_local = G_local*max((1._wp - damage_state), 0._wp)
13761376
end if
13771377

13781378
call s_compute_pressure( &
@@ -1381,7 +1381,7 @@ contains
13811381
dyn_p, pi_inf, gamma, rho, qv, &
13821382
rhoYks, pres, T, &
13831383
q_cons_vf(stress_idx%beg)%sf(j - 2, k - 2, l - 2), &
1384-
q_cons_vf(mom_idx%beg)%sf(j - 2, k - 2, l - 2), G)
1384+
q_cons_vf(mom_idx%beg)%sf(j - 2, k - 2, l - 2), G_local)
13851385
else
13861386
call s_compute_pressure(q_cons_vf(E_idx)%sf(j - 2, k - 2, l - 2), &
13871387
q_cons_vf(alf_idx)%sf(j - 2, k - 2, l - 2), &

src/simulation/m_fftw.fpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,18 @@ contains
7171
!! applying the Fourier filter in the azimuthal direction.
7272
impure subroutine s_initialize_fftw_module
7373

74+
integer :: ierr !< Generic flag used to identify and report GPU errors
75+
7476
! Size of input array going into DFT
7577
real_size = p + 1
7678
! Size of output array coming out of DFT
7779
cmplx_size = (p + 1)/2 + 1
7880

7981
x_size = m + 1
80-
8182
batch_size = x_size*sys_size
8283

8384
#if defined(MFC_OpenACC)
84-
integer :: ierr !< Generic flag used to identify and report GPU errors
85+
8586
rank = 1; istride = 1; ostride = 1
8687

8788
allocate (gpu_fft_size(1:rank), iembed(1:rank), oembed(1:rank))
@@ -134,12 +135,11 @@ contains
134135
real(c_double), pointer :: p_real(:)
135136
complex(c_double_complex), pointer :: p_cmplx(:), p_fltr_cmplx(:)
136137
integer :: i, j, k, l !< Generic loop iterators
138+
integer :: ierr !< Generic flag used to identify and report GPU errors
137139

138140
! Restrict filter to processors that have cells adjacent to axis
139141
if (bc_y%beg >= 0) return
140142
#if defined(MFC_OpenACC)
141-
integer :: ierr !< Generic flag used to identify and report GPU errors
142-
143143
$:GPU_PARALLEL_LOOP(collapse=3)
144144
do k = 1, sys_size
145145
do j = 0, m

src/simulation/m_hyperelastic.fpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ contains
103103
real(wp), dimension(num_fluids) :: alpha_k, alpha_rho_k
104104
real(wp), dimension(2) :: Re
105105
real(wp) :: rho, gamma, pi_inf, qv
106-
real(wp) :: G
106+
real(wp) :: G_local
107107
integer :: j, k, l, i, r
108108

109109
$:GPU_PARALLEL_LOOP(collapse=3, private='[alpha_K, alpha_rho_K, rho, &
110-
& gamma, pi_inf, qv, G, Re, tensora, tensorb]')
110+
& gamma, pi_inf, qv, G_local, Re, tensora, tensorb]')
111111
do l = 0, p
112112
do k = 0, n
113113
do j = 0, m
@@ -118,12 +118,12 @@ contains
118118
end do
119119
! If in simulation, use acc mixture subroutines
120120
call s_convert_species_to_mixture_variables_acc(rho, gamma, pi_inf, qv, alpha_k, &
121-
alpha_rho_k, Re, G, Gs)
121+
alpha_rho_k, Re, G_local, Gs)
122122
rho = max(rho, sgm_eps)
123-
G = max(G, sgm_eps)
124-
!if ( G <= verysmall ) G_K = 0._wp
123+
G_local = max(G_local, sgm_eps)
124+
!if ( G_local <= verysmall ) G_K = 0._wp
125125

126-
if (G > verysmall) then
126+
if (G_local > verysmall) then
127127
$:GPU_LOOP(parallelism='[seq]')
128128
do i = 1, tensor_size
129129
tensora(i) = 0._wp
@@ -190,13 +190,13 @@ contains
190190
btensor%vf(b_size)%sf(j, k, l) = tensorb(tensor_size)
191191
! STEP 5a: updating the Cauchy stress primitive scalar field
192192
if (hyper_model == 1) then
193-
call s_neoHookean_cauchy_solver(btensor%vf, q_prim_vf, G, j, k, l)
193+
call s_neoHookean_cauchy_solver(btensor%vf, q_prim_vf, G_local, j, k, l)
194194
elseif (hyper_model == 2) then
195-
call s_Mooney_Rivlin_cauchy_solver(btensor%vf, q_prim_vf, G, j, k, l)
195+
call s_Mooney_Rivlin_cauchy_solver(btensor%vf, q_prim_vf, G_local, j, k, l)
196196
end if
197197
! STEP 5b: updating the pressure field
198198
q_prim_vf(E_idx)%sf(j, k, l) = q_prim_vf(E_idx)%sf(j, k, l) - &
199-
G*q_prim_vf(xiend + 1)%sf(j, k, l)/gamma
199+
G_local*q_prim_vf(xiend + 1)%sf(j, k, l)/gamma
200200
! STEP 5c: updating the Cauchy stress conservative scalar field
201201
$:GPU_LOOP(parallelism='[seq]')
202202
do i = 1, b_size - 1
@@ -218,11 +218,11 @@ contains
218218
!! calculate the inverse of grad_xi to obtain F, F is a nxn tensor
219219
!! calculate the FFtranspose to obtain the btensor, btensor is nxn tensor
220220
!! btensor is symmetric, save the data space
221-
pure subroutine s_neoHookean_cauchy_solver(btensor_in, q_prim_vf, G, j, k, l)
221+
pure subroutine s_neoHookean_cauchy_solver(btensor_in, q_prim_vf, G_param, j, k, l)
222222
$:GPU_ROUTINE(parallelism='[seq]')
223223
type(scalar_field), dimension(sys_size), intent(inout) :: q_prim_vf
224224
type(scalar_field), dimension(b_size), intent(inout) :: btensor_in
225-
real(wp), intent(in) :: G
225+
real(wp), intent(in) :: G_param
226226
integer, intent(in) :: j, k, l
227227

228228
real(wp) :: trace
@@ -241,7 +241,7 @@ contains
241241
$:GPU_LOOP(parallelism='[seq]')
242242
do i = 1, b_size - 1
243243
q_prim_vf(strxb + i - 1)%sf(j, k, l) = &
244-
G*btensor_in(i)%sf(j, k, l)/btensor_in(b_size)%sf(j, k, l)
244+
G_param*btensor_in(i)%sf(j, k, l)/btensor_in(b_size)%sf(j, k, l)
245245
end do
246246
! compute the invariant without the elastic modulus
247247
q_prim_vf(xiend + 1)%sf(j, k, l) = &
@@ -257,11 +257,11 @@ contains
257257
!! calculate the inverse of grad_xi to obtain F, F is a nxn tensor
258258
!! calculate the FFtranspose to obtain the btensor, btensor is nxn tensor
259259
!! btensor is symmetric, save the data space
260-
pure subroutine s_Mooney_Rivlin_cauchy_solver(btensor_in, q_prim_vf, G, j, k, l)
260+
pure subroutine s_Mooney_Rivlin_cauchy_solver(btensor_in, q_prim_vf, G_param, j, k, l)
261261
$:GPU_ROUTINE(parallelism='[seq]')
262262
type(scalar_field), dimension(sys_size), intent(inout) :: q_prim_vf
263263
type(scalar_field), dimension(b_size), intent(inout) :: btensor_in
264-
real(wp), intent(in) :: G
264+
real(wp), intent(in) :: G_param
265265
integer, intent(in) :: j, k, l
266266

267267
real(wp) :: trace
@@ -282,7 +282,7 @@ contains
282282
$:GPU_LOOP(parallelism='[seq]')
283283
do i = 1, b_size - 1
284284
q_prim_vf(strxb + i - 1)%sf(j, k, l) = &
285-
G*btensor_in(i)%sf(j, k, l)/btensor_in(b_size)%sf(j, k, l)
285+
G_param*btensor_in(i)%sf(j, k, l)/btensor_in(b_size)%sf(j, k, l)
286286
end do
287287
! compute the invariant without the elastic modulus
288288
q_prim_vf(xiend + 1)%sf(j, k, l) = &

src/simulation/m_sim_helpers.fpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ contains
101101
real(wp), dimension(2), intent(inout) :: Re
102102

103103
real(wp), dimension(num_fluids) :: alpha_rho, Gs
104-
real(wp) :: qv, E, G
104+
real(wp) :: qv, E, G_local
105105

106106
integer :: i
107107

@@ -129,7 +129,7 @@ contains
129129

130130
if (elasticity) then
131131
call s_convert_species_to_mixture_variables_acc(rho, gamma, pi_inf, qv, alpha, &
132-
alpha_rho, Re, G, Gs)
132+
alpha_rho, Re, G_local, Gs)
133133
elseif (bubbles_euler) then
134134
call s_convert_species_to_mixture_variables_bubbles_acc(rho, gamma, pi_inf, qv, alpha, alpha_rho, Re)
135135
else
@@ -164,7 +164,7 @@ contains
164164

165165
! Adjust energy for hyperelasticity
166166
if (hyperelasticity) then
167-
E = E + G*q_prim_vf(xiend + 1)%sf(j, k, l)
167+
E = E + G_local*q_prim_vf(xiend + 1)%sf(j, k, l)
168168
end if
169169

170170
H = (E + pres)/rho

0 commit comments

Comments
 (0)