Skip to content

Commit 6c57dcf

Browse files
committed
More work into marking subroutines as pure or impure
1 parent 6eddb7a commit 6c57dcf

12 files changed

+118
-125
lines changed

src/common/m_boundary_common.fpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ module m_boundary_common
4242

4343
contains
4444

45-
subroutine s_initialize_boundary_common_module()
45+
impure subroutine s_initialize_boundary_common_module()
4646

4747
bcxb = bc_x%beg; bcxe = bc_x%end; bcyb = bc_y%beg; bcye = bc_y%end; bczb = bc_z%beg; bcze = bc_z%end
4848

@@ -71,7 +71,7 @@ contains
7171
!> The purpose of this procedure is to populate the buffers
7272
!! of the primitive variables, depending on the selected
7373
!! boundary conditions.
74-
subroutine s_populate_variables_buffers(q_prim_vf, pb, mv, bc_type)
74+
impure subroutine s_populate_variables_buffers(q_prim_vf, pb, mv, bc_type)
7575

7676
type(scalar_field), dimension(sys_size), intent(inout) :: q_prim_vf
7777
real(wp), dimension(idwbuff(1)%beg:, idwbuff(2)%beg:, idwbuff(3)%beg:, 1:, 1:), intent(inout) :: pb, mv
@@ -238,7 +238,7 @@ contains
238238

239239
end subroutine s_populate_variables_buffers
240240

241-
subroutine s_ghost_cell_extrapolation(q_prim_vf, pb, mv, bc_dir, bc_loc, k, l)
241+
pure subroutine s_ghost_cell_extrapolation(q_prim_vf, pb, mv, bc_dir, bc_loc, k, l)
242242
#ifdef _CRAYFTN
243243
!DIR$ INLINEALWAYS s_ghost_cell_extrapolation
244244
#else
@@ -307,7 +307,7 @@ contains
307307

308308
end subroutine s_ghost_cell_extrapolation
309309

310-
subroutine s_symmetry(q_prim_vf, pb, mv, bc_dir, bc_loc, k, l)
310+
pure subroutine s_symmetry(q_prim_vf, pb, mv, bc_dir, bc_loc, k, l)
311311
#ifdef _CRAYFTN
312312
!DIR$ INLINEALWAYS s_symmetry
313313
#else
@@ -571,7 +571,7 @@ contains
571571

572572
end subroutine s_symmetry
573573

574-
subroutine s_periodic(q_prim_vf, pb, mv, bc_dir, bc_loc, k, l)
574+
pure subroutine s_periodic(q_prim_vf, pb, mv, bc_dir, bc_loc, k, l)
575575
#ifdef _CRAYFTN
576576
!DIR$ INLINEALWAYS s_periodic
577577
#else
@@ -714,7 +714,7 @@ contains
714714

715715
end subroutine s_periodic
716716

717-
subroutine s_axis(q_prim_vf, pb, mv, bc_dir, bc_loc, k, l)
717+
pure subroutine s_axis(q_prim_vf, pb, mv, bc_dir, bc_loc, k, l)
718718
#ifdef _CRAYFTN
719719
!DIR$ INLINEALWAYS s_axis
720720
#else
@@ -778,7 +778,7 @@ contains
778778

779779
end subroutine s_axis
780780

781-
subroutine s_slip_wall(q_prim_vf, pb, mv, bc_dir, bc_loc, k, l)
781+
pure subroutine s_slip_wall(q_prim_vf, pb, mv, bc_dir, bc_loc, k, l)
782782
#ifdef _CRAYFTN
783783
!DIR$ INLINEALWAYS s_slip_wall
784784
#else
@@ -877,7 +877,7 @@ contains
877877

878878
end subroutine s_slip_wall
879879

880-
subroutine s_no_slip_wall(q_prim_vf, pb, mv, bc_dir, bc_loc, k, l)
880+
pure subroutine s_no_slip_wall(q_prim_vf, pb, mv, bc_dir, bc_loc, k, l)
881881
#ifdef _CRAYFTN
882882
!DIR$ INLINEALWAYS s_no_slip_wall
883883
#else
@@ -1012,7 +1012,7 @@ contains
10121012

10131013
end subroutine s_no_slip_wall
10141014

1015-
subroutine s_dirichlet(q_prim_vf, pb, mv, bc_dir, bc_loc, k, l)
1015+
pure subroutine s_dirichlet(q_prim_vf, pb, mv, bc_dir, bc_loc, k, l)
10161016
#ifdef _CRAYFTN
10171017
!DIR$ INLINEALWAYS s_dirichlet
10181018
#else
@@ -1081,7 +1081,7 @@ contains
10811081

10821082
end subroutine s_dirichlet
10831083

1084-
subroutine s_qbmm_extrapolation(pb, mv, bc_dir, bc_loc, k, l)
1084+
pure subroutine s_qbmm_extrapolation(pb, mv, bc_dir, bc_loc, k, l)
10851085
#ifdef _CRAYFTN
10861086
!DIR$ INLINEALWAYS s_qbmm_extrapolation
10871087
#else
@@ -1157,7 +1157,7 @@ contains
11571157

11581158
end subroutine s_qbmm_extrapolation
11591159

1160-
subroutine s_populate_capillary_buffers(c_divs, bc_type)
1160+
impure subroutine s_populate_capillary_buffers(c_divs, bc_type)
11611161

11621162
type(scalar_field), dimension(num_dims + 1), intent(inout) :: c_divs
11631163
type(integer_field), dimension(1:num_dims, -1:1), intent(in) :: bc_type
@@ -1280,7 +1280,7 @@ contains
12801280
end if
12811281
end subroutine s_populate_capillary_buffers
12821282

1283-
subroutine s_color_function_periodic(c_divs, bc_dir, bc_loc, k, l)
1283+
pure subroutine s_color_function_periodic(c_divs, bc_dir, bc_loc, k, l)
12841284
#ifdef _CRAYFTN
12851285
!DIR$ INLINEALWAYS s_color_function_periodic
12861286
#else
@@ -1338,7 +1338,7 @@ contains
13381338

13391339
end subroutine s_color_function_periodic
13401340

1341-
subroutine s_color_function_reflective(c_divs, bc_dir, bc_loc, k, l)
1341+
pure subroutine s_color_function_reflective(c_divs, bc_dir, bc_loc, k, l)
13421342
#ifdef _CRAYFTN
13431343
!DIR$ INLINEALWAYS s_color_function_reflective
13441344
#else
@@ -1420,7 +1420,7 @@ contains
14201420

14211421
end subroutine s_color_function_reflective
14221422

1423-
subroutine s_color_function_ghost_cell_extrapolation(c_divs, bc_dir, bc_loc, k, l)
1423+
pure subroutine s_color_function_ghost_cell_extrapolation(c_divs, bc_dir, bc_loc, k, l)
14241424
#ifdef _CRAYFTN
14251425
!DIR$ INLINEALWAYS s_color_function_ghost_cell_extrapolation
14261426
#else
@@ -1478,7 +1478,7 @@ contains
14781478

14791479
end subroutine s_color_function_ghost_cell_extrapolation
14801480

1481-
subroutine s_create_mpi_types(bc_type)
1481+
impure subroutine s_create_mpi_types(bc_type)
14821482

14831483
type(integer_field), dimension(1:num_dims, -1:1) :: bc_type
14841484

@@ -1511,7 +1511,7 @@ contains
15111511
#endif
15121512
end subroutine s_create_mpi_types
15131513

1514-
subroutine s_finalize_boundary_common_module()
1514+
impure subroutine s_finalize_boundary_common_module()
15151515

15161516
#ifndef MFC_POST_PROCESS
15171517
if (bc_io) then

src/common/m_checker_common.fpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ contains
2424

2525
!> Checks compatibility of parameters in the input file.
2626
!! Used by all three stages
27-
subroutine s_check_inputs_common
27+
impure subroutine s_check_inputs_common
2828

2929
#ifndef MFC_PRE_PROCESS
3030
call s_check_inputs_time_stepping
@@ -60,7 +60,7 @@ contains
6060

6161
!> Checks constraints on the time-stepping parameters.
6262
!! Called by s_check_inputs_common for simulation and post-processing
63-
subroutine s_check_inputs_time_stepping
63+
impure subroutine s_check_inputs_time_stepping
6464
if (cfl_dt) then
6565
@:PROHIBIT(cfl_target < 0 .or. cfl_target > 1._wp)
6666
@:PROHIBIT(t_stop <= 0)
@@ -76,7 +76,7 @@ contains
7676

7777
!> Checks constraints on the finite difference parameters.
7878
!! Called by s_check_inputs_common for simulation and post-processing
79-
subroutine s_check_inputs_finite_difference
79+
impure subroutine s_check_inputs_finite_difference
8080
@:PROHIBIT(all(fd_order /= (/dflt_int, 1, 2, 4/)), "fd_order must be 1, 2, or 4")
8181
end subroutine s_check_inputs_finite_difference
8282

@@ -85,7 +85,7 @@ contains
8585
#ifndef MFC_SIMULATION
8686

8787
! Checks constraints on the total number of cells
88-
subroutine s_check_total_cells
88+
impure subroutine s_check_total_cells
8989
character(len=5) :: numStr !< for int to string conversion
9090

9191
call s_int_to_str(2**(min(1, m) + min(1, n) + min(1, p))*num_procs, numStr)
@@ -100,7 +100,7 @@ contains
100100

101101
!> Checks constraints on the bubble parameters.
102102
!! Called by s_check_inputs_common for pre-processing and simulation
103-
subroutine s_check_inputs_bubbles_euler
103+
impure subroutine s_check_inputs_bubbles_euler
104104
@:PROHIBIT(bubbles_euler .and. nb < 1, "The Ensemble-Averaged Bubble Model requires nb >= 1")
105105
@:PROHIBIT(bubbles_euler .and. polydisperse .and. (nb == 1), "Polydisperse bubble dynamics requires nb > 1")
106106
@:PROHIBIT(bubbles_euler .and. polydisperse .and. (mod(nb, 2) == 0), "nb must be odd")
@@ -117,7 +117,7 @@ contains
117117

118118
!> Checks constraints on the QBMM and polydisperse bubble parameters.
119119
!! Called by s_check_inputs_common for pre-processing and simulation
120-
subroutine s_check_inputs_qbmm_and_polydisperse
120+
impure subroutine s_check_inputs_qbmm_and_polydisperse
121121
@:PROHIBIT(polydisperse .and. (.not. bubbles_euler), "Polydisperse bubble modeling requires the bubbles_euler flag to be set")
122122
@:PROHIBIT(polydisperse .and. f_is_default(poly_sigma), "Polydisperse bubble modeling requires poly_sigma to be set")
123123
@:PROHIBIT(polydisperse .and. poly_sigma <= 0)
@@ -127,15 +127,15 @@ contains
127127

128128
!> Checks constraints on the adv_n flag.
129129
!! Called by s_check_inputs_common for pre-processing and simulation
130-
subroutine s_check_inputs_adv_n
130+
impure subroutine s_check_inputs_adv_n
131131
@:PROHIBIT(adv_n .and. (.not. bubbles_euler))
132132
@:PROHIBIT(adv_n .and. num_fluids /= 1)
133133
@:PROHIBIT(adv_n .and. qbmm)
134134
end subroutine s_check_inputs_adv_n
135135

136136
!> Checks constraints on the hypoelasticity parameters.
137137
!! Called by s_check_inputs_common for pre-processing and simulation
138-
subroutine s_check_inputs_hypoelasticity
138+
impure subroutine s_check_inputs_hypoelasticity
139139
@:PROHIBIT(hypoelasticity .and. model_eqns /= 2)
140140
#ifdef MFC_SIMULATION
141141
@:PROHIBIT(elasticity .and. fd_order /= 4)
@@ -144,7 +144,7 @@ contains
144144

145145
!> Checks constraints on the hyperelasticity parameters.
146146
!! Called by s_check_inputs_common for pre-processing and simulation
147-
subroutine s_check_inputs_hyperelasticity
147+
impure subroutine s_check_inputs_hyperelasticity
148148
@:PROHIBIT(hyperelasticity .and. model_eqns == 1)
149149
@:PROHIBIT(hyperelasticity .and. model_eqns > 3)
150150
#ifdef MFC_SIMULATION
@@ -154,7 +154,7 @@ contains
154154

155155
!> Checks constraints on the phase change parameters.
156156
!! Called by s_check_inputs_common for pre-processing and simulation
157-
subroutine s_check_inputs_phase_change
157+
impure subroutine s_check_inputs_phase_change
158158
@:PROHIBIT(relax .and. model_eqns /= 3, "phase change requires model_eqns = 3")
159159
@:PROHIBIT(relax .and. relax_model < 0, "relax_model must be in between 0 and 6")
160160
@:PROHIBIT(relax .and. relax_model > 6, "relax_model must be in between 0 and 6")
@@ -180,7 +180,7 @@ contains
180180

181181
!> Checks constraints on dimensionality and the number of cells for the grid.
182182
!! Called by s_check_inputs_common for all three stages
183-
subroutine s_check_inputs_simulation_domain
183+
impure subroutine s_check_inputs_simulation_domain
184184
@:PROHIBIT(m == dflt_int, "m must be set")
185185
@:PROHIBIT(n == dflt_int, "n must be set")
186186
@:PROHIBIT(p == dflt_int, "p must be set")
@@ -193,7 +193,7 @@ contains
193193

194194
!> Checks constraints on model equations and number of fluids in the flow.
195195
!! Called by s_check_inputs_common for all three stages
196-
subroutine s_check_inputs_model_eqns_and_num_fluids
196+
impure subroutine s_check_inputs_model_eqns_and_num_fluids
197197
@:PROHIBIT(all(model_eqns /= (/1, 2, 3, 4/)), "model_eqns must be 1, 2, 3, or 4")
198198
@:PROHIBIT(num_fluids /= dflt_int .and. num_fluids < 1, "num_fluids must be positive")
199199
@:PROHIBIT(model_eqns == 1 .and. num_fluids /= dflt_int, "num_fluids is not supported for model_eqns = 1")
@@ -207,7 +207,7 @@ contains
207207

208208
!> Checks constraints regarding WENO order.
209209
!! Called by s_check_inputs_common for all three stages
210-
subroutine s_check_inputs_weno
210+
impure subroutine s_check_inputs_weno
211211
@:PROHIBIT(all(weno_order /= (/1, 3, 5, 7/)), "weno_order must be 1, 3, 5, or 7")
212212
@:PROHIBIT(m + 1 < weno_order, "m must be at least weno_order - 1")
213213
@:PROHIBIT(n > 0 .and. n + 1 < weno_order, "n must be at least weno_order - 1")
@@ -216,7 +216,7 @@ contains
216216

217217
!> Checks constraints on the boundary conditions in the x-direction.
218218
!! Called by s_check_inputs_common for all three stages
219-
subroutine s_check_inputs_bc
219+
impure subroutine s_check_inputs_bc
220220
logical :: skip_check !< Flag to skip the check when iterating over
221221
!! x, y, and z directions, for special treatment of cylindrical coordinates
222222

@@ -278,7 +278,7 @@ contains
278278

279279
!> Checks constraints on the stiffened equation of state fluids parameters.
280280
!! Called by s_check_inputs_common for all three stages
281-
subroutine s_check_inputs_stiffened_eos
281+
impure subroutine s_check_inputs_stiffened_eos
282282
character(len=5) :: iStr !< for int to string conversion
283283
integer :: bub_fac !< For allowing an extra fluid_pp if there are subgrid bubbles_euler
284284
integer :: i
@@ -315,7 +315,7 @@ contains
315315

316316
!> Checks constraints on the surface tension parameters.
317317
!! Called by s_check_inputs_common for all three stages
318-
subroutine s_check_inputs_surface_tension
318+
impure subroutine s_check_inputs_surface_tension
319319

320320
integer :: i
321321

@@ -345,7 +345,7 @@ contains
345345

346346
!> Checks constraints on the inputs for moving boundaries.
347347
!! Called by s_check_inputs_common for all three stages
348-
subroutine s_check_inputs_moving_bc
348+
impure subroutine s_check_inputs_moving_bc
349349
#:for X, VB2, VB3 in [('x', 'vb2', 'vb3'), ('y', 'vb3', 'vb1'), ('z', 'vb1', 'vb2')]
350350
if (any((/bc_${X}$%vb1, bc_${X}$%vb2, bc_${X}$%vb3/) /= 0._wp)) then
351351
if (bc_${X}$%beg == BC_SLIP_WALL) then
@@ -377,7 +377,7 @@ contains
377377
#:endfor
378378
end subroutine s_check_inputs_moving_bc
379379

380-
subroutine s_check_inputs_mhd
380+
impure subroutine s_check_inputs_mhd
381381
@:PROHIBIT(mhd .and. num_fluids /= 1, "MHD is only available for single-component flows")
382382
@:PROHIBIT(mhd .and. model_eqns /= 2, "MHD is only available for the 5-equation model")
383383

src/common/m_compile_specific.f90

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module m_compile_specific
1414

1515
!> Creates a directory and all its parents if it does not exist
1616
!! @param dir_name Directory path
17-
subroutine s_create_directory(dir_name)
17+
impure subroutine s_create_directory(dir_name)
1818
character(LEN=*), intent(in) :: dir_name
1919

2020
#ifdef _WIN32
@@ -25,7 +25,7 @@ subroutine s_create_directory(dir_name)
2525

2626
end subroutine s_create_directory
2727

28-
subroutine s_delete_file(filepath)
28+
impure subroutine s_delete_file(filepath)
2929
character(LEN=*), intent(in) :: filepath
3030

3131
#ifdef _WIN32
@@ -36,7 +36,7 @@ subroutine s_delete_file(filepath)
3636

3737
end subroutine s_delete_file
3838

39-
subroutine s_delete_directory(dir_name)
39+
impure subroutine s_delete_directory(dir_name)
4040
character(LEN=*), intent(in) :: dir_name
4141

4242
#ifdef _WIN32
@@ -50,7 +50,7 @@ end subroutine s_delete_directory
5050
!> Inquires on the existence of a directory
5151
!! @param fileloc File directory location
5252
!! @param dircheck Switch that indicates if directory exists
53-
subroutine my_inquire(fileloc, dircheck)
53+
impure subroutine my_inquire(fileloc, dircheck)
5454
character(LEN=*), intent(in) :: fileloc
5555
logical, intent(inout) :: dircheck
5656

@@ -62,13 +62,13 @@ subroutine my_inquire(fileloc, dircheck)
6262

6363
end subroutine my_inquire
6464

65-
subroutine s_get_cwd(cwd)
65+
impure subroutine s_get_cwd(cwd)
6666
character(LEN=*), intent(out) :: cwd
6767

6868
call GETCWD(cwd)
6969
end subroutine s_get_cwd
7070

71-
subroutine s_get_basename(dirpath, basename)
71+
impure subroutine s_get_basename(dirpath, basename)
7272
character(LEN=*), intent(in) :: dirpath
7373
character(LEN=*), intent(out) :: basename
7474

src/common/m_delay_file_access.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module m_delay_file_access
1111

1212
contains
1313

14-
subroutine DelayFileAccess(ProcessRank)
14+
impure subroutine DelayFileAccess(ProcessRank)
1515
integer, intent(in) :: ProcessRank
1616

1717
integer :: iDelay, nFileAccessDelayIterations

0 commit comments

Comments
 (0)