1# 1 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
44 include
'silo_f9x.inc'
50 real(wp),
allocatable,
dimension(:, :, :),
public ::
q_sf
51 real(wp),
allocatable,
dimension(:, :, :) ::
q_root_sf
52 real(wp),
allocatable,
dimension(:, :, :) ::
cyl_q_sf
55 real(sp),
allocatable,
dimension(:, :, :),
public ::
q_sf_s
76 integer,
allocatable,
dimension(:) ::
dims
89 character(LEN=path_len + name_len) ::
dbdir
91 character(LEN=path_len + 2*name_len) ::
rootdir
118 character(LEN=len_trim(case_dir) + 2*name_len) :: file_loc
159 if (
format == 1)
then
189 if (
format == 1)
then
222 if (
format == 1)
then
234 if (dir_check .neqv. .true.)
then
246 if (dir_check .neqv. .true.)
then
267 if (dir_check .neqv. .true.)
then
280 if (dir_check .neqv. .true.)
then
291 file_loc = trim(
dbdir)//
'/.'
294 if (dir_check .neqv. .true.)
then
304 if (
format == 2)
then
311 if (
format == 2)
then
445 integer :: lower_bound, upper_bound
447# 447 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
454 do i = lower_bound, upper_bound
461 do i = upper_bound, lower_bound, -1
474# 447 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
481 do i = lower_bound, upper_bound
488 do i = upper_bound, lower_bound, -1
501# 447 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
508 do i = lower_bound, upper_bound
515 do i = upper_bound, lower_bound, -1
528# 474 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
546 integer,
intent(IN) :: t_step
549 character(LEN=len_trim(case_dir) + 3*name_len) :: file_loc
555 if (
format == 1)
then
559 write (file_loc,
'(A,I0,A)')
'/', t_step,
'.silo'
564 ierr = dbcreate(trim(file_loc), len_trim(file_loc), &
565 db_clobber, db_local,
'MFC v3.0', 8, &
572 call s_mpi_abort(
'Unable to create Silo-HDF5 database '// &
573 'slave file '//trim(file_loc)//
'. '// &
582 write (file_loc,
'(A,I0,A)')
'/collection_', t_step,
'.silo'
583 file_loc = trim(
rootdir)//trim(file_loc)
585 ierr = dbcreate(trim(file_loc), len_trim(file_loc), &
586 db_clobber, db_local,
'MFC v3.0', 8, &
590 call s_mpi_abort(
'Unable to create Silo-HDF5 database '// &
591 'master file '//trim(file_loc)//
'. '// &
603 write (file_loc,
'(A,I0,A)')
'/', t_step,
'.dat'
608 open (
dbfile, iostat=
err, file=trim(file_loc), &
609 form=
'unformatted', status=
'replace')
615 call s_mpi_abort(
'Unable to create Binary database slave '// &
616 'file '//trim(file_loc)//
'. Exiting.')
637 write (file_loc,
'(A,I0,A)')
'/', t_step,
'.dat'
638 file_loc = trim(
rootdir)//trim(file_loc)
640 open (
dbroot, iostat=
err, file=trim(file_loc), &
641 form=
'unformatted', status=
'replace')
644 call s_mpi_abort(
'Unable to create Binary database '// &
645 'master file '//trim(file_loc)// &
664 character(LEN=path_len + 3*name_len) :: file_path
667 write (file_path,
'(A)')
'/intf_data.dat'
668 file_path = trim(
case_dir)//trim(file_path)
671 open (211, file=trim(file_path), &
681 character(LEN=path_len + 3*name_len) :: file_path
684 write (file_path,
'(A)')
'/eng_data.dat'
685 file_path = trim(
case_dir)//trim(file_path)
688 open (251, file=trim(file_path), &
717 integer,
intent(IN) :: t_step
723 character(LEN=4*name_len),
dimension(num_procs) :: meshnames
724 integer,
dimension(num_procs) :: meshtypes
733 if (
format == 1)
then
765 write (meshnames(i),
'(A,I0,A,I0,A)')
'../p', i - 1, &
766 '/', t_step,
'.silo:rectilinear_grid'
769 meshtypes = db_quad_rect
771 err = dbset2dstrlen(len(meshnames(1)))
773 err = dbaddiopt(
optlist, dbopt_extents_size, &
776 err = dbputmmesh(
dbroot,
'rectilinear_grid', 16, &
778 len_trim(meshnames), &
793 err = dbputqm(
dbfile,
'rectilinear_grid', 16, &
794 'x', 1,
'y', 1,
'z', 1, &
796 db_double, db_collinear, &
799 err = dbputqm(
dbfile,
'rectilinear_grid', 16, &
800 'x', 1,
'y', 1,
'z', 1, &
802 db_double, db_collinear, &
810 err = dbputqm(
dbfile,
'rectilinear_grid', 16, &
811 'x', 1,
'y', 1,
'z', 1, &
813 db_double, db_collinear, &
820 err = dbputqm(
dbfile,
'rectilinear_grid', 16, &
821 'x', 1,
'y', 1,
'z', 1, &
822 x_cb, db_f77null, db_f77null,
dims, 1, &
823 db_double, db_collinear, &
831 elseif (
format == 2)
then
923 character(LEN=*),
intent(IN) :: varname
926 integer,
intent(IN) :: t_step
932 character(LEN=4*name_len),
dimension(num_procs) :: varnames
933 integer,
dimension(num_procs) :: vartypes
942 if (
format == 1)
then
957 write (varnames(i),
'(A,I0,A,I0,A)')
'../p', i - 1, &
958 '/', t_step,
'.silo:'//trim(varname)
961 vartypes = db_quadvar
963 err = dbset2dstrlen(len(varnames(1)))
965 err = dbaddiopt(
optlist, dbopt_extents_size, 2)
969 varnames, len_trim(varnames), &
1007 elseif (wp == sp)
then
1026# 972 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1031 len_trim(varname), &
1032 'rectilinear_grid', 16, &
1034 0, db_float, db_zonecent, &
1038 len_trim(varname), &
1039 'rectilinear_grid', 16, &
1041 0, db_float, db_zonecent, &
1046 len_trim(varname), &
1047 'rectilinear_grid', 16, &
1049 0, db_float, db_zonecent, &
1053 len_trim(varname), &
1054 'rectilinear_grid', 16, &
1056 0, db_float, db_zonecent, &
1061# 972 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1066 len_trim(varname), &
1067 'rectilinear_grid', 16, &
1069 0, db_double, db_zonecent, &
1073 len_trim(varname), &
1074 'rectilinear_grid', 16, &
1076 0, db_double, db_zonecent, &
1081 len_trim(varname), &
1082 'rectilinear_grid', 16, &
1084 0, db_double, db_zonecent, &
1088 len_trim(varname), &
1089 'rectilinear_grid', 16, &
1091 0, db_double, db_zonecent, &
1096# 1007 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1141 integer,
intent(in) :: t_step
1143 character(len=len_trim(case_dir) + 3*name_len) :: file_loc
1148 real(wp),
dimension(20) :: inputvals
1149 real(wp) :: time_real
1150 integer,
dimension(MPI_STATUS_SIZE) :: status
1151 integer(KIND=MPI_OFFSET_KIND) :: disp
1154 logical :: lg_bub_file, file_exist
1156 integer,
dimension(2) :: gsizes, lsizes, start_idx_part
1159 real(wp) :: file_time, file_dt
1160 integer :: file_num_procs, file_tot_part, tot_part
1163 integer,
dimension(:),
allocatable :: proc_bubble_counts
1164 real(wp),
dimension(1:1, 1:lag_io_vars) :: lag_io_null
1168 write (file_loc,
'(A,I0,A)')
'lag_bubbles_', t_step,
'.dat'
1169 file_loc = trim(
case_dir)//
'/restart_data'//trim(
mpiiofs)//trim(file_loc)
1172 inquire (file=trim(file_loc), exist=file_exist)
1173 if (.not. file_exist)
then
1174 call s_mpi_abort(
'Restart file '//trim(file_loc)//
' does not exist!')
1180 call mpi_file_open(mpi_comm_self, file_loc, mpi_mode_rdonly, &
1183 call mpi_file_read(ifile, file_tot_part, 1, mpi_integer, status, ierr)
1184 call mpi_file_read(ifile, file_time, 1, mpi_p, status, ierr)
1185 call mpi_file_read(ifile, file_dt, 1, mpi_p, status, ierr)
1186 call mpi_file_read(ifile, file_num_procs, 1, mpi_integer, status, ierr)
1188 call mpi_file_close(ifile, ierr)
1191 call mpi_bcast(file_tot_part, 1, mpi_integer, 0, mpi_comm_world, ierr)
1192 call mpi_bcast(file_time, 1, mpi_p, 0, mpi_comm_world, ierr)
1193 call mpi_bcast(file_dt, 1, mpi_p, 0, mpi_comm_world, ierr)
1194 call mpi_bcast(file_num_procs, 1, mpi_integer, 0, mpi_comm_world, ierr)
1196 allocate (proc_bubble_counts(file_num_procs))
1199 call mpi_file_open(mpi_comm_self, file_loc, mpi_mode_rdonly, &
1203 disp = int(sizeof(file_tot_part) + 2*sizeof(file_time) + sizeof(file_num_procs), &
1205 call mpi_file_seek(ifile, disp, mpi_seek_set, ierr)
1206 call mpi_file_read(ifile, proc_bubble_counts, file_num_procs, mpi_integer, status, ierr)
1208 call mpi_file_close(ifile, ierr)
1211 call mpi_bcast(proc_bubble_counts, file_num_procs, mpi_integer, 0, mpi_comm_world, ierr)
1213 gsizes(1) = file_tot_part
1214 gsizes(2) = lag_io_vars
1215 lsizes(1) = file_tot_part
1216 lsizes(2) = lag_io_vars
1217 start_idx_part(1) = 0
1218 start_idx_part(2) = 0
1220 call mpi_type_create_subarray(2, gsizes, lsizes, start_idx_part, &
1221 mpi_order_fortran, mpi_p, view, ierr)
1222 call mpi_type_commit(view, ierr)
1224 call mpi_file_open(mpi_comm_world, file_loc, mpi_mode_rdonly, &
1227 disp = int(sizeof(file_tot_part) + 2*sizeof(file_time) + sizeof(file_num_procs) + &
1228 file_num_procs*sizeof(proc_bubble_counts(1)), mpi_offset_kind)
1229 call mpi_file_set_view(ifile, disp, mpi_p, view, &
1230 'native', mpi_info_null, ierr)
1235 mpi_p, status, ierr)
1237 write (file_loc,
'(A,I0,A)')
'lag_bubbles_post_process_', t_step,
'.dat'
1238 file_loc = trim(
case_dir)//
'/lag_bubbles_post_process/'//trim(file_loc)
1241 open (unit=29, file=file_loc, form=
'formatted', position=
'rewind')
1244 write (29,
'(A)', advance=
'no')
1245 if (
lag_id_wrt)
write (29,
'(A8)', advance=
'no')
'id, '
1246 if (
lag_pos_wrt)
write (29,
'(3(A17))', advance=
'no')
'px, ',
'py, ',
'pz, '
1247 if (
lag_pos_prev_wrt)
write (29,
'(3(A17))', advance=
'no')
'pvx, ',
'pvy, ',
'pvz, '
1248 if (
lag_vel_wrt)
write (29,
'(3(A17))', advance=
'no')
'vx, ',
'vy, ',
'vz, '
1249 if (
lag_rad_wrt)
write (29,
'(A17)', advance=
'no')
'radius, '
1250 if (
lag_rvel_wrt)
write (29,
'(A17)', advance=
'no')
'rvel, '
1251 if (
lag_r0_wrt)
write (29,
'(A17)', advance=
'no')
'r0, '
1252 if (
lag_rmax_wrt)
write (29,
'(A17)', advance=
'no')
'rmax, '
1253 if (
lag_rmin_wrt)
write (29,
'(A17)', advance=
'no')
'rmin, '
1255 if (
lag_pres_wrt)
write (29,
'(A17)', advance=
'no')
'pressure, '
1256 if (
lag_mv_wrt)
write (29,
'(A17)', advance=
'no')
'mv, '
1257 if (
lag_mg_wrt)
write (29,
'(A17)', advance=
'no')
'mg, '
1258 if (
lag_betat_wrt)
write (29,
'(A17)', advance=
'no')
'betaT, '
1259 if (
lag_betac_wrt)
write (29,
'(A17)', advance=
'no')
'betaC, '
1260 write (29,
'(A15)')
'time'
1263 do i = 1, file_tot_part
1267 write (29,
'(100(A))', advance=
'no')
''
1268 if (
lag_id_wrt)
write (29,
'(I6, A)', advance=
'no') id,
', '
1269 if (
lag_pos_wrt)
write (29,
'(3(E15.7, A))', advance=
'no') inputvals(1),
', ', inputvals(2),
', ', inputvals(3),
', '
1270 if (
lag_pos_prev_wrt)
write (29,
'(3(E15.7, A))', advance=
'no') inputvals(4),
', ', inputvals(5),
', ', inputvals(6),
', '
1271 if (
lag_vel_wrt)
write (29,
'(3(E15.7, A))', advance=
'no') inputvals(7),
', ', inputvals(8),
', ', inputvals(9),
', '
1272 if (
lag_rad_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(10),
', '
1273 if (
lag_rvel_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(11),
', '
1274 if (
lag_r0_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(12),
', '
1275 if (
lag_rmax_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(13),
', '
1276 if (
lag_rmin_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(14),
', '
1277 if (
lag_dphidt_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(15),
', '
1278 if (
lag_pres_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(16),
', '
1279 if (
lag_mv_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(17),
', '
1280 if (
lag_mg_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(18),
', '
1281 if (
lag_betat_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(19),
', '
1282 if (
lag_betac_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(20),
', '
1283 write (29,
'(E15.7)') time_real
1291 call s_mpi_barrier()
1293 call mpi_file_close(ifile, ierr)
1301 integer,
intent(in) :: t_step
1303 character(len=len_trim(case_dir) + 3*name_len) :: file_loc
1308 real(wp),
dimension(20) :: inputvals
1309 real(wp) :: time_real
1310 integer,
dimension(MPI_STATUS_SIZE) :: status
1311 integer(KIND=MPI_OFFSET_KIND) :: disp
1314 logical :: lg_bub_file, file_exist
1316 integer,
dimension(2) :: gsizes, lsizes, start_idx_part
1317 integer :: ifile, ierr, tot_data, valid_data, nbub
1318 real(wp) :: file_time, file_dt
1319 integer :: file_num_procs, file_tot_part
1320 integer,
dimension(:),
allocatable :: proc_bubble_counts
1321 real(wp),
dimension(1:1, 1:lag_io_vars) ::
dummy
1322 character(LEN=4*name_len),
dimension(num_procs) :: meshnames
1323 integer,
dimension(num_procs) :: meshtypes
1324 real(wp) :: dummy_data
1328 real(wp),
dimension(:),
allocatable :: bub_id
1329 real(wp),
dimension(:),
allocatable :: px, py, pz, ppx, ppy, ppz, vx, vy, vz
1330 real(wp),
dimension(:),
allocatable :: radius, rvel, rnot, rmax, rmin, dphidt
1331 real(wp),
dimension(:),
allocatable :: pressure, mv, mg, betat, betac
1337 write (file_loc,
'(A,I0,A)')
'lag_bubbles_', t_step,
'.dat'
1338 file_loc = trim(
case_dir)//
'/restart_data'//trim(
mpiiofs)//trim(file_loc)
1341 inquire (file=trim(file_loc), exist=file_exist)
1342 if (.not. file_exist)
then
1343 call s_mpi_abort(
'Restart file '//trim(file_loc)//
' does not exist!')
1349 call mpi_file_open(mpi_comm_self, file_loc, mpi_mode_rdonly, &
1352 call mpi_file_read(ifile, file_tot_part, 1, mpi_integer, status, ierr)
1353 call mpi_file_read(ifile, file_time, 1, mpi_p, status, ierr)
1354 call mpi_file_read(ifile, file_dt, 1, mpi_p, status, ierr)
1355 call mpi_file_read(ifile, file_num_procs, 1, mpi_integer, status, ierr)
1357 call mpi_file_close(ifile, ierr)
1360 call mpi_bcast(file_tot_part, 1, mpi_integer, 0, mpi_comm_world, ierr)
1361 call mpi_bcast(file_time, 1, mpi_p, 0, mpi_comm_world, ierr)
1362 call mpi_bcast(file_dt, 1, mpi_p, 0, mpi_comm_world, ierr)
1363 call mpi_bcast(file_num_procs, 1, mpi_integer, 0, mpi_comm_world, ierr)
1365 allocate (proc_bubble_counts(file_num_procs))
1368 call mpi_file_open(mpi_comm_self, file_loc, mpi_mode_rdonly, &
1372 disp = int(sizeof(file_tot_part) + 2*sizeof(file_time) + sizeof(file_num_procs), &
1374 call mpi_file_seek(ifile, disp, mpi_seek_set, ierr)
1375 call mpi_file_read(ifile, proc_bubble_counts, file_num_procs, mpi_integer, status, ierr)
1377 call mpi_file_close(ifile, ierr)
1380 call mpi_bcast(proc_bubble_counts, file_num_procs, mpi_integer, 0, mpi_comm_world, ierr)
1384 nbub = proc_bubble_counts(
proc_rank + 1)
1386 start_idx_part(1) = 0
1388 start_idx_part(1) = start_idx_part(1) + proc_bubble_counts(i)
1391 start_idx_part(2) = 0
1393 lsizes(2) = lag_io_vars
1395 gsizes(1) = file_tot_part
1396 gsizes(2) = lag_io_vars
1400# 1313 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1401 allocate (bub_id(nbub))
1402# 1313 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1404# 1313 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1406# 1313 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1408# 1313 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1409 allocate (ppx(nbub))
1410# 1313 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1411 allocate (ppy(nbub))
1412# 1313 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1413 allocate (ppz(nbub))
1414# 1313 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1416# 1313 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1418# 1313 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1420# 1313 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1421 allocate (radius(nbub))
1422# 1313 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1423 allocate (rvel(nbub))
1424# 1313 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1425 allocate (rnot(nbub))
1426# 1313 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1427 allocate (rmax(nbub))
1428# 1313 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1429 allocate (rmin(nbub))
1430# 1313 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1431 allocate (dphidt(nbub))
1432# 1313 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1433 allocate (pressure(nbub))
1434# 1313 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1436# 1313 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1438# 1313 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1439 allocate (betat(nbub))
1440# 1313 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1441 allocate (betac(nbub))
1442# 1315 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1445 call mpi_type_create_subarray(2, gsizes, lsizes, start_idx_part, &
1446 mpi_order_fortran, mpi_p, view, ierr)
1447 call mpi_type_commit(view, ierr)
1449 call mpi_file_open(mpi_comm_world, file_loc, mpi_mode_rdonly, &
1453 disp = int(sizeof(file_tot_part) + 2*sizeof(file_time) + sizeof(file_num_procs) + &
1454 file_num_procs*sizeof(proc_bubble_counts(1)), mpi_offset_kind)
1455 call mpi_file_set_view(ifile, disp, mpi_p, view,
'native',
mpi_info_int, ierr)
1458 lag_io_vars*nbub, mpi_p, status, ierr)
1460 call mpi_file_close(ifile, ierr)
1461 call mpi_type_free(view, ierr)
1465# 1341 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1467# 1341 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1469# 1341 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1471# 1341 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1473# 1341 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1475# 1341 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1477# 1341 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1479# 1341 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1481# 1341 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1483# 1341 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1485# 1341 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1487# 1341 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1489# 1341 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1491# 1341 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1493# 1341 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1495# 1341 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1497# 1341 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1499# 1341 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1501# 1341 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1503# 1341 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1505# 1341 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1507# 1343 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1516 write (meshnames(i),
'(A,I0,A,I0,A)')
'../p', i - 1, &
1517 '/', t_step,
'.silo:lag_bubbles'
1518 meshtypes(i) = db_pointmesh
1520 err = dbset2dstrlen(len(meshnames(1)))
1521 err = dbputmmesh(
dbroot,
'lag_bubbles', 16, &
1523 len_trim(meshnames), &
1524 meshtypes, db_f77null, ierr)
1527 err = dbputpm(
dbfile,
'lag_bubbles', 11, 3, &
1529 db_double, db_f77null, ierr)
1549 deallocate (bub_id, px, py, pz, ppx, ppy, ppz, vx, vy, vz, radius, &
1550 rvel, rnot, rmax, rmin, dphidt, pressure, mv, mg, &
1554 call mpi_type_contiguous(0, mpi_p, view, ierr)
1555 call mpi_type_commit(view, ierr)
1557 call mpi_file_open(mpi_comm_world, file_loc, mpi_mode_rdonly, &
1561 disp = int(sizeof(file_tot_part) + 2*sizeof(file_time) + sizeof(file_num_procs) + &
1562 file_num_procs*sizeof(proc_bubble_counts(1)), mpi_offset_kind)
1563 call mpi_file_set_view(ifile, disp, mpi_p, view,
'native',
mpi_info_int, ierr)
1565 call mpi_file_read_all(ifile,
dummy, 0, mpi_p, status, ierr)
1567 call mpi_file_close(ifile, ierr)
1568 call mpi_type_free(view, ierr)
1573 write (meshnames(i),
'(A,I0,A,I0,A)')
'../p', i - 1, &
1574 '/', t_step,
'.silo:lag_bubbles'
1575 meshtypes(i) = db_pointmesh
1577 err = dbset2dstrlen(len(meshnames(1)))
1578 err = dbputmmesh(
dbroot,
'lag_bubbles', 16, &
1580 len_trim(meshnames), &
1581 meshtypes, db_f77null, ierr)
1584 err = dbsetemptyok(1)
1585 err = dbputpm(
dbfile,
'lag_bubbles', 11, 3, &
1586 dummy_data, dummy_data, dummy_data, 0, &
1587 db_double, db_f77null, ierr)
1615 character(len=*),
intent(in) :: varname
1616 integer,
intent(in) :: t_step
1617 real(wp),
dimension(1:),
intent(in),
optional :: data
1618 integer,
intent(in),
optional :: nBubs
1620 character(len=64),
dimension(num_procs) :: var_names
1621 integer,
dimension(num_procs) :: var_types
1622 real(wp) :: dummy_data
1629 if (
present(nbubs) .and.
present(data))
then
1632 write (var_names(i),
'(A,I0,A,I0,A)')
'../p', i - 1, &
1633 '/', t_step,
'.silo:'//trim(varname)
1634 var_types(i) = db_pointvar
1636 err = dbset2dstrlen(len(var_names(1)))
1637 err = dbputmvar(
dbroot, trim(varname), len_trim(varname), &
1639 len_trim(var_names), &
1640 var_types, db_f77null, ierr)
1643 err = dbputpv1(
dbfile, trim(varname), len_trim(varname), &
1644 'lag_bubbles', 11,
data, nbubs, db_double, db_f77null, ierr)
1648 write (var_names(i),
'(A,I0,A,I0,A)')
'../p', i - 1, &
1649 '/', t_step,
'.silo:'//trim(varname)
1650 var_types(i) = db_pointvar
1652 err = dbset2dstrlen(len(var_names(1)))
1653 err = dbsetemptyok(1)
1654 err = dbputmvar(
dbroot, trim(varname), len_trim(varname), &
1656 len_trim(var_names), &
1657 var_types, db_f77null, ierr)
1660 err = dbsetemptyok(1)
1661 err = dbputpv1(
dbfile, trim(varname), len_trim(varname), &
1662 'lag_bubbles', 11, dummy_data, 0, db_double, db_f77null, ierr)
1670 type(
scalar_field),
dimension(sys_size),
intent(IN) :: q_prim_vf
1671 integer :: i,
j,
k,
l, cent
1672 integer :: counter, root
1673 real(wp),
allocatable :: x_td(:), y_td(:), x_d1(:), y_d1(:), y_d(:), x_d(:)
1674 real(wp) :: axp, axm, ayp, aym, tgp, euc_d, thres, maxalph_loc, maxalph_glb
1676 allocate (x_d1(
m*
n))
1677 allocate (y_d1(
m*
n))
1683 if (q_prim_vf(
e_idx + 2)%sf(i,
j,
k) > maxalph_loc)
then
1684 maxalph_loc = q_prim_vf(
e_idx + 2)%sf(i,
j,
k)
1690 call s_mpi_allreduce_max(maxalph_loc, maxalph_glb)
1701 thres = 0.9_wp*maxalph_glb
1704 axp = q_prim_vf(
e_idx + 2)%sf(
j + 1,
k, cent)
1705 axm = q_prim_vf(
e_idx + 2)%sf(
j,
k, cent)
1706 ayp = q_prim_vf(
e_idx + 2)%sf(
j,
k + 1, cent)
1707 aym = q_prim_vf(
e_idx + 2)%sf(
j,
k, cent)
1708 if ((axp > thres .and. axm < thres) .or. (axp < thres .and. axm > thres) &
1709 .or. (ayp > thres .and. aym < thres) .or. (ayp < thres .and. aym > thres))
then
1710 if (counter == 0)
then
1711 counter = counter + 1
1712 x_d1(counter) =
x_cc(
j)
1713 y_d1(counter) =
y_cc(
k)
1714 euc_d = sqrt((
x_cc(
j) - x_d1(i))**2 + (
y_cc(
k) - y_d1(i))**2)
1715 tgp = sqrt(
dx(
j)**2 +
dy(
k)**2)
1717 euc_d = sqrt((
x_cc(
j) - x_d1(i))**2 + (
y_cc(
k) - y_d1(i))**2)
1718 tgp = sqrt(
dx(
j)**2 +
dy(
k)**2)
1720 if (euc_d < tgp)
then
1722 elseif (euc_d > tgp .and. i == counter)
then
1723 counter = counter + 1
1724 x_d1(counter) =
x_cc(
j)
1725 y_d1(counter) =
y_cc(
k)
1734 allocate (x_d(counter), y_d(counter))
1742 call s_mpi_gather_data(x_d, counter, x_td, root)
1743 call s_mpi_gather_data(y_d, counter, y_td, root)
1745 do i = 1,
size(x_td)
1746 if (i ==
size(x_td))
then
1747 write (211,
'(F12.9,1X,F12.9,1X,I4)') &
1748 x_td(i), y_td(i),
size(x_td)
1750 write (211,
'(F12.9,1X,F12.9,1X,F3.1)') &
1751 x_td(i), y_td(i), 0._wp
1761 real(wp) :: elk, egk, elp, egint, vb, vl, pres_av, et
1762 real(wp) :: rho, pres, dv, tmp, gamma, pi_inf, maxma, maxma_glb, maxvel, c, ma, h, qv
1763 real(wp),
dimension(num_vels) :: vel
1764 real(wp),
dimension(num_fluids) ::
adv
1765 integer :: i,
j,
k,
l, s
1791 pres = q_prim_vf(
e_idx)%sf(i,
j,
k)
1792 egint = egint + q_prim_vf(
e_idx + 2)%sf(i,
j,
k)*(
gammas(2)*pres)*dv
1795 egk = egk + 0.5_wp*q_prim_vf(
e_idx + 2)%sf(i,
j,
k)*q_prim_vf(2)%sf(i,
j,
k)*vel(s)*vel(s)*dv
1796 elk = elk + 0.5_wp*q_prim_vf(
e_idx + 1)%sf(i,
j,
k)*q_prim_vf(1)%sf(i,
j,
k)*vel(s)*vel(s)*dv
1797 if (abs(vel(s)) > maxvel)
then
1798 maxvel = abs(vel(s))
1805 rho = rho +
adv(
l)*q_prim_vf(
l)%sf(i,
j,
k)
1809 h = ((gamma + 1._wp)*pres + pi_inf + qv)/rho
1813 h,
adv, 0._wp, 0._wp, c, qv)
1816 if (ma > maxma .and. (
adv(1) > (1.0_wp - 1.0e-10_wp)))
then
1821 pres_av = pres_av +
adv(1)*pres*dv
1828 call s_mpi_allreduce_sum(tmp, pres_av)
1830 call s_mpi_allreduce_sum(tmp, vl)
1832 call s_mpi_allreduce_max(maxma, maxma_glb)
1834 call s_mpi_allreduce_sum(tmp, elk)
1836 call s_mpi_allreduce_sum(tmp, egint)
1838 call s_mpi_allreduce_sum(tmp, egk)
1840 call s_mpi_allreduce_sum(tmp, vb)
1842 call s_mpi_allreduce_sum(tmp, et)
1846 write (251,
'(10X, 8F24.8)') &
1876 if (
format == 1)
then
1920 if (
format == 1)
then
type(scalar_field), dimension(sys_size), intent(inout) q_cons_vf
Platform-specific file and directory operations: create, delete, inquire, getcwd, and basename.
impure subroutine my_inquire(fileloc, dircheck)
Inquires on the existence of a directory.
impure subroutine s_create_directory(dir_name)
Creates a directory and all its parents if it does not exist.
Writes post-processed grid and flow-variable data to Silo-HDF5 or binary database files.
impure subroutine, public s_write_grid_to_formatted_database_file(t_step)
Write the computational grid (cell-boundary coordinates) to the formatted database slave and master f...
integer, dimension(:), allocatable hi_offset
real(sp), dimension(:, :, :), allocatable cyl_q_sf_s
real(wp), dimension(:, :), allocatable data_extents
impure subroutine, public s_write_variable_to_formatted_database_file(varname, t_step)
Write a single flow variable field to the formatted database slave and master files for a given time ...
impure subroutine, public s_open_energy_data_file()
Open the energy data file for appending volume-integrated energy budget quantities.
impure subroutine, public s_open_intf_data_file()
Open the interface data file for appending extracted interface coordinates.
character(len=path_len+name_len) dbdir
impure subroutine, public s_write_energy_data_file(q_prim_vf, q_cons_vf)
Compute volume-integrated kinetic, potential, and internal energies and write the energy budget to th...
real(sp), dimension(:, :, :), allocatable, public q_sf_s
impure subroutine, public s_write_lag_bubbles_to_formatted_database_file(t_step)
Read Lagrangian bubble restart data and write bubble positions and scalar fields to the Silo database...
integer, dimension(:), allocatable lo_offset
impure subroutine, public s_write_intf_data_file(q_prim_vf)
Extract the volume-fraction interface contour from primitive fields and write the coordinates to the ...
impure subroutine, public s_initialize_data_output_module()
Allocate storage arrays, configure output directories, and count flow variables for formatted databas...
impure subroutine, public s_close_energy_data_file()
Close the energy data file.
impure subroutine, public s_close_formatted_database_file()
Close the formatted database slave file and, for the root process, the master file.
impure subroutine, public s_open_formatted_database_file(t_step)
Open (or create) the Silo-HDF5 or Binary formatted database slave and master files for a given time s...
impure subroutine, public s_close_intf_data_file()
Close the interface data file.
impure subroutine, public s_write_lag_bubbles_results_to_text(t_step)
Subroutine that writes the post processed results in the folder 'lag_bubbles_data'.
real(wp), dimension(:, :, :), allocatable cyl_q_sf
impure subroutine, public s_finalize_data_output_module()
Deallocate module arrays and release all data-output resources.
integer, dimension(:), allocatable dims
impure subroutine, public s_define_output_region
Compute the cell-index bounds for the user-specified partial output domain in each coordinate directi...
real(wp), dimension(:, :), allocatable spatial_extents
character(len=path_len+2 *name_len) proc_rank_dir
real(wp), dimension(:, :, :), allocatable q_root_sf
subroutine s_write_lag_variable_to_formatted_database_file(varname, t_step, data, nbubs)
Write a single Lagrangian bubble point-variable to the Silo database slave and master files.
real(wp), dimension(:, :, :), allocatable, public q_sf
real(sp), dimension(:, :, :), allocatable q_root_sf_s
character(len=path_len+2 *name_len) rootdir
Shared derived types for field data, patch geometry, bubble dynamics, and MPI I/O structures.
Computes derived flow quantities (sound speed, vorticity, Schlieren, etc.) from conservative and prim...
Global parameters for the post-process: domain geometry, equation of state, and output database setti...
logical cont_damage
Continuum damage modeling.
logical hypoelasticity
Turn hypoelasticity on.
type(int_bounds_info) offset_y
type(int_bounds_info) mom_idx
Indexes of first & last momentum eqns.
integer num_fluids
Number of different fluids present in the flow.
logical, dimension(3) flux_wrt
real(wp), dimension(:), allocatable y_cc
integer proc_rank
Rank of the local processor.
logical output_partial_domain
Specify portion of domain to output for post-processing.
real(wp), dimension(:), allocatable adv
Advection variables.
type(int_bounds_info) z_output_idx
Indices of domain to output for post-processing.
logical dummy
AMDFlang workaround: keep a dummy logical to avoid a compiler case-optimization bug when a parameter+...
real(wp), dimension(:), allocatable y_cb
type(bounds_info) x_output
character(len=name_len) mpiiofs
real(wp), dimension(:), allocatable dz
real(wp), dimension(:, :), allocatable, public mpi_io_data_lg_bubbles
logical, dimension(3) mom_wrt
real(wp), dimension(:), allocatable x_root_cb
logical, dimension(num_fluids_max) alpha_wrt
logical, dimension(num_fluids_max) alpha_rho_wrt
integer model_eqns
Multicomponent flow model.
integer precision
Floating point precision of the database file(s).
real(wp), dimension(:), allocatable z_cb
type(bounds_info) z_output
Portion of domain to output for post-processing.
integer num_dims
Number of spatial dimensions.
type(int_bounds_info) x_output_idx
real(wp), dimension(:), allocatable x_cc
integer num_vels
Number of velocity components (different from num_dims for mhd).
real(wp), dimension(:), allocatable x_cb
real(wp), dimension(:), allocatable dy
type(int_bounds_info) offset_x
logical hyper_cleaning
Hyperbolic cleaning for MHD.
real(wp), dimension(:), allocatable z_cc
logical, dimension(3) omega_wrt
integer num_procs
Number of processors.
character(len=path_len) case_dir
Case folder location.
type(int_bounds_info) y_output_idx
type(int_bounds_info) adv_idx
Indexes of first & last advection eqns.
type(int_bounds_info) offset_z
logical mhd
Magnetohydrodynamics.
logical parallel_io
Format of the data files.
integer e_idx
Index of energy equation.
logical, dimension(3) vel_wrt
logical relativity
Relativity for RMHD.
real(wp), dimension(:), allocatable dx
Cell-width distributions in the x-, y- and z-coordinate directions.
type(bounds_info) y_output
Utility routines for bubble model setup, coordinate transforms, array sampling, and special functions...
MPI gather and scatter operations for distributing post-process grid and flow-variable data.
impure subroutine s_mpi_defragment_1d_grid_variable
This subroutine collects the sub-domain cell-boundary or cell-center locations data from all of the p...
impure subroutine s_mpi_defragment_1d_flow_variable(q_sf, q_root_sf)
This subroutine gathers the sub-domain flow variable data from all of the processors and puts it back...
impure subroutine s_mpi_gather_spatial_extents(spatial_extents)
This subroutine gathers the Silo database metadata for the spatial extents in order to boost the perf...
impure subroutine s_mpi_gather_data_extents(q_sf, data_extents)
This subroutine gathers the Silo database metadata for the flow variable's extents as to boost perfor...
Conservative-to-primitive variable conversion, mixture property evaluation, and pressure computation.
real(wp), dimension(:), allocatable, public gammas
subroutine s_compute_speed_of_sound(pres, rho, gamma, pi_inf, h, adv, vel_sum, c_c, c, qv)
Computes the speed of sound from thermodynamic state variables, supporting multiple equation-of-state...
real(wp), dimension(:), allocatable, public qvs
real(wp), dimension(:), allocatable, public pi_infs
Derived type annexing a scalar field (SF).