@@ -14,6 +14,7 @@ module m_global_parameters
1414
1515 use m_derived_types
1616 use m_helper_basic
17+
1718 ! $:USE_GPU_MODULE()
1819
1920 implicit none
@@ -26,8 +27,10 @@ module m_global_parameters
2627 character (LEN= path_len) :: case_dir !< Case folder location
2728 logical :: run_time_info !< Run- time output flag
2829 integer :: t_step_old !< Existing IC/ grid folder
30+
2931 ! Computational Domain Parameters
3032 integer :: proc_rank !< Rank of the local processor
33+
3134 !> @name Number of cells in the x- , y- and z- directions, respectively
3235 !> @{
3336 integer :: m, n, p
@@ -57,13 +60,14 @@ module m_global_parameters
5760 !> @{
5861 real (wp), target, allocatable, dimension (:) :: x_cc, y_cc, z_cc
5962 !> @}
60- ! type(bounds_info) :: x_domain, y_domain, z_domain !< Locations of the domain bounds in the x - , y - and z - coordinate directions
63+ ! type(bounds_info) :: x_domain, y_domain, z_domain !<
6164 !> @name Cell- width distributions in the x- , y- and z- directions, respectively
6265 !> @{
6366 real (wp), target, allocatable, dimension (:) :: dx, dy, dz
6467 !> @}
6568
6669 real (wp) :: dt !< Size of the time- step
70+
6771 $:GPU_DECLARE(create= ' [x_cb, y_cb, z_cb, x_cc, y_cc, z_cc, dx, dy, dz, dt, m, n, p]' )
6872
6973 !> @name Starting time- step iteration, stopping time- step iteration and the number of time- step iterations between successive
@@ -81,6 +85,7 @@ module m_global_parameters
8185
8286 logical :: cfl_adap_dt, cfl_const_dt, cfl_dt
8387 integer :: t_step_print !< Number of time- steps between printouts
88+
8489 ! Simulation Algorithm Parameters
8590 integer :: model_eqns !< Multicomponent flow model
8691 #:if MFC_CASE_OPTIMIZATION
@@ -162,7 +167,7 @@ module m_global_parameters
162167 logical :: mixture_err !< Mixture properties correction
163168 logical :: hypoelasticity !< hypoelasticity modeling
164169 logical :: hyperelasticity !< hyperelasticity modeling
165- logical :: int_comp !< THINC interface compression
170+ integer :: int_comp !< Interface compression: 0 = off, 1 = THINC, 2 = MTHINC
166171 real (wp) :: ic_eps !< THINC Epsilon to compress on surface cells
167172 real (wp) :: ic_beta !< THINC Sharpness Parameter
168173 integer :: hyper_model !< hyperelasticity solver algorithm
@@ -206,6 +211,7 @@ module m_global_parameters
206211 integer :: relax_model !< Relaxation model
207212 real (wp) :: palpha_eps !< trigger parameter for the p relaxation procedure, phase change model
208213 real (wp) :: ptgalpha_eps !< trigger parameter for the pTg relaxation procedure, phase change model
214+
209215 $:GPU_DECLARE(create= ' [relax, relax_model, palpha_eps, ptgalpha_eps]' )
210216
211217 integer :: num_bc_patches
@@ -293,7 +299,9 @@ module m_global_parameters
293299
294300 $:GPU_DECLARE(create= ' [Re_size, Re_size_max, Re_idx]' )
295301
296- ! WENO averaging flag: use arithmetic mean or unaltered WENO- reconstructed cell- boundary values
302+ ! The WENO average (WA) flag regulates whether the calculation of any cell- average spatial derivatives is carried out in each
303+ ! cell by utilizing the arithmetic mean of the left and right, WENO- reconstructed, cell- boundary values or simply, the unaltered
304+ ! left and right, WENO- reconstructed, cell- boundary values.
297305 !> @{
298306 real (wp) :: wa_flg
299307 !> @}
@@ -311,24 +319,39 @@ module m_global_parameters
311319
312320 $:GPU_DECLARE(create= ' [dir_idx, dir_flg, dir_idx_tau]' )
313321
322+ !> The number of cells that are necessary to be able to store enough boundary conditions data to march the solution in the
323+ !! physical computational domain to the next time- step.
314324 integer :: buff_size !< Number of ghost cells for boundary condition storage
325+
315326 $:GPU_DECLARE(create= ' [buff_size]' )
316327
317- integer :: shear_num !< Number of shear stress components
318- integer , dimension (3 ) :: shear_indices !< Indices of the stress components that represent shear stress
319- integer :: shear_BC_flip_num !< Number of shear stress components to reflect for boundary conditions
328+ integer :: shear_num !! Number of shear stress components
329+ integer , dimension (3 ) :: shear_indices !< Indices of the stress components that represent shear stress
330+ integer :: shear_BC_flip_num !< Number of shear stress components to reflect for boundary conditions
331+ !> Indices of shear stress components to reflect for boundary conditions. Size: (1 :3 , 1 :shear_BC_flip_num) for (x/ y/ z,
332+ !! [indices])
320333 integer , dimension (3 , 2 ) :: shear_BC_flip_indices !< Shear stress BC reflection indices (1 :3 , 1 :shear_BC_flip_num)
334+
321335 $:GPU_DECLARE(create= ' [shear_num, shear_indices, shear_BC_flip_num, shear_BC_flip_indices]' )
322336
323337 ! END: Simulation Algorithm Parameters
324338
325339 ! Fluids Physical Parameters
326340
341+ !> Database of the physical parameters of each of the fluids that is present in the flow. These include the stiffened gas
342+ !! equation of state parameters, and the Reynolds numbers.
327343 type(physical_parameters), dimension (num_fluids_max) :: fluid_pp !< Stiffened gas EOS parameters and Reynolds numbers per fluid
344+
328345 ! Subgrid Bubble Parameters
329346 type(subgrid_bubble_physical_parameters) :: bub_pp
330- integer :: fd_order !< Finite- difference order for CoM and flow probe derivatives
331- integer :: fd_number !< Finite- difference half- stencil size: MAX (1 , fd_order/ 2 )
347+
348+ !> The order of the finite- difference (fd) approximations of the first- order derivatives that need to be evaluated when the CoM
349+ !! or flow probe data files are to be written at each time step
350+ integer :: fd_order
351+
352+ !> The finite- difference number is given by MAX (1 , fd_order/ 2 ). Essentially, it is a measure of the half- size of the
353+ !! finite- difference stencil for the selected order of accuracy.
354+ integer :: fd_number
332355 $:GPU_DECLARE(create= ' [fd_order, fd_number]' )
333356
334357 logical :: probe_wrt
@@ -352,6 +375,9 @@ module m_global_parameters
352375 type(ib_patch_parameters), dimension (num_patches_max) :: patch_ib !< Immersed boundary patch parameters
353376 type(vec3_dt), allocatable, dimension (:) :: airfoil_grid_u, airfoil_grid_l
354377 integer :: Np
378+ !! Database of the immersed boundary patch parameters for each of the patches employed in the configuration of the initial
379+ !! condition. Note that the maximum allowable number of patches, num_patches_max, may be changed in the module
380+ !! m_derived_types.f90.
355381
356382 $:GPU_DECLARE(create= ' [ib, num_ibs, patch_ib, Np, airfoil_grid_u, airfoil_grid_l]' )
357383 !> @}
@@ -479,7 +505,10 @@ module m_global_parameters
479505 $:GPU_DECLARE(create=' [Bx0]' )
480506
481507 logical :: fft_wrt
508+ !> AMDFlang workaround: keep a dummy logical to avoid a compiler case-optimization bug when a parameter+GPU-kernel conditional
509+ !! is false
482510 logical :: dummy !< AMDFlang workaround for case-optimization + GPU-kernel bug
511+
483512 !> @name Continuum damage model parameters
484513 !> @{!
485514 real(wp) :: tau_star !< Stress threshold for continuum damage modeling
@@ -502,6 +531,7 @@ contains
502531 impure subroutine s_assign_default_values_to_user_inputs
503532
504533 integer :: i, j !< Generic loop iterator
534+
505535 ! Logistics
506536
507537 case_dir = ' .'
@@ -561,7 +591,7 @@ contains
561591 ptgalpha_eps = dflt_real
562592 hypoelasticity = .false.
563593 hyperelasticity = .false.
564- int_comp = .false.
594+ int_comp = 0
565595 ic_eps = dflt_ic_eps
566596 ic_beta = dflt_ic_beta
567597 elasticity = .false.
@@ -837,15 +867,15 @@ contains
837867
838868 end subroutine s_assign_default_values_to_user_inputs
839869
840- !> Initialize the global parameters module
870+ !> The computation of parameters, the allocation of memory, the association of pointers and/or the execution of any other
871+ !! procedures that are necessary to setup the module.
841872 impure subroutine s_initialize_global_parameters_module
842873
843874 integer :: i, j, k
844875 integer :: fac
845876
846877 #:if not MFC_CASE_OPTIMIZATION
847878 ! Determining the degree of the WENO polynomials
848-
849879 if (recon_type == WENO_TYPE) then
850880 weno_polyn = (weno_order - 1)/2
851881 if (teno) then
@@ -863,7 +893,9 @@ contains
863893 $:GPU_UPDATE(device=' [igr, igr_order, igr_iter_solver]' )
864894 #:endif
865895
866- ! Initialize counts: viscous fluids, surface-tension interfaces, curvature interfaces
896+ ! Initializing the number of fluids for which viscous effects will be non-negligible, the number of distinctive material
897+ ! interfaces for which surface tension will be important and also, the number of fluids for which the physical and geometric
898+ ! curvatures of the interfaces will be computed
867899 Re_size = 0
868900 Re_size_max = 0
869901
@@ -894,8 +926,10 @@ contains
894926 E_idx = mom_idx%end + 1
895927
896928 if (igr) then
897- ! IGR: volume fractions after energy (N-1 for N fluids; skipped when num_fluids=1)
898- adv_idx%beg = E_idx + 1 ! Alpha for fluid 1
929+ ! Volume fractions are stored in the indices immediately following the energy equation. IGR tracks a total of
930+ ! (N-1) volume fractions for N fluids, hence the "-1" in adv_idx%end. If num_fluids = 1 then adv_idx%end <
931+ ! adv_idx%beg, which skips all loops over the volume fractions since there is no volume fraction to track
932+ adv_idx%beg = E_idx + 1
899933 adv_idx%end = E_idx + num_fluids - 1
900934 else
901935 ! Volume fractions are stored in the indices immediately following the energy equation. WENO/MUSCL + Riemann
@@ -1029,7 +1063,8 @@ contains
10291063 end if
10301064 end if
10311065
1032- ! Count fluids with non-negligible viscous effects (Re > 0)
1066+ ! Determining the number of fluids for which the shear and the volume Reynolds numbers, e.g. viscous effects, are
1067+ ! important
10331068 do i = 1, num_fluids
10341069 if (fluid_pp(i)%Re(1) > 0) Re_size(1) = Re_size(1) + 1
10351070 if (fluid_pp(i)%Re(2) > 0) Re_size(2) = Re_size(2) + 1
@@ -1157,7 +1192,9 @@ contains
11571192 end do
11581193 end if
11591194
1160- ! Configure WENO averaging flag (arithmetic mean vs. unaltered values)
1195+ ! Configuring the WENO average flag that will be used to regulate whether any spatial derivatives are to computed in each
1196+ ! cell by using the arithmetic mean of left and right, WENO-reconstructed, cell-boundary values or otherwise, the unaltered
1197+ ! left and right, WENO-reconstructed, cell-boundary values
11611198 wa_flg = 0._wp; if (weno_avg) wa_flg = 1._wp
11621199 $:GPU_UPDATE(device=' [wa_flg]' )
11631200
0 commit comments