Skip to content

Commit 12de935

Browse files
author
Diego Vaca
committed
Merge branch 'lagrangian' of github.com:dgvacarevelo/MFC into lagrangian
2 parents af9371e + 3c20449 commit 12de935

File tree

9 files changed

+35
-36
lines changed

9 files changed

+35
-36
lines changed

.github/workflows/lint-source.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ jobs:
3636

3737
- name: No double precision intrinsics
3838
run: |
39-
! grep -iR 'dsqrt\|dexp\|dlog\|dble\|dabs\|double\ precision\|real(8)\|real(4)\|dprod\|dmin\|dmax\|dfloat\|dreal\|dcos\|dsin\|dtan\|dsign\|dtanh\|dsinh\|dcosh\|d0' --exclude-dir=syscheck --exclude="*nvtx*" ./src/*
39+
! grep -iR 'double_precision\|dsqrt\|dexp\|dlog\|dble\|dabs\|double\ precision\|real(8)\|real(4)\|dprod\|dmin\|dmax\|dfloat\|dreal\|dcos\|dsin\|dtan\|dsign\|dtanh\|dsinh\|dcosh\|d0' --exclude-dir=syscheck --exclude="*nvtx*" --exclude="*precision_select*" ./src/*
4040

src/common/m_mpi_common.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ contains
261261
end do
262262
263263
allocate (gathered_vector(sum(recounts)))
264-
call MPI_GATHERV(my_vector, counts, MPI_DOUBLE_PRECISION, gathered_vector, recounts, displs, MPI_DOUBLE_PRECISION, &
264+
call MPI_GATHERV(my_vector, counts, mpi_p, gathered_vector, recounts, displs, mpi_p, &
265265
root, MPI_COMM_WORLD, ierr)
266266
#endif
267267
end subroutine s_mpi_gather_data

src/post_process/m_data_input.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,10 +516,10 @@ subroutine s_read_parallel_data_files(t_step)
516516
! Initial displacement to skip at beginning of file
517517
disp = m_MOK*max(MOK, n_MOK)*max(MOK, p_MOK)*WP_MOK*(var_MOK - 1)
518518

519-
call MPI_FILE_SET_VIEW(ifile, disp, MPI_DOUBLE_PRECISION, MPI_IO_DATA%view(sys_size + 1), &
519+
call MPI_FILE_SET_VIEW(ifile, disp, mpi_p, MPI_IO_DATA%view(sys_size + 1), &
520520
'native', mpi_info_int, ierr)
521521
call MPI_FILE_READ(ifile, MPI_IO_DATA%var(sys_size + 1)%sf, data_size, &
522-
MPI_DOUBLE_PRECISION, status, ierr)
522+
mpi_p, status, ierr)
523523
end if
524524

525525
call s_mpi_barrier()

src/post_process/m_data_output.fpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,7 @@ contains
10761076
end if
10771077
10781078
call MPI_BCAST(tot_data, 1, MPI_integer, 0, MPI_COMM_WORLD, ierr)
1079-
call MPI_BCAST(time_real, 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
1079+
call MPI_BCAST(time_real, 1, mpi_p, 0, MPI_COMM_WORLD, ierr)
10801080
10811081
gsizes(1) = tot_data
10821082
gsizes(2) = 21
@@ -1086,7 +1086,7 @@ contains
10861086
start_idx_part(2) = 0
10871087
10881088
call MPI_TYPE_CREATE_SUBARRAY(2, gsizes, lsizes, start_idx_part, &
1089-
MPI_ORDER_FORTRAN, MPI_DOUBLE_PRECISION, view, ierr)
1089+
MPI_ORDER_FORTRAN, mpi_p, view, ierr)
10901090
call MPI_TYPE_COMMIT(view, ierr)
10911091
10921092
write (file_loc, '(A,I0,A)') 'lag_bubbles_', t_step, '.dat'
@@ -1099,13 +1099,13 @@ contains
10991099
mpi_info_int, ifile, ierr)
11001100
11011101
disp = 0._wp
1102-
call MPI_FILE_SET_VIEW(ifile, disp, MPI_DOUBLE_PRECISION, view, &
1102+
call MPI_FILE_SET_VIEW(ifile, disp, mpi_p, view, &
11031103
'native', mpi_info_null, ierr)
11041104
11051105
allocate (MPI_IO_DATA_lg_bubbles(tot_data, 1:21))
11061106
11071107
call MPI_FILE_READ_ALL(ifile, MPI_IO_DATA_lg_bubbles, 21*tot_data, &
1108-
MPI_DOUBLE_PRECISION, status, ierr)
1108+
mpi_p, status, ierr)
11091109
11101110
write (file_loc, '(A,I0,A)') 'lag_bubbles_post_process_', t_step, '.dat'
11111111
file_loc = trim(case_dir)//'/lag_bubbles_post_process/'//trim(file_loc)

src/pre_process/m_mpi_proxy.fpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ contains
9191
#:endfor
9292
9393
#:for VAR in [ '2', '3', '4', '5', '6', '7', '8', '9']
94-
call MPI_BCAST(patch_icpp(i)%a(${VAR}$), 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
94+
call MPI_BCAST(patch_icpp(i)%a(${VAR}$), 1, mpi_p, 0, MPI_COMM_WORLD, ierr)
9595
#:endfor
9696
9797
call MPI_BCAST(patch_icpp(i)%model_filepath, len(patch_icpp(i)%model_filepath), MPI_CHARACTER, 0, MPI_COMM_WORLD, ierr)
@@ -106,7 +106,7 @@ contains
106106
! Broadcast IB variables
107107
call MPI_BCAST(patch_ib(i)%geometry, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
108108
call MPI_BCAST(patch_ib(i)%model_filepath, len(patch_ib(i)%model_filepath), MPI_CHARACTER, 0, MPI_COMM_WORLD, ierr)
109-
call MPI_BCAST(patch_ib(i)%model_threshold, 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
109+
call MPI_BCAST(patch_ib(i)%model_threshold, 1, mpi_p, 0, MPI_COMM_WORLD, ierr)
110110
call MPI_BCAST(patch_ib(i)%model_spc, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
111111
112112
#:for VAR in [ 'x_centroid', 'y_centroid', 'z_centroid', &
@@ -115,7 +115,7 @@ contains
115115
#:endfor
116116
117117
#:for VAR in [ 'model_translate', 'model_scale', 'model_rotate']
118-
call MPI_BCAST(patch_ib(i)%${VAR}$, size(patch_ib(i)%${VAR}$), MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
118+
call MPI_BCAST(patch_ib(i)%${VAR}$, size(patch_ib(i)%${VAR}$), mpi_p, 0, MPI_COMM_WORLD, ierr)
119119
#:endfor
120120
end do
121121

src/simulation/m_bubbles_EE.fpp

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ contains
427427
real(wp), intent(out) :: h
428428

429429
real(wp) :: h0, h1 !< Time step size
430-
real(wp) :: d0, d1, d2 !< norms
430+
real(wp) :: d_0, d_1, d_2 !< norms
431431
real(wp), dimension(2) :: myR_tmp, myV_tmp, myA_tmp !< Bubble radius, radial velocity, and radial acceleration
432432

433433
! Determine the starting time step
@@ -438,13 +438,13 @@ contains
438438
fpb, fpbdot, alf, fntait, fBtait, &
439439
f_bub_adv_src, f_divu)
440440

441-
! Compute d0 = ||y0|| and d1 = ||f(x0,y0)||
442-
d0 = sqrt((myR_tmp(1)**2._wp + myV_tmp(1)**2._wp)/2._wp)
443-
d1 = sqrt((myV_tmp(1)**2._wp + myA_tmp(1)**2._wp)/2._wp)
444-
if (d0 < 1e-5_wp .or. d1 < 1e-5_wp) then
441+
! Compute d_0 = ||y0|| and d_1 = ||f(x0,y0)||
442+
d_0 = sqrt((myR_tmp(1)**2._wp + myV_tmp(1)**2._wp)/2._wp)
443+
d_1 = sqrt((myV_tmp(1)**2._wp + myA_tmp(1)**2._wp)/2._wp)
444+
if (d_0 < 1e-5_wp .or. d_1 < 1e-5_wp) then
445445
h0 = 1e-6_wp
446446
else
447-
h0 = 1e-2_wp*(d0/d1)
447+
h0 = 1e-2_wp*(d_0/d_1)
448448
end if
449449

450450
! Evaluate f(x0+h0,y0+h0*f(x0,y0))
@@ -454,18 +454,17 @@ contains
454454
fpb, fpbdot, alf, fntait, fBtait, &
455455
f_bub_adv_src, f_divu)
456456

457-
! Compute d2 = ||f(x0+h0,y0+h0*f(x0,y0))-f(x0,y0)||/h0
458-
d2 = sqrt(((myV_tmp(2) - myV_tmp(1))**2._wp + (myA_tmp(2) - myA_tmp(1))**2._wp)/2._wp)/h0
457+
! Compute d_2 = ||f(x0+h0,y0+h0*f(x0,y0))-f(x0,y0)||/h0
458+
d_2 = sqrt(((myV_tmp(2) - myV_tmp(1))**2._wp + (myA_tmp(2) - myA_tmp(1))**2._wp)/2._wp)/h0
459459

460-
! Set h1 = (0.01/max(d1,d2))^{1/(p+1)}
461-
! if max(d1,d2) < 1e-15_wp, h1 = max(1e-6_wp, h0*1e-3_wp)
462-
if (max(d1, d2) < 1e-15_wp) then
460+
! Set h1 = (0.01/max(d_1,d_2))^{1/(p+1)}
461+
! if max(d_1,d_2) < 1e-15_wp, h1 = max(1e-6_wp, h0*1e-3_wp)
462+
if (max(d_1, d_2) < 1e-15_wp) then
463463
h1 = max(1e-6_wp, h0*1e-3_wp)
464464
else
465-
h1 = (1e-2_wp/max(d1, d2))**(1._wp/3._wp)
465+
h1 = (1e-2_wp/max(d_1, d_2))**(1._wp/3._wp)
466466
end if
467467

468-
! Set h = min(100*h0,h1)
469468
h = min(100._wp*h0, h1)
470469

471470
end subroutine s_initialize_adap_dt

src/simulation/m_bubbles_EL.fpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,8 @@ contains
439439
end if
440440

441441
call MPI_BCAST(tot_data, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
442-
call MPI_BCAST(mytime, 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
443-
call MPI_BCAST(dt, 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
442+
call MPI_BCAST(mytime, 1, mpi_p, 0, MPI_COMM_WORLD, ierr)
443+
call MPI_BCAST(dt, 1, mpi_p, 0, MPI_COMM_WORLD, ierr)
444444

445445
gsizes(1) = tot_data
446446
gsizes(2) = 21
@@ -450,7 +450,7 @@ contains
450450
start_idx_part(2) = 0
451451

452452
call MPI_type_CREATE_SUBARRAY(2, gsizes, lsizes, start_idx_part, &
453-
MPI_ORDER_FORTRAN, MPI_doUBLE_PRECISION, view, ierr)
453+
MPI_ORDER_FORTRAN, mpi_p, view, ierr)
454454
call MPI_type_COMMIT(view, ierr)
455455

456456
! Open the file to write all flow variables
@@ -462,11 +462,11 @@ contains
462462
call MPI_FILE_open(MPI_COMM_WORLD, file_loc, MPI_MODE_RDONLY, &
463463
mpi_info_int, ifile, ierr)
464464
disp = 0._wp
465-
call MPI_FILE_SET_VIEW(ifile, disp, MPI_doUBLE_PRECISION, view, &
465+
call MPI_FILE_SET_VIEW(ifile, disp, mpi_p, view, &
466466
'native', mpi_info_null, ierr)
467467
allocate (MPI_IO_DATA_lag_bubbles(tot_data, 1:21))
468468
call MPI_FILE_read_ALL(ifile, MPI_IO_DATA_lag_bubbles, 21*tot_data, &
469-
MPI_doUBLE_PRECISION, status, ierr)
469+
mpi_p, status, ierr)
470470
do i = 1, tot_data
471471
id = int(MPI_IO_DATA_lag_bubbles(i, 1))
472472
inputvals(1:20) = MPI_IO_DATA_lag_bubbles(i, 2:21)
@@ -1776,7 +1776,7 @@ contains
17761776
end if
17771777

17781778
call MPI_type_CREATE_SUBARRAY(2, gsizes, lsizes, start_idx_part, &
1779-
MPI_ORDER_FORTRAN, MPI_doUBLE_PRECISION, view, ierr)
1779+
MPI_ORDER_FORTRAN, mpi_p, view, ierr)
17801780
call MPI_type_COMMIT(view, ierr)
17811781

17821782
allocate (MPI_IO_DATA_lag_bubbles(1:max(1, bub_id), 1:21))
@@ -1794,7 +1794,7 @@ contains
17941794

17951795
disp = 0._wp
17961796

1797-
call MPI_FILE_SET_VIEW(ifile, disp, MPI_doUBLE_PRECISION, view, &
1797+
call MPI_FILE_SET_VIEW(ifile, disp, mpi_p, view, &
17981798
'native', mpi_info_null, ierr)
17991799

18001800
! Cycle through list
@@ -1833,7 +1833,7 @@ contains
18331833
end if
18341834

18351835
call MPI_FILE_write_ALL(ifile, MPI_IO_DATA_lag_bubbles, 21*max(1, bub_id), &
1836-
MPI_doUBLE_PRECISION, status, ierr)
1836+
mpi_p, status, ierr)
18371837

18381838
call MPI_FILE_CLOSE(ifile, ierr)
18391839

src/simulation/m_data_output.fpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -972,10 +972,10 @@ contains
972972
! Initial displacement to skip at beginning of file
973973
disp = m_MOK*max(MOK, n_MOK)*max(MOK, p_MOK)*WP_MOK*(var_MOK - 1)
974974

975-
call MPI_FILE_SET_VIEW(ifile, disp, MPI_DOUBLE_PRECISION, MPI_IO_DATA%view(sys_size + 1), &
975+
call MPI_FILE_SET_VIEW(ifile, disp, mpi_p, MPI_IO_DATA%view(sys_size + 1), &
976976
'native', mpi_info_int, ierr)
977977
call MPI_FILE_WRITE_ALL(ifile, MPI_IO_DATA%var(sys_size + 1)%sf, data_size, &
978-
MPI_DOUBLE_PRECISION, status, ierr)
978+
mpi_p, status, ierr)
979979
end if
980980

981981
call MPI_FILE_CLOSE(ifile, ierr)

src/simulation/m_mpi_proxy.fpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ contains
242242
do i = 1, 3
243243
#:for VAR in [ 'bc_x%vel_in', 'bc_x%vel_out', 'bc_y%vel_in', 'bc_y%vel_out', &
244244
& 'bc_z%vel_in', 'bc_z%vel_out']
245-
call MPI_BCAST(${VAR}$ (i), 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
245+
call MPI_BCAST(${VAR}$ (i), 1, mpi_p, 0, MPI_COMM_WORLD, ierr)
246246
#:endfor
247247
end do
248248
@@ -266,7 +266,7 @@ contains
266266
267267
do i = 1, num_fluids_max
268268
#:for VAR in ['bc_x%alpha_rho_in','bc_x%alpha_in','bc_y%alpha_rho_in','bc_y%alpha_in','bc_z%alpha_rho_in','bc_z%alpha_in']
269-
call MPI_BCAST(${VAR}$ (i), 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
269+
call MPI_BCAST(${VAR}$ (i), 1, mpi_p, 0, MPI_COMM_WORLD, ierr)
270270
#:endfor
271271
end do
272272

0 commit comments

Comments
 (0)