Set elements of t
to zero according to ifix
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n |
The number of rows of data in the array. |
||
integer, | intent(in) | :: | m |
The number of columns of data in the array. |
||
integer, | intent(in) | :: | ifix(ldifix,m) |
The array designating whether an element of |
||
integer, | intent(in) | :: | ldifix |
The leading dimension of array |
||
real(kind=wp), | intent(in) | :: | t(ldt,m) |
The array being set to zero according to the elements of |
||
integer, | intent(in) | :: | ldt |
The leading dimension of array |
||
real(kind=wp), | intent(out) | :: | tfix(ldtfix,m) |
The resulting array. |
||
integer, | intent(in) | :: | ldtfix |
The leading dimension of array |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | i | ||||
integer, | public | :: | j |
pure subroutine difix(n, m, ifix, ldifix, t, ldt, tfix, ldtfix) !! Set elements of `t` to zero according to `ifix`. ! Routines Called (NONE) ! Date Written 910612 (YYMMDD) ! Revision Date 920304 (YYMMDD) use odrpack_kinds, only: zero integer, intent(in) :: n !! The number of rows of data in the array. integer, intent(in) :: m !! The number of columns of data in the array. integer, intent(in) :: ifix(ldifix, m) !! The array designating whether an element of `t` is to be set to zero. integer, intent(in) :: ldifix !! The leading dimension of array `ifix`. real(wp), intent(in) :: t(ldt, m) !! The array being set to zero according to the elements of `ifix`. integer, intent(in) :: ldt !! The leading dimension of array `t`. real(wp), intent(out) :: tfix(ldtfix, m) !! The resulting array. integer, intent(in) :: ldtfix !! The leading dimension of array `tfix`. ! Local scalars integer :: i, j ! Variable Definitions (alphabetically) ! I: An indexing variable. ! IFIX: The array designating whether an element of T is to be set to zero. ! J: an indexing variable. ! LDT: The leading dimension of array T. ! LDIFIX: The leading dimension of array IFIX. ! LDTFIX: The leading dimension of array TFIX. ! M: The number of columns of data in the array. ! N: The number of rows of data in the array. ! T: The array being set to zero according to the elements of IFIX. ! TFIX: The resulting array. if (n == 0 .or. m == 0) return if (ifix(1, 1) >= zero) then if (ldifix >= n) then do j = 1, m do i = 1, n if (ifix(i, j) == 0) then tfix(i, j) = zero else tfix(i, j) = t(i, j) end if end do end do else do j = 1, m if (ifix(1, j) == 0) then do i = 1, n tfix(i, j) = zero end do else do i = 1, n tfix(i, j) = t(i, j) end do end if end do end if end if end subroutine difix