pack_data_I2_R4 Subroutine

private pure subroutine pack_data_I2_R4(a1, a2, packed)

Arguments

TypeIntentOptionalAttributesName
integer(kind=I2P), intent(in) :: a1(1:)
real(kind=R4P), intent(in) :: a2(1:)
integer(kind=I1P), intent(inout), allocatable:: packed(:)

Called by

proc~~pack_data_i2_r4~3~~CalledByGraph proc~pack_data_i2_r4~3 pack_data_I2_R4 interface~pack_data~3 pack_data interface~pack_data~3->proc~pack_data_i2_r4~3

Contents

Source Code


Source Code

   pure subroutine pack_data_I2_R4(a1, a2, packed)
   !< Pack different kinds of data into single I1P array.
   !<
   !<```fortran
   !< use befor64
   !< use penf
   !< integer(I2P)              :: a1(1)
   !< real(R4P)                 :: a2(1)
   !< integer(I1P), allocatable :: pack(:)
   !< a1(1) = 0
   !< a2(1) = 1
   !< call pack_data(a1=a1, a2=a2, packed=pack)
   !< print *, pack(size(pack, dim=1))
   !<```
   !=> 63 <<<
   integer(I2P),              intent(in)    :: a1(1:)    !< First data stream.
   real(R4P),                 intent(in)    :: a2(1:)    !< Second data stream.
   integer(I1P), allocatable, intent(inout) :: packed(:) !< Packed data into I1P array.
   integer(I1P), allocatable                :: p1(:)     !< Temporary packed data of first stream.
   integer(I1P), allocatable                :: p2(:)     !< Temporary packed data of second stream.

   p1 = transfer(a1,p1)
   p2 = transfer(a2,p2)
   packed = [p1,p2]
   endsubroutine pack_data_I2_R4