From 9f3799e650ac07b2ca9ebaf9cd31157d0faf3439 Mon Sep 17 00:00:00 2001 From: Eric Morway Date: Tue, 17 Oct 2023 07:59:24 -0700 Subject: [PATCH] feat(InputOutput.f90): Introduce padl, a new string manipulation function --- src/Utilities/InputOutput.f90 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Utilities/InputOutput.f90 b/src/Utilities/InputOutput.f90 index f81c44b48eb..7f62ee7a89d 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