Skip to content

Commit

Permalink
Removing whitespace + regression test bug caught in toolchain (lint)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anand authored and Anand committed Nov 8, 2024
1 parent c032ee9 commit 9a2b3dd
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 49 deletions.
16 changes: 3 additions & 13 deletions src/simulation/m_cbc.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,11 @@ module m_cbc
!$acc declare create(dj, bcxb, bcxe, bcyb, bcye, bczb, bcze, cbc_dir, cbc_loc)

real(kind(0d0)) :: ux_in, ux_out, vx_in, vx_out, wx_in, wx_out, presx_in, presx_out, Delx_in, Delx_out

real(kind(0d0)) :: uy_in, uy_out, vy_in, vy_out, wy_in, wy_out, presy_in, presy_out, Dely_in, Dely_out

real(kind(0d0)) :: uz_in, uz_out, vz_in, vz_out, wz_in, wz_out, presz_in, presz_out, Delz_in, Delz_out

!$acc declare create(ux_in, ux_out, vx_in, vx_out, wx_in, wx_out, presx_in, presx_out, Delx_in, Delx_out)
!$acc declare create(uy_in, uy_out, vy_in, vy_out, wy_in, wy_out, presy_in, presy_out, Dely_in, Dely_out)
!$acc declare create(uz_in, uz_out, vz_in, vz_out, wz_in, wz_out, presz_in, presz_out, Delz_in, Delz_out)
!$acc declare create(ux_in, ux_out, vx_in, vx_out, wx_in, wx_out, presx_in, presx_out, Delx_in, Delx_out)
!$acc declare create(uy_in, uy_out, vy_in, vy_out, wy_in, wy_out, presy_in, presy_out, Dely_in, Dely_out)
!$acc declare create(uz_in, uz_out, vz_in, vz_out, wz_in, wz_out, presz_in, presz_out, Delz_in, Delz_out)

#ifdef CRAY_ACC_WAR
@:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:), alpha_rhox_in, alphax_in)
Expand Down Expand Up @@ -452,7 +449,6 @@ contains
@:ALLOCATE_GLOBAL(alphax_in(1:num_fluids), alphay_in(1:num_fluids), alphaz_in(1:num_fluids))

#:for CBC_DIR, XYZ in [(1, 'x'), (2, 'y'), (3, 'z')]

if (${CBC_DIR}$ == 1) then
u${XYZ}$_in = bc_${XYZ}$%u_in
v${XYZ}$_in = bc_${XYZ}$%v_in
Expand All @@ -463,7 +459,6 @@ contains
Del${XYZ}$_in = maxval(dx)
Del${XYZ}$_out = maxval(dx)
else if (${CBC_DIR}$ == 2) then

u${XYZ}$_in = bc_${XYZ}$%v_in
v${XYZ}$_in = bc_${XYZ}$%u_in
w${XYZ}$_in = bc_${XYZ}$%w_in
Expand All @@ -486,7 +481,6 @@ contains
Del${XYZ}$_out = maxval(dz)
end if
end if

pres${XYZ}$_in = bc_${XYZ}$%pres_in
pres${XYZ}$_out = bc_${XYZ}$%pres_out
do i = 1, num_fluids
Expand All @@ -496,7 +490,6 @@ contains
!$acc update device(u${XYZ}$_in, v${XYZ}$_in, w${XYZ}$_in, u${XYZ}$_out, v${XYZ}$_out, w${XYZ}$_out)
!$acc update device(pres${XYZ}$_in, pres${XYZ}$_out, alpha_rho${XYZ}$_in, alpha${XYZ}$_in)
!$acc update device(Del${XYZ}$_in, Del${XYZ}$_out)

#:endfor

end subroutine s_initialize_cbc_module
Expand Down Expand Up @@ -943,7 +936,6 @@ contains
call s_compute_nonreflecting_subsonic_buffer_L(lambda, L, rho, c, mf, dalpha_rho_ds, dpres_ds, dvel_ds, dadv_ds)
else if ((cbc_loc == -1 .and. bc${XYZ}$b == -7) .or. (cbc_loc == 1 .and. bc${XYZ}$e == -7)) then
call s_compute_nonreflecting_subsonic_inflow_L(lambda, L, rho, c, mf, dalpha_rho_ds, dpres_ds, dvel_ds, dadv_ds)

!Add GRCBC for Subsonic Inflow
if (bc_${XYZ}$%grcbc_in) then
!$acc loop seq
Expand All @@ -964,7 +956,6 @@ contains
end if
else if ((cbc_loc == -1 .and. bc${XYZ}$b == -8) .or. (cbc_loc == 1 .and. bc${XYZ}$e == -8)) then
call s_compute_nonreflecting_subsonic_outflow_L(lambda, L, rho, c, mf, dalpha_rho_ds, dpres_ds, dvel_ds, dadv_ds)

!Add GRCBC for Subsonic Outflow (Pressure)
if (bc_${XYZ}$%grcbc_out) then
L(advxe) = c*(1d0 - Ma)*(pres - pres${XYZ}$_out)/Del${XYZ}$_out
Expand All @@ -974,7 +965,6 @@ contains
L(advxe) = L(advxe) + rho*c**2d0*(1d0 - Ma)*(vel(dir_idx(1)) + u${XYZ}$_out*sign(1, cbc_loc))/Del${XYZ}$_out
end if
end if

else if ((cbc_loc == -1 .and. bc${XYZ}$b == -9) .or. (cbc_loc == 1 .and. bc${XYZ}$e == -9)) then
call s_compute_force_free_subsonic_outflow_L(lambda, L, rho, c, mf, dalpha_rho_ds, dpres_ds, dvel_ds, dadv_ds)
else if ((cbc_loc == -1 .and. bc${XYZ}$b == -10) .or. (cbc_loc == 1 .and. bc${XYZ}$e == -10)) then
Expand Down
43 changes: 38 additions & 5 deletions tests/872E17A1/golden-metadata.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions tests/872E17A1/golden.txt

Large diffs are not rendered by default.

49 changes: 41 additions & 8 deletions tests/EBBA071B/golden-metadata.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions tests/EBBA071B/golden.txt

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions toolchain/mfc/test/cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,27 +75,27 @@ def alter_bcs(dimInfo):
cases.append(define_case_d(stack, f"bc={bc}", get_bc_mods(bc, dimInfo)))

def alter_grcbc(dimInfo):
if(len(dimInfo[0]) == 1):
stack.push('', {'patch_icpp(1)%vel(1)' : 1.0, 'patch_icpp(2)%vel(1)' : 1.0, 'patch_icpp(3)%vel(1)' : 1.0,
if len(dimInfo[0]) == 1:
stack.push('', {'patch_icpp(1)%vel(1)':1.0, 'patch_icpp(2)%vel(1)':1.0, 'patch_icpp(3)%vel(1)':1.0,
'bc_x%beg':-7, 'bc_x%end':-8, 'bc_x%grcbc_in':'T', 'bc_x%grcbc_out':'T', 'bc_x%grcbc_vel_out':'T',
'bc_x%u_in':1.0, 'bc_x%v_in':0.0, 'bc_x%w_in':0.0, 'bc_x%u_out':1.0, 'bc_x%v_in':0.0, 'bc_x%w_in':0.0,
'bc_x%pres_in':1.0, 'bc_x%pres_out':1.0, 'bc_x%alpha_in(1)':1.0, 'bc_x%alpha_rho_in(1)':1.0 })
'bc_x%u_in':1.0, 'bc_x%v_in':0.0, 'bc_x%w_in':0.0, 'bc_x%u_out':1.0, 'bc_x%v_out':0.0, 'bc_x%w_out':0.0,
'bc_x%pres_in':1.0, 'bc_x%pres_out':1.0, 'bc_x%alpha_in(1)':1.0, 'bc_x%alpha_rho_in(1)':1.0})
cases.append(define_case_d(stack, [f"grcbc"],{}))
stack.pop()
elif(len(dimInfo[0]) == 2):
stack.push('', {'patch_icpp(1)%vel(2)' : 1.0, 'patch_icpp(2)%vel(2)' : 1.0, 'patch_icpp(3)%vel(2)' : 1.0,
elif len(dimInfo[0]) == 2:
stack.push('', {'patch_icpp(1)%vel(2)':1.0, 'patch_icpp(2)%vel(2)':1.0, 'patch_icpp(3)%vel(2)':1.0,
'bc_y%beg':-7, 'bc_y%end':-8, 'bc_y%grcbc_in':'T', 'bc_y%grcbc_out':'T', 'bc_y%grcbc_vel_out':'T',
'bc_y%u_in':0.0, 'bc_y%v_in':1.0, 'bc_y%w_in':0.0, 'bc_y%u_out':0.0, 'bc_y%v_in':1.0, 'bc_y%w_in':0.0,
'bc_y%pres_in':1.0, 'bc_y%pres_out':1.0, 'bc_y%alpha_in(1)':1.0, 'bc_y%alpha_rho_in(1)':1.0 })
'bc_y%u_in':0.0, 'bc_y%v_in':1.0, 'bc_y%w_in':0.0, 'bc_y%u_out':0.0, 'bc_y%v_out':1.0, 'bc_y%w_out':0.0,
'bc_y%pres_in':1.0, 'bc_y%pres_out':1.0, 'bc_y%alpha_in(1)':1.0, 'bc_y%alpha_rho_in(1)':1.0})
cases.append(define_case_d(stack, [f"grcbc"],{}))
stack.pop()
elif(len(dimInfo[0]) == 3):
stack.push('', {'patch_icpp(1)%vel(3)' : 1.0, 'patch_icpp(2)%vel(3)' : 1.0, 'patch_icpp(3)%vel(3)' : 1.0,
stack.pop()
elif len(dimInfo[0]) == 3:
stack.push('', {'patch_icpp(1)%vel(3)':1.0, 'patch_icpp(2)%vel(3)':1.0, 'patch_icpp(3)%vel(3)':1.0,
'bc_z%beg':-7, 'bc_z%end':-8, 'bc_z%grcbc_in':'T', 'bc_z%grcbc_out':'T', 'bc_z%grcbc_vel_out':'T',
'bc_z%u_in':0.0, 'bc_z%v_in':0.0, 'bc_z%w_in':1.0, 'bc_z%u_out':0.0, 'bc_z%v_in':0.0, 'bc_z%w_in':1.0,
'bc_z%pres_in':1.0, 'bc_z%pres_out':1.0, 'bc_z%alpha_in(1)':1.0, 'bc_z%alpha_rho_in(1)':1.0 })
'bc_z%u_in':0.0, 'bc_z%v_in':0.0, 'bc_z%w_in':1.0, 'bc_z%u_out':0.0, 'bc_z%v_out':0.0, 'bc_z%w_out':1.0,
'bc_z%pres_in':1.0, 'bc_z%pres_out':1.0, 'bc_z%alpha_in(1)':1.0, 'bc_z%alpha_rho_in(1)':1.0})
cases.append(define_case_d(stack, [f"grcbc"],{}))
stack.pop()
stack.pop()

def alter_capillary():
stack.push('', {'patch_icpp(1)%cf_val':1, 'patch_icpp(2)%cf_val':0, 'patch_icpp(3)%cf_val':1,
Expand Down

0 comments on commit 9a2b3dd

Please sign in to comment.