Skip to content

Commit

Permalink
chore(gwt1dsp1.f90): clean-up docstrings (MODFLOW-USGS#1431)
Browse files Browse the repository at this point in the history
  • Loading branch information
emorway-usgs authored Nov 7, 2023
1 parent d7babfa commit 68834b1
Showing 1 changed file with 48 additions and 105 deletions.
153 changes: 48 additions & 105 deletions src/Model/GroundWaterTransport/gwt1dsp1.f90
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,9 @@ module GwtDspModule

contains

!> @brief Create a DSP object
!<
subroutine dsp_cr(dspobj, name_model, input_mempath, inunit, iout, fmi)
! ******************************************************************************
! dsp_cr -- Create a new DSP object
! ******************************************************************************
!
! SPECIFICATIONS:
! ------------------------------------------------------------------------------
! -- modules
use KindModule, only: LGP
use MemoryManagerExtModule, only: mem_set_value
Expand All @@ -94,7 +90,6 @@ subroutine dsp_cr(dspobj, name_model, input_mempath, inunit, iout, fmi)
character(len=*), parameter :: fmtdsp = &
"(1x,/1x,'DSP-- DISPERSION PACKAGE, VERSION 1, 1/24/2018', &
&' INPUT READ FROM MEMPATH: ', A, //)"
! ------------------------------------------------------------------------------
!
! -- Create the object
allocate (dspobj)
Expand Down Expand Up @@ -122,21 +117,16 @@ subroutine dsp_cr(dspobj, name_model, input_mempath, inunit, iout, fmi)
return
end subroutine dsp_cr

!> @brief Define DSP object
!<
subroutine dsp_df(this, dis, dspOptions)
! ******************************************************************************
! dsp_df -- Define
! ******************************************************************************
!
! SPECIFICATIONS:
! ------------------------------------------------------------------------------
! -- modules
! -- dummy
class(GwtDspType) :: this
class(DisBaseType), pointer :: dis
type(GwtDspOptionsType), optional, intent(in) :: dspOptions !< the optional DSP options, used when not
!! creating DSP from file
! -- local
! ------------------------------------------------------------------------------
!
! -- Store pointer to dis
this%dis => dis
Expand Down Expand Up @@ -173,13 +163,11 @@ subroutine dsp_df(this, dis, dspOptions)
return
end subroutine dsp_df

!> @brief Add connections to DSP
!!
!! Add connections for extended neighbors to the sparse matrix
!<
subroutine dsp_ac(this, moffset, sparse)
! ******************************************************************************
! dsp_ac -- Add connections for extended neighbors to the sparse matrix
! ******************************************************************************
!
! SPECIFICATIONS:
! ------------------------------------------------------------------------------
! -- modules
use SparseModule, only: sparsematrix
use MemoryManagerModule, only: mem_allocate
Expand All @@ -188,7 +176,6 @@ subroutine dsp_ac(this, moffset, sparse)
integer(I4B), intent(in) :: moffset
type(sparsematrix), intent(inout) :: sparse
! -- local
! ------------------------------------------------------------------------------
!
! -- Add extended neighbors (neighbors of neighbors)
if (this%ixt3d > 0) call this%xt3d%xt3d_ac(moffset, sparse)
Expand All @@ -197,21 +184,18 @@ subroutine dsp_ac(this, moffset, sparse)
return
end subroutine dsp_ac

!> @brief Map DSP connections
!!
!! Map connections and construct iax, jax, and idxglox
!<
subroutine dsp_mc(this, moffset, matrix_sln)
! ******************************************************************************
! dsp_mc -- Map connections and construct iax, jax, and idxglox
! ******************************************************************************
!
! SPECIFICATIONS:
! ------------------------------------------------------------------------------
! -- modules
use MemoryManagerModule, only: mem_allocate
! -- dummy
class(GwtDspType) :: this
integer(I4B), intent(in) :: moffset
class(MatrixBaseType), pointer :: matrix_sln
! -- local
! ------------------------------------------------------------------------------
!
! -- Call xt3d map connections
if (this%ixt3d > 0) call this%xt3d%xt3d_mc(moffset, matrix_sln)
Expand All @@ -220,13 +204,11 @@ subroutine dsp_mc(this, moffset, matrix_sln)
return
end subroutine dsp_mc

!> @brief Allocate and read method for package
!!
!! Method to allocate and read static data for the package.
!<
subroutine dsp_ar(this, ibound, thetam)
! ******************************************************************************
! dsp_ar -- Allocate and Read
! ******************************************************************************
!
! SPECIFICATIONS:
! ------------------------------------------------------------------------------
! -- modules
! -- dummy
class(GwtDspType) :: this
Expand All @@ -237,7 +219,6 @@ subroutine dsp_ar(this, ibound, thetam)
character(len=*), parameter :: fmtdsp = &
"(1x,/1x,'DSP-- DISPERSION PACKAGE, VERSION 1, 1/24/2018', &
&' INPUT READ FROM UNIT ', i0, //)"
! ------------------------------------------------------------------------------
!
! -- dsp pointers to arguments that were passed in
this%ibound => ibound
Expand All @@ -247,19 +228,14 @@ subroutine dsp_ar(this, ibound, thetam)
return
end subroutine dsp_ar

!> @brief Advance method for the package
!<
subroutine dsp_ad(this)
! ******************************************************************************
! dsp_ad -- Advance
! ******************************************************************************
!
! SPECIFICATIONS:
! ------------------------------------------------------------------------------
! -- modules
use TdisModule, only: kstp, kper
! -- dummy
class(GwtDspType) :: this
! -- local
! ------------------------------------------------------------------------------
!
! -- xt3d
! TODO: might consider adding a new mf6 level set pointers method, and
Expand Down Expand Up @@ -289,13 +265,11 @@ subroutine dsp_ad(this)
return
end subroutine dsp_ad

!> @brief Fill coefficient method for package
!!
!! Method to calculate and fill coefficients for the package.
!<
subroutine dsp_fc(this, kiter, nodes, nja, matrix_sln, idxglo, rhs, cnew)
! ******************************************************************************
! dsp_fc -- Calculate coefficients and fill amat and rhs
! ******************************************************************************
!
! SPECIFICATIONS:
! ------------------------------------------------------------------------------
! -- modules
! -- dummy
class(GwtDspType) :: this
Expand All @@ -309,7 +283,6 @@ subroutine dsp_fc(this, kiter, nodes, nja, matrix_sln, idxglo, rhs, cnew)
! -- local
integer(I4B) :: n, m, idiag, idiagm, ipos, isympos, isymcon
real(DP) :: dnm
! ------------------------------------------------------------------------------
!
if (this%ixt3d > 0) then
call this%xt3d%xt3d_fc(kiter, matrix_sln, idxglo, rhs, cnew)
Expand Down Expand Up @@ -342,13 +315,11 @@ subroutine dsp_fc(this, kiter, nodes, nja, matrix_sln, idxglo, rhs, cnew)
return
end subroutine dsp_fc

!> @ brief Calculate flows for package
!!
!! Method to calculate dispersion contribution to flowja
!<
subroutine dsp_cq(this, cnew, flowja)
! ******************************************************************************
! dsp_cq -- Calculate dispersion contribution to flowja
! ******************************************************************************
!
! SPECIFICATIONS:
! ------------------------------------------------------------------------------
! -- modules
! -- dummy
class(GwtDspType) :: this
Expand All @@ -357,7 +328,6 @@ subroutine dsp_cq(this, cnew, flowja)
! -- local
integer(I4B) :: n, m, ipos, isympos
real(DP) :: dnm
! ------------------------------------------------------------------------------
!
! -- Calculate dispersion and add to flowja
if (this%ixt3d > 0) then
Expand All @@ -379,20 +349,17 @@ subroutine dsp_cq(this, cnew, flowja)
return
end subroutine dsp_cq

!> @ brief Allocate scalar variables for package
!!
!! Method to allocate scalar variables for the package.
!<
subroutine allocate_scalars(this)
! ******************************************************************************
! allocate_scalars
! ******************************************************************************
!
! SPECIFICATIONS:
! ------------------------------------------------------------------------------
! -- modules
use MemoryManagerModule, only: mem_allocate
use ConstantsModule, only: DZERO
! -- dummy
class(GwtDspType) :: this
! -- local
! ------------------------------------------------------------------------------
!
! -- allocate scalars in NumericalPackageType
call this%NumericalPackageType%allocate_scalars()
Expand Down Expand Up @@ -435,21 +402,18 @@ subroutine allocate_scalars(this)
return
end subroutine allocate_scalars

!> @ brief Allocate arrays for package
!!
!! Method to allocate arrays for the package.
!<
subroutine allocate_arrays(this, nodes)
! ******************************************************************************
! allocate_arrays
! ******************************************************************************
!
! SPECIFICATIONS:
! ------------------------------------------------------------------------------
! -- modules
use MemoryManagerModule, only: mem_allocate
use ConstantsModule, only: DZERO
! -- dummy
class(GwtDspType) :: this
integer(I4B), intent(in) :: nodes
! -- local
! ------------------------------------------------------------------------------
!
! -- Allocate
call mem_allocate(this%alh, nodes, 'ALH', trim(this%memoryPath))
Expand Down Expand Up @@ -477,21 +441,18 @@ subroutine allocate_arrays(this, nodes)
return
end subroutine allocate_arrays

!> @ brief Deallocate memory
!!
!! Method to deallocate memory for the package.
!<
subroutine dsp_da(this)
! ******************************************************************************
! dsp_da
! ******************************************************************************
!
! SPECIFICATIONS:
! ------------------------------------------------------------------------------
! -- modules
use MemoryManagerModule, only: mem_deallocate
use MemoryManagerExtModule, only: memorylist_remove
use SimVariablesModule, only: idm_context
! -- dummy
class(GwtDspType) :: this
! -- local
! ------------------------------------------------------------------------------
!
! -- Deallocate input memory
call memorylist_remove(this%name_model, 'DSP', idm_context)
Expand Down Expand Up @@ -555,15 +516,13 @@ subroutine log_options(this, found)
write (this%iout, '(4x,a,i0)') 'XT3D formulation [0=INACTIVE, 1=ACTIVE, &
&3=ACTIVE RHS] set to: ', this%ixt3d
write (this%iout, '(1x,a,/)') 'End Setting DSP Options'
! -- Return
return
end subroutine log_options

!> @brief Update simulation mempath options
!<
subroutine source_options(this)
! ******************************************************************************
! source_options -- update simulation mempath options
! ******************************************************************************
!
! SPECIFICATIONS:
! ------------------------------------------------------------------------------
! -- modules
!use KindModule, only: LGP
use MemoryManagerExtModule, only: mem_set_value
Expand All @@ -572,7 +531,6 @@ subroutine source_options(this)
class(GwtDspType) :: this
! -- locals
type(GwtDspParamFoundType) :: found
! ------------------------------------------------------------------------------
!
! -- update defaults with idm sourced values
call mem_set_value(this%ixt3doff, 'XT3D_OFF', this%input_mempath, &
Expand Down Expand Up @@ -630,13 +588,9 @@ subroutine log_griddata(this, found)

end subroutine log_griddata

!> @brief Update DSP simulation data from input mempath
!<
subroutine source_griddata(this)
! ******************************************************************************
! source_griddata -- update dsp simulation data from input mempath
! ******************************************************************************
!
! SPECIFICATIONS:
! ------------------------------------------------------------------------------
! -- modules
use SimModule, only: count_errors, store_error
use MemoryManagerModule, only: mem_reallocate, mem_reassignptr
Expand All @@ -650,7 +604,6 @@ subroutine source_griddata(this)
type(GwtDspParamFoundType) :: found
integer(I4B), dimension(:), pointer, contiguous :: map
! -- formats
! ------------------------------------------------------------------------------
!
! -- set map
map => null()
Expand Down Expand Up @@ -719,13 +672,9 @@ subroutine source_griddata(this)
return
end subroutine source_griddata

!> @brief Calculate dispersion coefficients
!<
subroutine calcdispellipse(this)
! ******************************************************************************
! calcdispellipse -- Calculate dispersion coefficients
! ******************************************************************************
!
! SPECIFICATIONS:
! ------------------------------------------------------------------------------
! -- modules
! -- dummy
class(GwtDspType) :: this
Expand All @@ -736,7 +685,6 @@ subroutine calcdispellipse(this)
real(DP) :: al, at1, at2
real(DP) :: qzoqsquared
real(DP) :: dstar
! ------------------------------------------------------------------------------
!
! -- loop through and calculate dispersion coefficients and angles
nodes = size(this%d11)
Expand Down Expand Up @@ -838,13 +786,9 @@ subroutine calcdispellipse(this)
return
end subroutine calcdispellipse

!> @brief Calculate dispersion coefficients
!<
subroutine calcdispcoef(this)
! ******************************************************************************
! calcdispcoef -- Calculate dispersion coefficients
! ******************************************************************************
!
! SPECIFICATIONS:
! ------------------------------------------------------------------------------
! -- modules
use GwfNpfModule, only: hyeff_calc
! -- dummy
Expand All @@ -858,7 +802,6 @@ subroutine calcdispcoef(this)
real(DP) :: satn, satm, topn, topm, botn, botm
real(DP) :: hwva, cond, cn, cm, denom
real(DP) :: anm, amn, thksatn, thksatm, sill_top, sill_bot, tpn, tpm
! ------------------------------------------------------------------------------
!
! -- set iavgmeth = 1 to use arithmetic averaging for effective dispersion
iavgmeth = 1
Expand Down

0 comments on commit 68834b1

Please sign in to comment.