Skip to content

Commit

Permalink
fixes the following comments: MODFLOW-USGS#1306 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
emorway-usgs committed Sep 14, 2023
1 parent 829a3e3 commit fee10ea
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
36 changes: 10 additions & 26 deletions src/Model/TransportModel/tsp1apt1.f90
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module TspAptModule
use BudgetTermModule, only: BudgetTermType
use TableModule, only: TableType, table_cr
use ObserveModule, only: ObserveType
use InputOutputModule, only: extract_idnum_or_bndname
use InputOutputModule, only: extract_idnum_or_bndname, padl
use BaseDisModule, only: DisBaseType
use MatrixBaseModule

Expand Down Expand Up @@ -804,7 +804,7 @@ subroutine apt_fc_expanded(this, rhs, ia, idxglo, matrix_sln)
integer(I4B) :: iposd, iposoffd
integer(I4B) :: ipossymd, ipossymoffd
real(DP) :: cold
real(DP) :: qbnd, qbndscld
real(DP) :: qbnd, qbnd_scaled
real(DP) :: omega
real(DP) :: rrate
real(DP) :: rhsval
Expand Down Expand Up @@ -859,19 +859,19 @@ subroutine apt_fc_expanded(this, rhs, ia, idxglo, matrix_sln)
qbnd = this%flowbudptr%budterm(this%idxbudgwf)%flow(j)
omega = DZERO
if (qbnd < DZERO) omega = DONE
qbndscld = qbnd * this%eqnsclfac
qbnd_scaled = qbnd * this%eqnsclfac
!
! -- add to apt row
iposd = this%idxdglo(j)
iposoffd = this%idxoffdglo(j)
call matrix_sln%add_value_pos(iposd, omega * qbndscld)
call matrix_sln%add_value_pos(iposoffd, (DONE - omega) * qbndscld)
call matrix_sln%add_value_pos(iposd, omega * qbnd_scaled)
call matrix_sln%add_value_pos(iposoffd, (DONE - omega) * qbnd_scaled)
!
! -- add to gwf row for apt connection
ipossymd = this%idxsymdglo(j)
ipossymoffd = this%idxsymoffdglo(j)
call matrix_sln%add_value_pos(ipossymd, -(DONE - omega) * qbndscld)
call matrix_sln%add_value_pos(ipossymoffd, -omega * qbndscld)
call matrix_sln%add_value_pos(ipossymd, -(DONE - omega) * qbnd_scaled)
call matrix_sln%add_value_pos(ipossymoffd, -omega * qbnd_scaled)
end if
end do
!
Expand All @@ -886,11 +886,11 @@ subroutine apt_fc_expanded(this, rhs, ia, idxglo, matrix_sln)
else
omega = DZERO
end if
qbndscld = qbnd * this%eqnsclfac
qbnd_scaled = qbnd * this%eqnsclfac
iposd = this%idxfjfdglo(j)
iposoffd = this%idxfjfoffdglo(j)
call matrix_sln%add_value_pos(iposd, omega * qbndscld)
call matrix_sln%add_value_pos(iposoffd, (DONE - omega) * qbndscld)
call matrix_sln%add_value_pos(iposd, omega * qbnd_scaled)
call matrix_sln%add_value_pos(iposoffd, (DONE - omega) * qbnd_scaled)
end do
end if
!
Expand Down Expand Up @@ -2028,22 +2028,6 @@ function pak_get_nbudterms(this) result(nbudterms)
nbudterms = 0
end function pak_get_nbudterms

!> @brief Function for string manipulation
!<
function padl(str, width) result(res)
! -- local
character(len=*), intent(in) :: str
integer, intent(in) :: width
! -- Return
character(len=max(len_trim(str), width)) :: res
! ------------------------------------------------------------------------------
res = str
res = adjustr(res)
!
! -- Return
return
end function

!> @brief Set up the budget object that stores advanced package flow terms
!<
subroutine apt_setup_budobj(this)
Expand Down
18 changes: 17 additions & 1 deletion src/Utilities/InputOutput.f90
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module InputOutputModule
UPCASE, URWORD, ULSTLB, UBDSV4, &
ubdsv06, UBDSVB, UCOLNO, ULAPRW, &
ULASAV, ubdsv1, ubdsvc, ubdsvd, UWWORD, &
same_word, get_node, get_ijk, unitinquire, &
same_word, get_node, get_ijk, padl, unitinquire, &
ParseLine, ulaprufw, openfile, &
linear_interpolate, lowcase, &
read_line, &
Expand Down Expand Up @@ -1197,6 +1197,22 @@ subroutine get_ijk(nodenumber, nrow, ncol, nlay, irow, icol, ilay)
!
return
end subroutine get_ijk

!> @brief Function for string manipulation
!<
function padl(str, width) result(res)
! -- local
character(len=*), intent(in) :: str
integer, intent(in) :: width
! -- Return
character(len=max(len_trim(str), width)) :: res
! ------------------------------------------------------------------------------
res = str
res = adjustr(res)
!
! -- Return
return
end function

subroutine get_jk(nodenumber, ncpl, nlay, icpl, ilay)
! Calculate icpl, and ilay from the nodenumber and grid
Expand Down

0 comments on commit fee10ea

Please sign in to comment.