Skip to content

Commit 45e80d9

Browse files
committed
better
1 parent a27f4cf commit 45e80d9

File tree

4 files changed

+18
-19
lines changed

4 files changed

+18
-19
lines changed

.github/workflows/lint-source.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@ jobs:
3636

3737
- name: No double precision intrinsics
3838
run: |
39-
! grep -iR 'dexp\|dlog\|dble\|dabs\|double\ precision\|real(8)\|real(4)\|dprod\|dmin\|dmax\|dfloat\|dreal\|dcos\|dsin\|dtan\|dsign\|dtanh\|dsinh\|dcosh\|\.d0\|\dd0' --exclude-dir=syscheck ./src/*
39+
! grep -iR 'dexp\|dlog\|dble\|dabs\|double\ precision\|real(8)\|real(4)\|dprod\|dmin\|dmax\|dfloat\|dreal\|dcos\|dsin\|dtan\|dsign\|dtanh\|dsinh\|dcosh\|d0' --exclude-dir=syscheck --exclude="*nvtx*" ./src/*
40+

src/simulation/m_bubbles.fpp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ contains
430430
real(wp), intent(out) :: h
431431

432432
real(wp) :: h0, h1 !< Time step size
433-
real(wp) :: d0, d1, d2 !< norms
433+
real(wp) :: d_0, d_1, d_2 !< norms
434434
real(wp), dimension(2) :: myR_tmp, myV_tmp, myA_tmp !< Bubble radius, radial velocity, and radial acceleration
435435

436436
! Determine the starting time step
@@ -441,13 +441,13 @@ contains
441441
fpb, fpbdot, alf, fntait, fBtait, &
442442
f_bub_adv_src, f_divu)
443443

444-
! Compute d0 = ||y0|| and d1 = ||f(x0,y0)||
445-
d0 = sqrt((myR_tmp(1)**2._wp + myV_tmp(1)**2._wp)/2._wp)
446-
d1 = sqrt((myV_tmp(1)**2._wp + myA_tmp(1)**2._wp)/2._wp)
447-
if (d0 < 1e-5_wp .or. d1 < 1e-5_wp) then
444+
! Compute d_0 = ||y0|| and d_1 = ||f(x0,y0)||
445+
d_0 = sqrt((myR_tmp(1)**2._wp + myV_tmp(1)**2._wp)/2._wp)
446+
d_1 = sqrt((myV_tmp(1)**2._wp + myA_tmp(1)**2._wp)/2._wp)
447+
if (d_0 < 1e-5_wp .or. d_1 < 1e-5_wp) then
448448
h0 = 1e-6_wp
449449
else
450-
h0 = 1e-2_wp*(d0/d1)
450+
h0 = 1e-2_wp*(d_0/d_1)
451451
end if
452452

453453
! Evaluate f(x0+h0,y0+h0*f(x0,y0))
@@ -457,15 +457,13 @@ contains
457457
fpb, fpbdot, alf, fntait, fBtait, &
458458
f_bub_adv_src, f_divu)
459459

460-
! Compute d2 = ||f(x0+h0,y0+h0*f(x0,y0))-f(x0,y0)||/h0
461-
d2 = sqrt(((myV_tmp(2) - myV_tmp(1))**2._wp + (myA_tmp(2) - myA_tmp(1))**2._wp)/2._wp)/h0
460+
! Compute d_2 = ||f(x0+h0,y0+h0*f(x0,y0))-f(x0,y0)||/h0
461+
d_2 = sqrt(((myV_tmp(2) - myV_tmp(1))**2._wp + (myA_tmp(2) - myA_tmp(1))**2._wp)/2._wp)/h0
462462

463-
! Set h1 = (0.01/max(d1,d2))^{1/(p+1)}
464-
! if max(d1,d2) < 1e-15_wp, h1 = max(1e-6_wp, h0*1e-3_wp)
465-
if (max(d1, d2) < 1e-15_wp) then
463+
if (max(d_1, d_2) < 1e-15_wp) then
466464
h1 = max(1e-6_wp, h0*1e-3_wp)
467465
else
468-
h1 = (1e-2_wp/max(d1, d2))**(1._wp/3._wp)
466+
h1 = (1e-2_wp/max(d_1, d_2))**(1._wp/3._wp)
469467
end if
470468

471469
! Set h = min(100*h0,h1)

src/simulation/m_qbmm.fpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,7 @@ contains
10461046
real(wp), dimension(0:2, 0:2) :: moms
10471047
real(wp), dimension(3) :: M1, M3
10481048
real(wp), dimension(2) :: myrho, myrho3, up, up3, Vf
1049-
real(wp) :: bu, bv, d20, d11, d02, c20, c11, c02
1049+
real(wp) :: bu, bv, d20, d11, d_02, c20, c11, c02
10501050
real(wp) :: mu2avg, mu2, vp21, vp22, rho21, rho22
10511051
10521052
moms(0, 0) = momin(1)
@@ -1060,11 +1060,11 @@ contains
10601060
bv = moms(0, 1)/moms(0, 0)
10611061
d20 = moms(2, 0)/moms(0, 0)
10621062
d11 = moms(1, 1)/moms(0, 0)
1063-
d02 = moms(0, 2)/moms(0, 0)
1063+
d_02 = moms(0, 2)/moms(0, 0)
10641064
10651065
c20 = d20 - bu**2._wp;
10661066
c11 = d11 - bu*bv;
1067-
c02 = d02 - bv**2._wp;
1067+
c02 = d_02 - bv**2._wp;
10681068
M1 = (/1._wp, 0._wp, c20/)
10691069
call s_hyqmom(myrho, up, M1)
10701070
Vf = c11*up/c20

src/simulation/m_riemann_solvers.fpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -563,8 +563,8 @@ contains
563563

564564
! elastic energy update
565565
!if ( hyperelasticity ) then
566-
! G_L = 0d0
567-
! G_R = 0d0
566+
! G_L = 0._wp
567+
! G_R = 0._wp
568568
!
569569
! !$acc loop seq
570570
! do i = 1, num_fluids
@@ -1012,7 +1012,7 @@ contains
10121012
10131013
real(wp) :: vel_L_rms, vel_R_rms, vel_avg_rms
10141014
real(wp) :: vel_L_tmp, vel_R_tmp
1015-
real(wp) :: rho_Star, E_Star, p_Star, p_K_Star
1015+
real(wp) :: rho_Star, E_Star, p_Star, p_K_Star, vel_K_star
10161016
real(wp) :: pres_SL, pres_SR, Ms_L, Ms_R
10171017
real(wp) :: flux_ene_e
10181018
real(wp) :: zcoef, pcorr !< low Mach number correction

0 commit comments

Comments
 (0)