block_copy_2d1d_s Subroutine

private pure subroutine block_copy_2d1d_s(extent_out, extent_in, rows, columns)

Copy a block

Arguments

Type IntentOptional Attributes Name
real(kind=real_4), intent(out), DIMENSION(rows, columns) :: extent_out

output matrix in the form of a 2-d array

real(kind=real_4), intent(in), DIMENSION(:) :: extent_in

input matrix in the form of a 1-d array

integer, intent(in) :: rows

input matrix size input matrix size

integer, intent(in) :: columns

input matrix size input matrix size


Source Code

      PURE SUBROUTINE block_copy_2d1d_s (extent_out, extent_in, &
                                                     rows, columns)
     !! Copy a block

         INTEGER, INTENT(IN) :: rows, columns
        !! input matrix size
        !! input matrix size
         REAL(kind=real_4), DIMENSION(rows, columns), INTENT(OUT) :: extent_out
        !! output matrix in the form of a 2-d array
         REAL(kind=real_4), DIMENSION(:), INTENT(IN)             :: extent_in
        !! input matrix in the form of a 1-d array

!    ---------------------------------------------------------------------------
         extent_out = RESHAPE(extent_in, (/rows, columns/))
      END SUBROUTINE block_copy_2d1d_s