Skip to content

Commit

Permalink
feat(InputOutput.f90): Introduce padl, a string manipulation function (
Browse files Browse the repository at this point in the history
…MODFLOW-USGS#1405)

* feat(InputOutput.f90): Introduce padl, a new string manipulation function

* Use a more descriptive name
  • Loading branch information
emorway-usgs authored Oct 17, 2023
1 parent adca281 commit cf01f53
Showing 1 changed file with 17 additions and 1 deletion.
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, str_pad_left, 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 str_pad_left(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 cf01f53

Please sign in to comment.