Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=I1P), | intent(in) | :: | x(1:,1:,1:) |
function encode_ascii_dataarray1_rank3_I1P(x) result(code)
!< Encode (Base64) a dataarray with 1 components of rank 3 (I1P).
integer(I1P), intent(in) :: x(1:,1:,1:) !< Data variable
character(len=:), allocatable :: code !< Encoded base64 dataarray.
integer(I4P) :: n1 !< Counter.
integer(I4P) :: n2 !< Counter.
integer(I4P) :: n3 !< Counter.
integer(I4P) :: l !< Length
integer(I4P) :: sp !< String pointer
integer(I4P) :: size_n1 !< Dimension 1 size
integer(I4P) :: size_n2 !< Dimension 2 size
integer(I4P) :: size_n3 !< Dimension 3 size
size_n1 = size(x, dim=1)
size_n2 = size(x, dim=2)
size_n3 = size(x, dim=3)
l = DI1P + 1
sp = 0
code = repeat(' ',l*size_n1*size_n2*size_n3)
do n3=1, size(x, dim=3)
do n2=1, size(x, dim=2)
do n1=1, size(x, dim=1)-1
code(sp+1:sp+l) = str(n=x(n1, n2, n3))//' '
sp = sp + l
enddo
code(sp+1:sp+l) = ' '//str(n=x(size(x, dim=1), n2, n3))
sp = sp + l
enddo
enddo
endfunction encode_ascii_dataarray1_rank3_I1P