1# 1 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
29 include
'silo_f9x.inc'
35 integer,
private ::
err
42 character(LEN=len_trim(case_dir) + 2*name_len) :: file_loc
60 allocate (
out%q_root_sf(0:
m_root,0:0,0:0))
62 allocate (
out%q_root_sf_s(0:
m_root,0:0,0:0))
74 allocate (
out%lo_offset(1:3))
75 allocate (
out%hi_offset(1:3))
76 allocate (
out%dims(1:3))
79 allocate (
out%lo_offset(1:2))
80 allocate (
out%hi_offset(1:2))
81 allocate (
out%dims(1:2))
84 allocate (
out%lo_offset(1:1))
85 allocate (
out%hi_offset(1:1))
86 allocate (
out%dims(1:1))
124 out%dbdir = trim(case_dir) //
'/silo_hdf5'
128 out%proc_rank_dir = trim(
out%dbdir) // trim(
out%proc_rank_dir)
130 file_loc = trim(
out%proc_rank_dir) //
'/.'
133 if (dir_check .neqv. .true.)
then
138 out%rootdir = trim(
out%dbdir) //
'/root'
140 file_loc = trim(
out%rootdir) //
'/.'
143 if (dir_check .neqv. .true.)
then
148 out%dbdir = trim(case_dir) //
'/binary'
152 out%proc_rank_dir = trim(
out%dbdir) // trim(
out%proc_rank_dir)
154 file_loc = trim(
out%proc_rank_dir) //
'/.'
158 if (dir_check .neqv. .true.)
then
163 out%rootdir = trim(
out%dbdir) //
'/root'
165 file_loc = trim(
out%rootdir) //
'/.'
169 if (dir_check .neqv. .true.)
then
175 if (bubbles_lagrange)
then
176 if (lag_txt_wrt)
then
177 out%dbdir = trim(case_dir) //
'/lag_bubbles_post_process'
178 file_loc = trim(
out%dbdir) //
'/.'
181 if (dir_check .neqv. .true.)
then
200 if (alpha_rho_wrt(i) .or. (cons_vars_wrt .or. prim_vars_wrt))
then
201 out%dbvars =
out%dbvars + 1
206 if ((rho_wrt .or. (model_eqns ==
model_eqns_gamma_law .and. (cons_vars_wrt .or. prim_vars_wrt))) &
207 & .and. (.not. relativity))
then
208 out%dbvars =
out%dbvars + 1
211 if (relativity .and. (rho_wrt .or. prim_vars_wrt))
out%dbvars =
out%dbvars + 1
212 if (relativity .and. (rho_wrt .or. cons_vars_wrt))
out%dbvars =
out%dbvars + 1
214 do i = 1, eqn_idx%E - eqn_idx%mom%beg
215 if (mom_wrt(i) .or. cons_vars_wrt)
out%dbvars =
out%dbvars + 1
218 do i = 1, eqn_idx%E - eqn_idx%mom%beg
219 if (vel_wrt(i) .or. prim_vars_wrt)
out%dbvars =
out%dbvars + 1
222 do i = 1, eqn_idx%E - eqn_idx%mom%beg
223 if (flux_wrt(i))
out%dbvars =
out%dbvars + 1
226 if (e_wrt .or. cons_vars_wrt)
out%dbvars =
out%dbvars + 1
227 if (pres_wrt .or. prim_vars_wrt)
out%dbvars =
out%dbvars + 1
228 if (hypoelasticity)
out%dbvars =
out%dbvars + (num_dims*(num_dims + 1))/2
229 if (cont_damage)
out%dbvars =
out%dbvars + 1
230 if (hyper_cleaning)
out%dbvars =
out%dbvars + 1
234 out%dbvars =
out%dbvars + 2
236 out%dbvars =
out%dbvars + 3
241 do i = 1, num_fluids - 1
242 if (alpha_wrt(i) .or. (cons_vars_wrt .or. prim_vars_wrt))
then
243 out%dbvars =
out%dbvars + 1
247 if (alpha_wrt(num_fluids) .or. (cons_vars_wrt .or. prim_vars_wrt))
then
248 out%dbvars =
out%dbvars + 1
252 if (gamma_wrt .or. (model_eqns ==
model_eqns_gamma_law .and. (cons_vars_wrt .or. prim_vars_wrt)))
then
253 out%dbvars =
out%dbvars + 1
256 if (heat_ratio_wrt)
out%dbvars =
out%dbvars + 1
258 if (pi_inf_wrt .or. (model_eqns ==
model_eqns_gamma_law .and. (cons_vars_wrt .or. prim_vars_wrt)))
then
259 out%dbvars =
out%dbvars + 1
262 if (pres_inf_wrt)
out%dbvars =
out%dbvars + 1
263 if (c_wrt)
out%dbvars =
out%dbvars + 1
267 if (omega_wrt(i))
out%dbvars =
out%dbvars + 1
271 if (omega_wrt(i))
out%dbvars =
out%dbvars + 1
275 if (schlieren_wrt)
out%dbvars =
out%dbvars + 1
284 integer :: lower_bound, upper_bound
286# 286 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
292 do i = lower_bound, upper_bound
299 do i = upper_bound, lower_bound, -1
311# 286 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
317 do i = lower_bound, upper_bound
324 do i = upper_bound, lower_bound, -1
336# 286 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
342 do i = lower_bound, upper_bound
349 do i = upper_bound, lower_bound, -1
361# 311 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
368 integer,
intent(in) :: t_step
369 character(LEN=len_trim(case_dir) + 3*name_len) :: file_loc
373 write (file_loc,
'(A,I0,A)')
'/', t_step,
'.silo'
374 file_loc = trim(
out%proc_rank_dir) // trim(file_loc)
376 ierr = dbcreate(trim(file_loc), len_trim(file_loc), db_clobber, db_local,
'MFC v3.0', 8, db_hdf5,
out%dbfile)
378 if (
out%dbfile == -1)
then
379 call s_mpi_abort(
'Unable to create Silo-HDF5 database ' //
'slave file ' // trim(file_loc) //
'. ' //
'Exiting.')
383 write (file_loc,
'(A,I0,A)')
'/collection_', t_step,
'.silo'
384 file_loc = trim(
out%rootdir) // trim(file_loc)
386 ierr = dbcreate(trim(file_loc), len_trim(file_loc), db_clobber, db_local,
'MFC v3.0', 8, db_hdf5,
out%dbroot)
388 if (
out%dbroot == -1)
then
389 call s_mpi_abort(
'Unable to create Silo-HDF5 database ' //
'master file ' // trim(file_loc) //
'. ' &
394 write (file_loc,
'(A,I0,A)')
'/', t_step,
'.dat'
395 file_loc = trim(
out%proc_rank_dir) // trim(file_loc)
397 open (
out%dbfile, iostat=
err, file=trim(file_loc), form=
'unformatted', status=
'replace')
400 call s_mpi_abort(
'Unable to create Binary database slave ' //
'file ' // trim(file_loc) //
'. Exiting.')
403 if (output_partial_domain)
then
407 write (
out%dbfile) m, n, p,
out%dbvars
411 write (file_loc,
'(A,I0,A)')
'/', t_step,
'.dat'
412 file_loc = trim(
out%rootdir) // trim(file_loc)
414 open (
out%dbroot, iostat=
err, file=trim(file_loc), form=
'unformatted', status=
'replace')
417 call s_mpi_abort(
'Unable to create Binary database ' //
'master file ' // trim(file_loc) //
'. Exiting.')
420 if (output_partial_domain)
then
433 character(LEN=path_len + 3*name_len) :: file_path
435 write (file_path,
'(A)')
'/intf_data.dat'
436 file_path = trim(case_dir) // trim(file_path)
438 open (211, file=trim(file_path), form=
'formatted', position=
'append', status=
'unknown')
445 character(LEN=path_len + 3*name_len) :: file_path
447 write (file_path,
'(A)')
'/eng_data.dat'
448 file_path = trim(case_dir) // trim(file_path)
450 open (251, file=trim(file_path), form=
'formatted', position=
'append', status=
'unknown')
457 integer,
intent(in) :: t_step
460 character(LEN=4*name_len),
dimension(num_procs) :: meshnames
461 integer,
dimension(num_procs) :: meshtypes
464 integer :: extents_size
482 out%spatial_extents(:,0) = (/minval(
x_cb), maxval(
x_cb)/)
490 write (meshnames(i),
'(A,I0,A,I0,A)')
'../p', i - 1,
'/', t_step,
'.silo:rectilinear_grid'
493 meshtypes = db_quad_rect
495 err = dbset2dstrlen(len(meshnames(1)))
496 err = dbmkoptlist(2,
out%optlist)
497 extents_size =
size(
out%spatial_extents, 1)
498 err = dbaddiopt(
out%optlist, dbopt_extents_size, extents_size)
499 err = dbadddopt(
out%optlist, dbopt_extents,
out%spatial_extents)
500 err = dbputmmesh(
out%dbroot,
'rectilinear_grid', 16,
num_procs, meshnames, len_trim(meshnames), meshtypes, &
502 err = dbfreeoptlist(
out%optlist)
509 err = dbmkoptlist(2,
out%optlist)
510 err = dbaddiaopt(
out%optlist, dbopt_lo_offset,
size(
out%lo_offset),
out%lo_offset)
511 err = dbaddiaopt(
out%optlist, dbopt_hi_offset,
size(
out%hi_offset),
out%hi_offset)
513 err = dbputqm(
out%dbfile,
'rectilinear_grid', 16,
'x', 1,
'y', 1,
'z', 1,
y_cb,
z_cb,
x_cb,
out%dims, 3, &
514 & db_double, db_collinear,
out%optlist, ierr)
516 err = dbputqm(
out%dbfile,
'rectilinear_grid', 16,
'x', 1,
'y', 1,
'z', 1,
x_cb,
y_cb,
z_cb,
out%dims, 3, &
517 & db_double, db_collinear,
out%optlist, ierr)
519 err = dbfreeoptlist(
out%optlist)
521 err = dbmkoptlist(2,
out%optlist)
522 err = dbaddiaopt(
out%optlist, dbopt_lo_offset,
size(
out%lo_offset),
out%lo_offset)
523 err = dbaddiaopt(
out%optlist, dbopt_hi_offset,
size(
out%hi_offset),
out%hi_offset)
524 err = dbputqm(
out%dbfile,
'rectilinear_grid', 16,
'x', 1,
'y', 1,
'z', 1,
x_cb,
y_cb, db_f77null,
out%dims, 2, &
525 & db_double, db_collinear,
out%optlist, ierr)
526 err = dbfreeoptlist(
out%optlist)
528 err = dbmkoptlist(2,
out%optlist)
529 err = dbaddiaopt(
out%optlist, dbopt_lo_offset,
size(
out%lo_offset),
out%lo_offset)
530 err = dbaddiaopt(
out%optlist, dbopt_hi_offset,
size(
out%hi_offset),
out%hi_offset)
531 err = dbputqm(
out%dbfile,
'rectilinear_grid', 16,
'x', 1,
'y', 1,
'z', 1,
x_cb, db_f77null, db_f77null,
out%dims, &
532 & 1, db_double, db_collinear,
out%optlist, ierr)
533 err = dbfreeoptlist(
out%optlist)
542 if (output_partial_domain)
then
553 if (output_partial_domain)
then
564 write (
out%dbfile) real(
x_cb, sp)
566 if (output_partial_domain)
then
583 if (output_partial_domain)
then
598 character(LEN=*),
intent(in) :: varname
599 integer,
intent(in) :: t_step
602 character(LEN=4*name_len),
dimension(num_procs) :: varnames
603 integer,
dimension(num_procs) :: vartypes
606 integer :: extents_size
613 out%data_extents(:,0) = (/minval(
out%q_sf), maxval(
out%q_sf)/)
618 write (varnames(i),
'(A,I0,A,I0,A)')
'../p', i - 1,
'/', t_step,
'.silo:' // trim(varname)
621 vartypes = db_quadvar
623 err = dbset2dstrlen(len(varnames(1)))
624 err = dbmkoptlist(2,
out%optlist)
625 extents_size =
size(
out%data_extents, 1)
626 err = dbaddiopt(
out%optlist, dbopt_extents_size, extents_size)
627 err = dbadddopt(
out%optlist, dbopt_extents,
out%data_extents)
628 err = dbputmvar(
out%dbroot, trim(varname), len_trim(varname),
num_procs, varnames, len_trim(varnames), vartypes, &
630 err = dbfreeoptlist(
out%optlist)
638 out%q_sf_s(i,
j,
k) = real(
out%q_sf(i,
j,
k), sp)
662 else if (wp == sp)
then
681# 631 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
682 if (precision == 1)
then
685 err = dbputqv1(
out%dbfile, trim(varname), len_trim(varname),
'rectilinear_grid', 16, &
686 &
out%cyl_q_sf_s,
out%dims - 1, 3, db_f77null, 0, db_float, db_zonecent, &
689 err = dbputqv1(
out%dbfile, trim(varname), len_trim(varname),
'rectilinear_grid', 16,
out%q_sf_s, &
690 &
out%dims - 1, 3, db_f77null, 0, db_float, db_zonecent, db_f77null, ierr)
693 err = dbputqv1(
out%dbfile, trim(varname), len_trim(varname),
'rectilinear_grid', 16,
out%q_sf_s, &
694 &
out%dims - 1, 2, db_f77null, 0, db_float, db_zonecent, db_f77null, ierr)
696 err = dbputqv1(
out%dbfile, trim(varname), len_trim(varname),
'rectilinear_grid', 16,
out%q_sf_s, &
697 &
out%dims - 1, 1, db_f77null, 0, db_float, db_zonecent, db_f77null, ierr)
700# 631 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
701 if (precision == 2)
then
704 err = dbputqv1(
out%dbfile, trim(varname), len_trim(varname),
'rectilinear_grid', 16, &
705 &
out%cyl_q_sf,
out%dims - 1, 3, db_f77null, 0, db_double, db_zonecent, &
708 err = dbputqv1(
out%dbfile, trim(varname), len_trim(varname),
'rectilinear_grid', 16,
out%q_sf, &
709 &
out%dims - 1, 3, db_f77null, 0, db_double, db_zonecent, db_f77null, ierr)
712 err = dbputqv1(
out%dbfile, trim(varname), len_trim(varname),
'rectilinear_grid', 16,
out%q_sf, &
713 &
out%dims - 1, 2, db_f77null, 0, db_double, db_zonecent, db_f77null, ierr)
715 err = dbputqv1(
out%dbfile, trim(varname), len_trim(varname),
'rectilinear_grid', 16,
out%q_sf, &
716 &
out%dims - 1, 1, db_f77null, 0, db_double, db_zonecent, db_f77null, ierr)
719# 650 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
724 write (
out%dbfile) varname, real(
out%q_sf, wp)
726 write (
out%dbfile) varname,
out%q_sf
735 out%q_root_sf(:,:,:) =
out%q_sf(:,:,:)
740 write (
out%dbroot) varname, real(
out%q_root_sf, wp)
742 write (
out%dbroot) varname,
out%q_root_sf
753 integer,
intent(in) :: t_step
754 character(len=len_trim(case_dir) + 3*name_len) :: file_loc
758 real(wp),
dimension(20) :: inputvals
759 real(wp) :: time_real
760 integer,
dimension(MPI_STATUS_SIZE) :: status
761 integer(KIND=MPI_OFFSET_KIND) :: disp
763 logical :: file_exist
764 integer,
dimension(2) :: gsizes, lsizes, start_idx_part
767 real(wp) :: file_time, file_dt
768 integer :: file_num_procs, file_tot_part
770 integer,
dimension(:),
allocatable :: proc_bubble_counts
771 real(wp),
dimension(1:1,1:lag_io_vars) :: lag_io_null
776 write (file_loc,
'(A,I0,A)')
'lag_bubbles_', t_step,
'.dat'
777 file_loc = trim(case_dir) //
'/restart_data' // trim(mpiiofs) // trim(file_loc)
780 inquire (file=trim(file_loc), exist=file_exist)
781 if (.not. file_exist)
then
782 call s_mpi_abort(
'Restart file ' // trim(file_loc) //
' does not exist!')
785 if (.not. parallel_io)
return
788 call mpi_file_open(mpi_comm_self, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
790 call mpi_file_read(ifile, file_tot_part, 1, mpi_integer, status, ierr)
791 call mpi_file_read(ifile, file_time, 1, mpi_p, status, ierr)
792 call mpi_file_read(ifile, file_dt, 1, mpi_p, status, ierr)
793 call mpi_file_read(ifile, file_num_procs, 1, mpi_integer, status, ierr)
795 call mpi_file_close(ifile, ierr)
798 call mpi_bcast(file_tot_part, 1, mpi_integer, 0, mpi_comm_world, ierr)
799 call mpi_bcast(file_time, 1, mpi_p, 0, mpi_comm_world, ierr)
800 call mpi_bcast(file_dt, 1, mpi_p, 0, mpi_comm_world, ierr)
801 call mpi_bcast(file_num_procs, 1, mpi_integer, 0, mpi_comm_world, ierr)
802 time_real = file_time
804 allocate (proc_bubble_counts(file_num_procs))
807 call mpi_file_open(mpi_comm_self, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
810 disp = int(sizeof(file_tot_part) + 2*sizeof(file_time) + sizeof(file_num_procs), mpi_offset_kind)
811 call mpi_file_seek(ifile, disp, mpi_seek_set, ierr)
812 call mpi_file_read(ifile, proc_bubble_counts, file_num_procs, mpi_integer, status, ierr)
814 call mpi_file_close(ifile, ierr)
817 call mpi_bcast(proc_bubble_counts, file_num_procs, mpi_integer, 0, mpi_comm_world, ierr)
819 if (file_tot_part > 0)
then
820 gsizes(1) = file_tot_part
822 lsizes(1) = file_tot_part
824 start_idx_part(1) = 0
825 start_idx_part(2) = 0
827 call mpi_type_create_subarray(2, gsizes, lsizes, start_idx_part, mpi_order_fortran, mpi_p, view, ierr)
828 call mpi_type_commit(view, ierr)
830 call mpi_file_open(mpi_comm_world, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
832 disp = int(sizeof(file_tot_part) + 2*sizeof(file_time) + sizeof(file_num_procs) &
833 & + file_num_procs*sizeof(proc_bubble_counts(1)), mpi_offset_kind)
834 call mpi_file_set_view(ifile, disp, mpi_p, view,
'native', mpi_info_null, ierr)
840 write (file_loc,
'(A,I0,A)')
'lag_bubbles_post_process_', t_step,
'.dat'
841 file_loc = trim(case_dir) //
'/lag_bubbles_post_process/' // trim(file_loc)
844 open (unit=29, file=file_loc, form=
'formatted', position=
'rewind')
847 write (29,
'(A)', advance=
'no')
848 if (lag_id_wrt)
write (29,
'(A8)', advance=
'no')
'id, '
849 if (lag_pos_wrt)
write (29,
'(3(A17))', advance=
'no')
'px, ',
'py, ',
'pz, '
850 if (lag_pos_prev_wrt)
write (29,
'(3(A17))', advance=
'no')
'pvx, ',
'pvy, ',
'pvz, '
851 if (lag_vel_wrt)
write (29,
'(3(A17))', advance=
'no')
'vx, ',
'vy, ',
'vz, '
852 if (lag_rad_wrt)
write (29,
'(A17)', advance=
'no')
'radius, '
853 if (lag_rvel_wrt)
write (29,
'(A17)', advance=
'no')
'rvel, '
854 if (lag_r0_wrt)
write (29,
'(A17)', advance=
'no')
'r0, '
855 if (lag_rmax_wrt)
write (29,
'(A17)', advance=
'no')
'rmax, '
856 if (lag_rmin_wrt)
write (29,
'(A17)', advance=
'no')
'rmin, '
857 if (lag_dphidt_wrt)
write (29,
'(A17)', advance=
'no')
'dphidt, '
858 if (lag_pres_wrt)
write (29,
'(A17)', advance=
'no')
'pressure, '
859 if (lag_mv_wrt)
write (29,
'(A17)', advance=
'no')
'mv, '
860 if (lag_mg_wrt)
write (29,
'(A17)', advance=
'no')
'mg, '
861 if (lag_betat_wrt)
write (29,
'(A17)', advance=
'no')
'betaT, '
862 if (lag_betac_wrt)
write (29,
'(A17)', advance=
'no')
'betaC, '
863 write (29,
'(A15)')
'time'
866 do i = 1, file_tot_part
870 write (29,
'(100(A))', advance=
'no')
''
871 if (lag_id_wrt)
write (29,
'(I6, A)', advance=
'no') id,
', '
872 if (lag_pos_wrt)
write (29,
'(3(E15.7, A))', advance=
'no') inputvals(1),
', ', inputvals(2),
', ', &
874 if (lag_pos_prev_wrt)
write (29,
'(3(E15.7, A))', advance=
'no') inputvals(4),
', ', inputvals(5),
', ', &
876 if (lag_vel_wrt)
write (29,
'(3(E15.7, A))', advance=
'no') inputvals(7),
', ', inputvals(8),
', ', &
878 if (lag_rad_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(10),
', '
879 if (lag_rvel_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(11),
', '
880 if (lag_r0_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(12),
', '
881 if (lag_rmax_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(13),
', '
882 if (lag_rmin_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(14),
', '
883 if (lag_dphidt_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(15),
', '
884 if (lag_pres_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(16),
', '
885 if (lag_mv_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(17),
', '
886 if (lag_mg_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(18),
', '
887 if (lag_betat_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(19),
', '
888 if (lag_betac_wrt)
write (29,
'(E15.7, A)', advance=
'no') inputvals(20),
', '
889 write (29,
'(E15.7)') time_real
899 call mpi_file_close(ifile, ierr)
901 call mpi_type_contiguous(0, mpi_p, view, ierr)
902 call mpi_type_commit(view, ierr)
904 call mpi_file_open(mpi_comm_world, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
906 disp = int(sizeof(file_tot_part) + 2*sizeof(file_time) + sizeof(file_num_procs) &
907 & + file_num_procs*sizeof(proc_bubble_counts(1)), mpi_offset_kind)
908 call mpi_file_set_view(ifile, disp, mpi_p, view,
'native', mpi_info_null, ierr)
910 call mpi_file_read_all(ifile, lag_io_null, 0, mpi_p, status, ierr)
912 call mpi_file_close(ifile, ierr)
913 call mpi_type_free(view, ierr)
922 integer,
intent(in) :: t_step
923 character(len=len_trim(case_dir) + 3*name_len) :: file_loc
927 real(wp) :: time_real
928 integer,
dimension(MPI_STATUS_SIZE) :: status
929 integer(KIND=MPI_OFFSET_KIND) :: disp
931 logical :: file_exist
932 integer,
dimension(2) :: gsizes, lsizes, start_idx_part
933 integer :: ifile, ierr, nbub
934 real(wp) :: file_time, file_dt
935 integer :: file_num_procs, file_tot_part
936 integer,
dimension(:),
allocatable :: proc_bubble_counts
937 real(wp),
dimension(1:1,1:lag_io_vars) :: dummy
938 character(LEN=4*name_len),
dimension(num_procs) :: meshnames
939 integer,
dimension(num_procs) :: meshtypes
940 real(wp) :: dummy_data
942 real(wp),
dimension(:),
allocatable :: bub_id
943 real(wp),
dimension(:),
allocatable :: px, py, pz, ppx, ppy, ppz, vx, vy, vz
944 real(wp),
dimension(:),
allocatable :: radius, rvel, rnot, rmax, rmin, dphidt
945 real(wp),
dimension(:),
allocatable :: pressure, mv, mg, betat, betac
951 write (file_loc,
'(A,I0,A)')
'lag_bubbles_', t_step,
'.dat'
952 file_loc = trim(case_dir) //
'/restart_data' // trim(mpiiofs) // trim(file_loc)
955 inquire (file=trim(file_loc), exist=file_exist)
956 if (.not. file_exist)
then
957 call s_mpi_abort(
'Restart file ' // trim(file_loc) //
' does not exist!')
960 if (.not. parallel_io)
return
963 call mpi_file_open(mpi_comm_self, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
965 call mpi_file_read(ifile, file_tot_part, 1, mpi_integer, status, ierr)
966 call mpi_file_read(ifile, file_time, 1, mpi_p, status, ierr)
967 call mpi_file_read(ifile, file_dt, 1, mpi_p, status, ierr)
968 call mpi_file_read(ifile, file_num_procs, 1, mpi_integer, status, ierr)
970 call mpi_file_close(ifile, ierr)
973 call mpi_bcast(file_tot_part, 1, mpi_integer, 0, mpi_comm_world, ierr)
974 call mpi_bcast(file_time, 1, mpi_p, 0, mpi_comm_world, ierr)
975 call mpi_bcast(file_dt, 1, mpi_p, 0, mpi_comm_world, ierr)
976 call mpi_bcast(file_num_procs, 1, mpi_integer, 0, mpi_comm_world, ierr)
977 time_real = file_time
979 allocate (proc_bubble_counts(file_num_procs))
982 call mpi_file_open(mpi_comm_self, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
985 disp = int(sizeof(file_tot_part) + 2*sizeof(file_time) + sizeof(file_num_procs), mpi_offset_kind)
986 call mpi_file_seek(ifile, disp, mpi_seek_set, ierr)
987 call mpi_file_read(ifile, proc_bubble_counts, file_num_procs, mpi_integer, status, ierr)
989 call mpi_file_close(ifile, ierr)
992 call mpi_bcast(proc_bubble_counts, file_num_procs, mpi_integer, 0, mpi_comm_world, ierr)
998 start_idx_part(1) = 0
1000 start_idx_part(1) = start_idx_part(1) + proc_bubble_counts(i)
1003 start_idx_part(2) = 0
1007 gsizes(1) = file_tot_part
1011# 944 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1012 allocate (bub_id(nbub))
1013# 944 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1015# 944 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1017# 944 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1019# 944 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1020 allocate (ppx(nbub))
1021# 944 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1022 allocate (ppy(nbub))
1023# 944 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1024 allocate (ppz(nbub))
1025# 944 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1027# 944 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1029# 944 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1031# 944 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1032 allocate (radius(nbub))
1033# 944 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1034 allocate (rvel(nbub))
1035# 944 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1036 allocate (rnot(nbub))
1037# 944 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1038 allocate (rmax(nbub))
1039# 944 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1040 allocate (rmin(nbub))
1041# 944 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1042 allocate (dphidt(nbub))
1043# 944 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1044 allocate (pressure(nbub))
1045# 944 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1047# 944 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1049# 944 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1050 allocate (betat(nbub))
1051# 944 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1052 allocate (betac(nbub))
1053# 946 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1056 call mpi_type_create_subarray(2, gsizes, lsizes, start_idx_part, mpi_order_fortran, mpi_p, view, ierr)
1057 call mpi_type_commit(view, ierr)
1059 call mpi_file_open(mpi_comm_world, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
1062 disp = int(sizeof(file_tot_part) + 2*sizeof(file_time) + sizeof(file_num_procs) &
1063 & + file_num_procs*sizeof(proc_bubble_counts(1)), mpi_offset_kind)
1064 call mpi_file_set_view(ifile, disp, mpi_p, view,
'native', mpi_info_int, ierr)
1068 call mpi_file_close(ifile, ierr)
1069 call mpi_type_free(view, ierr)
1072# 968 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1074# 968 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1076# 968 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1078# 968 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1080# 968 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1082# 968 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1084# 968 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1086# 968 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1088# 968 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1090# 968 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1092# 968 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1094# 968 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1096# 968 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1098# 968 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1100# 968 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1102# 968 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1104# 968 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1106# 968 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1108# 968 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1110# 968 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1112# 968 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1114# 970 "/home/runner/work/MFC/MFC/src/post_process/m_data_output.fpp"
1121 write (meshnames(i),
'(A,I0,A,I0,A)')
'../p', i - 1,
'/', t_step,
'.silo:lag_bubbles'
1122 meshtypes(i) = db_pointmesh
1124 err = dbset2dstrlen(len(meshnames(1)))
1125 err = dbputmmesh(
out%dbroot,
'lag_bubbles', 16,
num_procs, meshnames, len_trim(meshnames), meshtypes, db_f77null, &
1129 err = dbputpm(
out%dbfile,
'lag_bubbles', 11, 3, px, py, pz, nbub, db_double, db_f77null, ierr)
1132 if (lag_vel_wrt)
then
1149 deallocate (bub_id, px, py, pz, ppx, ppy, ppz, vx, vy, vz, radius, rvel, rnot, rmax, rmin, dphidt, pressure, mv, mg, &
1153 call mpi_type_contiguous(0, mpi_p, view, ierr)
1154 call mpi_type_commit(view, ierr)
1156 call mpi_file_open(mpi_comm_world, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
1159 disp = int(sizeof(file_tot_part) + 2*sizeof(file_time) + sizeof(file_num_procs) &
1160 & + file_num_procs*sizeof(proc_bubble_counts(1)), mpi_offset_kind)
1161 call mpi_file_set_view(ifile, disp, mpi_p, view,
'native', mpi_info_int, ierr)
1163 call mpi_file_read_all(ifile, dummy, 0, mpi_p, status, ierr)
1165 call mpi_file_close(ifile, ierr)
1166 call mpi_type_free(view, ierr)
1170 write (meshnames(i),
'(A,I0,A,I0,A)')
'../p', i - 1,
'/', t_step,
'.silo:lag_bubbles'
1171 meshtypes(i) = db_pointmesh
1173 err = dbset2dstrlen(len(meshnames(1)))
1174 err = dbputmmesh(
out%dbroot,
'lag_bubbles', 16,
num_procs, meshnames, len_trim(meshnames), meshtypes, db_f77null, &
1178 err = dbsetemptyok(1)
1179 err = dbputpm(
out%dbfile,
'lag_bubbles', 11, 3, dummy_data, dummy_data, dummy_data, 0, db_double, db_f77null, ierr)
1182 if (lag_vel_wrt)
then
1206 character(len=*),
intent(in) :: varname
1207 integer,
intent(in) :: t_step
1208 real(wp),
dimension(1:),
intent(in),
optional :: data
1209 integer,
intent(in),
optional :: nBubs
1210 character(len=64),
dimension(num_procs) :: var_names
1211 integer,
dimension(num_procs) :: var_types
1212 real(wp) :: dummy_data
1218 if (
present(nbubs) .and.
present(data))
then
1221 write (var_names(i),
'(A,I0,A,I0,A)')
'../p', i - 1,
'/', t_step,
'.silo:' // trim(varname)
1222 var_types(i) = db_pointvar
1224 err = dbset2dstrlen(len(var_names(1)))
1225 err = dbputmvar(
out%dbroot, trim(varname), len_trim(varname),
num_procs, var_names, len_trim(var_names), &
1226 & var_types, db_f77null, ierr)
1229 err = dbputpv1(
out%dbfile, trim(varname), len_trim(varname),
'lag_bubbles', 11,
data, nbubs, db_double, db_f77null, &
1234 write (var_names(i),
'(A,I0,A,I0,A)')
'../p', i - 1,
'/', t_step,
'.silo:' // trim(varname)
1235 var_types(i) = db_pointvar
1237 err = dbset2dstrlen(len(var_names(1)))
1238 err = dbsetemptyok(1)
1239 err = dbputmvar(
out%dbroot, trim(varname), len_trim(varname),
num_procs, var_names, len_trim(var_names), &
1240 & var_types, db_f77null, ierr)
1243 err = dbsetemptyok(1)
1244 err = dbputpv1(
out%dbfile, trim(varname), len_trim(varname),
'lag_bubbles', 11, dummy_data, 0, db_double, db_f77null, &
1253 character(len=len_trim(case_dir) + 4*name_len) :: in_file, out_file, file_loc
1254 integer :: iu_in, ios, i, rec_id
1255 integer,
allocatable,
dimension(:) :: iu_out
1256 real(wp) :: rec_time
1257 real(wp),
dimension(3) :: rec_force, rec_torque
1258 real(wp),
dimension(3) :: rec_vel, rec_angular_vel
1259 real(wp),
dimension(3) :: rec_angles, rec_centroid
1261 file_loc = trim(case_dir) //
'/D'
1263 in_file = trim(file_loc) //
'/ib_state.dat'
1264 open (newunit=iu_in, file=trim(in_file), form=
'unformatted', access=
'stream', status=
'old', action=
'read', iostat=ios)
1266 call s_mpi_abort(
'Cannot open IB state input file: ' // trim(in_file))
1269 allocate (iu_out(num_ibs))
1271 write (out_file,
'(A,I0,A)') trim(file_loc) //
'/ib_', i,
'.txt'
1272 open (newunit=iu_out(i), file=trim(out_file), form=
'formatted', status=
'replace', action=
'write', iostat=ios)
1274 call s_mpi_abort(
'Cannot open IB state output file: ' // trim(out_file))
1277 &
'(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'
1281 read (iu_in, iostat=ios) rec_time, rec_id, rec_force, rec_torque, rec_vel, rec_angular_vel, rec_angles, &
1282 & rec_centroid(1), rec_centroid(2), rec_centroid(3)
1285 if (rec_id >= 1 .and. rec_id <= num_ibs)
then
1286 write (iu_out(rec_id),
'(19(ES24.16E3,1X))') rec_time, rec_force(1), rec_force(2), rec_force(3), rec_torque(1), &
1287 & rec_torque(2), rec_torque(3), rec_vel(1), rec_vel(2), rec_vel(3), rec_angular_vel(1), &
1288 & rec_angular_vel(2), rec_angular_vel(3), rec_angles(1), rec_angles(2), rec_angles(3), rec_centroid(1), &
1289 & rec_centroid(2), rec_centroid(3)
1304 type(
scalar_field),
dimension(sys_size),
intent(in) :: q_prim_vf
1305 integer :: i,
j,
k,
l, cent
1306 integer :: counter, root
1307 real(wp),
allocatable :: x_td(:), y_td(:), x_d1(:), y_d1(:), y_d(:), x_d(:)
1308 real(wp) :: axp, axm, ayp, aym, tgp, euc_d, thres, maxalph_loc, maxalph_glb
1310 allocate (x_d1(m*n))
1311 allocate (y_d1(m*n))
1317 if (q_prim_vf(eqn_idx%E + 2)%sf(i,
j,
k) > maxalph_loc)
then
1318 maxalph_loc = q_prim_vf(eqn_idx%E + 2)%sf(i,
j,
k)
1324 call s_mpi_allreduce_max(maxalph_loc, maxalph_glb)
1335 thres = 0.9_wp*maxalph_glb
1338 axp = q_prim_vf(eqn_idx%E + 2)%sf(
j + 1,
k, cent)
1339 axm = q_prim_vf(eqn_idx%E + 2)%sf(
j,
k, cent)
1340 ayp = q_prim_vf(eqn_idx%E + 2)%sf(
j,
k + 1, cent)
1341 aym = q_prim_vf(eqn_idx%E + 2)%sf(
j,
k, cent)
1342 if ((axp > thres .and. axm < thres) .or. (axp < thres .and. axm > thres) .or. (ayp > thres .and. aym < thres) &
1343 & .or. (ayp < thres .and. aym > thres))
then
1344 if (counter == 0)
then
1345 counter = counter + 1
1346 x_d1(counter) =
x_cc(
j)
1347 y_d1(counter) =
y_cc(
k)
1349 tgp = sqrt(
dx(
j)**2 +
dy(
k)**2)
1351 euc_d = sqrt((
x_cc(
j) - x_d1(i))**2 + (
y_cc(
k) - y_d1(i))**2)
1352 if (euc_d < tgp)
then
1354 else if (i == counter)
then
1355 counter = counter + 1
1356 x_d1(counter) =
x_cc(
j)
1357 y_d1(counter) =
y_cc(
k)
1365 allocate (x_d(counter), y_d(counter))
1373 call s_mpi_gather_data(x_d, counter, x_td, root)
1374 call s_mpi_gather_data(y_d, counter, y_td, root)
1376 do i = 1,
size(x_td)
1377 if (i ==
size(x_td))
then
1378 write (211,
'(F12.9,1X,F12.9,1X,I4)') x_td(i), y_td(i),
size(x_td)
1380 write (211,
'(F12.9,1X,F12.9,1X,F3.1)') x_td(i), y_td(i), 0._wp
1391 real(wp) :: elk, egk, elp, egint, eg_phase, vb, vl, pres_av, et
1392 real(wp) :: rho, pres, dv, tmp, gamma, pi_inf, qv, maxma, maxma_glb, maxvel, c, ma
1393 real(wp),
dimension(num_vels) :: vel
1394 real(wp),
dimension(num_fluids) ::
adv, alpha_rho
1395 integer :: i,
j,
k,
l, s
1416 pres = q_prim_vf(eqn_idx%E)%sf(i,
j,
k)
1418 vel(s) = q_prim_vf(num_fluids + s)%sf(i,
j,
k)
1419 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
1420 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
1421 if (abs(vel(s)) > maxvel)
then
1422 maxvel = abs(vel(s))
1425 do l = 1, num_fluids
1426 adv(
l) = q_prim_vf(eqn_idx%E +
l)%sf(i,
j,
k)
1427 alpha_rho(
l) = q_prim_vf(
l)%sf(i,
j,
k)
1431 egint = egint + eg_phase*dv
1438 if (ma > maxma .and. (
adv(1) > (1.0_wp - 1.0e-10_wp)))
then
1443 pres_av = pres_av +
adv(1)*pres*dv
1450 call s_mpi_allreduce_sum(tmp, pres_av)
1452 call s_mpi_allreduce_sum(tmp, vl)
1454 call s_mpi_allreduce_max(maxma, maxma_glb)
1456 call s_mpi_allreduce_sum(tmp, elk)
1458 call s_mpi_allreduce_sum(tmp, egint)
1460 call s_mpi_allreduce_sum(tmp, egk)
1462 call s_mpi_allreduce_sum(tmp, vb)
1464 call s_mpi_allreduce_sum(tmp, et)
1468 write (251,
'(10X, 8F24.8)') elp, egint, elk, egk, et, vb, vl, maxma_glb
1476 integer,
intent(in) :: t_step
1477 character(len=len_trim(case_dir) + 3*name_len) :: file_loc
1480 integer,
parameter :: nfields_per_ib = 20
1481 real(wp) :: ib_buf(nfields_per_ib)
1482 real(wp),
dimension(:,:),
allocatable :: ib_data
1483 logical :: file_exist
1484 character(LEN=4*name_len),
dimension(num_procs) :: meshnames
1485 integer,
dimension(num_procs) :: meshtypes
1486 integer :: i, ios, file_unit
1487 integer :: ierr, nbodies
1488 integer :: r, nlocal, gbl_id
1489 character(len=10) :: t_step_string
1490 real(wp),
dimension(:),
allocatable :: px, py, pz
1491 real(wp),
dimension(:),
allocatable :: force_x, force_y, force_z
1492 real(wp),
dimension(:),
allocatable :: torque_x, torque_y, torque_z
1493 real(wp),
dimension(:),
allocatable :: vel_x, vel_y, vel_z
1494 real(wp),
dimension(:),
allocatable :: omega_x, omega_y, omega_z
1495 real(wp),
dimension(:),
allocatable :: angle_x, angle_y, angle_z
1496 real(wp),
dimension(:),
allocatable :: ib_diameter
1501 if (nbodies > 0)
then
1502 allocate (ib_data(nbodies, nfields_per_ib))
1503 allocate (px(nbodies), py(nbodies), pz(nbodies))
1504 allocate (force_x(nbodies), force_y(nbodies), force_z(nbodies))
1505 allocate (torque_x(nbodies), torque_y(nbodies), torque_z(nbodies))
1506 allocate (vel_x(nbodies), vel_y(nbodies), vel_z(nbodies))
1507 allocate (omega_x(nbodies), omega_y(nbodies), omega_z(nbodies))
1508 allocate (angle_x(nbodies), angle_y(nbodies), angle_z(nbodies))
1509 allocate (ib_diameter(nbodies))
1511 if (file_per_process)
then
1515 write (file_loc,
'(A,I0,A,i7.7,A)')
'ib_state_', t_step,
'_', r,
'.dat'
1516 file_loc = trim(case_dir) //
'/restart_data/lustre_' // trim(t_step_string) //
'/' // trim(file_loc)
1518 inquire (file=trim(file_loc), exist=file_exist)
1519 if (.not. file_exist)
call s_mpi_abort(
'Restart file ' // trim(file_loc) //
' does not exist!')
1521 open (newunit=file_unit, file=trim(file_loc), form=
'unformatted', access=
'stream', status=
'old', iostat=ios)
1522 if (ios /= 0)
call s_mpi_abort(
'Cannot open IB state file: ' // trim(file_loc))
1524 read (file_unit, iostat=ios) nlocal
1525 if (ios /= 0)
call s_mpi_abort(
'Error reading IB state file header: ' // trim(file_loc))
1528 read (file_unit, iostat=ios) gbl_id
1529 if (ios /= 0)
call s_mpi_abort(
'Error reading IB patch ID: ' // trim(file_loc))
1530 read (file_unit, iostat=ios) ib_buf
1531 if (ios /= 0)
call s_mpi_abort(
'Error reading IB state data: ' // trim(file_loc))
1532 ib_data(gbl_id,:) = ib_buf(:)
1539 write (file_loc,
'(A,I0,A)')
'/restart_data/ib_state_', t_step,
'.dat'
1540 file_loc = trim(case_dir) // trim(file_loc)
1542 inquire (file=trim(file_loc), exist=file_exist)
1543 if (.not. file_exist)
call s_mpi_abort(
'Restart file ' // trim(file_loc) //
' does not exist!')
1545 open (newunit=file_unit, file=trim(file_loc), form=
'unformatted', access=
'stream', status=
'old', iostat=ios)
1546 if (ios /= 0)
call s_mpi_abort(
'Cannot open IB state file: ' // trim(file_loc))
1549 read (file_unit, iostat=ios) ib_buf
1550 if (ios /= 0)
call s_mpi_abort(
'Error reading IB state file')
1551 ib_data(i,:) = ib_buf(:)
1558 force_x(i) = ib_data(i, 2); force_y(i) = ib_data(i, 3); force_z(i) = ib_data(i, 4)
1559 torque_x(i) = ib_data(i, 5); torque_y(i) = ib_data(i, 6); torque_z(i) = ib_data(i, 7)
1560 vel_x(i) = ib_data(i, 8); vel_y(i) = ib_data(i, 9); vel_z(i) = ib_data(i, 10)
1561 omega_x(i) = ib_data(i, 11); omega_y(i) = ib_data(i, 12); omega_z(i) = ib_data(i, 13)
1562 angle_x(i) = ib_data(i, 14); angle_y(i) = ib_data(i, 15); angle_z(i) = ib_data(i, 16)
1563 px(i) = ib_data(i, 17); py(i) = ib_data(i, 18); pz(i) = ib_data(i, 19)
1564 ib_diameter(i) = ib_data(i, 20)*2.0_wp
1567 write (meshnames(1),
'(A,I0,A)')
'../p0/', t_step,
'.silo:ib_bodies'
1568 meshtypes(1) = db_pointmesh
1569 err = dbset2dstrlen(len(meshnames(1)))
1570 err = dbputmmesh(
out%dbroot,
'ib_bodies', 16, 1, meshnames, len_trim(meshnames), meshtypes, db_f77null, ierr)
1572 err = dbputpm(
out%dbfile,
'ib_bodies', 9, 3, px, py, pz, nbodies, db_double, db_f77null, ierr)
1591 deallocate (ib_data, px, py, pz, force_x, force_y, force_z)
1592 deallocate (torque_x, torque_y, torque_z, vel_x, vel_y, vel_z)
1593 deallocate (omega_x, omega_y, omega_z, angle_x, angle_y, angle_z)
1594 deallocate (ib_diameter)
1604 character(len=*),
intent(in) :: varname
1605 integer,
intent(in) :: t_step
1606 real(wp),
dimension(:),
intent(in) :: data
1607 integer,
intent(in) :: nBodies
1608 character(len=4*name_len) :: var_name_entry
1609 integer :: var_type_entry, ierr
1611 write (var_name_entry,
'(A,I0,A)')
'../p0/', t_step,
'.silo:' // trim(varname)
1612 var_type_entry = db_pointvar
1613 err = dbset2dstrlen(len(var_name_entry))
1614 err = dbputmvar(
out%dbroot, trim(varname), len_trim(varname), 1, var_name_entry, len_trim(var_name_entry), &
1615 & var_type_entry, db_f77null, ierr)
1617 err = dbputpv1(
out%dbfile, trim(varname), len_trim(varname),
'ib_bodies', 9,
data, nbodies, db_double, db_f77null, ierr)
1627 ierr = dbclose(
out%dbfile)
1653 deallocate (
out%q_sf)
1654 if (n == 0)
deallocate (
out%q_root_sf)
1656 deallocate (
out%cyl_q_sf)
1663 deallocate (
out%spatial_extents)
1664 deallocate (
out%data_extents)
1665 deallocate (
out%lo_offset)
1666 deallocate (
out%hi_offset)
1667 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)
Inquire on the existence of a directory or file.
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...
Equations of state in Gamma/Pi form, rho e = Gamma(rho) p + Pi(rho).
subroutine, public s_phase_internal_energy(pres, alpha, alpha_rho, i, e_phase)
Internal energy per unit volume of phase i at pressure pres: alpha (Gamma p + Pi) + alpha_rho qv,...
subroutine, public s_compute_mixture_coefficients(alpha_rho_k, alpha_k, rho_k, gamma_k, pi_inf_k, qv_k)
Mixture coefficients of one state. Under bubbles_euler with num_fluids == 1 the sole advection slot a...
subroutine, public s_compute_speed_of_sound(pres, rho, gamma, pi_inf, adv, c, alpha_rho)
Speed of sound of a thermodynamic state. Enthalpy is not an argument: for a real state H,...
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.
Output workspace for post_process: flow variable buffers, VisIt extents/offsets, directory paths,...
Derived type annexing a scalar field (SF).