difix Subroutine

public pure subroutine difix(n, m, ifix, ldifix, t, ldt, tfix, ldtfix)

Uses

  • proc~~difix~~UsesGraph proc~difix difix module~odrpack_kinds odrpack_kinds proc~difix->module~odrpack_kinds iso_fortran_env iso_fortran_env module~odrpack_kinds->iso_fortran_env

Set elements of t to zero according to ifix.

Arguments

Type IntentOptional 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 t is to be set to zero.

integer, intent(in) :: ldifix

The leading dimension of array ifix.

real(kind=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(kind=wp), intent(out) :: tfix(ldtfix,m)

The resulting array.

integer, intent(in) :: ldtfix

The leading dimension of array tfix.


Called by

proc~~difix~~CalledByGraph proc~difix difix proc~devjac devjac proc~devjac->proc~difix proc~dodmn dodmn proc~dodmn->proc~devjac proc~doddrv doddrv proc~doddrv->proc~dodmn proc~dodcnt dodcnt proc~dodcnt->proc~doddrv proc~odr odr proc~odr->proc~dodcnt proc~odr_long_c odr_long_c proc~odr_long_c->proc~odr proc~odr_medium_c odr_medium_c proc~odr_medium_c->proc~odr proc~odr_short_c odr_short_c proc~odr_short_c->proc~odr program~example1 example1 program~example1->proc~odr program~example2 example2 program~example2->proc~odr program~example3 example3 program~example3->proc~odr program~example4 example4 program~example4->proc~odr program~example5 example5 program~example5->proc~odr

Variables

Type Visibility Attributes Name Initial
integer, public :: i
integer, public :: j

Source Code

   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