Set elements of t
to zero according to ifix
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n |
Number of rows of data in the array. |
||
integer, | intent(in) | :: | m |
Number of columns of data in the array. |
||
integer, | intent(in) | :: | ifix(ldifix,m) |
Array designating whether an element of |
||
integer, | intent(in) | :: | ldifix |
Leading dimension of array |
||
real(kind=wp), | intent(in) | :: | t(ldt,m) |
Array being set to zero according to the elements of |
||
integer, | intent(in) | :: | ldt |
Leading dimension of array |
||
real(kind=wp), | intent(out) | :: | tfix(ldtfix,m) |
Resulting array. |
||
integer, | intent(in) | :: | ldtfix |
Leading dimension of array |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | j |
pure subroutine set_ifix(n, m, ifix, ldifix, t, ldt, tfix, ldtfix) !! Set elements of `t` to zero according to `ifix`. use odrpack_kinds, only: zero integer, intent(in) :: n !! Number of rows of data in the array. integer, intent(in) :: m !! Number of columns of data in the array. integer, intent(in) :: ifix(ldifix, m) !! Array designating whether an element of `t` is to be set to zero. integer, intent(in) :: ldifix !! Leading dimension of array `ifix`. real(wp), intent(in) :: t(ldt, m) !! Array being set to zero according to the elements of `ifix`. integer, intent(in) :: ldt !! Leading dimension of array `t`. real(wp), intent(out) :: tfix(ldtfix, m) !! Resulting array. integer, intent(in) :: ldtfix !! Leading dimension of array `tfix`. ! Local scalars integer :: j ! Variable Definitions (alphabetically) ! J: an indexing variable. if (n == 0 .or. m == 0) return if (ifix(1, 1) >= zero) then if (ldifix == n) then where (ifix(:, :) == 0) tfix(1:n, :) = zero else where tfix(1:n, :) = t(1:n, :) end where else do j = 1, m if (ifix(1, j) == 0) then tfix(1:n, j) = zero else tfix(1:n, j) = t(1:n, j) end if end do end if end if end subroutine set_ifix