MFC
Exascale flow solver
Loading...
Searching...
No Matches
m_data_input.f90
Go to the documentation of this file.
1!>
2!! @file
3!> @brief Contains module m_data_input
4
5!> @brief Reads raw simulation grid and conservative-variable data for a given time-step and fills buffer regions
7
8#ifdef MFC_MPI
9 use mpi
10#endif
11
14 use m_mpi_proxy
15 use m_mpi_common
19 use m_helper
20
21 implicit none
22
25
26 abstract interface
27
28 !> Subroutine for reading data files
29 impure subroutine s_read_abstract_data_files(t_step)
30
31 implicit none
32
33 integer, intent(in) :: t_step
34
35 end subroutine s_read_abstract_data_files
36 end interface
37
38 type(scalar_field), allocatable, dimension(:), public :: q_cons_vf !< Conservative variables
39 type(scalar_field), allocatable, dimension(:), public :: q_cons_temp
40 type(scalar_field), allocatable, dimension(:), public :: q_prim_vf !< Primitive variables
41 type(integer_field), allocatable, dimension(:,:), public :: bc_type !< Boundary condition identifiers
42 type(scalar_field), public :: q_t_sf !< Temperature field
43 ! type(scalar_field), public :: ib_markers !<
44 type(integer_field), public :: ib_markers
45
46 procedure(s_read_abstract_data_files), pointer :: s_read_data_files => null()
47
48contains
49
50 !> Helper subroutine to read grid data files for a given direction
51 impure subroutine s_read_grid_data_direction(t_step_dir, direction, cb_array, d_array, cc_array, size_dim)
52
53 character(len=*), intent(in) :: t_step_dir
54 character(len=1), intent(in) :: direction
55 real(wp), dimension(-1:), intent(out) :: cb_array
56 real(wp), dimension(0:), intent(out) :: d_array
57 real(wp), dimension(0:), intent(out) :: cc_array
58 integer, intent(in) :: size_dim
59 character(LEN=len_trim(t_step_dir) + 10) :: file_loc
60 logical :: file_check
61
62 file_loc = trim(t_step_dir) // '/' // direction // '_cb.dat'
63 inquire (file=trim(file_loc), exist=file_check)
64
65 if (file_check) then
66 open (1, file=trim(file_loc), form='unformatted', status='old', action='read')
67 read (1) cb_array(-1:size_dim)
68 close (1)
69 else
70 call s_mpi_abort('File ' // direction // '_cb.dat is missing in ' // trim(t_step_dir) // '. Exiting.')
71 end if
72
73 d_array(0:size_dim) = cb_array(0:size_dim) - cb_array(-1:size_dim - 1)
74 cc_array(0:size_dim) = cb_array(-1:size_dim - 1) + d_array(0:size_dim)/2._wp
75
76 end subroutine s_read_grid_data_direction
77
78#ifdef MFC_MPI
79 !> Helper subroutine to setup MPI data I/O parameters
80 impure subroutine s_setup_mpi_io_params(data_size, m_MOK, n_MOK, p_MOK, WP_MOK, MOK, str_MOK, NVARS_MOK)
81
82 integer, intent(out) :: data_size
83 integer(KIND=MPI_OFFSET_KIND), intent(out) :: m_mok, n_mok, p_mok
84 integer(KIND=MPI_OFFSET_KIND), intent(out) :: wp_mok, mok, str_mok, nvars_mok
85
86 if (ib) then
88 else
90 end if
91
92 data_size = (m + 1)*(n + 1)*(p + 1)
93
94 m_mok = int(m_glb + 1, mpi_offset_kind)
95 n_mok = int(n_glb + 1, mpi_offset_kind)
96 p_mok = int(p_glb + 1, mpi_offset_kind)
97 wp_mok = int(storage_size(0._stp)/8, mpi_offset_kind)
98 mok = int(1._wp, mpi_offset_kind)
99 str_mok = int(name_len, mpi_offset_kind)
100 nvars_mok = int(sys_size, mpi_offset_kind)
101
102 end subroutine s_setup_mpi_io_params
103#endif
104
105 !> Helper subroutine to read IB data files
106 impure subroutine s_read_ib_data_files(file_loc_base, t_step)
107
108 character(len=*), intent(in) :: file_loc_base
109 integer, intent(in), optional :: t_step
110 character(LEN=len_trim(file_loc_base) + 20) :: file_loc
111 logical :: file_exist
112 integer :: ifile, ierr, data_size
113
114#ifdef MFC_MPI
115 integer, dimension(MPI_STATUS_SIZE) :: status
116 integer(KIND=MPI_OFFSET_KIND) :: disp
117 integer(KIND=MPI_OFFSET_KIND) :: m_mok, n_mok, p_mok, mok, wp_mok, var_mok
118 integer :: save_index
119#endif
120
121 if (.not. ib) return
122
123 if (parallel_io) then
124 write (file_loc, '(A)') trim(file_loc_base) // 'ib.dat'
125 else
126 write (file_loc, '(A)') trim(file_loc_base) // '/ib_data.dat'
127 end if
128 inquire (file=trim(file_loc), exist=file_exist)
129
130 if (file_exist) then
131 if (parallel_io) then
132#ifdef MFC_MPI
133 call mpi_file_open(mpi_comm_world, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
134
135 m_mok = int(m_glb + 1, mpi_offset_kind)
136 n_mok = int(n_glb + 1, mpi_offset_kind)
137 p_mok = int(p_glb + 1, mpi_offset_kind)
138 mok = int(1._wp, mpi_offset_kind)
139 wp_mok = int(storage_size(0._stp)/8, mpi_offset_kind)
140 save_index = t_step/t_step_save ! get the number of saves done to this point
141
142 data_size = (m + 1)*(n + 1)*(p + 1)
143 var_mok = int(sys_size + 1, mpi_offset_kind)
144 if (t_step == 0) then
145 disp = 0
146 else
147 disp = m_mok*max(mok, n_mok)*max(mok, p_mok)*wp_mok*(var_mok - 1 + int(save_index, mpi_offset_kind))
148 end if
149
150 call mpi_file_set_view(ifile, disp, mpi_integer, mpi_io_ib_data%view, 'native', mpi_info_int, ierr)
151 call mpi_file_read(ifile, mpi_io_ib_data%var%sf, data_size, mpi_integer, status, ierr)
152
153 call mpi_file_close(ifile, ierr)
154#endif
155 else
156 open (2, file=trim(file_loc), form='unformatted', action='read', status='old')
157 read (2) ib_markers%sf(0:m,0:n,0:p)
158 close (2)
159 end if
160 else
161 call s_mpi_abort('File ' // trim(file_loc) // ' is missing. Exiting.')
162 end if
163
164 end subroutine s_read_ib_data_files
165
166 !> Helper subroutine to allocate field arrays for given dimensionality
167 impure subroutine s_allocate_field_arrays(local_start_idx, end_x, end_y, end_z)
168
169 integer, intent(in) :: local_start_idx, end_x, end_y, end_z
170 integer :: i
171
172 do i = 1, sys_size
173 allocate (q_cons_vf(i)%sf(local_start_idx:end_x,local_start_idx:end_y,local_start_idx:end_z))
174 allocate (q_prim_vf(i)%sf(local_start_idx:end_x,local_start_idx:end_y,local_start_idx:end_z))
175 end do
176
177 if (ib) then
178 allocate (ib_markers%sf(local_start_idx:end_x,local_start_idx:end_y,local_start_idx:end_z))
179 end if
180
181 if (chemistry) then
182 allocate (q_t_sf%sf(local_start_idx:end_x,local_start_idx:end_y,local_start_idx:end_z))
183 end if
184
185 end subroutine s_allocate_field_arrays
186
187 !> Read the raw data files present in the corresponding time-step directory and to populate the associated grid and conservative
188 !! variables.
189 impure subroutine s_read_serial_data_files(t_step)
190
191 integer, intent(in) :: t_step
192 character(LEN=len_trim(case_dir) + 2*name_len) :: t_step_dir
193 character(LEN=len_trim(case_dir) + 3*name_len) :: file_loc
194 character(len=int(floor(log10(real(sys_size, wp)))) + 1) :: file_num
195 logical :: dir_check
196 logical :: file_check
197 integer :: i
198
199 write (t_step_dir, '(A,I0,A,I0)') '/p_all/p', proc_rank, '/', t_step
200 t_step_dir = trim(case_dir) // trim(t_step_dir)
201
202 file_loc = trim(t_step_dir) // '/.'
203 call my_inquire(file_loc, dir_check)
204
205 if (dir_check .neqv. .true.) then
206 call s_mpi_abort('Time-step folder ' // trim(t_step_dir) // ' is missing. Exiting.')
207 end if
208
209 if (bc_io) then
211 else
213 end if
214
215 ! Pass explicit slices so the dummy `dimension(-1:)` / `dimension(0:)` arguments map to the correct interior indices of the
216 ! actual arrays. Without slicing, when offset_x%beg or buff_size > 0 (i.e. format=1 parallel 3D ranks), Fortran's
217 ! assumed-shape re-mapping shifts the read by that many slots and leaves the last interior cells uninitialized - corrupting
218 ! downstream ghost-cell extrapolation.
219 call s_read_grid_data_direction(t_step_dir, 'x', x_cb(-1:m), dx(0:m), x_cc(0:m), m)
220
221 if (n > 0) then
222 call s_read_grid_data_direction(t_step_dir, 'y', y_cb(-1:n), dy(0:n), y_cc(0:n), n)
223
224 if (p > 0) then
225 call s_read_grid_data_direction(t_step_dir, 'z', z_cb(-1:p), dz(0:p), z_cc(0:p), p)
226 end if
227 end if
228
229 do i = 1, sys_size
230 write (file_num, '(I0)') i
231 file_loc = trim(t_step_dir) // '/q_cons_vf' // trim(file_num) // '.dat'
232 inquire (file=trim(file_loc), exist=file_check)
233
234 if (file_check) then
235 open (1, file=trim(file_loc), form='unformatted', status='old', action='read')
236 read (1) q_cons_vf(i)%sf(0:m,0:n,0:p)
237 close (1)
238 else
239 call s_mpi_abort('File q_cons_vf' // trim(file_num) // '.dat is missing in ' // trim(t_step_dir) // '. Exiting.')
240 end if
241 end do
242
243 call s_read_ib_data_files(t_step_dir)
244
245 end subroutine s_read_serial_data_files
246
247 !> Parallel-read the raw data files present in the corresponding time-step directory and to populate the associated grid and
248 !! conservative variables.
249 impure subroutine s_read_parallel_data_files(t_step)
250
251 integer, intent(in) :: t_step
252
253#ifdef MFC_MPI
254 real(wp), allocatable, dimension(:) :: x_cb_glb, y_cb_glb, z_cb_glb
255 integer :: ifile, ierr, data_size, filetype, stride
256 integer, dimension(MPI_STATUS_SIZE) :: status
257 integer(KIND=MPI_OFFSET_KIND) :: disp
258 integer(KIND=MPI_OFFSET_KIND) :: m_mok, n_mok, p_mok
259 integer(KIND=MPI_OFFSET_KIND) :: wp_mok, var_mok, str_mok
260 integer(KIND=MPI_OFFSET_KIND) :: nvars_mok
261 integer(KIND=MPI_OFFSET_KIND) :: mok
262 integer(kind=MPI_OFFSET_KIND) :: offset
263 character(LEN=path_len + 2*name_len) :: file_loc
264 logical :: file_exist
265 character(len=10) :: t_step_string
266 integer :: i
267
268 allocate (x_cb_glb(-1:m_glb))
269 allocate (y_cb_glb(-1:n_glb))
270 allocate (z_cb_glb(-1:p_glb))
271
272 if (down_sample) then
273 stride = 3
274 else
275 stride = 1
276 end if
277
278 file_loc = trim(case_dir) // '/restart_data' // trim(mpiiofs) // 'x_cb.dat'
279 inquire (file=trim(file_loc), exist=file_exist)
280
281 if (file_exist) then
282 data_size = m_glb + 2
283 call mpi_file_open(mpi_comm_world, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
284
285 call mpi_type_vector(data_size, 1, stride, mpi_p, filetype, ierr)
286 call mpi_type_commit(filetype, ierr)
287
288 offset = 0
289 call mpi_file_set_view(ifile, offset, mpi_p, filetype, 'native', mpi_info_int, ierr)
290
291 call mpi_file_read(ifile, x_cb_glb, data_size, mpi_p, status, ierr)
292 call mpi_file_close(ifile, ierr)
293 else
294 call s_mpi_abort('File ' // trim(file_loc) // ' is missing. Exiting.')
295 end if
296
297 ! Bitwise-consistent grid distribution from the global file
298 call s_apply_grid_from_global_dim(x_cb_glb, m_glb, m, start_idx(1), bc_x%beg, bc_x%end, offset_x%beg, offset_x%end, &
300
301 if (n > 0) then
302 file_loc = trim(case_dir) // '/restart_data' // trim(mpiiofs) // 'y_cb.dat'
303 inquire (file=trim(file_loc), exist=file_exist)
304
305 if (file_exist) then
306 data_size = n_glb + 2
307 call mpi_file_open(mpi_comm_world, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
308
309 call mpi_type_vector(data_size, 1, stride, mpi_p, filetype, ierr)
310 call mpi_type_commit(filetype, ierr)
311
312 offset = 0
313 call mpi_file_set_view(ifile, offset, mpi_p, filetype, 'native', mpi_info_int, ierr)
314
315 call mpi_file_read(ifile, y_cb_glb, data_size, mpi_p, status, ierr)
316 call mpi_file_close(ifile, ierr)
317 else
318 call s_mpi_abort('File ' // trim(file_loc) // ' is missing. Exiting.')
319 end if
320
321 call s_apply_grid_from_global_dim(y_cb_glb, n_glb, n, start_idx(2), bc_y%beg, bc_y%end, offset_y%beg, offset_y%end, &
323
324 if (p > 0) then
325 file_loc = trim(case_dir) // '/restart_data' // trim(mpiiofs) // 'z_cb.dat'
326 inquire (file=trim(file_loc), exist=file_exist)
327
328 if (file_exist) then
329 data_size = p_glb + 2
330 call mpi_file_open(mpi_comm_world, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
331
332 call mpi_type_vector(data_size, 1, stride, mpi_p, filetype, ierr)
333 call mpi_type_commit(filetype, ierr)
334
335 offset = 0
336 call mpi_file_set_view(ifile, offset, mpi_p, filetype, 'native', mpi_info_int, ierr)
337
338 call mpi_file_read(ifile, z_cb_glb, data_size, mpi_p, status, ierr)
339 call mpi_file_close(ifile, ierr)
340 else
341 call s_mpi_abort('File ' // trim(file_loc) // ' is missing. Exiting.')
342 end if
343
344 call s_apply_grid_from_global_dim(z_cb_glb, p_glb, p, start_idx(3), bc_z%beg, bc_z%end, offset_z%beg, &
346 end if
347 end if
348
349 call s_read_parallel_conservative_data(t_step, m_mok, n_mok, p_mok, wp_mok, mok, str_mok, nvars_mok)
350
351 deallocate (x_cb_glb, y_cb_glb, z_cb_glb)
352
353 if (bc_io) then
355 else
357 end if
358#endif
359
360 end subroutine s_read_parallel_data_files
361
362#ifdef MFC_MPI
363 !> Helper subroutine to read parallel conservative variable data
364 impure subroutine s_read_parallel_conservative_data(t_step, m_MOK, n_MOK, p_MOK, WP_MOK, MOK, str_MOK, NVARS_MOK)
365
366 integer, intent(in) :: t_step
367 integer(KIND=MPI_OFFSET_KIND), intent(inout) :: m_mok, n_mok, p_mok
368 integer(KIND=MPI_OFFSET_KIND), intent(inout) :: wp_mok, mok, str_mok, nvars_mok
369 integer :: ifile, ierr, data_size
370 integer, dimension(MPI_STATUS_SIZE) :: status
371 integer(KIND=MPI_OFFSET_KIND) :: disp, var_mok
372 character(LEN=path_len + 2*name_len) :: file_loc
373 logical :: file_exist
374 character(len=10) :: t_step_string
375 integer :: i
376
377 if (file_per_process) then
378 call s_int_to_str(t_step, t_step_string)
379 write (file_loc, '(I0,A1,I7.7,A)') t_step, '_', proc_rank, '.dat'
380 file_loc = trim(case_dir) // '/restart_data/lustre_' // trim(t_step_string) // trim(mpiiofs) // trim(file_loc)
381 inquire (file=trim(file_loc), exist=file_exist)
382
383 if (file_exist) then
384 call mpi_file_open(mpi_comm_self, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
385
386 if (down_sample) then
388 else
389 if (ib) then
391 else
393 end if
394 end if
395
396 if (down_sample) then
397 data_size = (m + 3)*(n + 3)*(p + 3)
398 else
399 data_size = (m + 1)*(n + 1)*(p + 1)
400 end if
401
402 m_mok = int(m_glb + 1, mpi_offset_kind)
403 n_mok = int(n_glb + 1, mpi_offset_kind)
404 p_mok = int(p_glb + 1, mpi_offset_kind)
405 wp_mok = int(storage_size(0._stp)/8, mpi_offset_kind)
406 mok = int(1._wp, mpi_offset_kind)
407 str_mok = int(name_len, mpi_offset_kind)
408 nvars_mok = int(sys_size, mpi_offset_kind)
409
410 if (bubbles_euler .or. elasticity .or. mhd) then
411 do i = 1, sys_size
412 var_mok = int(i, mpi_offset_kind)
413 call mpi_file_read_all(ifile, mpi_io_data%var(i)%sf, data_size*mpi_io_type, mpi_io_p, status, ierr)
414 end do
415 else
416 do i = 1, sys_size
417 var_mok = int(i, mpi_offset_kind)
418 call mpi_file_read_all(ifile, mpi_io_data%var(i)%sf, data_size*mpi_io_type, mpi_io_p, status, ierr)
419 end do
420 end if
421
422 call s_mpi_barrier()
423 call mpi_file_close(ifile, ierr)
424
425 if (down_sample) then
426 do i = 1, sys_size
427 q_cons_vf(i)%sf(0:m,0:n,0:p) = q_cons_temp(i)%sf(0:m,0:n,0:p)
428 end do
429 end if
430
431 call s_read_ib_data_files(trim(case_dir) // '/restart_data' // trim(mpiiofs), t_step)
432 else
433 call s_mpi_abort('File ' // trim(file_loc) // ' is missing. Exiting.')
434 end if
435 else
436 write (file_loc, '(I0,A)') t_step, '.dat'
437 file_loc = trim(case_dir) // '/restart_data' // trim(mpiiofs) // trim(file_loc)
438 inquire (file=trim(file_loc), exist=file_exist)
439
440 if (file_exist) then
441 call mpi_file_open(mpi_comm_world, file_loc, mpi_mode_rdonly, mpi_info_int, ifile, ierr)
442
443 call s_setup_mpi_io_params(data_size, m_mok, n_mok, p_mok, wp_mok, mok, str_mok, nvars_mok)
444
445 do i = 1, sys_size
446 var_mok = int(i, mpi_offset_kind)
447
448 disp = m_mok*max(mok, n_mok)*max(mok, p_mok)*wp_mok*(var_mok - 1)
449
450 call mpi_file_set_view(ifile, disp, mpi_p, mpi_io_data%view(i), 'native', mpi_info_int, ierr)
451 call mpi_file_read_all(ifile, mpi_io_data%var(i)%sf, data_size*mpi_io_type, mpi_io_p, status, ierr)
452 end do
453
454 call s_mpi_barrier()
455 call mpi_file_close(ifile, ierr)
456
457 call s_read_ib_data_files(trim(case_dir) // '/restart_data' // trim(mpiiofs), t_step)
458 else
459 call s_mpi_abort('File ' // trim(file_loc) // ' is missing. Exiting.')
460 end if
461 end if
462
464#endif
465
466 !> Computation of parameters, allocation procedures, and/or any other tasks needed to properly setup the module
468
469 integer :: i
470
471 allocate (q_cons_vf(1:sys_size))
472 allocate (q_prim_vf(1:sys_size))
473 allocate (q_cons_temp(1:sys_size))
474
475 if (n > 0) then
476 if (p > 0) then
478 if (down_sample) then
479 do i = 1, sys_size
480 allocate (q_cons_temp(i)%sf(-1:m + 1,-1:n + 1,-1:p + 1))
481 end do
482 end if
483 else
485 end if
486 else
488 end if
489
490 allocate (bc_type(1:num_dims,1:2))
491
492 allocate (bc_type(1, 1)%sf(0:0,0:n,0:p))
493 allocate (bc_type(1, 2)%sf(0:0,0:n,0:p))
494 if (n > 0) then
495 allocate (bc_type(2, 1)%sf(-buff_size:m + buff_size,0:0,0:p))
496 allocate (bc_type(2, 2)%sf(-buff_size:m + buff_size,0:0,0:p))
497 if (p > 0) then
498 allocate (bc_type(3, 1)%sf(-buff_size:m + buff_size,-buff_size:n + buff_size,0:0))
499 allocate (bc_type(3, 2)%sf(-buff_size:m + buff_size,-buff_size:n + buff_size,0:0))
500 end if
501 end if
502
503 if (parallel_io .neqv. .true.) then
505 else
507 end if
508
509 end subroutine s_initialize_data_input_module
510
511 !> Deallocation procedures for the module
513
514 integer :: i
515
516 do i = 1, sys_size
517 deallocate (q_cons_vf(i)%sf)
518 deallocate (q_prim_vf(i)%sf)
519 if (down_sample) then
520 deallocate (q_cons_temp(i)%sf)
521 end if
522 end do
523
524 deallocate (q_cons_vf)
525 deallocate (q_prim_vf)
526 deallocate (q_cons_temp)
527
528 if (ib) then
529 deallocate (ib_markers%sf)
530 end if
531
532 if (chemistry) then
533 deallocate (q_t_sf%sf)
534 end if
535
536 deallocate (bc_type(1, 1)%sf, bc_type(1, 2)%sf)
537 if (n > 0) then
538 deallocate (bc_type(2, 1)%sf, bc_type(2, 2)%sf)
539 if (p > 0) then
540 deallocate (bc_type(3, 1)%sf, bc_type(3, 2)%sf)
541 end if
542 end if
543
544 deallocate (bc_type)
545
546 s_read_data_files => null()
547
548 end subroutine s_finalize_data_input_module
549
550end module m_data_input
Subroutine for reading data files.
Noncharacteristic and processor boundary condition application for ghost cells and buffer regions.
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.
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.
Reads raw simulation grid and conservative-variable data for a given time-step and fills buffer regio...
impure subroutine s_allocate_field_arrays(local_start_idx, end_x, end_y, end_z)
Helper subroutine to allocate field arrays for given dimensionality.
impure subroutine, public s_read_parallel_data_files(t_step)
Parallel-read the raw data files present in the corresponding time-step directory and to populate the...
type(scalar_field), public q_t_sf
Temperature field.
type(scalar_field), dimension(:), allocatable, public q_cons_vf
Conservative variables.
impure subroutine s_read_parallel_conservative_data(t_step, m_mok, n_mok, p_mok, wp_mok, mok, str_mok, nvars_mok)
Helper subroutine to read parallel conservative variable data.
impure subroutine, public s_initialize_data_input_module
Computation of parameters, allocation procedures, and/or any other tasks needed to properly setup the...
type(scalar_field), dimension(:), allocatable, public q_prim_vf
Primitive variables.
impure subroutine s_setup_mpi_io_params(data_size, m_mok, n_mok, p_mok, wp_mok, mok, str_mok, nvars_mok)
Helper subroutine to setup MPI data I/O parameters.
impure subroutine, public s_finalize_data_input_module
Deallocation procedures for the module.
impure subroutine s_read_grid_data_direction(t_step_dir, direction, cb_array, d_array, cc_array, size_dim)
Helper subroutine to read grid data files for a given direction.
impure subroutine, public s_read_serial_data_files(t_step)
Read the raw data files present in the corresponding time-step directory and to populate the associat...
type(scalar_field), dimension(:), allocatable, public q_cons_temp
procedure(s_read_abstract_data_files), pointer, public s_read_data_files
type(integer_field), dimension(:,:), allocatable, public bc_type
Boundary condition identifiers.
type(integer_field), public ib_markers
impure subroutine s_read_ib_data_files(file_loc_base, t_step)
Helper subroutine to read IB data files.
Shared derived types for field data, patch geometry, bubble dynamics, and MPI I/O structures.
Global parameters for the post-process: domain geometry, equation of state, and output database setti...
type(int_bounds_info) offset_y
real(wp), dimension(:), allocatable y_cc
integer proc_rank
Rank of the local processor.
type(mpi_io_ib_var), public mpi_io_ib_data
real(wp), dimension(:), allocatable y_cb
real(wp), dimension(:), allocatable dz
integer buff_size
Number of ghost cells for boundary condition storage.
real(wp), dimension(:), allocatable z_cb
real(wp), dimension(:), allocatable x_cc
real(wp), dimension(:), allocatable x_cb
real(wp), dimension(:), allocatable dy
type(int_bounds_info) offset_x
real(wp), dimension(:), allocatable z_cc
type(int_bounds_info) offset_z
type(mpi_io_var), public mpi_io_data
real(wp), dimension(:), allocatable dx
Cell-width distributions in the x-, y- and z-coordinate directions.
Utility routines for bubble model setup, coordinate transforms, array sampling, and special functions...
elemental subroutine, public s_int_to_str(i, res)
Convert an integer to its trimmed string representation.
MPI 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.
impure subroutine s_initialize_mpi_data(q_cons_vf, ib_markers, beta)
Set up MPI I/O data views and variable pointers for parallel file output.
subroutine s_initialize_mpi_data_ds(q_cons_vf)
Set up MPI I/O data views for downsampled (coarsened) parallel file output.
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...
MPI gather and scatter operations for distributing post-process grid and flow-variable data.
Derived type annexing an integer scalar field (SF).
Derived type annexing a scalar field (SF).