Skip to content

Commit bb77a24

Browse files
committed
builds on frontier but doesn't run ):
1 parent 85e3989 commit bb77a24

File tree

3 files changed

+81
-33
lines changed

3 files changed

+81
-33
lines changed

src/simulation/m_bubbles_EL.fpp

Lines changed: 78 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,17 @@ contains
471471
type(scalar_field), dimension(sys_size), intent(inout) :: rhs_vf
472472
integer, intent(in) :: stage
473473

474+
! manual inline of s_compute_KM
475+
real(kind(0.d0)) :: pliqint, pbubble, deltaP, pinf, termI, aux1
476+
real(kind(0.d0)) :: aux2, velint, rhol, cson, E, H, qv, gamma, pi_inf
477+
real(kind(0d0)), dimension(num_fluids) :: alpha_rho, alpha
478+
integer, dimension(3) :: cell
479+
real(kind(0.0d0)), dimension(3) :: scoord
480+
481+
real(kind(0.d0)), dimension(num_dims) :: vel
482+
real(kind(0.d0)), dimension(2) :: Re
483+
! end inline
484+
474485
real(kind(0.d0)) :: gammaparticle, vaporflux, heatflux
475486
integer :: i, j, k, l
476487
real(kind(0.d0)) :: preterm1, term2, paux, pint, Romega, term1_fac, Rb
@@ -511,9 +522,43 @@ contains
511522

512523
! Radial motion model
513524
if (lag_params%bubble_model == 1) then
514-
!$acc parallel loop gang vector default(present) private(k) copyin(stage)
525+
!$acc parallel loop gang vector default(present) private(scoord,alpha,alpha_rho,cell,Re,vel) copyin(stage)
515526
do k = 1, nBubs
516-
call s_compute_KM(k, stage, q_prim_vf)
527+
!call s_compute_KM(k, stage, q_prim_vf)
528+
529+
! Manual inline of s_compute_KM
530+
pliqint = f_pressureliq_int(k) ! pressure at the bubble wall
531+
532+
scoord = mtn_s(k, 1:3, 2)
533+
call s_get_cell(scoord, cell)
534+
pinf = f_pressure_inf(k, q_prim_vf, 1, aux1, aux2) ! getting p_inf
535+
536+
do i = 1, num_fluids
537+
alpha_rho(i) = q_prim_vf(advxb + i - 1)%sf(cell(1), cell(2), cell(3))*q_prim_vf(i)%sf(cell(1), cell(2), cell(3))
538+
alpha(i) = q_prim_vf(advxb + i - 1)%sf(cell(1), cell(2), cell(3))
539+
end do
540+
541+
call s_convert_species_to_mixture_variables_acc(rhol, gamma, pi_inf, qv, alpha, alpha_rho, Re, cell(1), cell(2), cell(3))
542+
543+
! Computing speed of sound
544+
do i = 1, num_dims
545+
vel(i) = q_prim_vf(i + num_fluids)%sf(cell(1), cell(2), cell(3))
546+
end do
547+
E = gamma*pinf + pi_inf + 0.5d0*rhol*dot_product(vel, vel)
548+
H = (E + pinf)/rhol
549+
cson = sqrt((H - 0.5d0*dot_product(vel, vel))/gamma)
550+
551+
deltaP = pliqint - pinf
552+
termI = 0.0d0
553+
velint = intfc_vel(k, 2) - gas_dmvdt(k,stage)/(4.0d0*pi*intfc_rad(k, 2)**2*rhol)
554+
555+
intfc_dveldt(k, stage) = ((1.0d0 + velint/cson)*deltaP/rhol &
556+
+ termI &
557+
+ gas_dpdt(k,stage)*intfc_rad(k, 2)/rhol/cson &
558+
- velint**2*3.0d0/2.0d0*(1.0d0 - velint/3.0d0/cson)) &
559+
/(intfc_rad(k, 2)*(1.0d0 - velint/cson))
560+
! end of manual inline
561+
517562
intfc_draddt(k, stage) = intfc_vel(k, 2)
518563
end do
519564
else
@@ -674,8 +719,11 @@ contains
674719
!! @param step Current time-stage in RKCK stepper, otherwise step = 1
675720
!! @param q_prim_vf Primitive variables
676721
subroutine s_compute_KM(nparticles, step, q_prim_vf)
677-
!$acc routine seq
678-
722+
!#ifdef _CRAYFTN
723+
!!DIR$ INLINEALWAYS s_compute_KM
724+
!#else
725+
!!$acc routine seq
726+
!#endif
679727
integer, intent(in) :: nparticles, step
680728
type(scalar_field), dimension(sys_size), intent(in) :: q_prim_vf
681729

@@ -689,36 +737,36 @@ contains
689737
real(kind(0.d0)), dimension(2) :: Re
690738
integer :: i
691739

692-
pliqint = f_pressureliq_int(nparticles) ! pressure at the bubble wall
740+
!pliqint = f_pressureliq_int(nparticles) ! pressure at the bubble wall
693741

694-
scoord = mtn_s(nparticles, 1:3, 2)
695-
call s_get_cell(scoord, cell)
696-
pinf = f_pressure_inf(nparticles, q_prim_vf, 1, aux1, aux2) ! getting p_inf
742+
!scoord = mtn_s(nparticles, 1:3, 2)
743+
!call s_get_cell(scoord, cell)
744+
!pinf = f_pressure_inf(nparticles, q_prim_vf, 1, aux1, aux2) ! getting p_inf
697745

698-
do i = 1, num_fluids
699-
alpha_rho(i) = q_prim_vf(advxb + i - 1)%sf(cell(1), cell(2), cell(3))*q_prim_vf(i)%sf(cell(1), cell(2), cell(3))
700-
alpha(i) = q_prim_vf(advxb + i - 1)%sf(cell(1), cell(2), cell(3))
701-
end do
746+
!do i = 1, num_fluids
747+
!alpha_rho(i) = q_prim_vf(advxb + i - 1)%sf(cell(1), cell(2), cell(3))*q_prim_vf(i)%sf(cell(1), cell(2), cell(3))
748+
!alpha(i) = q_prim_vf(advxb + i - 1)%sf(cell(1), cell(2), cell(3))
749+
!end do
702750

703-
call s_convert_species_to_mixture_variables_acc(rhol, gamma, pi_inf, qv, alpha, alpha_rho, Re, cell(1), cell(2), cell(3))
751+
!call s_convert_species_to_mixture_variables_acc(rhol, gamma, pi_inf, qv, alpha, alpha_rho, Re, cell(1), cell(2), cell(3))
704752

705-
! Computing speed of sound
706-
do i = 1, num_dims
707-
vel(i) = q_prim_vf(i + num_fluids)%sf(cell(1), cell(2), cell(3))
708-
end do
709-
E = gamma*pinf + pi_inf + 0.5d0*rhol*dot_product(vel, vel)
710-
H = (E + pinf)/rhol
711-
cson = sqrt((H - 0.5d0*dot_product(vel, vel))/gamma)
712-
713-
deltaP = pliqint - pinf
714-
termI = 0.0d0
715-
velint = intfc_vel(nparticles, 2) - gas_dmvdt(nparticles, step)/(4.0d0*pi*intfc_rad(nparticles, 2)**2*rhol)
716-
717-
intfc_dveldt(nparticles, step) = ((1.0d0 + velint/cson)*deltaP/rhol &
718-
+ termI &
719-
+ gas_dpdt(nparticles, step)*intfc_rad(nparticles, 2)/rhol/cson &
720-
- velint**2*3.0d0/2.0d0*(1.0d0 - velint/3.0d0/cson)) &
721-
/(intfc_rad(nparticles, 2)*(1.0d0 - velint/cson))
753+
!! Computing speed of sound
754+
!do i = 1, num_dims
755+
!vel(i) = q_prim_vf(i + num_fluids)%sf(cell(1), cell(2), cell(3))
756+
!end do
757+
!E = gamma*pinf + pi_inf + 0.5d0*rhol*dot_product(vel, vel)
758+
!H = (E + pinf)/rhol
759+
!cson = sqrt((H - 0.5d0*dot_product(vel, vel))/gamma)
760+
761+
!deltaP = pliqint - pinf
762+
!termI = 0.0d0
763+
!velint = intfc_vel(nparticles, 2) - gas_dmvdt(nparticles, step)/(4.0d0*pi*intfc_rad(nparticles, 2)**2*rhol)
764+
765+
!intfc_dveldt(nparticles, step) = ((1.0d0 + velint/cson)*deltaP/rhol &
766+
!+ termI &
767+
!+ gas_dpdt(nparticles, step)*intfc_rad(nparticles, 2)/rhol/cson &
768+
!- velint**2*3.0d0/2.0d0*(1.0d0 - velint/3.0d0/cson)) &
769+
!/(intfc_rad(nparticles, 2)*(1.0d0 - velint/cson))
722770

723771
end subroutine s_compute_KM
724772

src/simulation/m_bubbles_EL_kernels.fpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ contains
124124
smearGridz = smearGrid
125125
if (p == 0) smearGridz = 1
126126

127-
!$acc parallel loop gang vector default(present) private(l, s_coord, cell, center) copyin(smearGrid, smearGridz)
127+
!$acc parallel loop gang vector default(present) private(nodecoord, l, s_coord, cell, center) copyin(smearGrid, smearGridz)
128128
do l = 1, nBubs
129129
nodecoord(1:3) = 0
130130
center(1:3) = 0.0d0
@@ -138,7 +138,7 @@ contains
138138
strength_vol = volpart
139139
strength_vel = 4.0d0*pi*lbk_rad(l, 2)**2*lbk_vel(l, 2)
140140

141-
!$acc loop collapse(3) private(i, j, k, cellaux, nodecoord)
141+
!$acc loop collapse(3) private(cellaux, nodecoord)
142142
do i = 1, smearGrid
143143
do j = 1, smearGrid
144144
do k = 1, smearGridz

src/simulation/m_time_steppers.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ contains
266266
do j = 1, sys_size
267267
@:ALLOCATE(rhs_ts_rkck(i)%vf(j)%sf(0:m, 0:n, 0:p))
268268
end do
269-
@:ACC_SETUP_SFs(rhs_ts_rkck(i))
269+
@:ACC_SETUP_VFs(rhs_ts_rkck(i))
270270
end do
271271
else
272272
! Allocating the cell-average RHS variables

0 commit comments

Comments
 (0)