@@ -190,272 +190,68 @@ contains
190190
191191 integer :: i, j !< Generic loop iterator
192192
193- ! Logistics
194- call MPI_BCAST(case_dir, len(case_dir), MPI_CHARACTER, &
195- 0, MPI_COMM_WORLD, ierr)
196- call MPI_BCAST(run_time_info, 1, MPI_LOGICAL, &
197- 0, MPI_COMM_WORLD, ierr)
198- call MPI_BCAST(t_step_old, 1, MPI_INTEGER, &
199- 0, MPI_COMM_WORLD, ierr)
200-
201- ! Computational domain parameters
202- call MPI_BCAST(m, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
203- call MPI_BCAST(n, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
204- call MPI_BCAST(p, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
205- call MPI_BCAST(m_glb, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
206- call MPI_BCAST(n_glb, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
207- call MPI_BCAST(p_glb, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
208-
209- call MPI_BCAST(cyl_coord, 1, MPI_LOGICAL, &
210- 0, MPI_COMM_WORLD, ierr)
211-
212- call MPI_BCAST(dt, 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
213-
214- call MPI_BCAST(t_step_start, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
215- call MPI_BCAST(t_step_stop, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
216- call MPI_BCAST(t_step_save, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
217-
218- ! Simulation algorithm parameters
219- call MPI_BCAST(model_eqns, 1, MPI_INTEGER, &
220- 0, MPI_COMM_WORLD, ierr)
221- call MPI_BCAST(num_fluids, 1, MPI_INTEGER, &
222- 0, MPI_COMM_WORLD, ierr)
223- call MPI_BCAST(adv_alphan, 1, MPI_LOGICAL, &
224- 0, MPI_COMM_WORLD, ierr)
225- call MPI_BCAST(mpp_lim, 1, MPI_LOGICAL, &
226- 0, MPI_COMM_WORLD, ierr)
227- call MPI_BCAST(time_stepper, 1, MPI_INTEGER, &
228- 0, MPI_COMM_WORLD, ierr)
229- call MPI_BCAST(weno_vars, 1, MPI_INTEGER, &
230- 0, MPI_COMM_WORLD, ierr)
193+ call MPI_BCAST(case_dir, len(case_dir), MPI_CHARACTER, 0, MPI_COMM_WORLD, ierr)
194+
195+ #:for VAR in [' t_step_old' , ' m' , ' n' , ' p' , ' m_glb' , ' n_glb' , ' p_glb' , &
196+ & ' t_step_start' ,' t_step_stop' ,' t_step_save' ,' model_eqns' , &
197+ & ' num_fluids' ,' time_stepper' , ' weno_vars' , ' riemann_solver' , &
198+ & ' wave_speeds' , ' avg_state' , ' precision' , ' bc_x%beg' , ' bc_x%end' , &
199+ & ' bc_y%beg' , ' bc_y%end' , ' bc_z%beg' , ' bc_z%end' , ' bc_x_glb%beg' , &
200+ & ' bc_x_glb%end' , ' bc_y_glb%beg' , ' bc_y_glb%end' , ' bc_z_glb%beg' , &
201+ & ' bc_z_glb%end' , ' fd_order' , ' num_probes' , ' num_integrals' , &
202+ & ' bubble_model' , ' thermal' , ' R0_type' , ' num_mono' ]
203+ call MPI_BCAST(${VAR}$, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
204+ #:endfor
205+ call MPI_BCAST(moment_order(1), 5, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
206+
207+ #:for VAR in [ ' run_time_info' ,' cyl_coord' , ' adv_alphan' , ' mpp_lim' , &
208+ & ' mapped_weno' , ' mp_weno' , ' cu_mpi' , ' weno_flat' , ' riemann_flat' , &
209+ & ' weno_Re_flux' , ' alt_soundspeed' , ' null_weights' , ' mixture_err' , &
210+ & ' parallel_io' , ' hypoelasticity' , ' bubbles' , ' polytropic' , &
211+ & ' polydisperse' , ' qbmm' , ' monopole' , ' probe_wrt' , ' integral_wrt' ]
212+ call MPI_BCAST(${VAR}$, 1, MPI_LOGICAL, 0, MPI_COMM_WORLD, ierr)
213+ #:endfor
214+ call MPI_BCAST(com_wrt(1), num_fluids_max, MPI_LOGICAL, 0, MPI_COMM_WORLD, ierr)
215+ call MPI_BCAST(cb_wrt(1), num_fluids_max, MPI_LOGICAL, 0, MPI_COMM_WORLD, ierr)
216+
217+ #:for VAR in [ ' dt' ,' weno_eps' ,' pref' ,' rhoref' ,' R0ref' ,' Web' ,' Ca' , &
218+ & ' Re_inv' ,' poly_sigma' ]
219+ call MPI_BCAST(${VAR}$, 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
220+ #:endfor
221+ call MPI_BCAST(threshold_mf(1), 5, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
222+
231223 #:if not MFC_CASE_OPTIMIZATION
232- call MPI_BCAST(weno_order, 1, MPI_INTEGER, &
233- 0, MPI_COMM_WORLD, ierr)
224+ call MPI_BCAST(weno_order, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
225+ call MPI_BCAST(nb, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
234226 #:endif
235- call MPI_BCAST(weno_eps, 1, MPI_DOUBLE_PRECISION, &
236- 0, MPI_COMM_WORLD, ierr)
237- call MPI_BCAST(mapped_weno, 1, MPI_LOGICAL, &
238- 0, MPI_COMM_WORLD, ierr)
239- call MPI_BCAST(mp_weno, 1, MPI_LOGICAL, &
240- 0, MPI_COMM_WORLD, ierr)
241- call MPI_BCAST(cu_mpi, 1, MPI_LOGICAL, &
242- 0, MPI_COMM_WORLD, ierr)
243- call MPI_BCAST(weno_flat, 1, MPI_LOGICAL, &
244- 0, MPI_COMM_WORLD, ierr)
245- call MPI_BCAST(riemann_flat, 1, MPI_LOGICAL, &
246- 0, MPI_COMM_WORLD, ierr)
247- call MPI_BCAST(weno_Re_flux, 1, MPI_LOGICAL, &
248- 0, MPI_COMM_WORLD, ierr)
249- call MPI_BCAST(riemann_solver, 1, MPI_INTEGER, &
250- 0, MPI_COMM_WORLD, ierr)
251- call MPI_BCAST(wave_speeds, 1, MPI_INTEGER, &
252- 0, MPI_COMM_WORLD, ierr)
253- call MPI_BCAST(avg_state, 1, MPI_INTEGER, &
254- 0, MPI_COMM_WORLD, ierr)
255- call MPI_BCAST(alt_soundspeed, 1, MPI_LOGICAL, &
256- 0, MPI_COMM_WORLD, ierr)
257- call MPI_BCAST(null_weights, 1, MPI_LOGICAL, &
258- 0, MPI_COMM_WORLD, ierr)
259- call MPI_BCAST(mixture_err, 1, MPI_LOGICAL, &
260- 0, MPI_COMM_WORLD, ierr)
261- call MPI_BCAST(parallel_io, 1, MPI_LOGICAL, &
262- 0, MPI_COMM_WORLD, ierr)
263- call MPI_BCAST(precision, 1, MPI_INTEGER, &
264- 0, MPI_COMM_WORLD, ierr)
265- call MPI_BCAST(hypoelasticity, 1, MPI_LOGICAL, &
266- 0, MPI_COMM_WORLD, ierr)
267-
268- call MPI_BCAST(bc_x%beg, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
269- call MPI_BCAST(bc_x%end, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
270- call MPI_BCAST(bc_y%beg, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
271- call MPI_BCAST(bc_y%end, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
272- call MPI_BCAST(bc_z%beg, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
273- call MPI_BCAST(bc_z%end, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
274-
275- call MPI_BCAST(bc_x_glb%beg, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
276- call MPI_BCAST(bc_x_glb%end, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
277- call MPI_BCAST(bc_y_glb%beg, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
278- call MPI_BCAST(bc_y_glb%end, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
279- call MPI_BCAST(bc_z_glb%beg, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
280- call MPI_BCAST(bc_z_glb%end, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
281-
282- ! Fluids physical parameters
227+
283228 do i = 1, num_fluids_max
284- call MPI_BCAST(fluid_pp(i)%gamma, 1, &
285- MPI_DOUBLE_PRECISION, 0, &
286- MPI_COMM_WORLD, ierr)
287- call MPI_BCAST(fluid_pp(i)%pi_inf, 1, &
288- MPI_DOUBLE_PRECISION, 0, &
289- MPI_COMM_WORLD, ierr)
290- call MPI_BCAST(fluid_pp(i)%Re(1), 2, &
291- MPI_DOUBLE_PRECISION, 0, &
292- MPI_COMM_WORLD, ierr)
293-
294- call MPI_BCAST(fluid_pp(i)%mul0, 1, &
295- MPI_DOUBLE_PRECISION, 0, &
296- MPI_COMM_WORLD, ierr)
297- call MPI_BCAST(fluid_pp(i)%ss, 1, &
298- MPI_DOUBLE_PRECISION, 0, &
299- MPI_COMM_WORLD, ierr)
300- call MPI_BCAST(fluid_pp(i)%pv, 1, &
301- MPI_DOUBLE_PRECISION, 0, &
302- MPI_COMM_WORLD, ierr)
303- call MPI_BCAST(fluid_pp(i)%gamma_v, 1, &
304- MPI_DOUBLE_PRECISION, 0, &
305- MPI_COMM_WORLD, ierr)
306- call MPI_BCAST(fluid_pp(i)%M_v, 1, &
307- MPI_DOUBLE_PRECISION, 0, &
308- MPI_COMM_WORLD, ierr)
309- call MPI_BCAST(fluid_pp(i)%mu_v, 1, &
310- MPI_DOUBLE_PRECISION, 0, &
311- MPI_COMM_WORLD, ierr)
312- call MPI_BCAST(fluid_pp(i)%k_v, 1, &
313- MPI_DOUBLE_PRECISION, 0, &
314- MPI_COMM_WORLD, ierr)
315- call MPI_BCAST(fluid_pp(i)%G, 1, &
316- MPI_DOUBLE_PRECISION, 0, &
317- MPI_COMM_WORLD, ierr)
229+ #:for VAR in [ ' gamma' ,' pi_inf' ,' mul0' ,' ss' ,' pv' ,' gamma_v' ,' M_v' , &
230+ & ' mu_v' ,' k_v' ,' G' ]
231+ call MPI_BCAST(fluid_pp(i)%${VAR}$, 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
232+ #:endfor
233+ call MPI_BCAST(fluid_pp(i)%Re(1), 2, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
318234 end do
319235
320- !Tait EOS
321- call MPI_BCAST(pref, 1, &
322- MPI_DOUBLE_PRECISION, 0, &
323- MPI_COMM_WORLD, ierr)
324- call MPI_BCAST(rhoref, 1, &
325- MPI_DOUBLE_PRECISION, 0, &
326- MPI_COMM_WORLD, ierr)
327-
328- !Bubble modeling
329- call MPI_BCAST(bubbles, 1, &
330- MPI_LOGICAL, 0, &
331- MPI_COMM_WORLD, ierr)
332- call MPI_BCAST(bubble_model, 1, &
333- MPI_INTEGER, 0, &
334- MPI_COMM_WORLD, ierr)
335- call MPI_BCAST(polytropic, 1, &
336- MPI_LOGICAL, 0, &
337- MPI_COMM_WORLD, ierr)
338- call MPI_BCAST(thermal, 1, &
339- MPI_INTEGER, 0, &
340- MPI_COMM_WORLD, ierr)
341- call MPI_BCAST(R0ref, 1, &
342- MPI_DOUBLE_PRECISION, 0, &
343- MPI_COMM_WORLD, ierr)
344- #:if not MFC_CASE_OPTIMIZATION
345- call MPI_BCAST(nb, 1, &
346- MPI_INTEGER, 0, &
347- MPI_COMM_WORLD, ierr)
348- #:endif
349- call MPI_BCAST(R0_type, 1, &
350- MPI_INTEGER, 0, &
351- MPI_COMM_WORLD, ierr)
352- call MPI_BCAST(Web, 1, &
353- MPI_DOUBLE_PRECISION, 0, &
354- MPI_COMM_WORLD, ierr)
355- call MPI_BCAST(Ca, 1, &
356- MPI_DOUBLE_PRECISION, 0, &
357- MPI_COMM_WORLD, ierr)
358- call MPI_BCAST(Re_inv, 1, &
359- MPI_DOUBLE_PRECISION, 0, &
360- MPI_COMM_WORLD, ierr)
361- call MPI_BCAST(polydisperse, 1, &
362- MPI_LOGICAL, 0, &
363- MPI_COMM_WORLD, ierr)
364- call MPI_BCAST(poly_sigma, 1, &
365- MPI_DOUBLE_PRECISION, 0, &
366- MPI_COMM_WORLD, ierr)
367-
368- call MPI_BCAST(qbmm, 1, &
369- MPI_LOGICAL, 0, &
370- MPI_COMM_WORLD, ierr)
371-
372- !Acoustic monopole
373- call MPI_BCAST(monopole, 1, &
374- MPI_LOGICAL, 0, &
375- MPI_COMM_WORLD, ierr)
376- call MPI_BCAST(num_mono, 1, &
377- MPI_INTEGER, 0, &
378- MPI_COMM_WORLD, ierr)
379-
380236 do j = 1, num_probes_max
381- do i = 1, 3
382- call MPI_BCAST(mono(j)%loc(i), 1, &
383- MPI_DOUBLE_PRECISION, 0, &
384- MPI_COMM_WORLD, ierr)
237+ do i = 1,3
238+ call MPI_BCAST(mono(j)%loc(i), 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
385239 end do
386- call MPI_BCAST(mono(j)%mag, 1, &
387- MPI_DOUBLE_PRECISION, 0, &
388- MPI_COMM_WORLD, ierr)
389- call MPI_BCAST(mono(j)%length, 1, &
390- MPI_DOUBLE_PRECISION, 0, &
391- MPI_COMM_WORLD, ierr)
392- call MPI_BCAST(mono(j)%delay, 1, &
393- MPI_DOUBLE_PRECISION, 0, &
394- MPI_COMM_WORLD, ierr)
395- call MPI_BCAST(mono(j)%dir, 1, &
396- MPI_DOUBLE_PRECISION, 0, &
397- MPI_COMM_WORLD, ierr)
398- call MPI_BCAST(mono(j)%npulse, 1, &
399- MPI_DOUBLE_PRECISION, 0, &
400- MPI_COMM_WORLD, ierr)
401- call MPI_BCAST(mono(j)%pulse, 1, &
402- MPI_INTEGER, 0, &
403- MPI_COMM_WORLD, ierr)
404- call MPI_BCAST(mono(j)%support, 1, &
405- MPI_INTEGER, 0, &
406- MPI_COMM_WORLD, ierr)
407- call MPI_BCAST(mono(j)%foc_length, 1, &
408- MPI_DOUBLE_PRECISION, 0, &
409- MPI_COMM_WORLD, ierr)
410- call MPI_BCAST(mono(j)%aperture, 1, &
411- MPI_DOUBLE_PRECISION, 0, &
412- MPI_COMM_WORLD, ierr)
413- end do
414240
415- call MPI_BCAST(com_wrt(1), num_fluids_max, MPI_LOGICAL, &
416- 0, MPI_COMM_WORLD, ierr)
417- call MPI_BCAST(cb_wrt(1), num_fluids_max, MPI_LOGICAL, &
418- 0, MPI_COMM_WORLD, ierr)
419- call MPI_BCAST(fd_order, 1, MPI_INTEGER, &
420- 0, MPI_COMM_WORLD, ierr)
421-
422- call MPI_BCAST(num_probes, 1, MPI_INTEGER, &
423- 0, MPI_COMM_WORLD, ierr)
424- call MPI_BCAST(probe_wrt, 1, MPI_LOGICAL, &
425- 0, MPI_COMM_WORLD, ierr)
426- do i = 1, num_probes_max
427- call MPI_BCAST(probe(i)%x, 1, MPI_DOUBLE_PRECISION, &
428- 0, MPI_COMM_WORLD, ierr)
429- call MPI_BCAST(probe(i)%y, 1, MPI_DOUBLE_PRECISION, &
430- 0, MPI_COMM_WORLD, ierr)
431- call MPI_BCAST(probe(i)%z, 1, MPI_DOUBLE_PRECISION, &
432- 0, MPI_COMM_WORLD, ierr)
433- end do
241+ #:for VAR in [ ' mag' , ' length' , ' delay' , ' dir' , ' npulse' , ' pulse' , &
242+ ' support' , ' foc_length' , ' aperture' ]
243+ call MPI_BCAST(mono(j)%${VAR}$, 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
244+ #:endfor
434245
435- call MPI_BCAST(integral_wrt, 1, MPI_LOGICAL, &
436- 0, MPI_COMM_WORLD, ierr)
437- call MPI_BCAST(num_integrals, 1, MPI_INTEGER, &
438- 0, MPI_COMM_WORLD, ierr)
439- do i = 1, num_probes_max
440- call MPI_BCAST(integral(i)%xmin, 1, MPI_DOUBLE_PRECISION, &
441- 0, MPI_COMM_WORLD, ierr)
442- call MPI_BCAST(integral(i)%xmax, 1, MPI_DOUBLE_PRECISION, &
443- 0, MPI_COMM_WORLD, ierr)
444- call MPI_BCAST(integral(i)%ymin, 1, MPI_DOUBLE_PRECISION, &
445- 0, MPI_COMM_WORLD, ierr)
446- call MPI_BCAST(integral(i)%ymax, 1, MPI_DOUBLE_PRECISION, &
447- 0, MPI_COMM_WORLD, ierr)
448- call MPI_BCAST(integral(i)%zmin, 1, MPI_DOUBLE_PRECISION, &
449- 0, MPI_COMM_WORLD, ierr)
450- call MPI_BCAST(integral(i)%zmax, 1, MPI_DOUBLE_PRECISION, &
451- 0, MPI_COMM_WORLD, ierr)
452- end do
453-
454- call MPI_BCAST(threshold_mf(1), 5, MPI_DOUBLE_PRECISION, &
455- 0, MPI_COMM_WORLD, ierr)
456- call MPI_BCAST(moment_order(1), 5, MPI_INTEGER, &
457- 0, MPI_COMM_WORLD, ierr)
246+ #:for VAR in [ ' x' ,' y' ,' z' ]
247+ call MPI_BCAST(probe(j)%${VAR}$, 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
248+ #:endfor
458249
250+ #:for VAR in [ ' xmin' , ' xmax' , ' ymin' , ' ymax' , ' zmin' , ' zmax' ]
251+ call MPI_BCAST(integral(j)%${VAR}$, 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
252+ #:endfor
253+ end do
254+
459255#endif
460256
461257 end subroutine s_mpi_bcast_user_inputs ! -------------------------------
0 commit comments