Select the unfixed elements of v2
and return them in v1
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n2 |
The number of items in |
||
integer, | intent(out) | :: | n1 |
The number of items in |
||
real(kind=wp), | intent(out) | :: | v1(n2) |
The vector of the unfixed items from |
||
real(kind=wp), | intent(in) | :: | v2(n2) |
The vector of the fixed and unfixed items from which the unfixed elements are to be extracted. |
||
integer, | intent(in) | :: | ifix(n2) |
The values designating whether the elements of |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | i |
pure subroutine dpack(n2, n1, v1, v2, ifix) !! Select the unfixed elements of `v2` and return them in `v1`. ! Routines Called DCOPY ! Date Written 860529 (YYMMDD) ! Revision Date 920304 (YYMMDD) use blas_interfaces, only: dcopy integer, intent(in) :: n2 !! The number of items in `v2`. integer, intent(out) :: n1 !! The number of items in `v1`. real(wp), intent(out) :: v1(n2) !! The vector of the unfixed items from `v2`. real(wp), intent(in) :: v2(n2) !! The vector of the fixed and unfixed items from which the unfixed elements are to be extracted. integer, intent(in) :: ifix(n2) !! The 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. ! IFIX: The values designating whether the elements of V2 are fixed at their input ! values or not. ! N1: The number of items in V1. ! N2: The number of items in V2. ! V1: The vector of the unfixed items from V2. ! V2: The vector of the fixed and unfixed items from which the unfixed elements are ! to be extracted. 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 call dcopy(n2, v2, 1, v1, 1) end if end subroutine dpack