function encode_binary_dataarray6_rank3_I4P(u, v, w, x, y, z) result(code)
!< Encode (Base64) a dataarray with 6 components of rank 3 (I4P).
integer(I4P), intent(in) :: u(1:,1:,1:) !< U component.
integer(I4P), intent(in) :: v(1:,1:,1:) !< V component.
integer(I4P), intent(in) :: w(1:,1:,1:) !< W component.
integer(I4P), intent(in) :: x(1:,1:,1:) !< X component.
integer(I4P), intent(in) :: y(1:,1:,1:) !< Y component.
integer(I4P), intent(in) :: z(1:,1:,1:) !< Z component.
character(len=:), allocatable :: code !< Encoded base64 dataarray.
integer(I1P), allocatable :: xyz(:) !< Packed data.
integer(I4P) :: nn1 !< Number of elements along dim 1.
integer(I4P) :: nn2 !< Number of elements along dim 2.
integer(I4P) :: nn3 !< Number of elements along dim 3.
integer(I4P) :: nn !< Number of elements.
integer(I4P) :: n1 !< Counter.
integer(I4P) :: n2 !< Counter.
integer(I4P) :: n3 !< Counter.
nn1 = size(x, dim=1)
nn2 = size(x, dim=2)
nn3 = size(x, dim=3)
nn = nn1*nn2*nn3
xyz = transfer([int(6*nn*BYI4P, I4P), [(((u(n1, n2, n3), v(n1, n2, n3), w(n1, n2, n3), &
x(n1, n2, n3), y(n1, n2, n3), z(n1, n2, n3), n1=1, nn1), &
n2=1, nn2), &
n3=1, nn3)]], xyz)
call b64_encode(n=xyz,code=code)
endfunction encode_binary_dataarray6_rank3_I4P