1# 1 "/home/runner/work/MFC/MFC/src/pre_process/m_start_up.fpp"
6# 1 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp" 1
7# 1 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp" 1
8# 1 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp" 1
9# 2 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
10# 3 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
11# 4 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
12# 5 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
13# 6 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
15# 8 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
16# 9 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
17# 10 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
19# 17 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
21# 46 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
23# 58 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
25# 68 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
27# 98 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
29# 110 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
31# 120 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
33# 145 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
35# 2 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp" 2
36# 1 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp" 1
37# 1 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp" 1
38# 2 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
39# 3 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
40# 4 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
41# 5 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
42# 6 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
44# 8 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
45# 9 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
46# 10 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
48# 17 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
50# 46 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
52# 58 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
54# 68 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
56# 98 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
58# 110 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
60# 120 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
62# 145 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
64# 2 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp" 2
66# 4 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
67# 5 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
68# 6 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
69# 7 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
70# 8 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
72# 20 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
74# 43 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
76# 48 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
78# 53 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
80# 58 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
82# 63 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
84# 68 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
86# 76 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
88# 81 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
90# 86 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
92# 91 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
94# 96 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
96# 101 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
98# 106 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
100# 111 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
102# 116 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
104# 121 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
106# 151 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
108# 192 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
110# 206 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
112# 231 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
114# 242 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
116# 244 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
117# 255 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
119# 284 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
121# 294 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
123# 304 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
125# 313 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
127# 330 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
129# 340 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
131# 347 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
133# 353 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
135# 359 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
137# 365 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
139# 371 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
141# 377 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
143# 3 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp" 2
144# 1 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp" 1
145# 1 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp" 1
146# 2 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
147# 3 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
148# 4 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
149# 5 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
150# 6 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
152# 8 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
153# 9 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
154# 10 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
156# 17 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
158# 46 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
160# 58 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
162# 68 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
164# 98 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
166# 110 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
168# 120 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
170# 145 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
172# 2 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp" 2
174# 7 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
176# 17 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
178# 22 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
180# 27 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
182# 32 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
184# 37 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
186# 42 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
188# 47 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
190# 52 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
192# 57 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
194# 62 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
196# 73 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
198# 78 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
200# 83 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
202# 88 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
204# 103 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
206# 131 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
208# 160 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
210# 175 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
212# 193 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
214# 215 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
216# 244 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
218# 259 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
220# 269 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
222# 278 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
224# 294 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
226# 304 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
228# 311 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
230# 4 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp" 2
233# 23 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
236# 43 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
239# 55 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
242# 112 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
245# 130 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
248# 145 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
251# 164 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
254# 193 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
257# 207 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
260# 219 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
263# 231 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
266# 242 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
269# 254 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
272# 266 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
275# 275 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
278# 282 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
281# 289 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
284# 296 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
287# 303 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
289# 305 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
290# 306 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
292# 2 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp" 2
294# 14 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
299# 57 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
302# 77 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
305# 85 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
308# 109 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
311# 125 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
314# 150 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
316# 156 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
318# 163 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
320# 6 "/home/runner/work/MFC/MFC/src/pre_process/m_start_up.fpp" 2
371 type(
scalar_field),
dimension(sys_size),
intent(inout) :: q_cons_vf_in
387 character(LEN=name_len) :: file_loc
388 logical :: file_check
390 character(len=1000) :: line
392# 1 "/home/runner/work/MFC/MFC/build/include/pre_process/generated_namelist.fpp" 1
395namelist /user_inputs/ bx0, ca, r0ref, re_inv, web, a_x, a_y, a_z, adv_n,
bc_x,
bc_y,
bc_z, bub_pp, bubbles_euler, &
396 & bubbles_lagrange, case_dir, cfl_adap_dt, cfl_const_dt, cont_damage, cyl_coord, dist_type, down_sample, elliptic_smoothing, &
397 & elliptic_smoothing_iters, fft_wrt, file_per_process, fluid_pp, fluid_rho, hyper_cleaning, hyperelasticity, hypoelasticity, &
398 & ib, ib_airfoil, igr, igr_order, loops_x, loops_y, loops_z, m, mhd, mixlayer_perturb, mixlayer_perturb_k0, &
399 & mixlayer_perturb_nk, mixlayer_vel_coef, mixlayer_vel_profile, model_eqns, mpp_lim, muscl_order, n, n_start, n_start_old, &
400 & nb, num_bc_patches, num_fluids, num_ibs, num_patches, num_stl_models, old_grid, old_ic, p, palpha_eps, parallel_io, &
401 & patch_bc, patch_ib, patch_icpp, perturb_flow, perturb_flow_fluid, perturb_flow_mag, perturb_sph, perturb_sph_fluid, &
402 & pi_fac, poly_sigma, polydisperse, polytropic, pre_stress, precision, pref, ptgalpha_eps, qbmm, recon_type, relativity, &
403 & relax, relax_model, rhorv, rhoref, sigr, sigv, sigma, simplex_params, simplex_perturb, stl_models, stretch_x, stretch_y, &
404 & stretch_z, surface_tension, t_step_old, t_step_start, thermal, viscous, weno_order, x_a, x_b,
x_domain, y_a, y_b, &
406# 78 "/home/runner/work/MFC/MFC/src/pre_process/m_start_up.fpp" 2
408 file_loc =
'pre_process.inp'
409 inquire (file=trim(file_loc), exist=file_check)
412 open (1, file=trim(file_loc), form=
'formatted', status=
'old', action=
'read')
413 read (1, nml=user_inputs, iostat=iostatus)
414 if (iostatus /= 0)
then
416 read (1, fmt=
'(A)') line
417 print *,
'Invalid line in namelist: ' // trim(line)
418 call s_mpi_abort(
'Invalid line in pre_process.inp. It is ' //
'likely due to a datatype mismatch. Exiting.')
430 if (cfl_adap_dt .or. cfl_const_dt)
cfl_dt = .true.
432 if (any((/
bc_x%beg,
bc_x%end,
bc_y%beg,
bc_y%end,
bc_z%beg,
bc_z%end/) == bc_dirichlet) .or. num_bc_patches > 0)
then
436 call s_mpi_abort(
'File pre_process.inp is missing. Exiting.')
445 character(LEN=len_trim(case_dir)) :: file_loc
448 case_dir = adjustl(case_dir)
450 file_loc = trim(case_dir) //
'/.'
454 if (dir_check .neqv. .true.)
then
455 print
'(A)',
'WARNING: Ensure that compiler flags/choices in Makefiles match your compiler! '
456 print
'(A)',
'WARNING: Ensure that preprocessor flags are enabled! '
457 call s_mpi_abort(
'Unsupported choice for the value of case_dir.' //
'Exiting.')
473 character(LEN=len_trim(case_dir) + 3*name_len) :: file_loc
475 logical :: file_check
480 write (
t_step_dir,
'(A,I0)')
'/', t_step_start
486 if (dir_check .neqv. .true.)
then
491 inquire (file=trim(file_loc), exist=file_check)
494 open (1, file=trim(file_loc), form=
'unformatted', status=
'old', action=
'read')
511 inquire (file=trim(file_loc), exist=file_check)
514 open (1, file=trim(file_loc), form=
'unformatted', status=
'old', action=
'read')
531 inquire (file=trim(file_loc), exist=file_check)
534 open (1, file=trim(file_loc), form=
'unformatted', status=
'old', action=
'read')
552 if (old_ic .neqv. .true.)
then
563 if (any(
x_cb(0:m) -
x_cb(-1:m - 1) <= 0._wp))
then
564 call s_mpi_abort(
'x_cb.dat in ' // trim(
t_step_dir) //
' contains non-positive cell-spacings. Exiting.')
568 if (any(
y_cb(0:n) -
y_cb(-1:n - 1) <= 0._wp))
then
569 call s_mpi_abort(
'y_cb.dat in ' // trim(
t_step_dir) //
' contains non-positive cell-spacings. ' //
'Exiting.')
573 if (any(
z_cb(0:p) -
z_cb(-1:p - 1) <= 0._wp))
then
574 call s_mpi_abort(
'z_cb.dat in ' // trim(
t_step_dir) //
' contains non-positive cell-spacings' //
' .Exiting.')
585 type(
scalar_field),
dimension(sys_size),
intent(inout) :: q_cons_vf_in
586 character(LEN=len_trim(case_dir) + 3*name_len) :: file_loc
587 character(len=int(floor(log10(real(sys_size, wp)))) + 1) :: file_num
588 logical :: file_check
592 write (file_num,
'(I0)') i
593 file_loc = trim(
t_step_dir) //
'/q_cons_vf' // trim(file_num) //
'.dat'
594 inquire (file=trim(file_loc), exist=file_check)
597 open (1, file=trim(file_loc), form=
'unformatted', status=
'old', action=
'read')
598 read (1) q_cons_vf_in(i)%sf
601 call s_mpi_abort(
'File q_cons_vf' // trim(file_num) //
'.dat is missing in ' // trim(
t_step_dir) //
'. Exiting.')
605 if (qbmm .and. .not. polytropic)
then
608 write (file_num,
'(I0)') sys_size + r + (i - 1)*nnode
609 file_loc = trim(
t_step_dir) //
'/pb' // trim(file_num) //
'.dat'
610 inquire (file=trim(file_loc), exist=file_check)
613 open (1, file=trim(file_loc), form=
'unformatted', status=
'old', action=
'read')
614 read (1)
pb%sf(:,:,:,r, i)
617 call s_mpi_abort(
'File pb' // trim(file_num) //
'.dat is missing in ' // trim(
t_step_dir) //
'. Exiting.')
624 write (file_num,
'(I0)') sys_size + r + (i - 1)*nnode
625 file_loc = trim(
t_step_dir) //
'/mv' // trim(file_num) //
'.dat'
626 inquire (file=trim(file_loc), exist=file_check)
629 open (1, file=trim(file_loc), form=
'unformatted', status=
'old', action=
'read')
630 read (1)
mv%sf(:,:,:,r, i)
633 call s_mpi_abort(
'File mv' // trim(file_num) //
'.dat is missing in ' // trim(
t_step_dir) //
'. Exiting.')
652 real(wp),
allocatable,
dimension(:) :: x_cb_glb, y_cb_glb, z_cb_glb
653 integer :: ifile, ierr, data_size
654 integer,
dimension(MPI_STATUS_SIZE) :: status
655 character(LEN=path_len + 2*name_len) :: file_loc
656 logical :: file_exist
658 allocate (x_cb_glb(-1:
m_glb))
659 allocate (y_cb_glb(-1:
n_glb))
660 allocate (z_cb_glb(-1:
p_glb))
662 file_loc = trim(case_dir) //
'/restart_data' // trim(mpiiofs) //
'x_cb.dat'
663 inquire (file=trim(file_loc), exist=file_exist)
666 data_size =
m_glb + 2
667 call mpi_file_open(mpi_comm_world, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
668 call mpi_file_read_all(ifile, x_cb_glb, data_size, mpi_p, status, ierr)
669 call mpi_file_close(ifile, ierr)
671 call s_mpi_abort(
'File ' // trim(file_loc) //
' is missing. Exiting. ')
674 x_cb(-1:m) = x_cb_glb((start_idx(1) - 1):(start_idx(1) + m))
682 file_loc = trim(case_dir) //
'/restart_data' // trim(mpiiofs) //
'y_cb.dat'
683 inquire (file=trim(file_loc), exist=file_exist)
686 data_size =
n_glb + 2
687 call mpi_file_open(mpi_comm_world, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
688 call mpi_file_read_all(ifile, y_cb_glb, data_size, mpi_p, status, ierr)
689 call mpi_file_close(ifile, ierr)
691 call s_mpi_abort(
'File ' // trim(file_loc) //
' is missing. Exiting. ')
694 y_cb(-1:n) = y_cb_glb((start_idx(2) - 1):(start_idx(2) + n))
702 file_loc = trim(case_dir) //
'/restart_data' // trim(mpiiofs) //
'z_cb.dat'
703 inquire (file=trim(file_loc), exist=file_exist)
706 data_size =
p_glb + 2
707 call mpi_file_open(mpi_comm_world, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
708 call mpi_file_read_all(ifile, z_cb_glb, data_size, mpi_p, status, ierr)
709 call mpi_file_close(ifile, ierr)
711 call s_mpi_abort(
'File ' // trim(file_loc) //
' is missing. Exiting. ')
714 z_cb(-1:p) = z_cb_glb((start_idx(3) - 1):(start_idx(3) + p))
723 deallocate (x_cb_glb, y_cb_glb, z_cb_glb)
732 type(
scalar_field),
dimension(sys_size),
intent(inout) :: q_cons_vf_in
735 integer :: ifile, ierr, data_size
736 integer,
dimension(MPI_STATUS_SIZE) :: status
737 integer(KIND=MPI_OFFSET_KIND) :: disp
738 integer(KIND=MPI_OFFSET_KIND) :: m_mok, n_mok, p_mok
739 integer(KIND=MPI_OFFSET_KIND) :: wp_mok, var_mok
740 integer(KIND=MPI_OFFSET_KIND) :: mok
741 character(LEN=path_len + 2*name_len) :: file_loc
742 logical :: file_exist
745 if (cfl_adap_dt)
then
746 write (file_loc,
'(I0,A)') n_start,
'.dat'
748 write (file_loc,
'(I0,A)') t_step_start,
'.dat'
750 file_loc = trim(
restart_dir) // trim(mpiiofs) // trim(file_loc)
751 inquire (file=trim(file_loc), exist=file_exist)
754 call mpi_file_open(mpi_comm_world, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
758 data_size = (m + 1)*(n + 1)*(p + 1)
761 m_mok = int(
m_glb + 1, mpi_offset_kind)
762 n_mok = int(
n_glb + 1, mpi_offset_kind)
763 p_mok = int(
p_glb + 1, mpi_offset_kind)
764 wp_mok = int(storage_size(0._stp)/8, mpi_offset_kind)
765 mok = int(1._wp, mpi_offset_kind)
768 var_mok = int(i, mpi_offset_kind)
771 disp = m_mok*max(mok, n_mok)*max(mok, p_mok)*wp_mok*(var_mok - 1)
773 call mpi_file_set_view(ifile, disp, mpi_p,
mpi_io_data%view(i),
'native', mpi_info_int, ierr)
774 call mpi_file_read(ifile,
mpi_io_data%var(i)%sf, data_size, mpi_p, status, ierr)
777 if (qbmm .and. .not. polytropic)
then
778 do i = sys_size + 1, sys_size + 2*nb*nnode
779 var_mok = int(i, mpi_offset_kind)
782 disp = m_mok*max(mok, n_mok)*max(mok, p_mok)*wp_mok*(var_mok - 1)
784 call mpi_file_set_view(ifile, disp, mpi_p,
mpi_io_data%view(i),
'native', mpi_info_int, ierr)
785 call mpi_file_read(ifile,
mpi_io_data%var(i)%sf, data_size, mpi_p, status, ierr)
791 call mpi_file_close(ifile, ierr)
793 call s_mpi_abort(
'File ' // trim(file_loc) //
' is missing. Exiting. ')
805 if (bubbles_euler .or. bubbles_lagrange)
then
813 call s_initialize_perturbation_module()
821 if (parallel_io .neqv. .true.)
then
842 if (parallel_io .neqv. .true.)
then
857 real(wp),
intent(inout) :: start, finish
868 if (hyper_cleaning)
then
869 if (.not. (eqn_idx%psi > 0))
then
870# 540 "/home/runner/work/MFC/MFC/src/pre_process/m_start_up.fpp"
871 call s_mpi_abort(
"m_start_up.fpp:540: " //
"Assertion failed: eqn_idx%psi > 0. " &
872# 540 "/home/runner/work/MFC/MFC/src/pre_process/m_start_up.fpp"
873 & //
"hyper_cleaning requires eqn_idx%psi to be set")
874# 540 "/home/runner/work/MFC/MFC/src/pre_process/m_start_up.fpp"
880 if (n > 0) r2 = r2 +
y_cc(
k)**2
881 if (p > 0) r2 = r2 +
z_cc(
l)**2
882 ic%q_cons_vf(eqn_idx%psi)%sf(
j,
k,
l) = 1.0e-2_wp*exp(-r2/(2.0_wp*0.05_wp**2))
883 ic%q_prim_vf(eqn_idx%psi)%sf(
j,
k,
l) =
ic%q_cons_vf(eqn_idx%psi)%sf(
j,
k,
l)
891 print *,
'initial condition might have been altered due to enforcement of pTg-equilibrium (relax = "T" activated)'
903 call cpu_time(finish)
908 impure subroutine s_save_data(proc_time, time_avg, time_final, file_exists)
910 real(wp),
dimension(:),
intent(inout) :: proc_time
911 real(wp),
intent(inout) :: time_avg, time_final
912 logical,
intent(inout) :: file_exists
923 time_final = time_avg
924 print *,
"Elapsed Time", time_final
926 time_final = maxval(proc_time)
927 print *,
"Elapsed Time", time_final
929 inquire (file=
'pre_time_data.dat', exist=file_exists)
930 if (file_exists)
then
931 open (1, file=
'pre_time_data.dat', position=
'append', status=
'old')
935 open (1, file=
'pre_time_data.dat', status=
'new')
953 print
'(" Pre-processing a ", I0, "x", I0, "x", I0, " case on ", I0, " rank(s)")', m, n, p,
num_procs
978 call s_finalize_perturbation_module()
Abstract interface for reading grid data files in serial or parallel.
Abstract interface for reading initial condition data files in serial or parallel.
Assigns initial primitive variables to computational cells based on patch geometry.
impure subroutine, public s_initialize_assign_variables_module
Allocate volume fraction sum and set the patch primitive variable assignment procedure pointer.
impure subroutine, public s_finalize_assign_variables_module
Nullify the patch primitive variable assignment procedure pointer.
Noncharacteristic and processor boundary condition application for ghost cells and buffer regions.
impure subroutine, public s_initialize_boundary_common_module()
Allocate and set up boundary condition buffer arrays for all coordinate directions.
subroutine, public s_finalize_boundary_common_module()
Deallocate boundary condition buffer arrays allocated during module initialization.
Applies spatially varying boundary condition patches along domain edges and faces.
Validates geometry parameters and constraints for immersed boundary patches.
impure subroutine, public s_check_ib_patches
Validate the geometry parameters of all active and inactive immersed boundary patches.
Validates geometry parameters and constraints for initial condition patches.
impure subroutine, public s_check_patches
Validate the geometry parameters of all active and inactive initial condition patches.
Shared input validation checks for grid dimensions and AMD GPU compiler limits.
impure subroutine, public s_check_inputs_common
Checks compatibility of parameters in the input file. Used by all three stages.
Checks pre-process input file parameters for compatibility and correctness.
impure subroutine, public s_check_inputs
Checks compatibility of parameters in the input file. Used by the pre_process stage.
Platform-specific file and directory operations: create, delete, inquire, getcwd, and basename.
impure subroutine s_delete_directory(dir_name)
Recursively delete a directory using a platform-specific system command.
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.
Writes grid and initial condition data to serial or parallel output files.
procedure(s_write_abstract_data_files), pointer, public s_write_data_files
impure subroutine, public s_write_serial_data_files(q_cons_vf, q_prim_vf, bc_type, q_t_sf)
Writes grid and initial condition data files to the "0" time-step directory in the local processor ra...
character(len=path_len+2 *name_len), private t_step_dir
Time-step folder into which grid and initial condition data will be placed.
impure subroutine, public s_initialize_data_output_module
Computation of parameters, allocation procedures, and/or any other tasks needed to properly setup the...
impure subroutine, public s_finalize_data_output_module
Resets s_write_data_files pointer.
impure subroutine, public s_write_parallel_data_files(q_cons_vf, q_prim_vf, bc_type, q_t_sf)
Writes grid and initial condition data files in parallel to the "0" time-step directory in the local ...
character(len=path_len+2 *name_len), public restart_dir
Restart data folder.
Shared derived types for field data, patch geometry, bubble dynamics, and MPI I/O structures.
Defines global parameters for the computational domain, simulation algorithm, and initial conditions.
integer p_glb
Global number of cells in each direction.
impure subroutine s_assign_default_values_to_user_inputs
Assigns default values to user inputs prior to reading them in. This allows for an easier consistency...
impure subroutine s_finalize_global_parameters_module
Deallocate all global grid, index, and equation-of-state parameter arrays.
real(wp) dz
Minimum cell-widths in the x-, y- and z-coordinate directions.
type(int_bounds_info) bc_z
Boundary conditions in the x-, y- and z-coordinate directions.
real(wp), dimension(:), allocatable y_cc
integer proc_rank
Rank of the local processor Number of cells in the x-, y- and z-coordinate directions.
logical bc_io
whether or not to save BC data
real(wp), dimension(:), allocatable y_cb
type(bounds_info) z_domain
Locations of the domain bounds in the x-, y- and z-coordinate directions.
type(bounds_info) x_domain
real(wp), dimension(:), allocatable z_cb
type(int_bounds_info) bc_y
impure subroutine s_initialize_global_parameters_module
Computation of parameters, allocation procedures, and/or any other tasks needed to properly setup the...
real(wp), dimension(:), allocatable x_cc
Locations of cell-centers (cc) in x-, y- and z-directions, respectively.
type(int_bounds_info) bc_x
real(wp), dimension(:), allocatable x_cb
Locations of cell-boundaries (cb) in x-, y- and z-directions, respectively.
type(bounds_info) y_domain
real(wp), dimension(:), allocatable z_cc
integer num_procs
Number of processors.
type(cell_num_bounds) cells_bounds
type(mpi_io_var), public mpi_io_data
impure subroutine s_initialize_parallel_io
Configure MPI parallel I/O settings and allocate processor coordinate arrays.
integer(kind=8) nglobal
Global number of cells in the domain.
Generates uniform or stretched rectilinear grids with hyperbolic-tangent spacing.
impure subroutine, public s_generate_serial_grid
Generate a uniform or stretched rectilinear grid in serial from user parameters.
impure subroutine, public s_initialize_grid_module
Computation of parameters, allocation procedures, and/or any other tasks needed to properly setup the...
procedure(s_generate_abstract_grid), pointer, public s_generate_grid
impure subroutine, public s_generate_parallel_grid
Generate a uniform or stretched rectilinear grid in parallel from user parameters.
impure subroutine, public s_finalize_grid_module
Deallocation procedures for the module.
Basic floating-point utilities: approximate equality, default detection, and coordinate bounds.
elemental subroutine, public s_update_cell_bounds(bounds, m, n, p)
Updates the min and max number of cells in each set of axes.
Utility routines for bubble model setup, coordinate transforms, array sampling, and special functions...
impure subroutine, public s_initialize_bubbles_model()
Initialize bubble model arrays for Euler or Lagrangian bubbles with polytropic or non-polytropic gas.
Allocate memory and read initial condition data for IC extrusion.
Assembles initial conditions by layering prioritized patches via constructive solid geometry.
type(ic_context) ic
Initial-condition state (fields, bc types, patch ids).
impure subroutine s_initialize_initial_condition_module
Computation of parameters, allocation procedures, and/or any other tasks needed to properly setup the...
impure subroutine s_finalize_initial_condition_module
Deallocation procedures for the module.
impure subroutine s_generate_initial_condition
Iterate over patches and, depending on the geometry type, call the related subroutine to setup the sa...
MPI communication layer: domain decomposition, halo exchange, reductions, and parallel I/O setup.
impure subroutine s_mpi_abort(prnt, code)
The subroutine terminates the MPI execution environment.
impure subroutine s_initialize_mpi_common_module
Initialize the module.
impure subroutine s_mpi_barrier
Halts all processes until all have reached barrier.
impure subroutine s_mpi_initialize
Initialize the MPI execution environment and query the number of processors and local rank.
impure subroutine s_initialize_mpi_data(q_cons_vf, ib_markers, beta)
Set up MPI I/O data views and variable pointers for parallel file output.
impure subroutine s_mpi_finalize
The subroutine finalizes the MPI execution environment.
impure subroutine mpi_bcast_time_step_values(proc_time, time_avg)
Gather per-rank time step wall-clock times onto rank 0 for performance reporting.
impure subroutine s_mpi_reduce_min(var_loc)
Reduce a local real value to its global minimum across all ranks.
impure subroutine s_finalize_mpi_common_module
Module deallocation and/or disassociation procedures.
subroutine s_mpi_decompose_computational_domain
Decompose the computational domain among processors by balancing cells per rank in each coordinate di...
Broadcasts user inputs and decomposes the domain across MPI ranks for pre-processing.
impure subroutine s_mpi_bcast_user_inputs
Since only processor with rank 0 is in charge of reading and checking the consistency of the user pro...
Phase transition relaxation solvers for liquid-vapor flows with cavitation and boiling.
impure subroutine, public s_finalize_relaxation_solver_module
Finalize the phase change module.
subroutine, public s_infinite_relaxation_k(q_cons_vf)
Apply pT- or pTg-equilibrium relaxation with mass depletion based on the incoming state conditions.
impure subroutine, public s_initialize_phasechange_module
Initialize the phase change module by setting saturation curve coefficients for pT- or pTg-equilibriu...
Reads and validates user inputs, loads existing grid/IC data, and initializes pre-process modules.
impure subroutine, public s_read_serial_ic_data_files(q_cons_vf_in)
The goal of this subroutine is to read in any preexisting initial condition data files so that they m...
impure subroutine, public s_initialize_modules
Initialize all pre-process modules, allocate data structures, and set I/O procedure pointers.
impure subroutine, public s_save_data(proc_time, time_avg, time_final, file_exists)
Gather processor timing data and write elapsed wall-clock time to a summary file.
impure subroutine, public s_apply_initial_condition(start, finish)
Generate or read the initial condition, apply relaxation if needed, and write output data files.
character(len=path_len+name_len) proc_rank_dir
Location of the folder associated with the rank of the local processor.
impure subroutine, public s_read_serial_grid_data_files
The goal of this subroutine is to read in any preexisting grid data as well as based on the imported ...
impure subroutine, public s_read_parallel_ic_data_files(q_cons_vf_in)
The goal of this subroutine is to read in any preexisting initial condition data files so that they m...
procedure(s_read_abstract_ic_data_files), pointer, public s_read_ic_data_files
impure subroutine, public s_read_grid()
Read an existing grid from data files or generate a new grid from user inputs.
impure subroutine, public s_check_grid_data_files
Cell-boundary data are checked for consistency by looking at the (non-)uniform cell-width distributio...
impure subroutine, public s_initialize_mpi_domain
Initialize MPI, read and validate user inputs on rank 0, and decompose the computational domain.
impure subroutine, public s_finalize_modules
Finalize all pre-process modules, deallocate resources, and shut down MPI.
impure subroutine, public s_read_input_file
Reads the configuration file pre_process.inp, in order to populate the parameters in module m_global_...
impure subroutine, public s_check_input_file
Checking that the user inputs make sense, i.e. that the individual choices are compatible with the co...
procedure(s_read_abstract_grid_data_files), pointer, public s_read_grid_data_files
impure subroutine, public s_read_parallel_grid_data_files
Cell-boundary data are checked for consistency by looking at the (non-)uniform cell-width distributio...
Conservative-to-primitive variable conversion, mixture property evaluation, and pressure computation.
impure subroutine, public s_initialize_variables_conversion_module
Initialize the variables conversion module.
impure subroutine s_finalize_variables_conversion_module()
Deallocate fluid property arrays and post-processing fields allocated during module initialization.
Derived type annexing an integer scalar field (SF).
Derived type for bubble variables pb and mv at quadrature nodes (qbmm).
Derived type annexing a scalar field (SF).