Skip to content

Commit 21cb9ed

Browse files
committed
add string formats for reproducibility and regenerate golden files
1 parent a52b157 commit 21cb9ed

File tree

19 files changed

+673
-356
lines changed

19 files changed

+673
-356
lines changed

src/simulation/m_bubbles_EL.fpp

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,22 +1410,36 @@ contains
14101410
character(LEN=path_len + 2*name_len) :: file_loc
14111411
logical :: file_exist
14121412

1413+
character(LEN=25) :: FMT
1414+
14131415
write (file_loc, '(A,I0,A)') 'lag_bubble_evol_', proc_rank, '.dat'
14141416
file_loc = trim(case_dir)//'/D/'//trim(file_loc)
14151417
inquire (FILE=trim(file_loc), EXIST=file_exist)
14161418

1419+
if (precision == 1) then
1420+
FMT = "(A16,A14,8A16)"
1421+
else
1422+
FMT = "(A24,A14,8A24)"
1423+
end if
1424+
14171425
if (.not. file_exist) then
14181426
open (11, FILE=trim(file_loc), FORM='formatted', position='rewind')
1419-
write (11, *) 'currentTime, particleID, x, y, z, ', &
1420-
'coreVaporMass, coreVaporConcentration, radius, interfaceVelocity, ', &
1427+
write (11, FMT) 'currentTime', 'particleID', 'x', 'y', 'z', &
1428+
'coreVaporMass', 'coreVaporConcentration', 'radius', 'interfaceVelocity', &
14211429
'corePressure'
14221430
else
14231431
open (11, FILE=trim(file_loc), FORM='formatted', position='append')
14241432
end if
14251433

1434+
if (precision == 1) then
1435+
FMT = "(F16.8,I14,8F16.8)"
1436+
else
1437+
FMT = "(F24.16,I14,8F24.16)"
1438+
end if
1439+
14261440
! Cycle through list
14271441
do k = 1, nBubs
1428-
write (11, '(6X,f12.6,I24.8,8e24.8)') &
1442+
write (11, FMT) &
14291443
qtime, &
14301444
lag_id(k, 1), &
14311445
mtn_pos(k, 1, 1), &
@@ -1435,7 +1449,7 @@ contains
14351449
gas_mv(k, 1)/(gas_mv(k, 1) + gas_mg(k)), &
14361450
intfc_rad(k, 1), &
14371451
intfc_vel(k, 1), &
1438-
gas_p(k, 1)
1452+
gas_p(k, 2)
14391453
end do
14401454

14411455
close (11)
@@ -1691,16 +1705,30 @@ contains
16911705
integer :: k
16921706
character(LEN=path_len + 2*name_len) :: file_loc
16931707
1708+
character(len=20) :: FMT
1709+
16941710
write (file_loc, '(A,I0,A)') 'stats_lag_bubbles_', proc_rank, '.dat'
16951711
file_loc = trim(case_dir)//'/D/'//trim(file_loc)
16961712
16971713
$:GPU_UPDATE(host='[Rmax_glb,Rmin_glb]')
16981714
1715+
if (precision == 1) then
1716+
FMT = "(A10,A14,5A16)"
1717+
else
1718+
FMT = "(A10,A14,5A24)"
1719+
end if
1720+
16991721
open (13, FILE=trim(file_loc), FORM='formatted', position='rewind')
1700-
write (13, *) 'proc_rank, particleID, x, y, z, Rmax_glb, Rmin_glb'
1722+
write (13, FMT) 'proc_rank', 'particleID', 'x', 'y', 'z', 'Rmax_glb', 'Rmin_glb'
1723+
1724+
if (precision == 1) then
1725+
FMT = "(I10,I14,5F16.8)"
1726+
else
1727+
FMT = "(I10,I14,5F24.16)"
1728+
end if
17011729
17021730
do k = 1, nBubs
1703-
write (13, '(6X,2I24.8,5e24.8)') &
1731+
write (13, FMT) &
17041732
proc_rank, &
17051733
lag_id(k, 1), &
17061734
mtn_pos(k, 1, 1), &

tests/016C1B8B/golden-metadata.txt

Lines changed: 72 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/016C1B8B/golden.txt

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)