1# 1 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
28 include
'silo_f9x.inc'
34 integer,
private ::
err
41 character(LEN=len_trim(case_dir) + 2*name_len) :: file_loc
59 allocate (
out%q_root_sf(0:
m_root,0:0,0:0))
61 allocate (
out%q_root_sf_s(0:
m_root,0:0,0:0))
73 allocate (
out%lo_offset(1:3))
74 allocate (
out%hi_offset(1:3))
75 allocate (
out%dims(1:3))
78 allocate (
out%lo_offset(1:2))
79 allocate (
out%hi_offset(1:2))
80 allocate (
out%dims(1:2))
83 allocate (
out%lo_offset(1:1))
84 allocate (
out%hi_offset(1:1))
85 allocate (
out%dims(1:1))
123 out%dbdir = trim(case_dir) //
'/silo_hdf5'
127 out%proc_rank_dir = trim(
out%dbdir) // trim(
out%proc_rank_dir)
129 file_loc = trim(
out%proc_rank_dir) //
'/.'
132 if (dir_check .neqv. .true.)
then
137 out%rootdir = trim(
out%dbdir) //
'/root'
139 file_loc = trim(
out%rootdir) //
'/.'
142 if (dir_check .neqv. .true.)
then
147 out%dbdir = trim(case_dir) //
'/binary'
151 out%proc_rank_dir = trim(
out%dbdir) // trim(
out%proc_rank_dir)
153 file_loc = trim(
out%proc_rank_dir) //
'/.'
157 if (dir_check .neqv. .true.)
then
162 out%rootdir = trim(
out%dbdir) //
'/root'
164 file_loc = trim(
out%rootdir) //
'/.'
168 if (dir_check .neqv. .true.)
then
174 if (bubbles_lagrange)
then
175 if (lag_txt_wrt)
then
176 out%dbdir = trim(case_dir) //
'/lag_bubbles_post_process'
177 file_loc = trim(
out%dbdir) //
'/.'
180 if (dir_check .neqv. .true.)
then
199 if (alpha_rho_wrt(i) .or. (cons_vars_wrt .or. prim_vars_wrt))
then
200 out%dbvars =
out%dbvars + 1
205 if ((rho_wrt .or. (model_eqns ==
model_eqns_gamma_law .and. (cons_vars_wrt .or. prim_vars_wrt))) &
206 & .and. (.not. relativity))
then
207 out%dbvars =
out%dbvars + 1
210 if (relativity .and. (rho_wrt .or. prim_vars_wrt))
out%dbvars =
out%dbvars + 1
211 if (relativity .and. (rho_wrt .or. cons_vars_wrt))
out%dbvars =
out%dbvars + 1
213 do i = 1, eqn_idx%E - eqn_idx%mom%beg
214 if (mom_wrt(i) .or. cons_vars_wrt)
out%dbvars =
out%dbvars + 1
217 do i = 1, eqn_idx%E - eqn_idx%mom%beg
218 if (vel_wrt(i) .or. prim_vars_wrt)
out%dbvars =
out%dbvars + 1
221 do i = 1, eqn_idx%E - eqn_idx%mom%beg
222 if (flux_wrt(i))
out%dbvars =
out%dbvars + 1
225 if (e_wrt .or. cons_vars_wrt)
out%dbvars =
out%dbvars + 1
226 if (pres_wrt .or. prim_vars_wrt)
out%dbvars =
out%dbvars + 1
227 if (hypoelasticity)
out%dbvars =
out%dbvars + (num_dims*(num_dims + 1))/2
228 if (cont_damage)
out%dbvars =
out%dbvars + 1
229 if (hyper_cleaning)
out%dbvars =
out%dbvars + 1
233 out%dbvars =
out%dbvars + 2
235 out%dbvars =
out%dbvars + 3
240 do i = 1, num_fluids - 1
241 if (alpha_wrt(i) .or. (cons_vars_wrt .or. prim_vars_wrt))
then
242 out%dbvars =
out%dbvars + 1
246 if (alpha_wrt(num_fluids) .or. (cons_vars_wrt .or. prim_vars_wrt))
then
247 out%dbvars =
out%dbvars + 1
251 if (gamma_wrt .or. (model_eqns ==
model_eqns_gamma_law .and. (cons_vars_wrt .or. prim_vars_wrt)))
then
252 out%dbvars =
out%dbvars + 1
255 if (heat_ratio_wrt)
out%dbvars =
out%dbvars + 1
257 if (pi_inf_wrt .or. (model_eqns ==
model_eqns_gamma_law .and. (cons_vars_wrt .or. prim_vars_wrt)))
then
258 out%dbvars =
out%dbvars + 1
261 if (pres_inf_wrt)
out%dbvars =
out%dbvars + 1
262 if (c_wrt)
out%dbvars =
out%dbvars + 1
266 if (omega_wrt(i))
out%dbvars =
out%dbvars + 1
270 if (omega_wrt(i))
out%dbvars =
out%dbvars + 1
274 if (schlieren_wrt)
out%dbvars =
out%dbvars + 1
283 integer :: lower_bound, upper_bound
285# 285 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
291 do i = lower_bound, upper_bound
298 do i = upper_bound, lower_bound, -1
310# 285 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
316 do i = lower_bound, upper_bound
323 do i = upper_bound, lower_bound, -1
335# 285 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
341 do i = lower_bound, upper_bound
348 do i = upper_bound, lower_bound, -1
360# 310 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
367 integer,
intent(in) :: t_step
368 character(LEN=len_trim(case_dir) + 3*name_len) :: file_loc
372 write (file_loc,
'(A,I0,A)')
'/', t_step,
'.silo'
373 file_loc = trim(
out%proc_rank_dir) // trim(file_loc)
375 ierr = dbcreate(trim(file_loc), len_trim(file_loc), db_clobber, db_local,
'MFC v3.0', 8, db_hdf5,
out%dbfile)
377 if (
out%dbfile == -1)
then
378 call s_mpi_abort(
'Unable to create Silo-HDF5 database ' //
'slave file ' // trim(file_loc) //
'. ' //
'Exiting.')
382 write (file_loc,
'(A,I0,A)')
'/collection_', t_step,
'.silo'
383 file_loc = trim(
out%rootdir) // trim(file_loc)
385 ierr = dbcreate(trim(file_loc), len_trim(file_loc), db_clobber, db_local,
'MFC v3.0', 8, db_hdf5,
out%dbroot)
387 if (
out%dbroot == -1)
then
388 call s_mpi_abort(
'Unable to create Silo-HDF5 database ' //
'master file ' // trim(file_loc) //
'. ' &
393 write (file_loc,
'(A,I0,A)')
'/', t_step,
'.dat'
394 file_loc = trim(
out%proc_rank_dir) // trim(file_loc)
396 open (
out%dbfile, iostat=
err, file=trim(file_loc), form=
'unformatted', status=
'replace')
399 call s_mpi_abort(
'Unable to create Binary database slave ' //
'file ' // trim(file_loc) //
'. Exiting.')
402 if (output_partial_domain)
then
406 write (
out%dbfile) m, n, p,
out%dbvars
410 write (file_loc,
'(A,I0,A)')
'/', t_step,
'.dat'
411 file_loc = trim(
out%rootdir) // trim(file_loc)
413 open (
out%dbroot, iostat=
err, file=trim(file_loc), form=
'unformatted', status=
'replace')
416 call s_mpi_abort(
'Unable to create Binary database ' //
'master file ' // trim(file_loc) //
'. Exiting.')
419 if (output_partial_domain)
then
432 character(LEN=path_len + 3*name_len) :: file_path
434 write (file_path,
'(A)')
'/intf_data.dat'
435 file_path = trim(case_dir) // trim(file_path)
437 open (211, file=trim(file_path), form=
'formatted', position=
'append', status=
'unknown')
444 character(LEN=path_len + 3*name_len) :: file_path
446 write (file_path,
'(A)')
'/eng_data.dat'
447 file_path = trim(case_dir) // trim(file_path)
449 open (251, file=trim(file_path), form=
'formatted', position=
'append', status=
'unknown')
456 integer,
intent(in) :: t_step
459 character(LEN=4*name_len),
dimension(num_procs) :: meshnames
460 integer,
dimension(num_procs) :: meshtypes
480 out%spatial_extents(:,0) = (/minval(
x_cb), maxval(
x_cb)/)
488 write (meshnames(i),
'(A,I0,A,I0,A)')
'../p', i - 1,
'/', t_step,
'.silo:rectilinear_grid'
491 meshtypes = db_quad_rect
493 err = dbset2dstrlen(len(meshnames(1)))
494 err = dbmkoptlist(2,
out%optlist)
495 err = dbaddiopt(
out%optlist, dbopt_extents_size,
size(
out%spatial_extents, 1))
496 err = dbadddopt(
out%optlist, dbopt_extents,
out%spatial_extents)
497 err = dbputmmesh(
out%dbroot,
'rectilinear_grid', 16,
num_procs, meshnames, len_trim(meshnames), meshtypes, &
499 err = dbfreeoptlist(
out%optlist)
506 err = dbmkoptlist(2,
out%optlist)
507 err = dbaddiaopt(
out%optlist, dbopt_lo_offset,
size(
out%lo_offset),
out%lo_offset)
508 err = dbaddiaopt(
out%optlist, dbopt_hi_offset,
size(
out%hi_offset),
out%hi_offset)
510 err = dbputqm(
out%dbfile,
'rectilinear_grid', 16,
'x', 1,
'y', 1,
'z', 1,
y_cb,
z_cb,
x_cb,
out%dims, 3, &
511 & db_double, db_collinear,
out%optlist, ierr)
513 err = dbputqm(
out%dbfile,
'rectilinear_grid', 16,
'x', 1,
'y', 1,
'z', 1,
x_cb,
y_cb,
z_cb,
out%dims, 3, &
514 & db_double, db_collinear,
out%optlist, ierr)
516 err = dbfreeoptlist(
out%optlist)
518 err = dbmkoptlist(2,
out%optlist)
519 err = dbaddiaopt(
out%optlist, dbopt_lo_offset,
size(
out%lo_offset),
out%lo_offset)
520 err = dbaddiaopt(
out%optlist, dbopt_hi_offset,
size(
out%hi_offset),
out%hi_offset)
521 err = dbputqm(
out%dbfile,
'rectilinear_grid', 16,
'x', 1,
'y', 1,
'z', 1,
x_cb,
y_cb, db_f77null,
out%dims, 2, &
522 & db_double, db_collinear,
out%optlist, ierr)
523 err = dbfreeoptlist(
out%optlist)
525 err = dbmkoptlist(2,
out%optlist)
526 err = dbaddiaopt(
out%optlist, dbopt_lo_offset,
size(
out%lo_offset),
out%lo_offset)
527 err = dbaddiaopt(
out%optlist, dbopt_hi_offset,
size(
out%hi_offset),
out%hi_offset)
528 err = dbputqm(
out%dbfile,
'rectilinear_grid', 16,
'x', 1,
'y', 1,
'z', 1,
x_cb, db_f77null, db_f77null,
out%dims, &
529 & 1, db_double, db_collinear,
out%optlist, ierr)
530 err = dbfreeoptlist(
out%optlist)
539 if (output_partial_domain)
then
550 if (output_partial_domain)
then
561 write (
out%dbfile) real(
x_cb, sp)
563 if (output_partial_domain)
then
580 if (output_partial_domain)
then
595 character(LEN=*),
intent(in) :: varname
596 integer,
intent(in) :: t_step
599 character(LEN=4*name_len),
dimension(num_procs) :: varnames
600 integer,
dimension(num_procs) :: vartypes
609 out%data_extents(:,0) = (/minval(
out%q_sf), maxval(
out%q_sf)/)
614 write (varnames(i),
'(A,I0,A,I0,A)')
'../p', i - 1,
'/', t_step,
'.silo:' // trim(varname)
617 vartypes = db_quadvar
619 err = dbset2dstrlen(len(varnames(1)))
620 err = dbmkoptlist(2,
out%optlist)
621 err = dbaddiopt(
out%optlist, dbopt_extents_size, 2)
622 err = dbadddopt(
out%optlist, dbopt_extents,
out%data_extents)
623 err = dbputmvar(
out%dbroot, trim(varname), len_trim(varname),
num_procs, varnames, len_trim(varnames), vartypes, &
625 err = dbfreeoptlist(
out%optlist)
633 out%q_sf_s(i,
j,
k) = real(
out%q_sf(i,
j,
k), sp)
657 else if (wp == sp)
then
676# 626 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
677 if (precision == 1)
then
680 err = dbputqv1(
out%dbfile, trim(varname), len_trim(varname),
'rectilinear_grid', 16, &
681 &
out%cyl_q_sf_s,
out%dims - 1, 3, db_f77null, 0, db_float, db_zonecent, &
684 err = dbputqv1(
out%dbfile, trim(varname), len_trim(varname),
'rectilinear_grid', 16,
out%q_sf_s, &
685 &
out%dims - 1, 3, db_f77null, 0, db_float, db_zonecent, db_f77null, ierr)
688 err = dbputqv1(
out%dbfile, trim(varname), len_trim(varname),
'rectilinear_grid', 16,
out%q_sf_s, &
689 &
out%dims - 1, 2, db_f77null, 0, db_float, db_zonecent, db_f77null, ierr)
691 err = dbputqv1(
out%dbfile, trim(varname), len_trim(varname),
'rectilinear_grid', 16,
out%q_sf_s, &
692 &
out%dims - 1, 1, db_f77null, 0, db_float, db_zonecent, db_f77null, ierr)
695# 626 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
696 if (precision == 2)
then
699 err = dbputqv1(
out%dbfile, trim(varname), len_trim(varname),
'rectilinear_grid', 16, &
700 &
out%cyl_q_sf,
out%dims - 1, 3, db_f77null, 0, db_double, db_zonecent, &
703 err = dbputqv1(
out%dbfile, trim(varname), len_trim(varname),
'rectilinear_grid', 16,
out%q_sf, &
704 &
out%dims - 1, 3, db_f77null, 0, db_double, db_zonecent, db_f77null, ierr)
707 err = dbputqv1(
out%dbfile, trim(varname), len_trim(varname),
'rectilinear_grid', 16,
out%q_sf, &
708 &
out%dims - 1, 2, db_f77null, 0, db_double, db_zonecent, db_f77null, ierr)
710 err = dbputqv1(
out%dbfile, trim(varname), len_trim(varname),
'rectilinear_grid', 16,
out%q_sf, &
711 &
out%dims - 1, 1, db_f77null, 0, db_double, db_zonecent, db_f77null, ierr)
714# 645 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
719 write (
out%dbfile) varname, real(
out%q_sf, wp)
721 write (
out%dbfile) varname,
out%q_sf
730 out%q_root_sf(:,:,:) =
out%q_sf(:,:,:)
735 write (
out%dbroot) varname, real(
out%q_root_sf, wp)
737 write (
out%dbroot) varname,
out%q_root_sf
748 integer,
intent(in) :: t_step
749 character(len=len_trim(case_dir) + 3*name_len) :: file_loc
753 real(wp),
dimension(20) :: inputvals
754 real(wp) :: time_real
755 integer,
dimension(MPI_STATUS_SIZE) :: status
756 integer(KIND=MPI_OFFSET_KIND) :: disp
758 logical :: file_exist
759 integer,
dimension(2) :: gsizes, lsizes, start_idx_part
762 real(wp) :: file_time, file_dt
763 integer :: file_num_procs, file_tot_part
765 integer,
dimension(:),
allocatable :: proc_bubble_counts
766 real(wp),
dimension(1:1,1:lag_io_vars) :: lag_io_null
771 write (file_loc,
'(A,I0,A)')
'lag_bubbles_', t_step,
'.dat'
772 file_loc = trim(case_dir) //
'/restart_data' // trim(mpiiofs) // trim(file_loc)
775 inquire (file=trim(file_loc), exist=file_exist)
776 if (.not. file_exist)
then
777 call s_mpi_abort(
'Restart file ' // trim(file_loc) //
' does not exist!')
780 if (.not. parallel_io)
return
783 call mpi_file_open(mpi_comm_self, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
785 call mpi_file_read(ifile, file_tot_part, 1, mpi_integer, status, ierr)
786 call mpi_file_read(ifile, file_time, 1, mpi_p, status, ierr)
787 call mpi_file_read(ifile, file_dt, 1, mpi_p, status, ierr)
788 call mpi_file_read(ifile, file_num_procs, 1, mpi_integer, status, ierr)
790 call mpi_file_close(ifile, ierr)
793 call mpi_bcast(file_tot_part, 1, mpi_integer, 0, mpi_comm_world, ierr)
794 call mpi_bcast(file_time, 1, mpi_p, 0, mpi_comm_world, ierr)
795 call mpi_bcast(file_dt, 1, mpi_p, 0, mpi_comm_world, ierr)
796 call mpi_bcast(file_num_procs, 1, mpi_integer, 0, mpi_comm_world, ierr)
797 time_real = file_time
799 allocate (proc_bubble_counts(file_num_procs))
802 call mpi_file_open(mpi_comm_self, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
805 disp = int(sizeof(file_tot_part) + 2*sizeof(file_time) + sizeof(file_num_procs), mpi_offset_kind)
806 call mpi_file_seek(ifile, disp, mpi_seek_set, ierr)
807 call mpi_file_read(ifile, proc_bubble_counts, file_num_procs, mpi_integer, status, ierr)
809 call mpi_file_close(ifile, ierr)
812 call mpi_bcast(proc_bubble_counts, file_num_procs, mpi_integer, 0, mpi_comm_world, ierr)
814 gsizes(1) = file_tot_part
816 lsizes(1) = file_tot_part
818 start_idx_part(1) = 0
819 start_idx_part(2) = 0
821 call mpi_type_create_subarray(2, gsizes, lsizes, start_idx_part, mpi_order_fortran, mpi_p, view, ierr)
822 call mpi_type_commit(view, ierr)
824 call mpi_file_open(mpi_comm_world, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
826 disp = int(sizeof(file_tot_part) + 2*sizeof(file_time) + sizeof(file_num_procs) &
827 & + file_num_procs*sizeof(proc_bubble_counts(1)), mpi_offset_kind)
828 call mpi_file_set_view(ifile, disp, mpi_p, view,
'native', mpi_info_null, ierr)
834 write (file_loc,
'(A,I0,A)')
'lag_bubbles_post_process_', t_step,
'.dat'
835 file_loc = trim(case_dir) //
'/lag_bubbles_post_process/' // trim(file_loc)
838 open (unit=29, file=file_loc, form=
'formatted', position=
'rewind')
841 write (29,
'(A)', advance=
'no')
842 if (lag_id_wrt)
write (29,
'(A8)', advance=
'no')
'id, '
843 if (lag_pos_wrt)
write (29,
'(3(A17))', advance=
'no')
'px, ',
'py, ',
'pz, '
844 if (lag_pos_prev_wrt)
write (29,
'(3(A17))', advance=
'no')
'pvx, ',
'pvy, ',
'pvz, '
845 if (lag_vel_wrt)
write (29,
'(3(A17))', advance=
'no')
'vx, ',
'vy, ',
'vz, '
846 if (lag_rad_wrt)
write (29,
'(A17)', advance=
'no')
'radius, '
847 if (lag_rvel_wrt)
write (29,
'(A17)', advance=
'no')
'rvel, '
848 if (lag_r0_wrt)
write (29,
'(A17)', advance=
'no')
'r0, '
849 if (lag_rmax_wrt)
write (29,
'(A17)', advance=
'no')
'rmax, '
850 if (lag_rmin_wrt)
write (29,
'(A17)', advance=
'no')
'rmin, '
851 if (lag_dphidt_wrt)
write (29,
'(A17)', advance=
'no')
'dphidt, '
852 if (lag_pres_wrt)
write (29,
'(A17)', advance=
'no')
'pressure, '
853 if (lag_mv_wrt)
write (29,
'(A17)', advance=
'no')
'mv, '
854 if (lag_mg_wrt)
write (29,
'(A17)', advance=
'no')
'mg, '
855 if (lag_betat_wrt)
write (29,
'(A17)', advance=
'no')
'betaT, '
856 if (lag_betac_wrt)
write (29,
'(A17)', advance=
'no')
'betaC, '
857 write (29,
'(A15)')
'time'
860 do i = 1, file_tot_part
864 write (29,
'(100(A))', advance=
'no')
''
865 if (lag_id_wrt)
write (29,
'(I6, A)', advance=
'no') id,
', '
866 if (lag_pos_wrt)
write (29,
'(3(E15.7, A))', advance=
'no') inputvals(1),
', ', inputvals(2),
', ', &
868 if (lag_pos_prev_wrt)
write (29,
'(3(E15.7, A))', advance=
'no') inputvals(4),
', ', inputvals(5),
', ', &
870 if (lag_vel_wrt)
write (29,
'(3(E15.7, A))', advance=
'no') inputvals(7),
', ', inputvals(8),
', ', &
872 if (lag_rad_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(10),
', '
873 if (lag_rvel_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(11),
', '
874 if (lag_r0_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(12),
', '
875 if (lag_rmax_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(13),
', '
876 if (lag_rmin_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(14),
', '
877 if (lag_dphidt_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(15),
', '
878 if (lag_pres_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(16),
', '
879 if (lag_mv_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(17),
', '
880 if (lag_mg_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(18),
', '
881 if (lag_betat_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(19),
', '
882 if (lag_betac_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(20),
', '
883 write (29,
'(E15.7)') time_real
893 call mpi_file_close(ifile, ierr)
901 integer,
intent(in) :: t_step
902 character(len=len_trim(case_dir) + 3*name_len) :: file_loc
906 real(wp) :: time_real
907 integer,
dimension(MPI_STATUS_SIZE) :: status
908 integer(KIND=MPI_OFFSET_KIND) :: disp
910 logical :: file_exist
911 integer,
dimension(2) :: gsizes, lsizes, start_idx_part
912 integer :: ifile, ierr, nbub
913 real(wp) :: file_time, file_dt
914 integer :: file_num_procs, file_tot_part
915 integer,
dimension(:),
allocatable :: proc_bubble_counts
916 real(wp),
dimension(1:1,1:lag_io_vars) :: dummy
917 character(LEN=4*name_len),
dimension(num_procs) :: meshnames
918 integer,
dimension(num_procs) :: meshtypes
919 real(wp) :: dummy_data
921 real(wp),
dimension(:),
allocatable :: bub_id
922 real(wp),
dimension(:),
allocatable :: px, py, pz, ppx, ppy, ppz, vx, vy, vz
923 real(wp),
dimension(:),
allocatable :: radius, rvel, rnot, rmax, rmin, dphidt
924 real(wp),
dimension(:),
allocatable :: pressure, mv, mg, betat, betac
930 write (file_loc,
'(A,I0,A)')
'lag_bubbles_', t_step,
'.dat'
931 file_loc = trim(case_dir) //
'/restart_data' // trim(mpiiofs) // trim(file_loc)
934 inquire (file=trim(file_loc), exist=file_exist)
935 if (.not. file_exist)
then
936 call s_mpi_abort(
'Restart file ' // trim(file_loc) //
' does not exist!')
939 if (.not. parallel_io)
return
942 call mpi_file_open(mpi_comm_self, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
944 call mpi_file_read(ifile, file_tot_part, 1, mpi_integer, status, ierr)
945 call mpi_file_read(ifile, file_time, 1, mpi_p, status, ierr)
946 call mpi_file_read(ifile, file_dt, 1, mpi_p, status, ierr)
947 call mpi_file_read(ifile, file_num_procs, 1, mpi_integer, status, ierr)
949 call mpi_file_close(ifile, ierr)
952 call mpi_bcast(file_tot_part, 1, mpi_integer, 0, mpi_comm_world, ierr)
953 call mpi_bcast(file_time, 1, mpi_p, 0, mpi_comm_world, ierr)
954 call mpi_bcast(file_dt, 1, mpi_p, 0, mpi_comm_world, ierr)
955 call mpi_bcast(file_num_procs, 1, mpi_integer, 0, mpi_comm_world, ierr)
956 time_real = file_time
958 allocate (proc_bubble_counts(file_num_procs))
961 call mpi_file_open(mpi_comm_self, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
964 disp = int(sizeof(file_tot_part) + 2*sizeof(file_time) + sizeof(file_num_procs), mpi_offset_kind)
965 call mpi_file_seek(ifile, disp, mpi_seek_set, ierr)
966 call mpi_file_read(ifile, proc_bubble_counts, file_num_procs, mpi_integer, status, ierr)
968 call mpi_file_close(ifile, ierr)
971 call mpi_bcast(proc_bubble_counts, file_num_procs, mpi_integer, 0, mpi_comm_world, ierr)
977 start_idx_part(1) = 0
979 start_idx_part(1) = start_idx_part(1) + proc_bubble_counts(i)
982 start_idx_part(2) = 0
986 gsizes(1) = file_tot_part
990# 923 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
991 allocate (bub_id(nbub))
992# 923 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
994# 923 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
996# 923 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
998# 923 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1000# 923 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1001 allocate (ppy(nbub))
1002# 923 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1003 allocate (ppz(nbub))
1004# 923 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1006# 923 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1008# 923 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1010# 923 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1011 allocate (radius(nbub))
1012# 923 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1013 allocate (rvel(nbub))
1014# 923 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1015 allocate (rnot(nbub))
1016# 923 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1017 allocate (rmax(nbub))
1018# 923 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1019 allocate (rmin(nbub))
1020# 923 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1021 allocate (dphidt(nbub))
1022# 923 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1023 allocate (pressure(nbub))
1024# 923 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1026# 923 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1028# 923 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1029 allocate (betat(nbub))
1030# 923 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1031 allocate (betac(nbub))
1032# 925 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1035 call mpi_type_create_subarray(2, gsizes, lsizes, start_idx_part, mpi_order_fortran, mpi_p, view, ierr)
1036 call mpi_type_commit(view, ierr)
1038 call mpi_file_open(mpi_comm_world, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
1041 disp = int(sizeof(file_tot_part) + 2*sizeof(file_time) + sizeof(file_num_procs) &
1042 & + file_num_procs*sizeof(proc_bubble_counts(1)), mpi_offset_kind)
1043 call mpi_file_set_view(ifile, disp, mpi_p, view,
'native', mpi_info_int, ierr)
1047 call mpi_file_close(ifile, ierr)
1048 call mpi_type_free(view, ierr)
1051# 947 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1053# 947 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1055# 947 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1057# 947 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1059# 947 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1061# 947 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1063# 947 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1065# 947 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1067# 947 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1069# 947 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1071# 947 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1073# 947 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1075# 947 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1077# 947 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1079# 947 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1081# 947 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1083# 947 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1085# 947 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1087# 947 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1089# 947 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1091# 947 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1093# 949 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1100 write (meshnames(i),
'(A,I0,A,I0,A)')
'../p', i - 1,
'/', t_step,
'.silo:lag_bubbles'
1101 meshtypes(i) = db_pointmesh
1103 err = dbset2dstrlen(len(meshnames(1)))
1104 err = dbputmmesh(
out%dbroot,
'lag_bubbles', 16,
num_procs, meshnames, len_trim(meshnames), meshtypes, db_f77null, &
1108 err = dbputpm(
out%dbfile,
'lag_bubbles', 11, 3, px, py, pz, nbub, db_double, db_f77null, ierr)
1111 if (lag_vel_wrt)
then
1128 deallocate (bub_id, px, py, pz, ppx, ppy, ppz, vx, vy, vz, radius, rvel, rnot, rmax, rmin, dphidt, pressure, mv, mg, &
1132 call mpi_type_contiguous(0, mpi_p, view, ierr)
1133 call mpi_type_commit(view, ierr)
1135 call mpi_file_open(mpi_comm_world, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
1138 disp = int(sizeof(file_tot_part) + 2*sizeof(file_time) + sizeof(file_num_procs) &
1139 & + file_num_procs*sizeof(proc_bubble_counts(1)), mpi_offset_kind)
1140 call mpi_file_set_view(ifile, disp, mpi_p, view,
'native', mpi_info_int, ierr)
1142 call mpi_file_read_all(ifile, dummy, 0, mpi_p, status, ierr)
1144 call mpi_file_close(ifile, ierr)
1145 call mpi_type_free(view, ierr)
1149 write (meshnames(i),
'(A,I0,A,I0,A)')
'../p', i - 1,
'/', t_step,
'.silo:lag_bubbles'
1150 meshtypes(i) = db_pointmesh
1152 err = dbset2dstrlen(len(meshnames(1)))
1153 err = dbputmmesh(
out%dbroot,
'lag_bubbles', 16,
num_procs, meshnames, len_trim(meshnames), meshtypes, db_f77null, &
1157 err = dbsetemptyok(1)
1158 err = dbputpm(
out%dbfile,
'lag_bubbles', 11, 3, dummy_data, dummy_data, dummy_data, 0, db_double, db_f77null, ierr)
1161 if (lag_vel_wrt)
then
1185 character(len=*),
intent(in) :: varname
1186 integer,
intent(in) :: t_step
1187 real(wp),
dimension(1:),
intent(in),
optional :: data
1188 integer,
intent(in),
optional :: nBubs
1189 character(len=64),
dimension(num_procs) :: var_names
1190 integer,
dimension(num_procs) :: var_types
1191 real(wp) :: dummy_data
1197 if (
present(nbubs) .and.
present(data))
then
1200 write (var_names(i),
'(A,I0,A,I0,A)')
'../p', i - 1,
'/', t_step,
'.silo:' // trim(varname)
1201 var_types(i) = db_pointvar
1203 err = dbset2dstrlen(len(var_names(1)))
1204 err = dbputmvar(
out%dbroot, trim(varname), len_trim(varname),
num_procs, var_names, len_trim(var_names), &
1205 & var_types, db_f77null, ierr)
1208 err = dbputpv1(
out%dbfile, trim(varname), len_trim(varname),
'lag_bubbles', 11,
data, nbubs, db_double, db_f77null, &
1213 write (var_names(i),
'(A,I0,A,I0,A)')
'../p', i - 1,
'/', t_step,
'.silo:' // trim(varname)
1214 var_types(i) = db_pointvar
1216 err = dbset2dstrlen(len(var_names(1)))
1217 err = dbsetemptyok(1)
1218 err = dbputmvar(
out%dbroot, trim(varname), len_trim(varname),
num_procs, var_names, len_trim(var_names), &
1219 & var_types, db_f77null, ierr)
1222 err = dbsetemptyok(1)
1223 err = dbputpv1(
out%dbfile, trim(varname), len_trim(varname),
'lag_bubbles', 11, dummy_data, 0, db_double, db_f77null, &
1232 character(len=len_trim(case_dir) + 4*name_len) :: in_file, out_file, file_loc
1233 integer :: iu_in, ios, i, rec_id
1234 integer,
allocatable,
dimension(:) :: iu_out
1235 real(wp) :: rec_time
1236 real(wp),
dimension(3) :: rec_force, rec_torque
1237 real(wp),
dimension(3) :: rec_vel, rec_angular_vel
1238 real(wp),
dimension(3) :: rec_angles, rec_centroid
1240 file_loc = trim(case_dir) //
'/D'
1242 in_file = trim(file_loc) //
'/ib_state.dat'
1243 open (newunit=iu_in, file=trim(in_file), form=
'unformatted', access=
'stream', status=
'old', action=
'read', iostat=ios)
1245 call s_mpi_abort(
'Cannot open IB state input file: ' // trim(in_file))
1248 allocate (iu_out(num_ibs))
1250 write (out_file,
'(A,I0,A)') trim(file_loc) //
'/ib_', i,
'.txt'
1251 open (newunit=iu_out(i), file=trim(out_file), form=
'formatted', status=
'replace', action=
'write', iostat=ios)
1253 call s_mpi_abort(
'Cannot open IB state output file: ' // trim(out_file))
1256 &
'(A)')
'mytime fx fy fz Tau_x Tau_y Tau_z vx vy vz omega_x omega_y omega_z angle_x angle_y angle_z x_c y_c z_c'
1260 read (iu_in, iostat=ios) rec_time, rec_id, rec_force, rec_torque, rec_vel, rec_angular_vel, rec_angles, &
1261 & rec_centroid(1), rec_centroid(2), rec_centroid(3)
1264 if (rec_id >= 1 .and. rec_id <= num_ibs)
then
1265 write (iu_out(rec_id),
'(19(ES24.16E3,1X))') rec_time, rec_force(1), rec_force(2), rec_force(3), rec_torque(1), &
1266 & rec_torque(2), rec_torque(3), rec_vel(1), rec_vel(2), rec_vel(3), rec_angular_vel(1), &
1267 & rec_angular_vel(2), rec_angular_vel(3), rec_angles(1), rec_angles(2), rec_angles(3), rec_centroid(1), &
1268 & rec_centroid(2), rec_centroid(3)
1283 type(
scalar_field),
dimension(sys_size),
intent(in) :: q_prim_vf
1284 integer :: i,
j,
k,
l, cent
1285 integer :: counter, root
1286 real(wp),
allocatable :: x_td(:), y_td(:), x_d1(:), y_d1(:), y_d(:), x_d(:)
1287 real(wp) :: axp, axm, ayp, aym, tgp, euc_d, thres, maxalph_loc, maxalph_glb
1289 allocate (x_d1(m*n))
1290 allocate (y_d1(m*n))
1296 if (q_prim_vf(eqn_idx%E + 2)%sf(i,
j,
k) > maxalph_loc)
then
1297 maxalph_loc = q_prim_vf(eqn_idx%E + 2)%sf(i,
j,
k)
1303 call s_mpi_allreduce_max(maxalph_loc, maxalph_glb)
1314 thres = 0.9_wp*maxalph_glb
1317 axp = q_prim_vf(eqn_idx%E + 2)%sf(
j + 1,
k, cent)
1318 axm = q_prim_vf(eqn_idx%E + 2)%sf(
j,
k, cent)
1319 ayp = q_prim_vf(eqn_idx%E + 2)%sf(
j,
k + 1, cent)
1320 aym = q_prim_vf(eqn_idx%E + 2)%sf(
j,
k, cent)
1321 if ((axp > thres .and. axm < thres) .or. (axp < thres .and. axm > thres) .or. (ayp > thres .and. aym < thres) &
1322 & .or. (ayp < thres .and. aym > thres))
then
1323 if (counter == 0)
then
1324 counter = counter + 1
1325 x_d1(counter) =
x_cc(
j)
1326 y_d1(counter) =
y_cc(
k)
1328 tgp = sqrt(
dx(
j)**2 +
dy(
k)**2)
1330 euc_d = sqrt((
x_cc(
j) - x_d1(i))**2 + (
y_cc(
k) - y_d1(i))**2)
1331 if (euc_d < tgp)
then
1333 else if (i == counter)
then
1334 counter = counter + 1
1335 x_d1(counter) =
x_cc(
j)
1336 y_d1(counter) =
y_cc(
k)
1344 allocate (x_d(counter), y_d(counter))
1352 call s_mpi_gather_data(x_d, counter, x_td, root)
1353 call s_mpi_gather_data(y_d, counter, y_td, root)
1355 do i = 1,
size(x_td)
1356 if (i ==
size(x_td))
then
1357 write (211,
'(F12.9,1X,F12.9,1X,I4)') x_td(i), y_td(i),
size(x_td)
1359 write (211,
'(F12.9,1X,F12.9,1X,F3.1)') x_td(i), y_td(i), 0._wp
1370 real(wp) :: elk, egk, elp, egint, vb, vl, pres_av, et
1371 real(wp) :: rho, pres, dv, tmp, gamma, pi_inf, maxma, maxma_glb, maxvel, c, ma, h, qv
1372 real(wp),
dimension(num_vels) :: vel
1373 real(wp),
dimension(num_fluids) ::
adv
1374 integer :: i,
j,
k,
l, s
1400 pres = q_prim_vf(eqn_idx%E)%sf(i,
j,
k)
1401 egint = egint + q_prim_vf(eqn_idx%E + 2)%sf(i,
j,
k)*(
gammas(2)*pres)*dv
1403 vel(s) = q_prim_vf(num_fluids + s)%sf(i,
j,
k)
1404 egk = egk + 0.5_wp*q_prim_vf(eqn_idx%E + 2)%sf(i,
j,
k)*q_prim_vf(2)%sf(i,
j,
k)*vel(s)*vel(s)*dv
1405 elk = elk + 0.5_wp*q_prim_vf(eqn_idx%E + 1)%sf(i,
j,
k)*q_prim_vf(1)%sf(i,
j,
k)*vel(s)*vel(s)*dv
1406 if (abs(vel(s)) > maxvel)
then
1407 maxvel = abs(vel(s))
1410 do l = 1, eqn_idx%adv%end - eqn_idx%E
1411 adv(
l) = q_prim_vf(eqn_idx%E +
l)%sf(i,
j,
k)
1414 rho = rho +
adv(
l)*q_prim_vf(
l)%sf(i,
j,
k)
1418 h = ((gamma + 1._wp)*pres + pi_inf + qv)/rho
1423 if (ma > maxma .and. (
adv(1) > (1.0_wp - 1.0e-10_wp)))
then
1428 pres_av = pres_av +
adv(1)*pres*dv
1435 call s_mpi_allreduce_sum(tmp, pres_av)
1437 call s_mpi_allreduce_sum(tmp, vl)
1439 call s_mpi_allreduce_max(maxma, maxma_glb)
1441 call s_mpi_allreduce_sum(tmp, elk)
1443 call s_mpi_allreduce_sum(tmp, egint)
1445 call s_mpi_allreduce_sum(tmp, egk)
1447 call s_mpi_allreduce_sum(tmp, vb)
1449 call s_mpi_allreduce_sum(tmp, et)
1453 write (251,
'(10X, 8F24.8)') elp, egint, elk, egk, et, vb, vl, maxma_glb
1461 integer,
intent(in) :: t_step
1462 character(len=len_trim(case_dir) + 3*name_len) :: file_loc
1465 integer,
parameter :: nfields_per_ib = 20
1466 real(wp) :: ib_buf(nfields_per_ib)
1467 real(wp),
dimension(:,:),
allocatable :: ib_data
1468 logical :: file_exist
1469 character(LEN=4*name_len),
dimension(num_procs) :: meshnames
1470 integer,
dimension(num_procs) :: meshtypes
1471 integer :: i, ios, file_unit
1472 integer :: ierr, nbodies
1473 integer :: r, nlocal, gbl_id
1474 character(len=10) :: t_step_string
1475 real(wp),
dimension(:),
allocatable :: px, py, pz
1476 real(wp),
dimension(:),
allocatable :: force_x, force_y, force_z
1477 real(wp),
dimension(:),
allocatable :: torque_x, torque_y, torque_z
1478 real(wp),
dimension(:),
allocatable :: vel_x, vel_y, vel_z
1479 real(wp),
dimension(:),
allocatable :: omega_x, omega_y, omega_z
1480 real(wp),
dimension(:),
allocatable :: angle_x, angle_y, angle_z
1481 real(wp),
dimension(:),
allocatable :: ib_diameter
1486 if (nbodies > 0)
then
1487 allocate (ib_data(nbodies, nfields_per_ib))
1488 allocate (px(nbodies), py(nbodies), pz(nbodies))
1489 allocate (force_x(nbodies), force_y(nbodies), force_z(nbodies))
1490 allocate (torque_x(nbodies), torque_y(nbodies), torque_z(nbodies))
1491 allocate (vel_x(nbodies), vel_y(nbodies), vel_z(nbodies))
1492 allocate (omega_x(nbodies), omega_y(nbodies), omega_z(nbodies))
1493 allocate (angle_x(nbodies), angle_y(nbodies), angle_z(nbodies))
1494 allocate (ib_diameter(nbodies))
1496 if (file_per_process)
then
1500 write (file_loc,
'(A,I0,A,i7.7,A)')
'ib_state_', t_step,
'_', r,
'.dat'
1501 file_loc = trim(case_dir) //
'/restart_data/lustre_' // trim(t_step_string) //
'/' // trim(file_loc)
1503 inquire (file=trim(file_loc), exist=file_exist)
1504 if (.not. file_exist)
call s_mpi_abort(
'Restart file ' // trim(file_loc) //
' does not exist!')
1506 open (newunit=file_unit, file=trim(file_loc), form=
'unformatted', access=
'stream', status=
'old', iostat=ios)
1507 if (ios /= 0)
call s_mpi_abort(
'Cannot open IB state file: ' // trim(file_loc))
1509 read (file_unit, iostat=ios) nlocal
1510 if (ios /= 0)
call s_mpi_abort(
'Error reading IB state file header: ' // trim(file_loc))
1513 read (file_unit, iostat=ios) gbl_id
1514 if (ios /= 0)
call s_mpi_abort(
'Error reading IB patch ID: ' // trim(file_loc))
1515 read (file_unit, iostat=ios) ib_buf
1516 if (ios /= 0)
call s_mpi_abort(
'Error reading IB state data: ' // trim(file_loc))
1517 ib_data(gbl_id,:) = ib_buf(:)
1524 write (file_loc,
'(A,I0,A)')
'/restart_data/ib_state_', t_step,
'.dat'
1525 file_loc = trim(case_dir) // trim(file_loc)
1527 inquire (file=trim(file_loc), exist=file_exist)
1528 if (.not. file_exist)
call s_mpi_abort(
'Restart file ' // trim(file_loc) //
' does not exist!')
1530 open (newunit=file_unit, file=trim(file_loc), form=
'unformatted', access=
'stream', status=
'old', iostat=ios)
1531 if (ios /= 0)
call s_mpi_abort(
'Cannot open IB state file: ' // trim(file_loc))
1534 read (file_unit, iostat=ios) ib_buf
1535 if (ios /= 0)
call s_mpi_abort(
'Error reading IB state file')
1536 ib_data(i,:) = ib_buf(:)
1543 force_x(i) = ib_data(i, 2); force_y(i) = ib_data(i, 3); force_z(i) = ib_data(i, 4)
1544 torque_x(i) = ib_data(i, 5); torque_y(i) = ib_data(i, 6); torque_z(i) = ib_data(i, 7)
1545 vel_x(i) = ib_data(i, 8); vel_y(i) = ib_data(i, 9); vel_z(i) = ib_data(i, 10)
1546 omega_x(i) = ib_data(i, 11); omega_y(i) = ib_data(i, 12); omega_z(i) = ib_data(i, 13)
1547 angle_x(i) = ib_data(i, 14); angle_y(i) = ib_data(i, 15); angle_z(i) = ib_data(i, 16)
1548 px(i) = ib_data(i, 17); py(i) = ib_data(i, 18); pz(i) = ib_data(i, 19)
1549 ib_diameter(i) = ib_data(i, 20)*2.0_wp
1552 write (meshnames(1),
'(A,I0,A)')
'../p0/', t_step,
'.silo:ib_bodies'
1553 meshtypes(1) = db_pointmesh
1554 err = dbset2dstrlen(len(meshnames(1)))
1555 err = dbputmmesh(
out%dbroot,
'ib_bodies', 16, 1, meshnames, len_trim(meshnames), meshtypes, db_f77null, ierr)
1557 err = dbputpm(
out%dbfile,
'ib_bodies', 9, 3, px, py, pz, nbodies, db_double, db_f77null, ierr)
1576 deallocate (ib_data, px, py, pz, force_x, force_y, force_z)
1577 deallocate (torque_x, torque_y, torque_z, vel_x, vel_y, vel_z)
1578 deallocate (omega_x, omega_y, omega_z, angle_x, angle_y, angle_z)
1579 deallocate (ib_diameter)
1589 character(len=*),
intent(in) :: varname
1590 integer,
intent(in) :: t_step
1591 real(wp),
dimension(:),
intent(in) :: data
1592 integer,
intent(in) :: nBodies
1593 character(len=4*name_len) :: var_name_entry
1594 integer :: var_type_entry, ierr
1596 write (var_name_entry,
'(A,I0,A)')
'../p0/', t_step,
'.silo:' // trim(varname)
1597 var_type_entry = db_pointvar
1598 err = dbset2dstrlen(len(var_name_entry))
1599 err = dbputmvar(
out%dbroot, trim(varname), len_trim(varname), 1, var_name_entry, len_trim(var_name_entry), &
1600 & var_type_entry, db_f77null, ierr)
1602 err = dbputpv1(
out%dbfile, trim(varname), len_trim(varname),
'ib_bodies', 9,
data, nbodies, db_double, db_f77null, ierr)
1612 ierr = dbclose(
out%dbfile)
1638 deallocate (
out%q_sf)
1639 if (n == 0)
deallocate (
out%q_root_sf)
1641 deallocate (
out%cyl_q_sf)
1648 deallocate (
out%spatial_extents)
1649 deallocate (
out%data_extents)
1650 deallocate (
out%lo_offset)
1651 deallocate (
out%hi_offset)
1652 deallocate (
out%dims)
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)
Create a directory and all its parents if it does not exist.
Compile-time constant parameters: default values, tolerances, and physical constants.
integer, parameter lag_io_vars
Number of variables per particle for MPI_IO.
integer, parameter model_eqns_5eq
integer, parameter format_silo
integer, parameter format_binary
integer, parameter precision_single
integer, parameter model_eqns_6eq
integer, parameter model_eqns_gamma_law
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...
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.
impure subroutine, public s_write_ib_state_files()
Convert the binary immersed-boundary state file to per-body formatted text files.
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...
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...
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 ...
subroutine s_write_ib_variable(varname, t_step, data, nbodies)
Write a single IB point-variable to the Silo database slave and master files.
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)
Write the post-processed results in the folder 'lag_bubbles_data'.
impure subroutine, public s_finalize_data_output_module()
Deallocate module arrays and release all data-output resources.
impure subroutine, public s_define_output_region
Compute the cell-index bounds for the user-specified partial output domain in each coordinate directi...
impure subroutine, public s_write_ib_bodies_to_formatted_database_file(t_step)
Read IB state and write a Silo point mesh with per-body scalar fields.
type(output_context), public out
Output workspace: flow variable buffers, VisIt extents/offsets, directory paths, file handles,...
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.
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...
type(int_bounds_info) offset_y
real(wp), dimension(:,:), allocatable, public mpi_io_data_lg_bubbles
real(wp), dimension(:), allocatable y_cc
integer proc_rank
Rank of the local processor.
real(wp), dimension(:), allocatable adv
Advection variables.
type(int_bounds_info) z_output_idx
Indices of domain to output for post-processing.
real(wp), dimension(:), allocatable y_cb
type(bounds_info) x_output
real(wp), dimension(:), allocatable dz
real(wp), dimension(:), allocatable x_root_cb
real(wp), dimension(:), allocatable z_cb
type(bounds_info) z_output
Portion of domain to output for post-processing.
type(int_bounds_info) x_output_idx
real(wp), dimension(:), allocatable x_cc
real(wp), dimension(:), allocatable x_cb
real(wp), dimension(:), allocatable dy
type(int_bounds_info) offset_x
real(wp), dimension(:), allocatable z_cc
integer num_procs
Number of processors.
type(int_bounds_info) y_output_idx
type(int_bounds_info) offset_z
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...
elemental subroutine, public s_int_to_str(i, res)
Convert an integer to its trimmed string representation.
MPI gather and scatter operations for distributing post-process grid and flow-variable data.
impure subroutine s_mpi_defragment_1d_grid_variable
Collect the sub-domain cell-boundary or cell-center location data from all processors and put back to...
impure subroutine s_mpi_defragment_1d_flow_variable(q_sf, q_root_sf)
Gather the sub-domain flow variable data from all processors and reassemble it for the entire computa...
impure subroutine s_mpi_gather_spatial_extents(spatial_extents)
Gather spatial extents from all ranks for Silo database metadata.
impure subroutine s_mpi_gather_data_extents(q_sf, data_extents)
Gather the Silo database metadata for the flow variable's extents to boost performance of the multidi...
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)
Compute 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
Output workspace for post_process: flow variable buffers, VisIt extents/offsets, directory paths,...
Derived type annexing a scalar field (SF).