Skip to content

Commit 91d110b

Browse files
authored
Update and rename m_mpi_proxy.f90 to m_mpi_proxy.fpp
1 parent d9e5c56 commit 91d110b

File tree

1 file changed

+47
-261
lines changed

1 file changed

+47
-261
lines changed

src/pre_process/m_mpi_proxy.f90 renamed to src/pre_process/m_mpi_proxy.fpp

Lines changed: 47 additions & 261 deletions
Original file line numberDiff line numberDiff line change
@@ -139,274 +139,60 @@ subroutine s_mpi_bcast_user_inputs() ! ---------------------------------
139139
integer :: i
140140
141141
! Logistics
142-
call MPI_BCAST(case_dir, len(case_dir), MPI_CHARACTER, &
143-
0, MPI_COMM_WORLD, ierr)
144-
call MPI_BCAST(old_grid, 1, MPI_LOGICAL, &
145-
0, MPI_COMM_WORLD, ierr)
146-
call MPI_BCAST(old_ic, 1, MPI_LOGICAL, &
147-
0, MPI_COMM_WORLD, ierr)
148-
call MPI_BCAST(t_step_old, 1, MPI_INTEGER, &
149-
0, MPI_COMM_WORLD, ierr)
150-
151-
! Computational domain parameters
152-
call MPI_BCAST(m, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
153-
call MPI_BCAST(n, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
154-
call MPI_BCAST(p, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
155-
call MPI_BCAST(m_glb, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
156-
call MPI_BCAST(n_glb, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
157-
call MPI_BCAST(p_glb, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
158-
159-
call MPI_BCAST(cyl_coord, 1, MPI_LOGICAL, 0, MPI_COMM_WORLD, ierr)
160-
161-
call MPI_BCAST(x_domain%beg, 1, MPI_DOUBLE_PRECISION, &
162-
0, MPI_COMM_WORLD, ierr)
163-
call MPI_BCAST(x_domain%end, 1, MPI_DOUBLE_PRECISION, &
164-
0, MPI_COMM_WORLD, ierr)
165-
call MPI_BCAST(y_domain%beg, 1, MPI_DOUBLE_PRECISION, &
166-
0, MPI_COMM_WORLD, ierr)
167-
call MPI_BCAST(y_domain%end, 1, MPI_DOUBLE_PRECISION, &
168-
0, MPI_COMM_WORLD, ierr)
169-
call MPI_BCAST(z_domain%beg, 1, MPI_DOUBLE_PRECISION, &
170-
0, MPI_COMM_WORLD, ierr)
171-
call MPI_BCAST(z_domain%end, 1, MPI_DOUBLE_PRECISION, &
172-
0, MPI_COMM_WORLD, ierr)
173-
174-
call MPI_BCAST(stretch_x, 1, MPI_LOGICAL, 0, MPI_COMM_WORLD, ierr)
175-
call MPI_BCAST(stretch_y, 1, MPI_LOGICAL, 0, MPI_COMM_WORLD, ierr)
176-
call MPI_BCAST(stretch_z, 1, MPI_LOGICAL, 0, MPI_COMM_WORLD, ierr)
177-
178-
call MPI_BCAST(a_x, 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
179-
call MPI_BCAST(a_y, 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
180-
call MPI_BCAST(a_z, 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
181-
call MPI_BCAST(loops_x, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
182-
call MPI_BCAST(loops_y, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
183-
call MPI_BCAST(loops_z, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
184-
call MPI_BCAST(x_a, 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
185-
call MPI_BCAST(x_b, 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
186-
call MPI_BCAST(y_a, 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
187-
call MPI_BCAST(y_b, 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
188-
call MPI_BCAST(z_a, 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
189-
call MPI_BCAST(z_b, 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
190-
191-
! Simulation algorithm parameters
192-
call MPI_BCAST(model_eqns, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
193-
call MPI_BCAST(num_fluids, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
194-
call MPI_BCAST(adv_alphan, 1, MPI_LOGICAL, 0, MPI_COMM_WORLD, ierr)
195-
call MPI_BCAST(mpp_lim, 1, MPI_LOGICAL, 0, MPI_COMM_WORLD, ierr)
196-
call MPI_BCAST(weno_order, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
197-
198-
call MPI_BCAST(bc_x%beg, 1, MPI_DOUBLE_PRECISION, &
199-
0, MPI_COMM_WORLD, ierr)
200-
call MPI_BCAST(bc_x%end, 1, MPI_DOUBLE_PRECISION, &
201-
0, MPI_COMM_WORLD, ierr)
202-
call MPI_BCAST(bc_y%beg, 1, MPI_DOUBLE_PRECISION, &
203-
0, MPI_COMM_WORLD, ierr)
204-
call MPI_BCAST(bc_y%end, 1, MPI_DOUBLE_PRECISION, &
205-
0, MPI_COMM_WORLD, ierr)
206-
call MPI_BCAST(bc_z%beg, 1, MPI_DOUBLE_PRECISION, &
207-
0, MPI_COMM_WORLD, ierr)
208-
call MPI_BCAST(bc_z%end, 1, MPI_DOUBLE_PRECISION, &
209-
0, MPI_COMM_WORLD, ierr)
210-
call MPI_BCAST(hypoelasticity, 1, MPI_LOGICAL, 0, MPI_COMM_WORLD, ierr)
211-
212-
call MPI_BCAST(parallel_io, 1, MPI_LOGICAL, 0, MPI_COMM_WORLD, ierr)
213-
call MPI_BCAST(precision, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
214-
call MPI_BCAST(perturb_flow, 1, MPI_LOGICAL, 0, MPI_COMM_WORLD, ierr)
215-
call MPI_BCAST(perturb_flow_fluid, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
216-
call MPI_BCAST(perturb_sph, 1, MPI_LOGICAL, 0, MPI_COMM_WORLD, ierr)
217-
call MPI_BCAST(perturb_sph_fluid, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
218-
call MPI_BCAST(fluid_rho(1), num_fluids_max, MPI_LOGICAL, &
219-
0, MPI_COMM_WORLD, &
220-
ierr)
221-
222-
! Initial condition parameters
223-
call MPI_BCAST(num_patches, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
142+
call MPI_BCAST(case_dir, len(case_dir), MPI_CHARACTER, 0, MPI_COMM_WORLD, ierr)
143+
144+
#:for VAR in ['t_step_old', 'm', 'n', 'p', 'm_glb', 'n_glb', 'p_glb', &
145+
& 'loops_x', 'loops_y', 'loops_z', 'model_eqns', 'num_fluids', &
146+
& 'weno_order', 'precision', 'perturb_flow_fluid', &
147+
& 'perturb_sph_fluid', 'num_patches', 'thermal', 'nb', 'dist_type',&
148+
& 'R0_type' ]
149+
call MPI_BCAST(${VAR}$, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
150+
#:endfor
151+
152+
#:for VAR in [ 'old_grid','old_ic','stretch_x','stretch_y','stretch_z',&
153+
& 'cyl_coord','adv_alphan','mpp_lim','hypoelasticity', &
154+
& 'parallel_io', 'perturb_flow','perturb_sph', 'bubbles', &
155+
& 'polytropic', 'polydisperse', 'qbmm' ]
156+
call MPI_BCAST(${VAR}$, 1, MPI_LOGICAL, 0, MPI_COMM_WORLD, ierr)
157+
#:endfor
158+
call MPI_BCAST(fluid_rho(1), num_fluids_max, MPI_LOGICAL, 0, MPI_COMM_WORLD, ierr)
159+
160+
161+
#:for VAR in [ 'x_domain%beg', 'x_domain%end', 'y_domain%beg', &
162+
& 'y_domain%end', 'z_domain%beg', 'z_domain%end', 'a_x', 'a_y', &
163+
& 'a_z', 'x_a', 'x_b', 'y_a', 'y_b', 'z_a', 'z_b', 'bc_x%beg', &
164+
& 'bc_x%end', 'bc_y%beg', 'bc_y%end', 'bc_z%beg', 'bc_z%end', &
165+
& 'pref', 'rhoref', 'poly_sigma', 'R0ref', 'Web', 'Ca', 'Re_inv', &
166+
& 'sigR', 'sigV', 'rhoRV' ]
167+
call MPI_BCAST(${VAR}$, 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
168+
#:endfor
224169
225170
do i = 1, num_patches_max
226-
call MPI_BCAST(patch_icpp(i)%geometry, 1, &
227-
MPI_INTEGER, 0, &
228-
MPI_COMM_WORLD, ierr)
229-
call MPI_BCAST(patch_icpp(i)%x_centroid, 1, &
230-
MPI_DOUBLE_PRECISION, 0, &
231-
MPI_COMM_WORLD, ierr)
232-
call MPI_BCAST(patch_icpp(i)%y_centroid, 1, &
233-
MPI_DOUBLE_PRECISION, 0, &
234-
MPI_COMM_WORLD, ierr)
235-
call MPI_BCAST(patch_icpp(i)%z_centroid, 1, &
236-
MPI_DOUBLE_PRECISION, 0, &
237-
MPI_COMM_WORLD, ierr)
238-
call MPI_BCAST(patch_icpp(i)%length_x, 1, &
239-
MPI_DOUBLE_PRECISION, 0, &
240-
MPI_COMM_WORLD, ierr)
241-
call MPI_BCAST(patch_icpp(i)%length_y, 1, &
242-
MPI_DOUBLE_PRECISION, 0, &
243-
MPI_COMM_WORLD, ierr)
244-
call MPI_BCAST(patch_icpp(i)%length_z, 1, &
245-
MPI_DOUBLE_PRECISION, 0, &
246-
MPI_COMM_WORLD, ierr)
247-
call MPI_BCAST(patch_icpp(i)%radius, 1, &
248-
MPI_DOUBLE_PRECISION, 0, &
249-
MPI_COMM_WORLD, ierr)
250-
call MPI_BCAST(patch_icpp(i)%epsilon, 1, &
251-
MPI_DOUBLE_PRECISION, 0, &
252-
MPI_COMM_WORLD, ierr)
253-
call MPI_BCAST(patch_icpp(i)%beta, 1, &
254-
MPI_DOUBLE_PRECISION, 0, &
255-
MPI_COMM_WORLD, ierr)
256-
call MPI_BCAST(patch_icpp(i)%normal(1), 3, &
257-
MPI_DOUBLE_PRECISION, 0, &
258-
MPI_COMM_WORLD, ierr)
259-
call MPI_BCAST(patch_icpp(i)%radii(1), 3, &
260-
MPI_DOUBLE_PRECISION, 0, &
261-
MPI_COMM_WORLD, ierr)
262-
call MPI_BCAST(patch_icpp(i)%smoothen, 1, &
263-
MPI_LOGICAL, 0, &
264-
MPI_COMM_WORLD, ierr)
265-
call MPI_BCAST(patch_icpp(i)%smooth_patch_id, 1, &
266-
MPI_INTEGER, 0, &
267-
MPI_COMM_WORLD, ierr)
268-
call MPI_BCAST(patch_icpp(i)%smooth_coeff, 1, &
269-
MPI_DOUBLE_PRECISION, 0, &
270-
MPI_COMM_WORLD, ierr)
271-
call MPI_BCAST(patch_icpp(i)%rho, 1, &
272-
MPI_DOUBLE_PRECISION, 0, &
273-
MPI_COMM_WORLD, ierr)
274-
call MPI_BCAST(patch_icpp(i)%vel(1), 3, &
275-
MPI_DOUBLE_PRECISION, 0, &
276-
MPI_COMM_WORLD, ierr)
277-
call MPI_BCAST(patch_icpp(i)%pres, 1, &
278-
MPI_DOUBLE_PRECISION, 0, &
279-
MPI_COMM_WORLD, ierr)
280-
call MPI_BCAST(patch_icpp(i)%gamma, 1, &
281-
MPI_DOUBLE_PRECISION, 0, &
282-
MPI_COMM_WORLD, ierr)
283-
call MPI_BCAST(patch_icpp(i)%pi_inf, 1, &
284-
MPI_DOUBLE_PRECISION, 0, &
285-
MPI_COMM_WORLD, ierr)
286-
call MPI_BCAST(patch_icpp(i)%tau_e(1), 6, &
287-
MPI_DOUBLE_PRECISION, 0, &
288-
MPI_COMM_WORLD, ierr)
289-
call MPI_BCAST(patch_icpp(i)%alter_patch(0), &
290-
num_patches_max, MPI_LOGICAL, 0, &
291-
MPI_COMM_WORLD, ierr)
292-
call MPI_BCAST(patch_icpp(i)%alpha_rho(1), &
293-
num_fluids_max, MPI_DOUBLE_PRECISION, 0, &
294-
MPI_COMM_WORLD, ierr)
295-
call MPI_BCAST(patch_icpp(i)%alpha(1), &
296-
num_fluids_max - 1, MPI_DOUBLE_PRECISION, 0, &
297-
MPI_COMM_WORLD, ierr)
298-
299-
! Bubbles
300-
call MPI_BCAST(patch_icpp(i)%r0, 1, &
301-
MPI_DOUBLE_PRECISION, 0, &
302-
MPI_COMM_WORLD, ierr)
303-
call MPI_BCAST(patch_icpp(i)%v0, 1, &
304-
MPI_DOUBLE_PRECISION, 0, &
305-
MPI_COMM_WORLD, ierr)
306-
call MPI_BCAST(patch_icpp(i)%p0, 1, &
307-
MPI_DOUBLE_PRECISION, 0, &
308-
MPI_COMM_WORLD, ierr)
309-
call MPI_BCAST(patch_icpp(i)%m0, 1, &
310-
MPI_DOUBLE_PRECISION, 0, &
311-
MPI_COMM_WORLD, ierr)
312-
171+
call MPI_BCAST(patch_icpp(i)%geometry, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
172+
call MPI_BCAST(patch_icpp(i)%smooth_patch_id, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
173+
174+
call MPI_BCAST(patch_icpp(i)%smoothen, 1, MPI_LOGICAL, 0, MPI_COMM_WORLD, ierr)
175+
call MPI_BCAST(patch_icpp(i)%alter_patch(0), num_patches_max, MPI_LOGICAL, 0, MPI_COMM_WORLD, ierr)
176+
177+
call MPI_BCAST(patch_icpp(i)%alpha_rho(1), num_fluids_max, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
178+
call MPI_BCAST(patch_icpp(i)%alpha(1), num_fluids_max - 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
179+
180+
#:for VAR in [ 'x_centroid', 'y_centroid', 'z_centroid', &
181+
& 'length_x', 'length_y', 'length_z', 'radius', 'epsilon', &
182+
& 'beta', 'normal(1)', 'radii(1)', 'smooth_coeff', 'rho', &
183+
& 'vel(1)', 'pres', 'gamma', 'pi_inf', 'tau_e(1)', 'r0', 'v0', &
184+
& 'p0', 'm0' ]
185+
call MPI_BCAST(patch_icpp(i)%${VAR}$, 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
186+
#:endfor
313187
end do
314188
315189
! Fluids physical parameters
316190
do i = 1, num_fluids_max
317-
call MPI_BCAST(fluid_pp(i)%gamma, 1, &
318-
MPI_DOUBLE_PRECISION, 0, &
319-
MPI_COMM_WORLD, ierr)
320-
call MPI_BCAST(fluid_pp(i)%pi_inf, 1, &
321-
MPI_DOUBLE_PRECISION, 0, &
322-
MPI_COMM_WORLD, ierr)
323-
324-
call MPI_BCAST(fluid_pp(i)%mul0, 1, &
325-
MPI_DOUBLE_PRECISION, 0, &
326-
MPI_COMM_WORLD, ierr)
327-
call MPI_BCAST(fluid_pp(i)%ss, 1, &
328-
MPI_DOUBLE_PRECISION, 0, &
329-
MPI_COMM_WORLD, ierr)
330-
call MPI_BCAST(fluid_pp(i)%pv, 1, &
331-
MPI_DOUBLE_PRECISION, 0, &
332-
MPI_COMM_WORLD, ierr)
333-
call MPI_BCAST(fluid_pp(i)%gamma_v, 1, &
334-
MPI_DOUBLE_PRECISION, 0, &
335-
MPI_COMM_WORLD, ierr)
336-
call MPI_BCAST(fluid_pp(i)%M_v, 1, &
337-
MPI_DOUBLE_PRECISION, 0, &
338-
MPI_COMM_WORLD, ierr)
339-
call MPI_BCAST(fluid_pp(i)%mu_v, 1, &
340-
MPI_DOUBLE_PRECISION, 0, &
341-
MPI_COMM_WORLD, ierr)
342-
call MPI_BCAST(fluid_pp(i)%k_v, 1, &
343-
MPI_DOUBLE_PRECISION, 0, &
344-
MPI_COMM_WORLD, ierr)
345-
call MPI_BCAST(fluid_pp(i)%G, 1, &
346-
MPI_DOUBLE_PRECISION, 0, &
347-
MPI_COMM_WORLD, ierr)
191+
#:for VAR in [ 'gamma','pi_inf','mul0','ss','pv','gamma_v','M_v', &
192+
& 'mu_v','k_v', 'G' ]
193+
call MPI_BCAST(fluid_pp(i)%${VAR}$, 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
194+
#:endfor
348195
end do
349-
350-
! Tait EOS
351-
call MPI_BCAST(pref, 1, &
352-
MPI_DOUBLE_PRECISION, 0, &
353-
MPI_COMM_WORLD, ierr)
354-
call MPI_BCAST(rhoref, 1, &
355-
MPI_DOUBLE_PRECISION, 0, &
356-
MPI_COMM_WORLD, ierr)
357-
358-
! Bubble modeling
359-
call MPI_BCAST(bubbles, 1, &
360-
MPI_LOGICAL, 0, &
361-
MPI_COMM_WORLD, ierr)
362-
call MPI_BCAST(polytropic, 1, &
363-
MPI_LOGICAL, 0, &
364-
MPI_COMM_WORLD, ierr)
365-
call MPI_BCAST(polydisperse, 1, &
366-
MPI_LOGICAL, 0, &
367-
MPI_COMM_WORLD, ierr)
368-
call MPI_BCAST(poly_sigma, 1, &
369-
MPI_DOUBLE_PRECISION, 0, &
370-
MPI_COMM_WORLD, ierr)
371-
call MPI_BCAST(thermal, 1, &
372-
MPI_INTEGER, 0, &
373-
MPI_COMM_WORLD, ierr)
374-
call MPI_BCAST(R0ref, 1, &
375-
MPI_DOUBLE_PRECISION, 0, &
376-
MPI_COMM_WORLD, ierr)
377-
call MPI_BCAST(nb, 1, &
378-
MPI_INTEGER, 0, &
379-
MPI_COMM_WORLD, ierr)
380-
381-
call MPI_BCAST(Web, 1, &
382-
MPI_DOUBLE_PRECISION, 0, &
383-
MPI_COMM_WORLD, ierr)
384-
call MPI_BCAST(Ca, 1, &
385-
MPI_DOUBLE_PRECISION, 0, &
386-
MPI_COMM_WORLD, ierr)
387-
call MPI_BCAST(Re_inv, 1, &
388-
MPI_DOUBLE_PRECISION, 0, &
389-
MPI_COMM_WORLD, ierr)
390-
391-
call MPI_BCAST(qbmm, 1, &
392-
MPI_LOGICAL, 0, &
393-
MPI_COMM_WORLD, ierr)
394-
call MPI_BCAST(sigR, 1, &
395-
MPI_DOUBLE_PRECISION, 0, &
396-
MPI_COMM_WORLD, ierr)
397-
call MPI_BCAST(sigV, 1, &
398-
MPI_DOUBLE_PRECISION, 0, &
399-
MPI_COMM_WORLD, ierr)
400-
call MPI_BCAST(rhoRV, 1, &
401-
MPI_DOUBLE_PRECISION, 0, &
402-
MPI_COMM_WORLD, ierr)
403-
call MPI_BCAST(dist_type, 1, &
404-
MPI_INTEGER, 0, &
405-
MPI_COMM_WORLD, ierr)
406-
call MPI_BCAST(R0_type, 1, &
407-
MPI_INTEGER, 0, &
408-
MPI_COMM_WORLD, ierr)
409-
410196
#endif
411197
412198
end subroutine s_mpi_bcast_user_inputs ! -------------------------------

0 commit comments

Comments
 (0)