From fee10ea6680ac7170e95287106f26582f9b956f3 Mon Sep 17 00:00:00 2001 From: Eric Morway Date: Fri, 11 Aug 2023 11:51:21 -0700 Subject: [PATCH] fixes the following comments: https://github.com/MODFLOW-USGS/modflow6/pull/1306#discussion_r1272267932 https://github.com/MODFLOW-USGS/modflow6/pull/1306#discussion_r1272289264 responds to https://github.com/MODFLOW-USGS/modflow6/pull/1306#discussion_r1272267932 --- src/Model/TransportModel/tsp1apt1.f90 | 36 ++++++++------------------- src/Utilities/InputOutput.f90 | 18 +++++++++++++- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/Model/TransportModel/tsp1apt1.f90 b/src/Model/TransportModel/tsp1apt1.f90 index aefff321423..5a6d203db14 100644 --- a/src/Model/TransportModel/tsp1apt1.f90 +++ b/src/Model/TransportModel/tsp1apt1.f90 @@ -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 @@ -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 @@ -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 ! @@ -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 ! @@ -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) diff --git a/src/Utilities/InputOutput.f90 b/src/Utilities/InputOutput.f90 index f81c44b48eb..beedb19d9ce 100644 --- a/src/Utilities/InputOutput.f90 +++ b/src/Utilities/InputOutput.f90 @@ -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, & @@ -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