Skip to content

Commit 4ab00f4

Browse files
committed
Condense verbose multi-line comments across codebase
1 parent adc5219 commit 4ab00f4

23 files changed

Lines changed: 80 additions & 197 deletions

src/common/include/macros.fpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919
#ifdef MFC_SIMULATION
2020
#ifdef __NVCOMPILER_GPU_UNIFIED_MEM
2121
block
22-
! Beginning in the 25.3 release, the structure of the cudafor module has been changed slightly. The module now includes, or
23-
! "uses" 3 submodules: cuda_runtime_api, gpu_reductions, and sort. The cudafor functionality has not changed. But for new
24-
! users, or users who have needed to work-around name conflicts in the module, it may be better to use cuda_runtime_api to
25-
! expose interfaces to the CUDA runtime calls described in Chapter 4 of this guide.
22+
! NVIDIA CUDA Fortran 25.3+: uses submodules (cuda_runtime_api, gpu_reductions, sort) See
2623
! https://docs.nvidia.com/hpc-sdk/compilers/cuda-fortran-prog-guide/index.html#fortran-host-modules
2724
#if __NVCOMPILER_MAJOR__ < 25 || (__NVCOMPILER_MAJOR__ == 25 && __NVCOMPILER_MINOR__ < 3)
2825
use cudafor, gpu_sum => sum, gpu_maxval => maxval, gpu_minval => minval

src/common/m_helper_basic.fpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,7 @@ contains
125125
logical, intent(in) :: igr
126126
logical, intent(in) :: ib
127127

128-
! Determining the number of cells that are needed in order to store sufficient boundary conditions data as to iterate the
129-
! solution in the physical computational domain from one time-step iteration to the next one
128+
! Determine ghost cell buffer size for boundary conditions
130129

131130
if (igr) then
132131
buff_size = (igr_order - 1)/2 + 2

src/common/m_mpi_common.fpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,9 +1046,7 @@ contains
10461046
end do
10471047
else
10481048
if (cyl_coord .and. p > 0) then
1049-
! Implement pencil processor blocking if using cylindrical coordinates so that all cells in azimuthal
1050-
! direction are stored on a single processor. This is necessary for efficient application of Fourier filter
1051-
! near axis.
1049+
! Pencil blocking for cylindrical coordinates (Fourier filter near axis)
10521050

10531051
! Initial values of the processor factorization optimization
10541052
num_procs_x = 1

src/common/m_phase_change.fpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,7 @@ contains
144144
! case, MFL cannot be either 0 or 1, so I chose it to be 2
145145
call s_infinite_pt_relaxation_k(j, k, l, 2, pS, p_infpT, q_cons_vf, rhoe, TS)
146146

147-
! check if pTg-equilibrium is required NOTE that NOTHING else needs to be updated OTHER than the individual
148-
! partial densities given the outputs from the pT- and pTg-equilibrium solvers are just p and one of the partial
149-
! masses (pTg- case)
147+
! Check if pTg-equilibrium needed; only partial densities require updating
150148
if ((relax_model == 6) .and. ((q_cons_vf(lp + contxb - 1)%sf(j, k, &
151149
& l) > mixM*rM) .and. (q_cons_vf(vp + contxb - 1)%sf(j, k, &
152150
& l) > mixM*rM)) .and. (pS < pCr) .and. (TS < TCr)) then
@@ -567,8 +565,7 @@ contains
567565
end if
568566
end if
569567
570-
! Defining the correction in terms of an absolute value might not be the best practice. Maybe a good way to do this is to
571-
! partition the partial densities, giving a small percentage of the total reacting density
568+
! TODO: Consider partitioning partial densities instead of absolute-value correction
572569
MCT = 2*mixM
573570
574571
! correcting the partial densities of the reacting fluids. What to do for the nonreacting ones?

src/common/m_variables_conversion.fpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,7 @@ contains
300300
real(wp) :: alpha_K_sum
301301
integer :: i, j !< Generic loop iterators
302302
#ifdef MFC_SIMULATION
303-
! Constraining the partial densities and the volume fractions within their physical bounds to make sure that any mixture
304-
! variables that are derived from them result within the limits that are set by the fluids physical parameters that make up
305-
! the mixture
303+
! Constrain partial densities and volume fractions within physical bounds
306304
if (num_fluids == 1 .and. bubbles_euler) then
307305
rho_K = alpha_rho_K(1)
308306
gamma_K = gammas(1)

src/post_process/m_data_output.fpp

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,10 @@ module m_data_output
2222
& s_write_energy_data_file, s_close_formatted_database_file, s_close_intf_data_file, s_close_energy_data_file, &
2323
& s_finalize_data_output_module
2424

25-
! Including the Silo Fortran interface library that features the subroutines and parameters that are required to write in the
26-
! Silo-HDF5 database format INCLUDE 'silo.inc'
25+
! Include Silo-HDF5 interface library
2726
include 'silo_f9x.inc'
2827

29-
! Generic storage for flow variable(s) that are to be written to formatted database file(s). Note that for 1D simulations,
30-
! q_root_sf is employed to gather the flow variable(s) from all sub-domains on to the root process. If the run is not parallel,
31-
! but serial, then q_root_sf is equal to q_sf.
28+
! Flow variable storage; q_root_sf gathers to rank 0 in 1D parallel runs
3229
real(wp), allocatable, dimension(:,:,:), public :: q_sf
3330
real(wp), allocatable, dimension(:,:,:) :: q_root_sf
3431
real(wp), allocatable, dimension(:,:,:) :: cyl_q_sf
@@ -38,20 +35,15 @@ module m_data_output
3835
real(sp), allocatable, dimension(:,:,:) :: q_root_sf_s
3936
real(sp), allocatable, dimension(:,:,:) :: cyl_q_sf_s
4037

41-
! The spatial and data extents array variables contain information about the minimum and maximum values of the grid and flow
42-
! variable(s), respectively. The purpose of bookkeeping this information is to boost the visualization of the Silo-HDF5 database
43-
! file(s) in VisIt.
38+
! Spatial and data extents for VisIt visualization
4439
real(wp), allocatable, dimension(:,:) :: spatial_extents
4540
real(wp), allocatable, dimension(:,:) :: data_extents
4641

47-
! The size of the ghost zone layer at beginning of each coordinate direction (lo) and at end of each coordinate direction (hi).
48-
! Adding this information to Silo-HDF5 database file(s) is recommended since it supplies VisIt with connectivity information
49-
! between the sub-domains of a parallel data set.
42+
! Ghost zone layer sizes (lo/hi) for subdomain connectivity in VisIt
5043
integer, allocatable, dimension(:) :: lo_offset
5144
integer, allocatable, dimension(:) :: hi_offset
5245

53-
! For Silo-HDF5 database format, this variable is used to keep track of the number of cell-boundaries, for the grid associated
54-
! with the local process, in each of the active coordinate directions.
46+
! Track cell-boundary count per active coordinate direction
5547
integer, allocatable, dimension(:) :: dims
5648

5749
! Locations of various folders in the case's directory tree, associated with the choice of the formatted database format. These
@@ -404,11 +396,7 @@ contains
404396
!> @brief Open (or create) the Silo-HDF5 or Binary formatted database slave and master files for a given time step.
405397
impure subroutine s_open_formatted_database_file(t_step)
406398
407-
! Description: This subroutine opens a new formatted database file, or replaces an old one, and readies it for the data
408-
! storage of the grid and the flow variable(s) associated with the current time-step, t_step. This is performed by all the
409-
! local process(es). The root processor, in addition, must also generate a master formatted database file whose job will be
410-
! to link, and thus combine, the data from all of the local process(es). Note that for the Binary format, this extra task
411-
! that is assigned to the root process is not performed in multidimensions.
399+
! Open/create DB file for current time-step; rank 0 creates master file (Silo only)
412400
413401
! Time-step that is currently being post-processed
414402
integer, intent(in) :: t_step

src/post_process/m_derived_variables.fpp

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,12 @@ contains
4242
!> Computation of parameters, allocation procedures, and/or any other tasks needed to properly setup the module
4343
impure subroutine s_initialize_derived_variables_module
4444

45-
! Allocating the gradient magnitude of the density variable provided that numerical Schlieren function is outputted during
46-
! post-process
45+
! Allocate density gradient magnitude if Schlieren output requested
4746
if (schlieren_wrt) then
4847
allocate (gm_rho_sf(-offset_x%beg:m + offset_x%end, -offset_y%beg:n + offset_y%end, -offset_z%beg:p + offset_z%end))
4948
end if
5049

51-
! Allocating the variables which will store the coefficients of the centered family of finite-difference schemes. Note that
52-
! sufficient space is allocated so that the coefficients up to any chosen order of accuracy may be bookkept. However, if
53-
! higher than fourth-order accuracy coefficients are wanted, the formulae required to compute these coefficients will have
54-
! to be implemented in the subroutine s_compute_finite_difference_coefficients.
50+
! Allocate FD coefficients (up to 4th order; higher orders need extension)
5551

5652
! Allocating centered finite-difference coefficients in x-direction
5753
if (omega_wrt(2) .or. omega_wrt(3) .or. schlieren_wrt .or. liutex_wrt) then
@@ -68,8 +64,7 @@ contains
6864
allocate (fd_coeff_z(-fd_number:fd_number, -offset_z%beg:p + offset_z%end))
6965
end if
7066

71-
! Annotating the dimensionality of the dataset undergoing the post- process. A flag value of 1 indicates that the dataset is
72-
! 3D, while a flag value of 0 indicates that it is not.
67+
! Set flg=1 if 3D, else 0
7368
if (p > 0) then
7469
flg = 1
7570
else
@@ -136,8 +131,7 @@ contains
136131
! Fluid bulk modulus for alternate sound speed
137132
real(wp) :: blkmod1, blkmod2
138133

139-
! Computing speed of sound values from those of pressure, density, specific heat ratio function and the liquid stiffness
140-
! function
134+
! Compute speed of sound from pressure, density, gamma, liquid stiffness
141135
do k = -offset_z%beg, p + offset_z%end
142136
do j = -offset_y%beg, n + offset_y%end
143137
do i = -offset_x%beg, m + offset_x%end
@@ -582,17 +576,13 @@ contains
582576
end do
583577
end if
584578
585-
! Up until now, only the dot product of the gradient of the density field has been calculated and stored in the gradient
586-
! magnitude of density variable. So now we proceed to take the square-root as to complete the desired calculation.
579+
! Finalize Schlieren: take sqrt of accumulated dot product
587580
gm_rho_sf = sqrt(gm_rho_sf)
588581
589-
! Determining the local maximum of the gradient magnitude of density and bookkeeping the result, along with rank of the
590-
! local processor
582+
! Find local max of density gradient magnitude with processor rank
591583
gm_rho_max = (/maxval(gm_rho_sf), real(proc_rank, wp)/)
592584
593-
! Comparing the local maximum gradient magnitude of the density on this processor to the those computed on the remaining
594-
! processors. This allows for the global maximum to be computed and the rank of the processor on which it has occurred to be
595-
! recorded.
585+
! Compute global max density gradient across all processors
596586
if (num_procs > 1) call s_mpi_reduce_maxloc(gm_rho_max)
597587
598588
! Computing Numerical Schlieren Function

src/post_process/m_global_parameters.fpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ module m_global_parameters
8282
integer :: n_start
8383
!> @}
8484

85-
! NOTE: The variables m_root, x_root_cb and x_root_cc contain the grid data of the defragmented computational domain. They are
86-
! only used in 1D. For serial simulations, they are equal to m, x_cb and x_cc, respectively.
85+
! NOTE: m_root, x_root_cb, x_root_cc = defragmented grid (1D only; equals m, x_cb, x_cc in serial)
8786

8887
!> @name Simulation Algorithm Parameters
8988
!> @{
@@ -138,8 +137,7 @@ module m_global_parameters
138137
! Cell Indices for the (local) interior points (O-m, O-n, 0-p). Stands for "InDices With BUFFer".
139138
type(int_bounds_info) :: idwint(1:3)
140139

141-
! Cell Indices for the entire (local) domain. In simulation, this includes the buffer region. idwbuff and idwint are the same
142-
! otherwise. Stands for "InDices With BUFFer".
140+
! Cell indices (InDices With BUFFer): includes buffer in simulation only
143141
type(int_bounds_info) :: idwbuff(1:3)
144142
integer :: num_bc_patches
145143
logical :: bc_io

src/post_process/p_main.fpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ program p_main
6161
exit
6262
end if
6363
else
64-
! Modifies the time-step iterator so that it may reach the final time- step to be post-processed, in the case that this
65-
! one is not originally attainable through constant incrementation from the first time-step. This modification is
66-
! performed upon reaching the final time-step. In case that it is not needed, the post-processor is done and may exit.
64+
! Adjust time-step iterator to reach final step if needed, else exit
6765
if ((t_step_stop - t_step) < t_step_save .and. t_step_stop /= t_step) then
6866
t_step = t_step_stop - t_step_save
6967
else if (t_step == t_step_stop) then

src/pre_process/m_assign_variables.fpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ contains
6666
allocate (alf_sum%sf(0:m, 0:n, 0:p))
6767
end if
6868

69-
! Depending on multicomponent flow model, the appropriate procedure for assignment of the patch mixture or species primitive
70-
! variables to a cell in the domain is targeted by the procedure pointer
69+
! Select procedure pointer based on multicomponent flow model
7170

7271
if (model_eqns == 1) then ! Gamma/pi_inf model
7372
s_assign_patch_primitive_variables => s_assign_patch_mixture_primitive_variables
@@ -258,8 +257,7 @@ contains
258257
#endif
259258
type(scalar_field), dimension(1:sys_size), intent(inout) :: q_prim_vf
260259

261-
! Density, the specific heat ratio function and the liquid stiffness function, respectively, obtained from the combination
262-
! of primitive variables of the current and smoothing patches
260+
! Density, gamma, and liquid stiffness from current and smoothing patches
263261
real(wp) :: rho !< density
264262
real(wp) :: gamma
265263
real(wp) :: lit_gamma !< specific heat ratio
@@ -621,8 +619,7 @@ contains
621619
!> @brief Nullifies the patch primitive variable assignment procedure pointer.
622620
impure subroutine s_finalize_assign_variables_module
623621

624-
! Nullifying procedure pointer to the subroutine assigning either the patch mixture or species primitive variables to a cell
625-
! in the computational domain
622+
! Nullify primitive variable assignment procedure pointer
626623
s_assign_patch_primitive_variables => null()
627624

628625
end subroutine s_finalize_assign_variables_module

0 commit comments

Comments
 (0)