@@ -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,15 @@ 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 !<
64+ !! Locations of the domain bounds in the x- , y- and z- coordinate directions
6165 !> @name Cell- width distributions in the x- , y- and z- directions, respectively
6266 !> @{
6367 real (wp), target, allocatable, dimension (:) :: dx, dy, dz
6468 !> @}
6569
6670 real (wp) :: dt !< Size of the time- step
71+
6772 $:GPU_DECLARE(create= ' [x_cb, y_cb, z_cb, x_cc, y_cc, z_cc, dx, dy, dz, dt, m, n, p]' )
6873
6974 !> @name Starting time- step iteration, stopping time- step iteration and the number of time- step iterations between successive
@@ -81,6 +86,7 @@ module m_global_parameters
8186
8287 logical :: cfl_adap_dt, cfl_const_dt, cfl_dt
8388 integer :: t_step_print !< Number of time- steps between printouts
89+
8490 ! Simulation Algorithm Parameters
8591 integer :: model_eqns !< Multicomponent flow model
8692 #:if MFC_CASE_OPTIMIZATION
@@ -162,7 +168,7 @@ module m_global_parameters
162168 logical :: mixture_err !< Mixture properties correction
163169 logical :: hypoelasticity !< hypoelasticity modeling
164170 logical :: hyperelasticity !< hyperelasticity modeling
165- logical :: int_comp !< THINC interface compression
171+ integer :: int_comp !< Interface compression: 0 = off, 1 = THINC, 2 = MTHINC
166172 real (wp) :: ic_eps !< THINC Epsilon to compress on surface cells
167173 real (wp) :: ic_beta !< THINC Sharpness Parameter
168174 integer :: hyper_model !< hyperelasticity solver algorithm
@@ -206,6 +212,7 @@ module m_global_parameters
206212 integer :: relax_model !< Relaxation model
207213 real (wp) :: palpha_eps !< trigger parameter for the p relaxation procedure, phase change model
208214 real (wp) :: ptgalpha_eps !< trigger parameter for the pTg relaxation procedure, phase change model
215+
209216 $:GPU_DECLARE(create= ' [relax, relax_model, palpha_eps, ptgalpha_eps]' )
210217
211218 integer :: num_bc_patches
@@ -293,7 +300,9 @@ module m_global_parameters
293300
294301 $:GPU_DECLARE(create= ' [Re_size, Re_size_max, Re_idx]' )
295302
296- ! WENO averaging flag: use arithmetic mean or unaltered WENO- reconstructed cell- boundary values
303+ ! The WENO average (WA) flag regulates whether the calculation of any cell- average spatial derivatives is carried out in each
304+ ! cell by utilizing the arithmetic mean of the left and right, WENO- reconstructed, cell- boundary values or simply, the unaltered
305+ ! left and right, WENO- reconstructed, cell- boundary values.
297306 !> @{
298307 real (wp) :: wa_flg
299308 !> @}
@@ -311,24 +320,39 @@ module m_global_parameters
311320
312321 $:GPU_DECLARE(create= ' [dir_idx, dir_flg, dir_idx_tau]' )
313322
323+ !> The number of cells that are necessary to be able to store enough boundary conditions data to march the solution in the
324+ !! physical computational domain to the next time- step.
314325 integer :: buff_size !< Number of ghost cells for boundary condition storage
326+
315327 $:GPU_DECLARE(create= ' [buff_size]' )
316328
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
329+ integer :: shear_num !! Number of shear stress components
330+ integer , dimension (3 ) :: shear_indices !< Indices of the stress components that represent shear stress
331+ integer :: shear_BC_flip_num !< Number of shear stress components to reflect for boundary conditions
332+ !> Indices of shear stress components to reflect for boundary conditions. Size: (1 :3 , 1 :shear_BC_flip_num) for (x/ y/ z,
333+ !! [indices])
320334 integer , dimension (3 , 2 ) :: shear_BC_flip_indices !< Shear stress BC reflection indices (1 :3 , 1 :shear_BC_flip_num)
335+
321336 $:GPU_DECLARE(create= ' [shear_num, shear_indices, shear_BC_flip_num, shear_BC_flip_indices]' )
322337
323338 ! END: Simulation Algorithm Parameters
324339
325340 ! Fluids Physical Parameters
326341
342+ !> Database of the physical parameters of each of the fluids that is present in the flow. These include the stiffened gas
343+ !! equation of state parameters, and the Reynolds numbers.
327344 type(physical_parameters), dimension (num_fluids_max) :: fluid_pp !< Stiffened gas EOS parameters and Reynolds numbers per fluid
345+
328346 ! Subgrid Bubble Parameters
329347 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 )
348+
349+ !> The order of the finite- difference (fd) approximations of the first- order derivatives that need to be evaluated when the CoM
350+ !! or flow probe data files are to be written at each time step
351+ integer :: fd_order
352+
353+ !> The finite- difference number is given by MAX (1 , fd_order/ 2 ). Essentially, it is a measure of the half- size of the
354+ !! finite- difference stencil for the selected order of accuracy.
355+ integer :: fd_number
332356 $:GPU_DECLARE(create= ' [fd_order, fd_number]' )
333357
334358 logical :: probe_wrt
@@ -352,6 +376,9 @@ module m_global_parameters
352376 type(ib_patch_parameters), dimension (num_patches_max) :: patch_ib !< Immersed boundary patch parameters
353377 type(vec3_dt), allocatable, dimension (:) :: airfoil_grid_u, airfoil_grid_l
354378 integer :: Np
379+ !! Database of the immersed boundary patch parameters for each of the patches employed in the configuration of the initial
380+ !! condition. Note that the maximum allowable number of patches, num_patches_max, may be changed in the module
381+ !! m_derived_types.f90.
355382
356383 $:GPU_DECLARE(create= ' [ib, num_ibs, patch_ib, Np, airfoil_grid_u, airfoil_grid_l]' )
357384 !> @}
@@ -479,7 +506,10 @@ module m_global_parameters
479506 $:GPU_DECLARE(create=' [Bx0]' )
480507
481508 logical :: fft_wrt
509+ !> AMDFlang workaround: keep a dummy logical to avoid a compiler case-optimization bug when a parameter+GPU-kernel conditional
510+ !! is false
482511 logical :: dummy !< AMDFlang workaround for case-optimization + GPU-kernel bug
512+
483513 !> @name Continuum damage model parameters
484514 !> @{!
485515 real(wp) :: tau_star !< Stress threshold for continuum damage modeling
@@ -502,6 +532,7 @@ contains
502532 impure subroutine s_assign_default_values_to_user_inputs
503533
504534 integer :: i, j !< Generic loop iterator
535+
505536 ! Logistics
506537
507538 case_dir = ' .'
@@ -561,7 +592,7 @@ contains
561592 ptgalpha_eps = dflt_real
562593 hypoelasticity = .false.
563594 hyperelasticity = .false.
564- int_comp = .false.
595+ int_comp = 0
565596 ic_eps = dflt_ic_eps
566597 ic_beta = dflt_ic_beta
567598 elasticity = .false.
@@ -837,15 +868,15 @@ contains
837868
838869 end subroutine s_assign_default_values_to_user_inputs
839870
840- !> Initialize the global parameters module
871+ !> The computation of parameters, the allocation of memory, the association of pointers and/or the execution of any other
872+ !! procedures that are necessary to setup the module.
841873 impure subroutine s_initialize_global_parameters_module
842874
843875 integer :: i, j, k
844876 integer :: fac
845877
846878 #:if not MFC_CASE_OPTIMIZATION
847879 ! Determining the degree of the WENO polynomials
848-
849880 if (recon_type == WENO_TYPE) then
850881 weno_polyn = (weno_order - 1)/2
851882 if (teno) then
@@ -863,7 +894,9 @@ contains
863894 $:GPU_UPDATE(device=' [igr, igr_order, igr_iter_solver]' )
864895 #:endif
865896
866- ! Initialize counts: viscous fluids, surface-tension interfaces, curvature interfaces
897+ ! Initializing the number of fluids for which viscous effects will be non-negligible, the number of distinctive material
898+ ! interfaces for which surface tension will be important and also, the number of fluids for which the physical and geometric
899+ ! curvatures of the interfaces will be computed
867900 Re_size = 0
868901 Re_size_max = 0
869902
@@ -894,8 +927,10 @@ contains
894927 E_idx = mom_idx%end + 1
895928
896929 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
930+ ! Volume fractions are stored in the indices immediately following the energy equation. IGR tracks a total of
931+ ! (N-1) volume fractions for N fluids, hence the "-1" in adv_idx%end. If num_fluids = 1 then adv_idx%end <
932+ ! adv_idx%beg, which skips all loops over the volume fractions since there is no volume fraction to track
933+ adv_idx%beg = E_idx + 1
899934 adv_idx%end = E_idx + num_fluids - 1
900935 else
901936 ! Volume fractions are stored in the indices immediately following the energy equation. WENO/MUSCL + Riemann
@@ -1029,7 +1064,8 @@ contains
10291064 end if
10301065 end if
10311066
1032- ! Count fluids with non-negligible viscous effects (Re > 0)
1067+ ! Determining the number of fluids for which the shear and the volume Reynolds numbers, e.g. viscous effects, are
1068+ ! important
10331069 do i = 1, num_fluids
10341070 if (fluid_pp(i)%Re(1) > 0) Re_size(1) = Re_size(1) + 1
10351071 if (fluid_pp(i)%Re(2) > 0) Re_size(2) = Re_size(2) + 1
@@ -1157,7 +1193,9 @@ contains
11571193 end do
11581194 end if
11591195
1160- ! Configure WENO averaging flag (arithmetic mean vs. unaltered values)
1196+ ! Configuring the WENO average flag that will be used to regulate whether any spatial derivatives are to computed in each
1197+ ! cell by using the arithmetic mean of left and right, WENO-reconstructed, cell-boundary values or otherwise, the unaltered
1198+ ! left and right, WENO-reconstructed, cell-boundary values
11611199 wa_flg = 0._wp; if (weno_avg) wa_flg = 1._wp
11621200 $:GPU_UPDATE(device=' [wa_flg]' )
11631201
0 commit comments