pack_vec Subroutine

public pure subroutine pack_vec(n2, n1, v1, v2, ifix)

Select the unfixed elements of v2 and return them in v1.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n2

Number of items in v2.

integer, intent(out) :: n1

Number of items in v1.

real(kind=wp), intent(out) :: v1(n2)

Vector of the unfixed items from v2.

real(kind=wp), intent(in) :: v2(n2)

Vector of the fixed and unfixed items from which the unfixed elements are to be extracted.

integer, intent(in) :: ifix(n2)

Values designating whether the elements of v2 are fixed at their input values or not.


Called by

proc~~pack_vec~~CalledByGraph proc~pack_vec pack_vec proc~odr odr proc~odr->proc~pack_vec 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

Source Code

   pure subroutine pack_vec(n2, n1, v1, v2, ifix)
   !! Select the unfixed elements of `v2` and return them in `v1`.

      integer, intent(in) :: n2
         !! Number of items in `v2`.
      integer, intent(out) :: n1
         !! Number of items in `v1`.
      real(wp), intent(out) :: v1(n2)
         !! Vector of the unfixed items from `v2`.
      real(wp), intent(in) :: v2(n2)
         !! Vector of the fixed and unfixed items from which the unfixed elements are to be extracted.
      integer, intent(in) :: ifix(n2)
         !! Values designating whether the elements of `v2` are fixed at their input values or not.

      ! Local scalars
      integer :: i

      ! Variable definitions (alphabetically)
      !  I:       An indexing variable.

      n1 = 0
      if (ifix(1) >= 0) then
         do i = 1, n2
            if (ifix(i) /= 0) then
               n1 = n1 + 1
               v1(n1) = v2(i)
            end if
         end do
      else
         n1 = n2
         v1 = v2
      end if

   end subroutine pack_vec