1# 1 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
6# 1 "/home/runner/work/MFC/MFC/src/common/include/case.fpp" 1
12# 8 "/home/runner/work/MFC/MFC/src/common/include/case.fpp"
15# 12 "/home/runner/work/MFC/MFC/src/common/include/case.fpp"
16# 6 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp" 2
17# 1 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp" 1
18# 1 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp" 1
19# 1 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp" 1
20# 2 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
21# 3 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
22# 4 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
23# 5 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
24# 6 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
26# 8 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
27# 9 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
28# 10 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
30# 17 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
32# 46 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
34# 58 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
36# 68 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
38# 98 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
40# 110 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
42# 120 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
44# 167 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
46# 2 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp" 2
47# 1 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp" 1
48# 1 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp" 1
49# 2 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
50# 3 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
51# 4 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
52# 5 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
53# 6 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
55# 8 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
56# 9 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
57# 10 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
59# 17 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
61# 46 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
63# 58 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
65# 68 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
67# 98 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
69# 110 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
71# 120 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
73# 167 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
75# 2 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp" 2
77# 4 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
78# 5 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
79# 6 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
80# 7 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
81# 8 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
83# 20 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
85# 43 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
87# 48 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
89# 53 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
91# 58 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
93# 63 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
95# 68 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
97# 76 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
99# 81 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
101# 86 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
103# 91 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
105# 96 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
107# 101 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
109# 106 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
111# 111 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
113# 116 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
115# 121 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
117# 151 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
119# 192 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
121# 206 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
123# 231 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
125# 242 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
127# 244 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
128# 255 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
130# 284 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
132# 294 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
134# 304 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
136# 313 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
138# 330 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
140# 340 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
142# 347 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
144# 353 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
146# 359 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
148# 365 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
150# 371 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
152# 377 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
154# 3 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp" 2
155# 1 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp" 1
156# 1 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp" 1
157# 2 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
158# 3 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
159# 4 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
160# 5 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
161# 6 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
163# 8 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
164# 9 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
165# 10 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
167# 17 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
169# 46 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
171# 58 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
173# 68 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
175# 98 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
177# 110 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
179# 120 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
181# 167 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
183# 2 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp" 2
185# 7 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
187# 17 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
189# 22 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
191# 27 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
193# 32 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
195# 37 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
197# 42 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
199# 47 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
201# 52 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
203# 57 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
205# 62 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
207# 73 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
209# 78 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
211# 83 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
213# 88 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
215# 103 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
217# 131 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
219# 160 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
221# 175 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
223# 193 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
225# 215 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
227# 244 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
229# 259 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
231# 269 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
233# 278 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
235# 294 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
237# 304 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
239# 311 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
241# 4 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp" 2
244# 23 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
247# 43 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
250# 55 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
253# 112 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
256# 130 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
259# 145 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
262# 164 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
265# 193 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
268# 207 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
271# 219 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
274# 231 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
277# 242 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
280# 254 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
283# 266 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
286# 275 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
289# 282 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
292# 289 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
295# 296 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
298# 303 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
300# 305 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
301# 306 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
303# 2 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp" 2
305# 14 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
310# 55 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
313# 75 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
316# 83 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
319# 107 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
322# 123 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
325# 148 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
327# 154 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
329# 161 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
331# 7 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp" 2
364#if defined(MFC_OpenACC)
365# 39 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
367# 39 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
368#elif defined(MFC_OpenMP)
369# 39 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
371# 39 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
405 if (.not. parallel_io)
then
416 character(LEN=name_len),
parameter :: file_path =
'./simulation.inp'
417 logical :: file_exist
421 character(len=1000) :: line
423# 1 "/home/runner/work/MFC/MFC/build/include/simulation/generated_namelist.fpp" 1
426# 21 "/home/runner/work/MFC/MFC/build/include/simulation/generated_namelist.fpp"
427namelist /user_inputs/ adc_kappa, bx0, ca, r0ref, re_inv, web, acoustic, acoustic_source, adap_dt, adap_dt_max_iters, &
428 & adap_dt_tol, adv_n, alf_factor, alpha_bar, alt_soundspeed, avg_state,
bc_x,
bc_y,
bc_z, bf_spatial_support, bf_x, bf_y, &
429 & bf_z, bub_pp, bubble_model, bubbles_euler, bubbles_lagrange, case_dir, cfl_adap_dt, cfl_const_dt, cfl_target, chem_params, &
430 & coefficient_of_restitution, collision_model, collision_time, cont_damage, cont_damage_s, cyl_coord, down_sample, dt, &
431 & fd_order, fft_wrt, file_per_process, fluid_pp, g_x, g_y, g_z, hll_u_interface, hyper_cleaning, hyper_cleaning_speed, &
432 & hyper_cleaning_tau, hypo_hll_interface_rhs, hypoelasticity, ib, ib_airfoil, ib_coefficient_of_friction, &
433 & ib_neighborhood_radius, ib_state_wrt, ic_beta, ic_eps, int_comp, k_x, k_y, k_z, lag_params, low_mach, m, &
434 & many_ib_patch_parallelism, mixture_err, model_eqns, mp_weno, mpp_lim, muscl_eps, n, n_start, null_weights, num_bc_patches, &
435 & num_ibs, num_igr_iters, num_igr_warm_start_iters, num_particle_clouds, num_probes, num_source, num_stl_models, &
436 & num_turbulent_sources, nv_uvm_igr_temps_on_gpu, nv_uvm_out_of_core, nv_uvm_pref_gpu, p, p_x, p_y, p_z, palpha_eps, &
437 & parallel_io, particle_cloud, patch_ib, pi_fac, poly_sigma, polydisperse, polytropic, precision, prim_vars_wrt, probe, &
438 & probe_wrt, ptgalpha_eps, qbmm, rburn, rdma_mpi, reactive_burn, relax, relax_model, riemann_hypo_adc, riemann_solver, &
440 & synth_n_shells,
synth_n_waves_per_shell, synth_seed, synthetic_turbulence, t_save, t_step_old, t_step_print, t_step_save, &
441 & t_step_start, t_step_stop, t_stop, tau_star, teno_ct, thermal, time_stepper,
turb_pos, w_x, w_y, w_z, wave_speeds, &
442 & weno_re_flux, weno_avg, weno_eps, &
443 & igr, igr_iter_solver, igr_order, igr_pres_lim, mapped_weno, mhd, muscl_lim, muscl_order,
nb, num_fluids, recon_type, &
444 & relativity, teno, viscous, weno_order, wenoz, wenoz_q
445# 40 "/home/runner/work/MFC/MFC/build/include/simulation/generated_namelist.fpp"
446# 91 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp" 2
448 inquire (file=trim(file_path), exist=file_exist)
451 open (1, file=trim(file_path), form=
'formatted', action=
'read', status=
'old')
452 read (1, nml=user_inputs, iostat=iostatus)
454 if (iostatus /= 0)
then
456 read (1, fmt=
'(A)') line
457 print *,
'Invalid line in namelist: ' // trim(line)
458 call s_mpi_abort(
'Invalid line in simulation.inp. It is ' //
'likely due to a datatype mismatch. Exiting.')
463 if ((bf_x) .or. (bf_y) .or. (bf_z) .or. (bf_spatial_support))
then
473 if (cfl_adap_dt .or. cfl_const_dt)
cfl_dt = .true.
483 call s_mpi_abort(trim(file_path) //
' is missing. Exiting.')
491 character(LEN=path_len) :: file_path
492 logical :: file_exist
494 file_path = trim(case_dir) //
'/.'
498 if (file_exist .neqv. .true.)
then
499 call s_mpi_abort(trim(file_path) //
' is missing. Exiting.')
511 character(LEN=path_len + 2*name_len) :: t_step_dir
512 character(LEN=path_len + 3*name_len) :: file_path
513 logical :: file_exist
517 write (t_step_dir,
'(A,I0,A,I0)') trim(case_dir) //
'/p_all/p',
proc_rank,
'/', n_start
519 write (t_step_dir,
'(A,I0,A,I0)') trim(case_dir) //
'/p_all/p',
proc_rank,
'/', t_step_start
522 file_path = trim(t_step_dir) //
'/.'
525 if (file_exist .neqv. .true.)
then
526 call s_mpi_abort(trim(file_path) //
' is missing. Exiting.')
535 file_path = trim(t_step_dir) //
'/x_cb.dat'
537 inquire (file=trim(file_path), exist=file_exist)
540 open (2, file=trim(file_path), form=
'unformatted', action=
'read', status=
'old')
541 read (2)
x_cb(-1:m);
close (2)
543 call s_mpi_abort(trim(file_path) //
' is missing. Exiting.')
550 file_path = trim(t_step_dir) //
'/y_cb.dat'
552 inquire (file=trim(file_path), exist=file_exist)
555 open (2, file=trim(file_path), form=
'unformatted', action=
'read', status=
'old')
556 read (2)
y_cb(-1:n);
close (2)
558 call s_mpi_abort(trim(file_path) //
' is missing. Exiting.')
566 file_path = trim(t_step_dir) //
'/z_cb.dat'
568 inquire (file=trim(file_path), exist=file_exist)
571 open (2, file=trim(file_path), form=
'unformatted', action=
'read', status=
'old')
572 read (2)
z_cb(-1:p);
close (2)
574 call s_mpi_abort(trim(file_path) //
' is missing. Exiting.')
582 write (file_path,
'(A,I0,A)') trim(t_step_dir) //
'/q_cons_vf',
i,
'.dat'
583 inquire (file=trim(file_path), exist=file_exist)
585 open (2, file=trim(file_path), form=
'unformatted', action=
'read', status=
'old')
586 read (2)
q_cons_vf(
i)%sf(0:m,0:n,0:p);
close (2)
588 call s_mpi_abort(trim(file_path) //
' is missing. Exiting.')
592 if (bubbles_euler .or. hypoelasticity)
then
594 if (qbmm .and. .not. polytropic)
then
597 write (file_path,
'(A,I0,A)') trim(t_step_dir) //
'/pb', sys_size + (
i - 1)*
nnode +
r,
'.dat'
598 inquire (file=trim(file_path), exist=file_exist)
600 open (2, file=trim(file_path), form=
'unformatted', action=
'read', status=
'old')
601 read (2)
pb_ts(1)%sf(0:m,0:n,0:p,
r,
i);
close (2)
603 call s_mpi_abort(trim(file_path) //
' is missing. Exiting.')
609 write (file_path,
'(A,I0,A)') trim(t_step_dir) //
'/mv', sys_size + (
i - 1)*
nnode +
r,
'.dat'
610 inquire (file=trim(file_path), exist=file_exist)
612 open (2, file=trim(file_path), form=
'unformatted', action=
'read', status=
'old')
613 read (2)
mv_ts(1)%sf(0:m,0:n,0:p,
r,
i);
close (2)
615 call s_mpi_abort(trim(file_path) //
' is missing. Exiting.')
630 real(wp),
allocatable,
dimension(:) :: x_cb_glb, y_cb_glb, z_cb_glb
631 integer :: ifile, ierr, data_size
632 integer,
dimension(MPI_STATUS_SIZE) :: status
633 integer(KIND=MPI_OFFSET_KIND) :: disp
634 integer(KIND=MPI_OFFSET_KIND) :: m_mok, n_mok, p_mok
635 integer(KIND=MPI_OFFSET_KIND) :: wp_mok, var_mok
636 integer(KIND=MPI_OFFSET_KIND) :: mok
637 character(LEN=path_len + 2*name_len) :: file_loc
638 logical :: file_exist
639 character(len=10) :: t_step_start_string
643 integer :: m_ds, n_ds, p_ds
644 integer :: m_glb_ds, n_glb_ds, p_glb_ds
645 integer :: m_glb_read, n_glb_read, p_glb_read
647 allocate (x_cb_glb(-1:
m_glb))
648 allocate (y_cb_glb(-1:
n_glb))
649 allocate (z_cb_glb(-1:
p_glb))
651 file_loc = trim(case_dir) //
'/restart_data' // trim(mpiiofs) //
'x_cb.dat'
652 inquire (file=trim(file_loc), exist=file_exist)
654 if (down_sample)
then
655 m_ds = int((m + 1)/3) - 1
656 n_ds = int((n + 1)/3) - 1
657 p_ds = int((p + 1)/3) - 1
659 m_glb_ds = int((
m_glb + 1)/3) - 1
660 n_glb_ds = int((
n_glb + 1)/3) - 1
661 p_glb_ds = int((
p_glb + 1)/3) - 1
665 data_size =
m_glb + 2
666 call mpi_file_open(mpi_comm_world, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
667 call mpi_file_read(ifile, x_cb_glb, data_size, mpi_p, status, ierr)
668 call mpi_file_close(ifile, ierr)
670 call s_mpi_abort(
'File ' // trim(file_loc) //
' is missing. Exiting.')
677 file_loc = trim(case_dir) //
'/restart_data' // trim(mpiiofs) //
'y_cb.dat'
678 inquire (file=trim(file_loc), exist=file_exist)
681 data_size =
n_glb + 2
682 call mpi_file_open(mpi_comm_world, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
683 call mpi_file_read(ifile, y_cb_glb, data_size, mpi_p, status, ierr)
684 call mpi_file_close(ifile, ierr)
686 call s_mpi_abort(
'File ' // trim(file_loc) //
' is missing. Exiting.')
693 file_loc = trim(case_dir) //
'/restart_data' // trim(mpiiofs) //
'z_cb.dat'
694 inquire (file=trim(file_loc), exist=file_exist)
697 data_size =
p_glb + 2
698 call mpi_file_open(mpi_comm_world, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
699 call mpi_file_read(ifile, z_cb_glb, data_size, mpi_p, status, ierr)
700 call mpi_file_close(ifile, ierr)
702 call s_mpi_abort(
'File ' // trim(file_loc) //
'is missing. Exiting.')
710 if (file_per_process)
then
713 write (file_loc,
'(I0,A1,I7.7,A)') n_start,
'_',
proc_rank,
'.dat'
716 write (file_loc,
'(I0,A1,I7.7,A)') t_step_start,
'_',
proc_rank,
'.dat'
718 file_loc = trim(case_dir) //
'/restart_data/lustre_' // trim(t_step_start_string) // trim(mpiiofs) // trim(file_loc)
719 inquire (file=trim(file_loc), exist=file_exist)
722 call mpi_file_open(mpi_comm_self, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
724 if (down_sample)
then
735 if (down_sample)
then
736 data_size = (m_ds + 3)*(n_ds + 3)*(p_ds + 3)
737 m_glb_read = m_glb_ds + 1
738 n_glb_read = n_glb_ds + 1
739 p_glb_read = p_glb_ds + 1
741 data_size = (m + 1)*(n + 1)*(p + 1)
742 m_glb_read =
m_glb + 1
743 n_glb_read =
n_glb + 1
744 p_glb_read =
p_glb + 1
747 m_mok = int(m_glb_read + 1, mpi_offset_kind)
748 n_mok = int(m_glb_read + 1, mpi_offset_kind)
749 p_mok = int(m_glb_read + 1, mpi_offset_kind)
750 wp_mok = int(storage_size(0._stp)/8, mpi_offset_kind)
751 mok = int(1._wp, mpi_offset_kind)
753 if (bubbles_euler .or. hypoelasticity)
then
755 var_mok = int(
i, mpi_offset_kind)
757 call mpi_file_read(ifile,
mpi_io_data%var(
i)%sf, data_size*mpi_io_type, mpi_io_p, status, ierr)
760 if (qbmm .and. .not. polytropic)
then
761 do i = sys_size + 1, sys_size + 2*
nb*
nnode
762 var_mok = int(
i, mpi_offset_kind)
764 call mpi_file_read(ifile,
mpi_io_data%var(
i)%sf, data_size*mpi_io_type, mpi_io_p, status, ierr)
768 if (down_sample)
then
770 var_mok = int(
i, mpi_offset_kind)
772 call mpi_file_read(ifile,
q_cons_temp(
i)%sf, data_size*mpi_io_type, mpi_io_p, status, ierr)
776 var_mok = int(
i, mpi_offset_kind)
778 call mpi_file_read(ifile,
mpi_io_data%var(
i)%sf, data_size*mpi_io_type, mpi_io_p, status, ierr)
785 call mpi_file_close(ifile, ierr)
787 call s_mpi_abort(
'File ' // trim(file_loc) //
' is missing. Exiting.')
791 write (file_loc,
'(I0,A)') n_start,
'.dat'
793 write (file_loc,
'(I0,A)') t_step_start,
'.dat'
795 file_loc = trim(case_dir) //
'/restart_data' // trim(mpiiofs) // trim(file_loc)
796 inquire (file=trim(file_loc), exist=file_exist)
799 call mpi_file_open(mpi_comm_world, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
808 data_size = (m + 1)*(n + 1)*(p + 1)
810 m_mok = int(
m_glb + 1, mpi_offset_kind)
811 n_mok = int(
n_glb + 1, mpi_offset_kind)
812 p_mok = int(
p_glb + 1, mpi_offset_kind)
813 wp_mok = int(storage_size(0._stp)/8, mpi_offset_kind)
814 mok = int(1._wp, mpi_offset_kind)
816 if (bubbles_euler .or. hypoelasticity)
then
818 var_mok = int(
i, mpi_offset_kind)
819 disp = m_mok*max(mok, n_mok)*max(mok, p_mok)*wp_mok*(var_mok - 1)
821 call mpi_file_set_view(ifile, disp, mpi_io_p,
mpi_io_data%view(
i),
'native', mpi_info_int, ierr)
822 call mpi_file_read(ifile,
mpi_io_data%var(
i)%sf, data_size*mpi_io_type, mpi_io_p, status, ierr)
825 if (qbmm .and. .not. polytropic)
then
826 do i = sys_size + 1, sys_size + 2*
nb*
nnode
827 var_mok = int(
i, mpi_offset_kind)
828 disp = m_mok*max(mok, n_mok)*max(mok, p_mok)*wp_mok*(var_mok - 1)
830 call mpi_file_set_view(ifile, disp, mpi_io_p,
mpi_io_data%view(
i),
'native', mpi_info_int, ierr)
831 call mpi_file_read(ifile,
mpi_io_data%var(
i)%sf, data_size*mpi_io_type, mpi_io_p, status, ierr)
836 var_mok = int(
i, mpi_offset_kind)
838 disp = m_mok*max(mok, n_mok)*max(mok, p_mok)*wp_mok*(var_mok - 1)
840 call mpi_file_set_view(ifile, disp, mpi_io_p,
mpi_io_data%view(
i),
'native', mpi_info_int, ierr)
841 call mpi_file_read_all(ifile,
mpi_io_data%var(
i)%sf, data_size*mpi_io_type, mpi_io_p, status, ierr)
847 call mpi_file_close(ifile, ierr)
849 call s_mpi_abort(
'File ' // trim(file_loc) //
' is missing. Exiting.')
853 deallocate (x_cb_glb, y_cb_glb, z_cb_glb)
867 type(
scalar_field),
dimension(sys_size),
intent(inout) :: v_vf
873 real(wp),
dimension(2) :: re
875 integer ::
i,
j,
k,
l, c
876 real(wp),
dimension(num_species) :: rhoyks
889 do i = eqn_idx%mom%beg, eqn_idx%mom%end
890 dyn_pres = dyn_pres + 5.e-1_wp*v_vf(
i)%sf(
j,
k,
l)*v_vf(
i)%sf(
j,
k,
l)/max(rho,
sgm_eps)
894 do c = 1, num_species
895 rhoyks(c) = v_vf(eqn_idx%species%beg + c - 1)%sf(
j,
k,
l)
901 pres_mag = 0.5_wp*(bx0**2 + v_vf(eqn_idx%B%beg)%sf(
j,
k,
l)**2 + v_vf(eqn_idx%B%beg + 1)%sf(
j,
k,
l)**2)
903 pres_mag = 0.5_wp*(v_vf(eqn_idx%B%beg)%sf(
j,
k,
l)**2 + v_vf(eqn_idx%B%beg + 1)%sf(
j,
k, &
904 &
l)**2 + v_vf(eqn_idx%B%beg + 2)%sf(
j,
k,
l)**2)
908 call s_compute_pressure(v_vf(eqn_idx%E)%sf(
j,
k,
l), 0._stp, dyn_pres, pi_inf, gamma, rho, qv, rhoyks, pres, &
909 & t, pres_mag=pres_mag)
912 v_vf(
i + eqn_idx%int_en%beg - 1)%sf(
j,
k,
l) = v_vf(
i + eqn_idx%adv%beg - 1)%sf(
j,
k, &
913 &
l)*(gammas(
i)*pres + pi_infs(
i)) + v_vf(
i + eqn_idx%cont%beg - 1)%sf(
j,
k,
l)*qvs(
i)
924 integer,
intent(inout) :: t_step
925 real(wp),
intent(inout) :: time_avg
926 integer ::
i, eta_hh, eta_mm, eta_ss
937 print *,
"Delta t = ", dt
943 if ((
mytime + dt) >= t_stop)
then
946# 589 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
947#if defined(MFC_OpenACC)
948# 589 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
950# 589 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
951#elif defined(MFC_OpenMP)
952# 589 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
954# 589 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
961# 594 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
962#if defined(MFC_OpenACC)
963# 594 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
965# 594 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
966#elif defined(MFC_OpenMP)
967# 594 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
969# 594 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
975 if (
proc_rank == 0 .and. mod(t_step - t_step_start, t_step_print) == 0)
then
977 eta_hh = int(eta_sec)/3600
978 eta_mm = mod(int(eta_sec), 3600)/60
979 eta_ss = mod(int(eta_sec), 60)
980 print
'(" [", I3, "%] Time ", ES16.6, " dt = ", ES16.6, " @ Time Step = ", I8, " Time Avg = ", ES16.6, " Time/step = ", ES12.6, " ETA (HH:MM:SS) = ", I0, ":", I2.2, ":", I2.2)', &
984 if (
proc_rank == 0 .and. mod(t_step - t_step_start, t_step_print) == 0)
then
986 eta_hh = int(eta_sec)/3600
987 eta_mm = mod(int(eta_sec), 3600)/60
988 eta_ss = mod(int(eta_sec), 60)
989 print
'(" [", I3, "%] Time step ", I8, " of ", I0, " @ t_step = ", I8, " Time Avg = ", ES12.6, " Time/step= ", ES12.6, " ETA (HH:MM:SS) = ", I0, ":", I2.2, ":", I2.2)', &
990 & int(ceiling(100._wp*(real(t_step - t_step_start)/(t_step_stop - t_step_start + 1)))), &
999# 622 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1000#if defined(MFC_OpenACC)
1001# 622 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1003# 622 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1004#elif defined(MFC_OpenMP)
1005# 622 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1007# 622 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1010 if (bubbles_euler)
then
1012# 625 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1013#if defined(MFC_OpenACC)
1014# 625 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1016# 625 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1017#elif defined(MFC_OpenMP)
1018# 625 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1020# 625 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1027 call s_tvd_rk(t_step, time_avg, time_stepper)
1044 real(wp),
intent(inout) :: time_avg, time_final
1045 real(wp),
intent(inout) :: io_time_avg, io_time_final
1046 real(wp),
dimension(:),
intent(inout) :: proc_time
1047 real(wp),
dimension(:),
intent(inout) :: io_proc_time
1048 logical,
intent(inout) :: file_exists
1049 real(wp) :: grind_time
1061 io_time_final = 0._wp
1063 time_final = time_avg
1064 io_time_final = io_time_avg
1066 time_final = maxval(proc_time)
1067 io_time_final = maxval(io_proc_time)
1070 grind_time = time_final*1.0e9_wp/(real(sys_size, wp)*real(maxval((/1,
m_glb/)), wp)*real(maxval((/1,
n_glb/)), &
1071 & wp)*real(maxval((/1,
p_glb/)), wp))
1073 print *,
"Performance:", grind_time,
"ns/gp/eq/rhs"
1074 inquire (file=
'time_data.dat', exist=file_exists)
1075 if (file_exists)
then
1076 open (1, file=
'time_data.dat',
position=
'append', status=
'old')
1078 open (1, file=
'time_data.dat', status=
'new')
1079 write (1,
'(A10, A15, A15)')
"Ranks",
"s/step",
"ns/gp/eq/rhs"
1082 write (1,
'(I10, 2(F15.8))')
num_procs, time_final, grind_time
1086 inquire (file=
'io_time_data.dat', exist=file_exists)
1087 if (file_exists)
then
1088 open (1, file=
'io_time_data.dat',
position=
'append', status=
'old')
1090 open (1, file=
'io_time_data.dat', status=
'new')
1091 write (1,
'(A10, A15)')
"Ranks",
"s/step"
1094 write (1,
'(I10, F15.8)')
num_procs, io_time_final
1103 integer,
intent(inout) :: t_step
1104 real(wp),
intent(inout) :: start, finish, io_time_avg
1105 integer,
intent(inout) :: nt
1106 integer(kind=8) ::
i,
j,
k,
l
1108 integer :: save_count
1110 if (down_sample)
then
1118# 721 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1120# 721 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1121#if defined(MFC_OpenACC)
1122# 721 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1124# 721 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1125#elif defined(MFC_OpenMP)
1126# 721 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1128# 721 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1130# 721 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1132# 721 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1134# 721 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1146# 731 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1147#if defined(MFC_OpenACC)
1148# 731 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1150# 731 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1151#elif defined(MFC_OpenMP)
1152# 731 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1154# 731 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1156# 731 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1161 call cpu_time(start)
1164#ifndef FRONTIER_UNIFIED
1166# 739 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1167#if defined(MFC_OpenACC)
1168# 739 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1170# 739 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1171#elif defined(MFC_OpenMP)
1172# 739 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1174# 739 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1181 print *,
"NaN(s) in timestep output.",
j,
k,
l,
i,
proc_rank, t_step, m, n, p
1189 if (qbmm .and. .not. polytropic)
then
1191# 754 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1192#if defined(MFC_OpenACC)
1193# 754 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1195# 754 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1196#elif defined(MFC_OpenMP)
1197# 754 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1199# 754 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1202# 755 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1203#if defined(MFC_OpenACC)
1204# 755 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1206# 755 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1207#elif defined(MFC_OpenMP)
1208# 755 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1210# 755 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1215 save_count = int(
mytime/t_save)
1220 if (bubbles_lagrange)
then
1222# 765 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1223#if defined(MFC_OpenACC)
1224# 765 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1226# 765 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1227#elif defined(MFC_OpenMP)
1228# 765 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1230# 765 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1232# 767 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1235 call s_mpi_abort(
"Bubble radius is negative or NaN, please reduce dt.")
1240# 773 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1241#if defined(MFC_OpenACC)
1242# 773 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1244# 773 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1245#elif defined(MFC_OpenMP)
1246# 773 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1248# 773 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1252# 775 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1253#if defined(MFC_OpenACC)
1254# 775 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1256# 775 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1257#elif defined(MFC_OpenMP)
1258# 775 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1260# 775 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1272 call cpu_time(finish)
1276 nt = int((t_step - t_step_start)/(t_step_save))
1280 io_time_avg = abs(finish - start)
1282 io_time_avg = (abs(finish - start) + io_time_avg*(nt - 1))/nt
1290 integer :: m_ds, n_ds, p_ds
1294# 818 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1295 if (bubbles_euler .or. bubbles_lagrange)
then
1309 if (acoustic_source)
then
1313 if (viscous .and. (.not. igr))
then
1329 if (down_sample)
then
1330 m_ds = int((m + 1)/3) - 1
1331 n_ds = int((n + 1)/3) - 1
1332 p_ds = int((p + 1)/3) - 1
1336 allocate (
q_cons_temp(
i)%sf(-1:m_ds + 1,-1:n_ds + 1,-1:p_ds + 1))
1340 if (down_sample)
then
1345# 867 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1346#if defined(MFC_OpenACC)
1347# 867 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1349# 867 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1350#elif defined(MFC_OpenMP)
1351# 867 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1353# 867 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1372 else if (p == 0)
then
1381# 893 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1382#if defined(MFC_OpenACC)
1383# 893 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1385# 893 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1386#elif defined(MFC_OpenMP)
1387# 893 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1389# 893 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1392 if (n > 0) dy_min = minval(
dy)
1393 if (p > 0) dz_min = minval(
dz)
1399 integer :: num_particle_cloud_ibs
1405 if (
cfl_dt .and. n_start > 0)
then
1407 allocate (particle_cloud_ibs(0))
1408 num_particle_cloud_ibs = 0
1409 else if (t_step_start > 0)
then
1411 allocate (particle_cloud_ibs(0))
1412 num_particle_cloud_ibs = 0
1417 deallocate (particle_cloud_ibs)
1420 if (t_step_start == 0 .or. (cfl_dt .and. n_start == 0))
then
1421 call s_write_ib_data_file(0)
1422 call s_write_ib_state_file(0)
1425 if (bodyforces .or. synthetic_turbulence)
call s_initialize_body_forces_module()
1426 if (acoustic_source)
call s_precalculate_acoustic_spatial_sources()
1429 if (chemistry)
call s_compute_q_t_sf(q_t_sf, q_cons_ts(1)%vf, idwint)
1434 call s_initialize_igr_module()
1437 if (recon_type == recon_type_weno)
then
1438 call s_initialize_weno_module()
1439 else if (recon_type == recon_type_muscl)
then
1440 call s_initialize_muscl_module()
1442 call s_initialize_cbc_module()
1443 call s_initialize_riemann_solvers_module()
1445 if (int_comp > 0)
call s_initialize_thinc_module()
1446 call s_initialize_derived_variables()
1447 if (bubbles_lagrange)
call s_initialize_bubbles_el_module(q_cons_ts(1)%vf, bc_type)
1449 if (hypoelasticity)
call s_initialize_hypoelastic_module()
1459 real(wp) :: starttime, endtime
1460 integer :: num_devices, local_size, num_nodes, ppn, my_device_num
1461 integer :: dev, devnum, local_rank
1463 integer :: local_comm
1465#if defined(MFC_OpenACC)
1466 integer(acc_device_kind) :: devtype
1470 call s_mpi_initialize()
1477 call mpi_comm_split_type(mpi_comm_world, mpi_comm_type_shared, 0, mpi_info_null, local_comm, ierr)
1478 call mpi_comm_size(local_comm, local_size, ierr)
1479 call mpi_comm_rank(local_comm, local_rank, ierr)
1481#if defined(MFC_OpenACC)
1482 devtype = acc_get_device_type()
1483 devnum = acc_get_num_devices(devtype)
1484 dev = mod(local_rank, devnum)
1486 call acc_set_device_num(dev, devtype)
1487#elif defined(MFC_OpenMP)
1488 devnum = omp_get_num_devices()
1489 dev = mod(local_rank, devnum)
1490 call omp_set_default_device(dev)
1494 if (proc_rank == 0)
then
1495 call s_assign_default_values_to_user_inputs()
1499 print
'(" Simulating a ", A, " ", I0, "x", I0, "x", I0, " case on ", I0, " rank(s) ", A, ".")', &
1500# 1004 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1502# 1008 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1503 m, n, p, num_procs, &
1504#if defined(MFC_OpenACC)
1505 "with OpenACC offloading"
1506#elif defined(MFC_OpenMP)
1507 "with OpenMP offloading"
1513 call s_mpi_bcast_user_inputs()
1520 call s_initialize_parallel_io()
1522 call s_mpi_decompose_computational_domain(write_silo_ghost_offsets=.false., adjust_local_domains=.false.)
1524 bc = bc_xyz_info(bc_x, bc_y, bc_z)
1533 if (.not. down_sample)
then
1536# 1040 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1537#if defined(MFC_OpenACC)
1538# 1040 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1540# 1040 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1541#elif defined(MFC_OpenMP)
1542# 1040 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1544# 1040 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1549 if (qbmm .and. .not. polytropic)
then
1551# 1045 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1552#if defined(MFC_OpenACC)
1553# 1045 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1555# 1045 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1556#elif defined(MFC_OpenMP)
1557# 1045 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1559# 1045 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1564# 1048 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1565#if defined(MFC_OpenACC)
1566# 1048 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1568# 1048 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1569#elif defined(MFC_OpenMP)
1570# 1048 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1572# 1048 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1577# 1051 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1578#if defined(MFC_OpenACC)
1579# 1051 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1581# 1051 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1582#elif defined(MFC_OpenMP)
1583# 1051 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1585# 1051 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1589# 1053 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1590#if defined(MFC_OpenACC)
1591# 1053 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1593# 1053 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1594#elif defined(MFC_OpenMP)
1595# 1053 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1597# 1053 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1601# 1055 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1602#if defined(MFC_OpenACC)
1603# 1055 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1605# 1055 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1606#elif defined(MFC_OpenMP)
1607# 1055 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1609# 1055 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1611# 1059 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1613 if (bubbles_euler)
then
1615# 1061 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1616#if defined(MFC_OpenACC)
1617# 1061 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1619# 1061 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1620#elif defined(MFC_OpenMP)
1621# 1061 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1623# 1061 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1625 if (.not. polytropic)
then
1627# 1063 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1628#if defined(MFC_OpenACC)
1629# 1063 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1631# 1063 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1632#elif defined(MFC_OpenMP)
1633# 1063 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1635# 1063 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1639# 1065 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1640#if defined(MFC_OpenACC)
1641# 1065 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1643# 1065 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1644#elif defined(MFC_OpenMP)
1645# 1065 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1647# 1065 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1653# 1069 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1654#if defined(MFC_OpenACC)
1655# 1069 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1657# 1069 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1658#elif defined(MFC_OpenMP)
1659# 1069 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1661# 1069 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1665# 1071 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1666#if defined(MFC_OpenACC)
1667# 1071 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1669# 1071 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1670#elif defined(MFC_OpenMP)
1671# 1071 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1673# 1071 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1676# 1072 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1677#if defined(MFC_OpenACC)
1678# 1072 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1680# 1072 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1681#elif defined(MFC_OpenMP)
1682# 1072 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1684# 1072 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1688# 1074 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1689#if defined(MFC_OpenACC)
1690# 1074 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1692# 1074 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1693#elif defined(MFC_OpenMP)
1694# 1074 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1696# 1074 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1699# 1075 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1700#if defined(MFC_OpenACC)
1701# 1075 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1703# 1075 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1704#elif defined(MFC_OpenMP)
1705# 1075 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1707# 1075 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1710# 1076 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1711#if defined(MFC_OpenACC)
1712# 1076 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1714# 1076 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1715#elif defined(MFC_OpenMP)
1716# 1076 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1718# 1076 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1721# 1077 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1722#if defined(MFC_OpenACC)
1723# 1077 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1725# 1077 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1726#elif defined(MFC_OpenMP)
1727# 1077 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1729# 1077 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1732# 1078 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1733#if defined(MFC_OpenACC)
1734# 1078 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1736# 1078 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1737#elif defined(MFC_OpenMP)
1738# 1078 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1740# 1078 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1744# 1080 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1745#if defined(MFC_OpenACC)
1746# 1080 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1748# 1080 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1749#elif defined(MFC_OpenMP)
1750# 1080 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1752# 1080 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1755# 1081 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1756#if defined(MFC_OpenACC)
1757# 1081 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1759# 1081 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1760#elif defined(MFC_OpenMP)
1761# 1081 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1763# 1081 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1766# 1082 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1767#if defined(MFC_OpenACC)
1768# 1082 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1770# 1082 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1771#elif defined(MFC_OpenMP)
1772# 1082 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1774# 1082 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1778# 1084 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1779#if defined(MFC_OpenACC)
1780# 1084 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1782# 1084 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1783#elif defined(MFC_OpenMP)
1784# 1084 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1786# 1084 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1789# 1085 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1790#if defined(MFC_OpenACC)
1791# 1085 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1793# 1085 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1794#elif defined(MFC_OpenMP)
1795# 1085 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1797# 1085 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1800# 1086 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1801#if defined(MFC_OpenACC)
1802# 1086 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1804# 1086 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1805#elif defined(MFC_OpenMP)
1806# 1086 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1808# 1086 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1811# 1087 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1812#if defined(MFC_OpenACC)
1813# 1087 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1815# 1087 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1816#elif defined(MFC_OpenMP)
1817# 1087 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1819# 1087 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1823# 1089 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1824#if defined(MFC_OpenACC)
1825# 1089 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1827# 1089 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1828#elif defined(MFC_OpenMP)
1829# 1089 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1831# 1089 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1835# 1091 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1836#if defined(MFC_OpenACC)
1837# 1091 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1839# 1091 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1840#elif defined(MFC_OpenMP)
1841# 1091 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1843# 1091 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1847# 1093 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1848#if defined(MFC_OpenACC)
1849# 1093 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1851# 1093 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1852#elif defined(MFC_OpenMP)
1853# 1093 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1855# 1093 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1861# 1097 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1862#if defined(MFC_OpenACC)
1863# 1097 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1865# 1097 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1866#elif defined(MFC_OpenMP)
1867# 1097 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1869# 1097 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1872# 1100 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1874# 1100 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1875#if defined(MFC_OpenACC)
1876# 1100 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1878# 1100 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1879#elif defined(MFC_OpenMP)
1880# 1100 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1882# 1100 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1884# 1102 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
1891 call s_finalize_time_steppers_module()
1892 if (hypoelasticity)
call s_finalize_hypoelastic_module()
1893 call s_finalize_derived_variables_module()
1894 call s_finalize_data_output_module()
1895 call s_finalize_rhs_module()
1897 call s_finalize_igr_module()
1899 call s_finalize_cbc_module()
1900 call s_finalize_riemann_solvers_module()
1901 if (recon_type == recon_type_weno)
then
1902 call s_finalize_weno_module()
1903 else if (recon_type == recon_type_muscl)
then
1904 call s_finalize_muscl_module()
1907 if (int_comp > 0)
call s_finalize_thinc_module()
1908 call s_finalize_variables_conversion_module()
1909 if (grid_geometry == 3)
call s_finalize_fftw_module
1910 call s_finalize_mpi_common_module()
1911 call s_finalize_global_parameters_module()
1912 call s_finalize_boundary_common_module()
1913 if (relax)
call s_finalize_relaxation_solver_module()
1914 if (bubbles_lagrange)
call s_finalize_lagrangian_solver()
1915 if (viscous .and. (.not. igr))
then
1916 call s_finalize_viscous_module()
1918 call s_finalize_mpi_proxy_module()
1920 if (surface_tension)
call s_finalize_surface_tension_module()
1921 if (bodyforces .or. synthetic_turbulence)
call s_finalize_body_forces_module()
1922 if (ib)
call s_finalize_ibm_module()
1924 call s_mpi_finalize()
1932 integer,
intent(in) :: t_step
1933 character(len=path_len + 2*name_len) :: file_loc
1934 integer :: i, ios, file_unit, ierr
1935 integer :: r, nlocal, gbl_id
1936 integer,
parameter :: nfields_per_ib = 20
1937 real(wp) :: ib_buf(nfields_per_ib)
1938 logical :: file_exist
1939 character(len=10) :: t_step_string
1941 if (file_per_process)
then
1942 call s_int_to_str(t_step, t_step_string)
1944 do r = 0, num_procs - 1
1945 write (file_loc,
'(A,I0,A,i7.7,A)')
'ib_state_', t_step,
'_', r,
'.dat'
1946 file_loc = trim(case_dir) //
'/restart_data/lustre_' // trim(t_step_string) //
'/' // trim(file_loc)
1948 inquire (file=trim(file_loc), exist=file_exist)
1949 if (.not. file_exist)
call s_mpi_abort(
'Cannot open IB state file for restart: ' // trim(file_loc))
1951 open (newunit=file_unit, file=trim(file_loc), form=
'unformatted', access=
'stream', status=
'old', iostat=ios)
1952 if (ios /= 0)
call s_mpi_abort(
'Error opening IB state restart file: ' // trim(file_loc))
1954 read (file_unit, iostat=ios) nlocal
1955 if (ios /= 0)
call s_mpi_abort(
'Error reading IB state file header: ' // trim(file_loc))
1958 read (file_unit, iostat=ios) gbl_id
1959 if (ios /= 0)
call s_mpi_abort(
'Error reading IB patch ID: ' // trim(file_loc))
1960 read (file_unit, iostat=ios) ib_buf
1961 if (ios /= 0)
call s_mpi_abort(
'Error reading IB state data: ' // trim(file_loc))
1963 patch_ib(gbl_id)%vel = ib_buf(8:10)
1964 patch_ib(gbl_id)%angular_vel = ib_buf(11:13)
1965 patch_ib(gbl_id)%angles = ib_buf(14:16)
1966 patch_ib(gbl_id)%x_centroid = ib_buf(17)
1967 patch_ib(gbl_id)%y_centroid = ib_buf(18)
1968 patch_ib(gbl_id)%z_centroid = ib_buf(19)
1974 write (file_loc,
'(A,I0,A)')
'/restart_data/ib_state_', t_step,
'.dat'
1975 file_loc = trim(case_dir) // trim(file_loc)
1977 if (proc_rank == 0)
then
1978 inquire (file=trim(file_loc), exist=file_exist)
1979 if (.not. file_exist)
then
1980 call s_mpi_abort(
'Cannot open IB state file for restart: ' // trim(file_loc))
1983 open (newunit=file_unit, file=trim(file_loc), form=
'unformatted', access=
'stream', status=
'old', iostat=ios)
1984 if (ios /= 0)
call s_mpi_abort(
'Error opening IB state restart file: ' // trim(file_loc))
1987 read (file_unit, iostat=ios) ib_buf
1988 if (ios /= 0)
call s_mpi_abort(
'Error reading IB state restart file')
1990 patch_ib(i)%vel = ib_buf(8:10)
1991 patch_ib(i)%angular_vel = ib_buf(11:13)
1992 patch_ib(i)%angles = ib_buf(14:16)
1993 patch_ib(i)%x_centroid = ib_buf(17)
1994 patch_ib(i)%y_centroid = ib_buf(18)
1995 patch_ib(i)%z_centroid = ib_buf(19)
2003 call mpi_bcast(patch_ib(i)%vel, 3, mpi_p, 0, mpi_comm_world, ierr)
2004 call mpi_bcast(patch_ib(i)%angular_vel, 3, mpi_p, 0, mpi_comm_world, ierr)
2005 call mpi_bcast(patch_ib(i)%angles, 3, mpi_p, 0, mpi_comm_world, ierr)
2006 call mpi_bcast(patch_ib(i)%x_centroid, 1, mpi_p, 0, mpi_comm_world, ierr)
2007 call mpi_bcast(patch_ib(i)%y_centroid, 1, mpi_p, 0, mpi_comm_world, ierr)
2008 call mpi_bcast(patch_ib(i)%z_centroid, 1, mpi_p, 0, mpi_comm_world, ierr)
2023 type(ib_patch_parameters),
intent(in),
dimension(:) :: particle_cloud_ibs
2024 integer,
intent(in) :: num_particle_cloud_ibs
2025 real(wp),
dimension(3) :: centroid
2027 integer :: num_namelist_ibs, num_bed_ibs
2029 num_namelist_ibs = num_ibs
2031 do i = 1, num_particle_clouds
2032 num_bed_ibs = num_bed_ibs + particle_cloud(i)%num_particles
2036 moving_immersed_boundary_flag = .false.
2037 do i = 1, num_namelist_ibs
2038 if (patch_ib(i)%moving_ibm /= 0)
then
2039 moving_immersed_boundary_flag = .true.
2043 if (.not. moving_immersed_boundary_flag)
then
2044 do i = 1, num_particle_clouds
2045 if (particle_cloud(i)%moving_ibm /= 0)
then
2046 moving_immersed_boundary_flag = .true.
2055 if (num_procs == 1)
then
2057 do i = 1, num_particle_cloud_ibs
2058 patch_ib(num_namelist_ibs + i) = particle_cloud_ibs(i)
2060 num_gbl_ibs = num_namelist_ibs + num_particle_cloud_ibs
2061 if (num_gbl_ibs > num_ib_patches_max_namelist)
then
2062# 1278 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2063 call s_prohibit_abort(
"num_gbl_ibs > num_ib_patches_max_namelist",
"Total IB count exceeds patch_ib capacity. Increase num_ib_patches_max_namelist.")
2064# 1278 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2066# 1280 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2067 num_ibs = num_gbl_ibs
2068 num_local_ibs = num_gbl_ibs
2069 do i = 1, num_gbl_ibs
2070 local_ib_patch_ids(i) = i
2076 num_gbl_ibs = num_namelist_ibs + num_bed_ibs
2077 do i = 1, num_namelist_ibs
2078 centroid = [patch_ib(i)%x_centroid, patch_ib(i)%y_centroid, 0._wp]
2079 if (num_dims == 3) centroid(3) = patch_ib(i)%z_centroid
2080 if (f_neighborhood_ranks_own_location(centroid))
then
2081 num_ibs = num_ibs + 1
2082 patch_ib(num_ibs) = patch_ib(i)
2083 patch_ib(num_ibs)%gbl_patch_id = i
2084 if (f_local_rank_owns_location(centroid))
then
2085 num_local_ibs = num_local_ibs + 1
2086 if (num_local_ibs > num_local_ibs_max)
then
2087# 1299 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2088 call s_prohibit_abort(
"num_local_ibs > num_local_ibs_max",
"Too many IBs on a single processor rank. Modify case file or increase limit of num_local_ibs_max to resolve.")
2089# 1299 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2091# 1301 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2092 local_ib_patch_ids(num_local_ibs) = num_ibs
2097 do i = 1, num_particle_cloud_ibs
2098 centroid = [particle_cloud_ibs(i)%x_centroid, particle_cloud_ibs(i)%y_centroid, 0._wp]
2099 if (num_dims == 3) centroid(3) = particle_cloud_ibs(i)%z_centroid
2100 num_ibs = num_ibs + 1
2101 if (num_ibs > num_ib_patches_max_namelist)
then
2102# 1310 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2103 call s_prohibit_abort(
"num_ibs > num_ib_patches_max_namelist",
"Local IB count exceeds patch_ib capacity. Increase num_ib_patches_max_namelist.")
2104# 1310 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2106# 1312 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2107 patch_ib(num_ibs) = particle_cloud_ibs(i)
2108 if (f_local_rank_owns_location(centroid))
then
2109 num_local_ibs = num_local_ibs + 1
2110 if (num_local_ibs > num_local_ibs_max)
then
2111# 1315 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2112 call s_prohibit_abort(
"num_local_ibs > num_local_ibs_max",
"Too many IBs on a single processor rank. Modify case file or increase limit of num_local_ibs_max to resolve.")
2113# 1315 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2115# 1317 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2116 local_ib_patch_ids(num_local_ibs) = num_ibs
2122 do i = 1, num_particle_cloud_ibs
2123 patch_ib(num_namelist_ibs + i) = particle_cloud_ibs(i)
2125 num_gbl_ibs = num_namelist_ibs + num_particle_cloud_ibs
2126 if (num_gbl_ibs > num_ib_patches_max_namelist)
then
2127# 1327 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2128 call s_prohibit_abort(
"num_gbl_ibs > num_ib_patches_max_namelist",
"Total IB count exceeds patch_ib capacity. Increase num_ib_patches_max_namelist.")
2129# 1327 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2131# 1329 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2132 num_ibs = num_gbl_ibs
2133 num_local_ibs = num_gbl_ibs
2134 do i = 1, num_gbl_ibs
2135 local_ib_patch_ids(i) = i
2140# 1336 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2142# 1336 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2143 use iso_fortran_env,
only: output_unit
2144# 1336 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2146# 1336 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2147 print *,
'm_start_up.fpp:1336: ',
'@:ALLOCATE(ib_gbl_idx_lookup(1:num_gbl_ibs))'
2148# 1336 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2150# 1336 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2151 call flush (output_unit)
2152# 1336 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2154# 1336 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2156# 1336 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2157 allocate (ib_gbl_idx_lookup(1:num_gbl_ibs))
2158# 1336 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2160# 1336 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2162# 1336 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2163#if defined(MFC_OpenACC)
2164# 1336 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2166# 1336 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2167#elif defined(MFC_OpenMP)
2168# 1336 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2170# 1336 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2179 integer :: ax, k, nbr_idx, nreqs, sx, sy, sz, dx, dy, dz
2180 integer,
allocatable :: send_table(:,:,:), recv_tables(:,:,:,:)
2181 integer,
dimension(52) :: requests
2185 integer,
dimension(4) :: buf4, rbuf4
2186 integer,
dimension(2) :: buf2, rbuf2
2188 ax = ib_neighborhood_radius
2190 if (
allocated(ib_neighbor_ranks))
deallocate (ib_neighbor_ranks)
2191 allocate (ib_neighbor_ranks(-ax:ax,-ax:ax,-ax:ax))
2192 ib_neighbor_ranks = mpi_proc_null
2193 ib_neighbor_ranks(0, 0, 0) = proc_rank
2196 ib_neighbor_ranks(-1, 0, 0) = bc_x%beg
2197 ib_neighbor_ranks(+1, 0, 0) = bc_x%end
2198 if (num_dims >= 2)
then
2199 ib_neighbor_ranks(0, -1, 0) = bc_y%beg
2200 ib_neighbor_ranks(0, +1, 0) = bc_y%end
2202 if (num_dims == 3)
then
2203 ib_neighbor_ranks(0, 0, -1) = bc_z%beg
2204 ib_neighbor_ranks(0, 0, +1) = bc_z%end
2207 if (num_dims >= 2)
then
2209 buf4 = [bc_y%beg, bc_y%end, bc_z%beg, bc_z%end]
2212 call mpi_sendrecv(buf4, 4, mpi_integer, merge(bc_x%beg, mpi_proc_null, bc_x%beg >= 0), 310, rbuf4, 4, mpi_integer, &
2213 & merge(bc_x%end, mpi_proc_null, bc_x%end >= 0), 310, mpi_comm_world, mpi_status_ignore, ierr)
2214 if (bc_x%end >= 0)
then
2215 ib_neighbor_ranks(+1, -1, 0) = rbuf4(1)
2216 ib_neighbor_ranks(+1, +1, 0) = rbuf4(2)
2217 ib_neighbor_ranks(+1, 0, -1) = rbuf4(3)
2218 ib_neighbor_ranks(+1, 0, +1) = rbuf4(4)
2221 call mpi_sendrecv(buf4, 4, mpi_integer, merge(bc_x%end, mpi_proc_null, bc_x%end >= 0), 311, rbuf4, 4, mpi_integer, &
2222 & merge(bc_x%beg, mpi_proc_null, bc_x%beg >= 0), 311, mpi_comm_world, mpi_status_ignore, ierr)
2223 if (bc_x%beg >= 0)
then
2224 ib_neighbor_ranks(-1, -1, 0) = rbuf4(1)
2225 ib_neighbor_ranks(-1, +1, 0) = rbuf4(2)
2226 ib_neighbor_ranks(-1, 0, -1) = rbuf4(3)
2227 ib_neighbor_ranks(-1, 0, +1) = rbuf4(4)
2231 if (num_dims == 3)
then
2233 buf2 = [bc_z%beg, bc_z%end]
2235 call mpi_sendrecv(buf2, 2, mpi_integer, merge(bc_y%beg, mpi_proc_null, bc_y%beg >= 0), 312, rbuf2, 2, mpi_integer, &
2236 & merge(bc_y%end, mpi_proc_null, bc_y%end >= 0), 312, mpi_comm_world, mpi_status_ignore, ierr)
2237 if (bc_y%end >= 0)
then
2238 ib_neighbor_ranks(0, +1, -1) = rbuf2(1)
2239 ib_neighbor_ranks(0, +1, +1) = rbuf2(2)
2242 call mpi_sendrecv(buf2, 2, mpi_integer, merge(bc_y%end, mpi_proc_null, bc_y%end >= 0), 313, rbuf2, 2, mpi_integer, &
2243 & merge(bc_y%beg, mpi_proc_null, bc_y%beg >= 0), 313, mpi_comm_world, mpi_status_ignore, ierr)
2244 if (bc_y%beg >= 0)
then
2245 ib_neighbor_ranks(0, -1, -1) = rbuf2(1)
2246 ib_neighbor_ranks(0, -1, +1) = rbuf2(2)
2252# 1418 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2253 call mpi_sendrecv(buf2, 2, mpi_integer, merge(ib_neighbor_ranks(-1, -1, 0), mpi_proc_null, &
2254 & ib_neighbor_ranks(-1, -1, 0) >= 0), 320, rbuf2, 2, mpi_integer, &
2255 & merge(ib_neighbor_ranks(1, 1, 0), mpi_proc_null, ib_neighbor_ranks(1, 1, &
2256 & 0) >= 0), 320, mpi_comm_world, mpi_status_ignore, ierr)
2257 if (ib_neighbor_ranks(1, 1, 0) >= 0)
then
2258 ib_neighbor_ranks(1, 1, -1) = rbuf2(1)
2259 ib_neighbor_ranks(1, 1, +1) = rbuf2(2)
2261# 1418 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2262 call mpi_sendrecv(buf2, 2, mpi_integer, merge(ib_neighbor_ranks(-1, 1, 0), mpi_proc_null, &
2263 & ib_neighbor_ranks(-1, 1, 0) >= 0), 321, rbuf2, 2, mpi_integer, &
2264 & merge(ib_neighbor_ranks(1, -1, 0), mpi_proc_null, ib_neighbor_ranks(1, -1, &
2265 & 0) >= 0), 321, mpi_comm_world, mpi_status_ignore, ierr)
2266 if (ib_neighbor_ranks(1, -1, 0) >= 0)
then
2267 ib_neighbor_ranks(1, -1, -1) = rbuf2(1)
2268 ib_neighbor_ranks(1, -1, +1) = rbuf2(2)
2270# 1418 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2271 call mpi_sendrecv(buf2, 2, mpi_integer, merge(ib_neighbor_ranks(1, -1, 0), mpi_proc_null, &
2272 & ib_neighbor_ranks(1, -1, 0) >= 0), 322, rbuf2, 2, mpi_integer, &
2273 & merge(ib_neighbor_ranks(-1, 1, 0), mpi_proc_null, ib_neighbor_ranks(-1, 1, &
2274 & 0) >= 0), 322, mpi_comm_world, mpi_status_ignore, ierr)
2275 if (ib_neighbor_ranks(-1, 1, 0) >= 0)
then
2276 ib_neighbor_ranks(-1, 1, -1) = rbuf2(1)
2277 ib_neighbor_ranks(-1, 1, +1) = rbuf2(2)
2279# 1418 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2280 call mpi_sendrecv(buf2, 2, mpi_integer, merge(ib_neighbor_ranks(1, 1, 0), mpi_proc_null, &
2281 & ib_neighbor_ranks(1, 1, 0) >= 0), 323, rbuf2, 2, mpi_integer, &
2282 & merge(ib_neighbor_ranks(-1, -1, 0), mpi_proc_null, ib_neighbor_ranks(-1, -1, &
2283 & 0) >= 0), 323, mpi_comm_world, mpi_status_ignore, ierr)
2284 if (ib_neighbor_ranks(-1, -1, 0) >= 0)
then
2285 ib_neighbor_ranks(-1, -1, -1) = rbuf2(1)
2286 ib_neighbor_ranks(-1, -1, +1) = rbuf2(2)
2288# 1427 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2295 allocate (send_table(-ax:ax,-ax:ax,-ax:ax))
2296 allocate (recv_tables(-ax:ax,-ax:ax,-ax:ax,1:26))
2299 send_table = ib_neighbor_ranks
2306 if (sx == 0 .and. sy == 0 .and. sz == 0) cycle
2307 nbr_idx = nbr_idx + 1
2308 if (ib_neighbor_ranks(sx, sy, sz) < 0) cycle
2310 call mpi_irecv(recv_tables(:,:,:,nbr_idx), (2*ax + 1)**3, mpi_integer, ib_neighbor_ranks(sx, sy, sz), &
2311 & 400, mpi_comm_world, requests(nreqs), ierr)
2319 if (sx == 0 .and. sy == 0 .and. sz == 0) cycle
2320 if (ib_neighbor_ranks(sx, sy, sz) < 0) cycle
2322 call mpi_isend(send_table, (2*ax + 1)**3, mpi_integer, ib_neighbor_ranks(sx, sy, sz), 400, &
2323 & mpi_comm_world, requests(nreqs), ierr)
2328 call mpi_waitall(nreqs, requests, mpi_statuses_ignore, ierr)
2334 if (sx == 0 .and. sy == 0 .and. sz == 0) cycle
2335 nbr_idx = nbr_idx + 1
2336 if (ib_neighbor_ranks(sx, sy, sz) < 0) cycle
2340 if (recv_tables(dx, dy, dz, nbr_idx) == mpi_proc_null) cycle
2341 if (dx + sx < -ax .or. dx + sx > ax) cycle
2342 if (dy + sy < -ax .or. dy + sy > ax) cycle
2343 if (dz + sz < -ax .or. dz + sz > ax) cycle
2344 if (ib_neighbor_ranks(dx + sx, dy + sy, dz + sz) /= mpi_proc_null) cycle
2345 ib_neighbor_ranks(dx + sx, dy + sy, dz + sz) = recv_tables(dx, dy, dz, nbr_idx)
2354 deallocate (send_table, recv_tables)
2362 real(wp) :: beg_val, end_val, recv_val, bound, max_ib_bound, local_rank_width, min_rank_width
2363 integer :: k, send_neighbor, recv_neighbor, ierr, temporary_radius
2367 neighbor_domain_x%beg = -huge(0._wp)
2368 neighbor_domain_x%end = huge(0._wp)
2369 neighbor_domain_y%beg = -huge(0._wp)
2370 neighbor_domain_y%end = huge(0._wp)
2371 neighbor_domain_z%beg = -huge(0._wp)
2372 neighbor_domain_z%end = huge(0._wp)
2376 if (ib_neighborhood_radius < 1)
then
2377 ib_neighborhood_radius = 0
2380 max_ib_bound = -1._wp
2382 call s_get_ib_bound(patch_ib(k), bound)
2383 max_ib_bound = max(max_ib_bound, bound)
2385 do k = 1, num_particle_clouds
2386 max_ib_bound = max(max_ib_bound, particle_cloud(k)%radius)
2390 local_rank_width = -1._wp
2391# 1530 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2392 if (num_dims >= 1) local_rank_width = max(local_rank_width, abs(x_cb(m) - x_cb(-1)))
2393# 1530 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2394 if (num_dims >= 2) local_rank_width = max(local_rank_width, abs(y_cb(n) - y_cb(-1)))
2395# 1530 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2396 if (num_dims >= 3) local_rank_width = max(local_rank_width, abs(z_cb(p) - z_cb(-1)))
2397# 1532 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2398 call s_mpi_allreduce_min(local_rank_width, min_rank_width)
2401 ib_neighborhood_radius = max(1, ceiling(1.1_wp*max_ib_bound/(min_rank_width)))
2402 if (proc_rank == 0) print *,
"Automatic choice of ib_neighborhood_radius selected: ", ib_neighborhood_radius
2407# 1542 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2408 if (num_dims >= 1)
then
2411 do k = 1, ib_neighborhood_radius
2412 send_neighbor = merge(bc_x%end, mpi_proc_null, bc_x%end >= 0)
2413 recv_neighbor = merge(bc_x%beg, mpi_proc_null, bc_x%beg >= 0)
2414 recv_val = -huge(0._wp)
2415 call mpi_sendrecv(beg_val, 1, mpi_p, send_neighbor, 100, recv_val, 1, mpi_p, recv_neighbor, 100, &
2416 & mpi_comm_world, mpi_status_ignore, ierr)
2419 send_neighbor = merge(bc_x%beg, mpi_proc_null, bc_x%beg >= 0)
2420 recv_neighbor = merge(bc_x%end, mpi_proc_null, bc_x%end >= 0)
2421 recv_val = huge(0._wp)
2422 call mpi_sendrecv(end_val, 1, mpi_p, send_neighbor, 101, recv_val, 1, mpi_p, recv_neighbor, &
2423 & 101, mpi_comm_world, mpi_status_ignore, ierr)
2427 if (f_approx_equal(beg_val, x_cb(m)) .or. f_approx_equal(end_val, x_cb(-1)))
then
2428 beg_val = -huge(0._wp)
2429 end_val = huge(0._wp)
2433 neighbor_domain_x%beg = beg_val
2434 neighbor_domain_x%end = end_val
2436# 1542 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2437 if (num_dims >= 2)
then
2440 do k = 1, ib_neighborhood_radius
2441 send_neighbor = merge(bc_y%end, mpi_proc_null, bc_y%end >= 0)
2442 recv_neighbor = merge(bc_y%beg, mpi_proc_null, bc_y%beg >= 0)
2443 recv_val = -huge(0._wp)
2444 call mpi_sendrecv(beg_val, 1, mpi_p, send_neighbor, 102, recv_val, 1, mpi_p, recv_neighbor, 102, &
2445 & mpi_comm_world, mpi_status_ignore, ierr)
2448 send_neighbor = merge(bc_y%beg, mpi_proc_null, bc_y%beg >= 0)
2449 recv_neighbor = merge(bc_y%end, mpi_proc_null, bc_y%end >= 0)
2450 recv_val = huge(0._wp)
2451 call mpi_sendrecv(end_val, 1, mpi_p, send_neighbor, 103, recv_val, 1, mpi_p, recv_neighbor, &
2452 & 103, mpi_comm_world, mpi_status_ignore, ierr)
2456 if (f_approx_equal(beg_val, y_cb(n)) .or. f_approx_equal(end_val, y_cb(-1)))
then
2457 beg_val = -huge(0._wp)
2458 end_val = huge(0._wp)
2462 neighbor_domain_y%beg = beg_val
2463 neighbor_domain_y%end = end_val
2465# 1542 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
2466 if (num_dims >= 3)
then
2469 do k = 1, ib_neighborhood_radius
2470 send_neighbor = merge(bc_z%end, mpi_proc_null, bc_z%end >= 0)
2471 recv_neighbor = merge(bc_z%beg, mpi_proc_null, bc_z%beg >= 0)
2472 recv_val = -huge(0._wp)
2473 call mpi_sendrecv(beg_val, 1, mpi_p, send_neighbor, 104, recv_val, 1, mpi_p, recv_neighbor, 104, &
2474 & mpi_comm_world, mpi_status_ignore, ierr)
2477 send_neighbor = merge(bc_z%beg, mpi_proc_null, bc_z%beg >= 0)
2478 recv_neighbor = merge(bc_z%end, mpi_proc_null, bc_z%end >= 0)
2479 recv_val = huge(0._wp)
2480 call mpi_sendrecv(end_val, 1, mpi_p, send_neighbor, 105, recv_val, 1, mpi_p, recv_neighbor, &
2481 & 105, mpi_comm_world, mpi_status_ignore, ierr)
2485 if (f_approx_equal(beg_val, z_cb(p)) .or. f_approx_equal(end_val, z_cb(-1)))
then
2486 beg_val = -huge(0._wp)
2487 end_val = huge(0._wp)
2491 neighbor_domain_z%beg = beg_val
2492 neighbor_domain_z%end = end_val
2494# 1571 "/home/runner/work/MFC/MFC/src/simulation/m_start_up.fpp"
type(scalar_field), dimension(sys_size), intent(inout) q_cons_vf
One-way acoustic source injection, Maeda and Colonius JCP (2017).
impure subroutine, public s_initialize_acoustic_src
Initialize the acoustic source module.
Computes gravitational and body force source terms for the momentum equations.
Noncharacteristic and processor boundary condition application for ghost cells and buffer regions.
subroutine, public s_populate_grid_variables_buffers(x_cb_in, x_cc_in, dx_in, x_offset, y_offset, z_offset, y_cb_in, y_cc_in, dy_in, z_cb_in, z_cc_in, dz_in, global_bounds)
Populate the buffers of the grid variables, which are constituted of the cell-boundary locations and ...
impure subroutine, public s_populate_variables_buffers(bc_type, q_prim_vf, pb_in, mv_in, q_t_sf)
Populate the buffers of the primitive variables based on the selected boundary conditions.
impure subroutine, public s_initialize_boundary_common_module(use_dirichlet_buffers)
Allocate and set up boundary condition buffer arrays for all coordinate directions.
Boundary condition restart I/O, capillary/IGR buffer population, and grid-variable buffers.
subroutine s_assign_default_bc_type(bc_type)
Initialize the per-cell boundary condition type arrays with the global default BC values.
subroutine s_read_serial_boundary_condition_files(step_dirpath, bc_type)
Read boundary condition type and buffer data from serial (unformatted) restart files.
subroutine s_read_parallel_boundary_condition_files(bc_type)
Read boundary condition type and buffer data from per-rank parallel files using MPI I/O.
Computes ensemble-averaged (Euler–Euler) bubble source terms for radius, velocity,...
impure subroutine s_initialize_bubbles_ee_module
Initialize the Euler-Euler bubble module.
Tracks Lagrangian bubbles and couples their dynamics to the Eulerian flow via volume averaging.
impure subroutine s_write_lag_bubble_stats()
Write the maximum and minimum radius of each bubble.
impure subroutine s_write_restart_lag_bubbles(t_step)
Write restart files for the Lagrangian bubble solver.
type(scalar_field), dimension(:), allocatable q_beta
Projection of the lagrangian particles in the Eulerian framework.
real(wp), dimension(:,:), allocatable intfc_rad
Bubble radius.
Characteristic boundary conditions (CBC) for slip walls, non-reflecting subsonic inflow/outflow,...
Shared input validation checks for grid dimensions and AMD GPU compiler limits.
impure subroutine, public s_check_inputs_common(check_total_cells, n_global)
Checks compatibility of parameters in the input file. Used by all three stages.
Validates simulation input parameters for consistency and supported configurations.
impure subroutine, public s_check_inputs
Checks compatibility of parameters in the input file. Used by the simulation stage.
Multi-species chemistry interface for thermodynamic properties, reaction rates, and transport coeffic...
Ghost-node immersed boundary method: locates ghost/image points, computes interpolation coefficients,...
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.
Compile-time constant parameters: default values, tolerances, and physical constants.
real(wp), parameter dflt_t_guess
Default guess for temperature (when a previous value is not available).
integer, parameter time_stepper_rk2
real(wp), parameter sgm_eps
Segmentation tolerance.
integer, parameter recon_type_muscl
integer, parameter time_stepper_rk1
integer, parameter time_stepper_rk3
integer, parameter nnode
Number of QBMM nodes.
integer, parameter recon_type_weno
integer, parameter model_eqns_6eq
integer, parameter bc_periodic
Writes solution data, run-time stability diagnostics (ICFL, VCFL, CCFL, Rc), and probe/center-of-mass...
impure subroutine, public s_initialize_data_output_module
Initialize the data output module.
impure subroutine, public s_write_data_files(q_cons_vf, q_t_sf, q_prim_vf, t_step, bc_type, beta)
Write data files. Dispatch subroutine that replaces procedure pointer.
impure subroutine, public s_write_ib_state_file(time_step)
Writes IB state records to restart_data/ib_state.dat. Must be called only on rank 0.
Shared derived types for field data, patch geometry, bubble dynamics, and MPI I/O structures.
Derives diagnostic flow quantities (vorticity, speed of sound, numerical Schlieren,...
impure subroutine, public s_initialize_derived_variables_module
Computation of parameters, allocation procedures, and/or any other tasks needed to properly setup the...
Global parameters for the computational domain, fluid properties, and simulation algorithm configurat...
real(wp) mytime
Current simulation time.
real(wp), dimension(num_synth_shells_max) synth_k_shell
real(wp), dimension(num_synth_shells_max) synth_amp_shell
real(wp), dimension(:), allocatable, target z_cb
type(int_bounds_info) bc_z
logical, dimension(3) periodic_bc
integer proc_rank
Rank of the local processor.
type(mpi_io_ib_var), public mpi_io_ib_data
type(bounds_info), dimension(3) glb_bounds
type(int_bounds_info), dimension(1:3) idwbuff
integer buff_size
Number of ghost cells for boundary condition storage.
type(int_bounds_info) bc_y
impure subroutine s_initialize_global_parameters_module
Initialize the global parameters module.
real(wp), dimension(:), allocatable, target y_cc
type(pres_field), dimension(:), allocatable pb_ts
type(pres_field), dimension(:), allocatable mv_ts
type(int_bounds_info) bc_x
real(wp), dimension(:), allocatable, target z_cc
integer num_procs
Number of processors.
real(wp), dimension(:), allocatable, target x_cc
integer, dimension(num_synth_shells_max) synth_n_waves_per_shell
real(wp), dimension(num_turb_sources_max, 3) turb_pos
real(wp), dimension(:), allocatable, target y_cb
type(cell_num_bounds) cells_bounds
type(mpi_io_var), public mpi_io_data
real(wp), dimension(:), allocatable, target dy
real(wp), dimension(num_turb_sources_max, 3) synth_l
real(wp) finaltime
Final simulation time.
real(wp), dimension(:), allocatable, target dz
real(wp), dimension(:), allocatable, target dx
real(wp), dimension(:), allocatable, target x_cb
Basic floating-point utilities: approximate equality, default detection, and coordinate bounds.
elemental subroutine, public s_update_cell_bounds(bounds, m, n, p)
Update 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...
subroutine, public s_upsample_data(q_cons_vf, q_cons_temp)
Upsample conservative variable fields from a coarsened grid back to the original resolution using int...
impure subroutine, public s_initialize_bubbles_model()
Initialize bubble model arrays for Euler or Lagrangian bubbles with polytropic or non-polytropic gas.
elemental subroutine, public s_int_to_str(i, res)
Convert an integer to its trimmed string representation.
Computes hypoelastic stress-rate source terms and damage-state evolution.
Allocate memory and read initial condition data for IC extrusion.
subroutine, public s_initialize_ib_airfoils()
Initialize the NACA surface grids for all airfoil IB patches. Must be called after the grid is establ...
Ghost-node immersed boundary method: locates ghost/image points, computes interpolation coefficients,...
type(integer_field), public ib_markers
impure subroutine, public s_initialize_ibm_module()
Allocates memory for the variables in the IBM module.
Iterative ghost rasterization (IGR) for sharp immersed boundary treatment.
Binary STL file reader and processor for immersed boundary geometry.
subroutine, public s_instantiate_stl_models()
Load, transform, and register STL/OBJ immersed-boundary models onto the simulation grid.
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_mpi_barrier
Halts all processes until all have reached barrier.
subroutine s_apply_grid_from_global_dim(x_cb_glb, m_dim_glb, m_dim, sidx, bc_beg, bc_end, cb_lo, cb_hi, cw_lo, cw_hi, x_cb_loc, x_cc_loc, dx_loc)
Populate the local cell-boundary, cell-center, and cell-width arrays in one direction directly from t...
impure subroutine s_initialize_mpi_data(q_cons_vf, ib_markers, ib_mpi_data, beta, qbmm_pb, qbmm_mv)
Set up MPI I/O data views and variable pointers for parallel file output.
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.
subroutine s_initialize_mpi_data_ds(m_ds, n_ds, p_ds, q_cons_vf)
Set up MPI I/O data views for downsampled (coarsened) parallel file output.
impure subroutine s_initialize_mpi_common_module(exchange_all_chemistry_temperatures_in, use_rdma_transport_in)
Initialize the module.
MPI halo exchange, domain decomposition, and buffer packing/unpacking for the simulation solver.
subroutine s_initialize_mpi_proxy_module()
Initialize the MPI proxy module.
MUSCL reconstruction with interface sharpening for contact-preserving advection.
NVIDIA NVTX profiling API bindings for GPU performance instrumentation.
subroutine nvtxstartrange(name, id)
Push a named NVTX range for GPU profiling, optionally with a color based on the given identifier.
subroutine nvtxendrange
Pop the current NVTX range to end the GPU profiling region.
Generates particle beds by converting particle_cloud patch specifications into individual immersed bo...
impure subroutine, public s_generate_particle_clouds(particle_cloud_ibs, num_particle_cloud_ibs)
Generate all particle beds and fill particle_cloud_ibs. Called on all ranks before s_reduce_ib_patch_...
Phase transition relaxation solvers for liquid-vapor flows with cavitation and boiling.
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 (no module-level state to set up; the pT/pTg relaxation solvers ar...
Quadrature-based moment methods (QBMM) for polydisperse bubble moment inversion and transport.
impure subroutine, public s_initialize_qbmm_module
Initialize the QBMM module.
Assemble the right-hand side of the governing equations using finite-volume flux differencing,...
impure subroutine, public s_initialize_rhs_module
Initialize the RHS module.
Approximate and exact Riemann solvers (HLL, HLLC, HLLD, exact) for the multicomponent Navier–Stokes e...
Simulation helper routines for enthalpy computation, CFL calculation, and stability checks.
Reads input files, loads initial conditions and grid data, and orchestrates solver initialization and...
impure subroutine s_read_ib_restart_data(t_step)
Reads IB kinematic state from restart_data/ib_state.dat on restart. Rank 0 reads the last num_ibs rec...
impure subroutine, public s_read_serial_data_files(q_cons_vf)
Read serial initial condition and grid data files and compute cell-width distributions.
impure subroutine, public s_initialize_modules
Initialize all simulation sub-modules in the required dependency order.
impure subroutine, public s_read_data_files(q_cons_vf)
Read data files. Dispatch subroutine that replaces procedure pointer.
impure subroutine, public s_read_parallel_data_files(q_cons_vf)
Read parallel initial condition and grid data files via MPI I/O.
subroutine, public s_initialize_internal_energy_equations(v_vf)
Initialize internal-energy equations from phase mass, mixture momentum, and total energy.
impure subroutine, public s_save_performance_metrics(time_avg, time_final, io_time_avg, io_time_final, proc_time, io_proc_time, file_exists)
Collect per-process wall-clock times and write aggregate performance metrics to file.
subroutine s_compute_ib_neighbor_ranks()
Build ib_neighbor_ranks(-1:1,-1:1,-1:1): MPI ranks of all neighbor domains. Uses two rounds of MPI_SE...
impure subroutine, public s_save_data(t_step, start, finish, io_time_avg, nt)
Save conservative variable data to disk at the current time step.
subroutine s_get_neighbor_bounds()
type(scalar_field), dimension(:), allocatable q_cons_temp
subroutine, public s_initialize_gpu_vars
Transfer initial conservative variable and model parameter data to the GPU device.
subroutine s_reduce_ib_patch_array(particle_cloud_ibs, num_particle_cloud_ibs)
Merges patch_ib (namelist patches, fixed at num_ib_patches_max_namelist) with particle_cloud_ibs (alr...
impure subroutine, public s_initialize_mpi_domain
Set up the MPI execution environment, bind GPUs, and decompose the computational domain.
impure subroutine, public s_finalize_modules
Finalize and deallocate all simulation sub-modules in reverse initialization order.
impure subroutine, public s_read_input_file
Verify the input file exists and read it.
impure subroutine, public s_check_input_file
Validate that all user-provided inputs form a consistent simulation configuration.
impure subroutine, public s_perform_time_step(t_step, time_avg)
Advance the simulation by one time step, handling CFL-based dt and time-stepper dispatch.
Computes capillary source fluxes and color-function gradients for the diffuse-interface surface tensi...
impure subroutine, public s_initialize_surface_tension_module
Allocate and initialize surface tension module arrays.
THINC and MTHINC interface compression for volume fraction sharpening. THINC (int_comp=1): 1D directi...
real(wp), dimension(:,:,:), allocatable position
Total-variation-diminishing (TVD) Runge–Kutta time integrators (1st-, 2nd-, and 3rd-order SSP).
type(scalar_field) q_t_sf
Cell-average temperature variables at the current time-stage.
type(integer_field), dimension(:,:), allocatable bc_type
Boundary condition identifiers.
impure subroutine s_initialize_time_steppers_module
Initialize the time steppers module.
type(vector_field), dimension(:), allocatable q_cons_ts
Cell-average conservative variables at each time-stage (TS).
type(scalar_field), dimension(:), allocatable q_prim_vf
Cell-average primitive variables at the current time-stage.
impure subroutine s_compute_dt()
Compute the global time step size from CFL stability constraints across all cells.
impure subroutine s_tvd_rk(t_step, time_avg, nstage)
Advance the solution one full step using a TVD Runge-Kutta time integrator.
integer stor
storage index
Conservative-to-primitive variable conversion, mixture property evaluation, and pressure computation.
subroutine, public s_compute_pressure(energy, alf, dyn_p, pi_inf, gamma, rho, qv, rhoyks, pres, t, stress, mom, g, pres_mag)
Compute the pressure from the appropriate equation of state.
impure subroutine, public s_initialize_variables_conversion_module(store_mixture_fields, enforce_density_floor, preserve_qbmm_number, lagrange_beta_index)
Initialize the variables conversion module.
subroutine, public s_convert_to_mixture_variables(q_vf, i, j, k, rho, gamma, pi_inf, qv, re_k, g_k, g)
Dispatch to the s_convert_mixture_to_mixture_variables and s_convert_species_to_mixture_variables sub...
Computes viscous stress tensors and diffusive flux contributions for the Navier–Stokes equations.
impure subroutine, public s_initialize_viscous_module
Initialize the viscous module.
WENO/WENO-Z/TENO reconstruction with optional monotonicity-preserving bounds and mapped weights.
Integer bounds for variables.
Derived type annexing a scalar field (SF).