encode_bits Subroutine

private pure subroutine encode_bits(bits, padd, code)

Arguments

TypeIntentOptionalAttributesName
integer(kind=I1P), intent(in) :: bits(1:)
integer(kind=I4P), intent(in) :: padd
character, intent(out) :: code

Called by

proc~~encode_bits~~CalledByGraph proc~encode_bits encode_bits proc~b64_encode_r8 b64_encode_R8 proc~b64_encode_r8->proc~encode_bits proc~b64_encode_r4_a b64_encode_R4_a proc~b64_encode_r4_a->proc~encode_bits proc~b64_encode_i2_a b64_encode_I2_a proc~b64_encode_i2_a->proc~encode_bits proc~b64_encode_i8_a b64_encode_I8_a proc~b64_encode_i8_a->proc~encode_bits proc~b64_encode_i4_a b64_encode_I4_a proc~b64_encode_i4_a->proc~encode_bits proc~b64_encode_i1_a b64_encode_I1_a proc~b64_encode_i1_a->proc~encode_bits proc~b64_encode_string_a b64_encode_string_a proc~b64_encode_string_a->proc~encode_bits proc~b64_encode_r16_a b64_encode_R16_a proc~b64_encode_r16_a->proc~encode_bits proc~b64_encode_i8 b64_encode_I8 proc~b64_encode_i8->proc~encode_bits proc~b64_encode_r8_a b64_encode_R8_a proc~b64_encode_r8_a->proc~encode_bits proc~b64_encode_r4 b64_encode_R4 proc~b64_encode_r4->proc~encode_bits proc~b64_encode_i4 b64_encode_I4 proc~b64_encode_i4->proc~encode_bits proc~b64_encode_i2 b64_encode_I2 proc~b64_encode_i2->proc~encode_bits proc~b64_encode_i1 b64_encode_I1 proc~b64_encode_i1->proc~encode_bits proc~b64_encode_string b64_encode_string proc~b64_encode_string->proc~encode_bits proc~b64_encode_r16 b64_encode_R16 proc~b64_encode_r16->proc~encode_bits proc~b64_encode_up b64_encode_up proc~b64_encode_up->proc~b64_encode_r8 proc~b64_encode_up->proc~b64_encode_i8 proc~b64_encode_up->proc~b64_encode_r4 proc~b64_encode_up->proc~b64_encode_i4 proc~b64_encode_up->proc~b64_encode_i2 proc~b64_encode_up->proc~b64_encode_i1 proc~b64_encode_up->proc~b64_encode_string proc~b64_encode_up_a b64_encode_up_a proc~b64_encode_up_a->proc~b64_encode_r4_a proc~b64_encode_up_a->proc~b64_encode_i2_a proc~b64_encode_up_a->proc~b64_encode_i8_a proc~b64_encode_up_a->proc~b64_encode_i4_a proc~b64_encode_up_a->proc~b64_encode_i1_a proc~b64_encode_up_a->proc~b64_encode_string_a proc~b64_encode_up_a->proc~b64_encode_r8_a interface~b64_encode b64_encode interface~b64_encode->proc~b64_encode_r8 interface~b64_encode->proc~b64_encode_r4_a interface~b64_encode->proc~b64_encode_i2_a interface~b64_encode->proc~b64_encode_i8_a interface~b64_encode->proc~b64_encode_i4_a interface~b64_encode->proc~b64_encode_i1_a interface~b64_encode->proc~b64_encode_string_a interface~b64_encode->proc~b64_encode_i8 interface~b64_encode->proc~b64_encode_r8_a interface~b64_encode->proc~b64_encode_r4 interface~b64_encode->proc~b64_encode_i4 interface~b64_encode->proc~b64_encode_i2 interface~b64_encode->proc~b64_encode_i1 interface~b64_encode->proc~b64_encode_string proc~encode_binary_dataarray1_rank1_r4p encode_binary_dataarray1_rank1_R4P proc~encode_binary_dataarray1_rank1_r4p->interface~b64_encode program~volatile_doctest~360 volatile_doctest program~volatile_doctest~360->interface~b64_encode proc~encode_binary_dataarray3_rank3_r8p encode_binary_dataarray3_rank3_R8P proc~encode_binary_dataarray3_rank3_r8p->interface~b64_encode program~volatile_doctest~528 volatile_doctest program~volatile_doctest~528->interface~b64_encode proc~encode_binary_dataarray6_rank1_i1p encode_binary_dataarray6_rank1_I1P proc~encode_binary_dataarray6_rank1_i1p->interface~b64_encode program~volatile_doctest~1085 volatile_doctest program~volatile_doctest~1085->interface~b64_encode program~volatile_doctest~1117 volatile_doctest program~volatile_doctest~1117->interface~b64_encode proc~encode_binary_dataarray1_rank4_i8p encode_binary_dataarray1_rank4_I8P proc~encode_binary_dataarray1_rank4_i8p->interface~b64_encode proc~encode_binary_dataarray1_rank1_i8p encode_binary_dataarray1_rank1_I8P proc~encode_binary_dataarray1_rank1_i8p->interface~b64_encode proc~encode_binary_dataarray3_rank3_r4p encode_binary_dataarray3_rank3_R4P proc~encode_binary_dataarray3_rank3_r4p->interface~b64_encode program~volatile_doctest~361 volatile_doctest program~volatile_doctest~361->interface~b64_encode program~volatile_doctest~529 volatile_doctest program~volatile_doctest~529->interface~b64_encode program~volatile_doctest~907 volatile_doctest program~volatile_doctest~907->interface~b64_encode proc~encode_binary_dataarray1_rank2_i2p encode_binary_dataarray1_rank2_I2P proc~encode_binary_dataarray1_rank2_i2p->interface~b64_encode proc~encode_binary_dataarray6_rank3_r8p encode_binary_dataarray6_rank3_R8P proc~encode_binary_dataarray6_rank3_r8p->interface~b64_encode program~volatile_doctest~918 volatile_doctest program~volatile_doctest~918->interface~b64_encode program~volatile_doctest~1118 volatile_doctest program~volatile_doctest~1118->interface~b64_encode proc~encode_binary_dataarray1_rank4_i4p encode_binary_dataarray1_rank4_I4P proc~encode_binary_dataarray1_rank4_i4p->interface~b64_encode program~volatile_doctest~351 volatile_doctest program~volatile_doctest~351->interface~b64_encode program~volatile_doctest~1097 volatile_doctest program~volatile_doctest~1097->interface~b64_encode proc~encode_binary_dataarray3_rank3_i8p encode_binary_dataarray3_rank3_I8P proc~encode_binary_dataarray3_rank3_i8p->interface~b64_encode program~volatile_doctest~332 volatile_doctest program~volatile_doctest~332->interface~b64_encode program~volatile_doctest~908 volatile_doctest program~volatile_doctest~908->interface~b64_encode program~volatile_doctest~940 volatile_doctest program~volatile_doctest~940->interface~b64_encode proc~encode_binary_dataarray1_rank2_i1p encode_binary_dataarray1_rank2_I1P proc~encode_binary_dataarray1_rank2_i1p->interface~b64_encode proc~encode_binary_dataarray6_rank3_r4p encode_binary_dataarray6_rank3_R4P proc~encode_binary_dataarray6_rank3_r4p->interface~b64_encode program~volatile_doctest~509 volatile_doctest program~volatile_doctest~509->interface~b64_encode program~volatile_doctest~1119 volatile_doctest program~volatile_doctest~1119->interface~b64_encode proc~encode_binary_dataarray1_rank4_i2p encode_binary_dataarray1_rank4_I2P proc~encode_binary_dataarray1_rank4_i2p->interface~b64_encode program~volatile_doctest~352 volatile_doctest program~volatile_doctest~352->interface~b64_encode program~volatile_doctest~520 volatile_doctest program~volatile_doctest~520->interface~b64_encode interface~b64_encode_up b64_encode_up interface~b64_encode_up->proc~b64_encode_up_a interface~b64_encode_up->proc~b64_encode_up_a interface~b64_encode_up->interface~b64_encode_up interface~b64_encode_up->interface~b64_encode_up proc~encode_binary_dataarray3_rank3_i4p encode_binary_dataarray3_rank3_I4P proc~encode_binary_dataarray3_rank3_i4p->interface~b64_encode program~volatile_doctest~333 volatile_doctest program~volatile_doctest~333->interface~b64_encode program~volatile_doctest~941 volatile_doctest program~volatile_doctest~941->interface~b64_encode proc~encode_binary_dataarray1_rank3_r8p encode_binary_dataarray1_rank3_R8P proc~encode_binary_dataarray1_rank3_r8p->interface~b64_encode proc~encode_binary_dataarray6_rank3_i8p encode_binary_dataarray6_rank3_I8P proc~encode_binary_dataarray6_rank3_i8p->interface~b64_encode program~volatile_doctest~343 volatile_doctest program~volatile_doctest~343->interface~b64_encode program~volatile_doctest~510 volatile_doctest program~volatile_doctest~510->interface~b64_encode program~volatile_doctest~542 volatile_doctest program~volatile_doctest~542->interface~b64_encode program~volatile_doctest~920 volatile_doctest program~volatile_doctest~920->interface~b64_encode program~volatile_doctest~1120 volatile_doctest program~volatile_doctest~1120->interface~b64_encode proc~encode_binary_dataarray1_rank4_i1p encode_binary_dataarray1_rank4_I1P proc~encode_binary_dataarray1_rank4_i1p->interface~b64_encode proc~encode_binary_dataarray3_rank3_i2p encode_binary_dataarray3_rank3_I2P proc~encode_binary_dataarray3_rank3_i2p->interface~b64_encode program~volatile_doctest~942 volatile_doctest program~volatile_doctest~942->interface~b64_encode program~volatile_doctest~1110 volatile_doctest program~volatile_doctest~1110->interface~b64_encode proc~encode_binary_dataarray1_rank3_r4p encode_binary_dataarray1_rank3_R4P proc~encode_binary_dataarray1_rank3_r4p->interface~b64_encode proc~encode_binary_dataarray6_rank3_i4p encode_binary_dataarray6_rank3_I4P proc~encode_binary_dataarray6_rank3_i4p->interface~b64_encode program~volatile_doctest~543 volatile_doctest program~volatile_doctest~543->interface~b64_encode program~volatile_doctest~1089 volatile_doctest program~volatile_doctest~1089->interface~b64_encode proc~encode_binary_dataarray1_rank1_i2p encode_binary_dataarray1_rank1_I2P proc~encode_binary_dataarray1_rank1_i2p->interface~b64_encode proc~encode_binary_dataarray3_rank1_r8p encode_binary_dataarray3_rank1_R8P proc~encode_binary_dataarray3_rank1_r8p->interface~b64_encode program~volatile_doctest~522 volatile_doctest program~volatile_doctest~522->interface~b64_encode program~volatile_doctest~1100 volatile_doctest program~volatile_doctest~1100->interface~b64_encode proc~encode_binary_dataarray3_rank3_i1p encode_binary_dataarray3_rank3_I1P proc~encode_binary_dataarray3_rank3_i1p->interface~b64_encode program~volatile_doctest~365 volatile_doctest program~volatile_doctest~365->interface~b64_encode program~volatile_doctest~943 volatile_doctest program~volatile_doctest~943->interface~b64_encode proc~encode_binary_dataarray1_rank3_i8p encode_binary_dataarray1_rank3_I8P proc~encode_binary_dataarray1_rank3_i8p->interface~b64_encode proc~encode_binary_dataarray6_rank3_i2p encode_binary_dataarray6_rank3_I2P proc~encode_binary_dataarray6_rank3_i2p->interface~b64_encode program~volatile_doctest~345 volatile_doctest program~volatile_doctest~345->interface~b64_encode program~volatile_doctest~1090 volatile_doctest program~volatile_doctest~1090->interface~b64_encode program~volatile_doctest~544 volatile_doctest program~volatile_doctest~544->interface~b64_encode proc~encode_binary_dataarray1_rank1_i1p encode_binary_dataarray1_rank1_I1P proc~encode_binary_dataarray1_rank1_i1p->interface~b64_encode proc~encode_binary_dataarray3_rank1_r4p encode_binary_dataarray3_rank1_R4P proc~encode_binary_dataarray3_rank1_r4p->interface~b64_encode program~volatile_doctest~933 volatile_doctest program~volatile_doctest~933->interface~b64_encode proc~encode_binary_dataarray6_rank1_r8p encode_binary_dataarray6_rank1_R8P proc~encode_binary_dataarray6_rank1_r8p->interface~b64_encode program~volatile_doctest~366 volatile_doctest program~volatile_doctest~366->interface~b64_encode program~volatile_doctest~912 volatile_doctest program~volatile_doctest~912->interface~b64_encode program~volatile_doctest~1112 volatile_doctest program~volatile_doctest~1112->interface~b64_encode program~volatile_doctest~923 volatile_doctest program~volatile_doctest~923->interface~b64_encode proc~encode_binary_dataarray1_rank3_i4p encode_binary_dataarray1_rank3_I4P proc~encode_binary_dataarray1_rank3_i4p->interface~b64_encode proc~encode_binary_dataarray6_rank3_i1p encode_binary_dataarray6_rank3_I1P proc~encode_binary_dataarray6_rank3_i1p->interface~b64_encode program~volatile_doctest~545 volatile_doctest program~volatile_doctest~545->interface~b64_encode proc~encode_binary_dataarray1_rank2_r8p encode_binary_dataarray1_rank2_R8P proc~encode_binary_dataarray1_rank2_r8p->interface~b64_encode proc~encode_binary_dataarray3_rank1_i8p encode_binary_dataarray3_rank1_I8P proc~encode_binary_dataarray3_rank1_i8p->interface~b64_encode proc~encode_binary_dataarray6_rank1_r4p encode_binary_dataarray6_rank1_R4P proc~encode_binary_dataarray6_rank1_r4p->interface~b64_encode program~volatile_doctest~367 volatile_doctest program~volatile_doctest~367->interface~b64_encode program~volatile_doctest~535 volatile_doctest program~volatile_doctest~535->interface~b64_encode program~volatile_doctest~913 volatile_doctest program~volatile_doctest~913->interface~b64_encode program~volatile_doctest~1113 volatile_doctest program~volatile_doctest~1113->interface~b64_encode proc~encode_binary_dataarray1_rank1_i4p encode_binary_dataarray1_rank1_I4P proc~encode_binary_dataarray1_rank1_i4p->interface~b64_encode proc~encode_binary_dataarray1_rank3_i2p encode_binary_dataarray1_rank3_I2P proc~encode_binary_dataarray1_rank3_i2p->interface~b64_encode program~volatile_doctest~514 volatile_doctest program~volatile_doctest~514->interface~b64_encode proc~encode_binary_dataarray1_rank2_r4p encode_binary_dataarray1_rank2_R4P proc~encode_binary_dataarray1_rank2_r4p->interface~b64_encode proc~encode_binary_dataarray3_rank1_i4p encode_binary_dataarray3_rank1_I4P proc~encode_binary_dataarray3_rank1_i4p->interface~b64_encode program~volatile_doctest~525 volatile_doctest program~volatile_doctest~525->interface~b64_encode program~volatile_doctest~935 volatile_doctest program~volatile_doctest~935->interface~b64_encode program~volatile_doctest~1103 volatile_doctest program~volatile_doctest~1103->interface~b64_encode proc~encode_binary_dataarray6_rank1_i8p encode_binary_dataarray6_rank1_I8P proc~encode_binary_dataarray6_rank1_i8p->interface~b64_encode program~volatile_doctest~337 volatile_doctest program~volatile_doctest~337->interface~b64_encode program~volatile_doctest~368 volatile_doctest program~volatile_doctest~368->interface~b64_encode proc~encode_binary_dataarray1_rank3_i1p encode_binary_dataarray1_rank3_I1P proc~encode_binary_dataarray1_rank3_i1p->interface~b64_encode program~volatile_doctest~348 volatile_doctest program~volatile_doctest~348->interface~b64_encode program~volatile_doctest~515 volatile_doctest program~volatile_doctest~515->interface~b64_encode proc~encode_binary_dataarray1_rank2_i8p encode_binary_dataarray1_rank2_I8P proc~encode_binary_dataarray1_rank2_i8p->interface~b64_encode proc~encode_binary_dataarray3_rank1_i2p encode_binary_dataarray3_rank1_I2P proc~encode_binary_dataarray3_rank1_i2p->interface~b64_encode proc~encode encode proc~encode->interface~b64_encode program~volatile_doctest~358 volatile_doctest program~volatile_doctest~358->interface~b64_encode program~volatile_doctest~936 volatile_doctest program~volatile_doctest~936->interface~b64_encode program~volatile_doctest~1104 volatile_doctest program~volatile_doctest~1104->interface~b64_encode proc~encode_binary_dataarray6_rank1_i4p encode_binary_dataarray6_rank1_I4P proc~encode_binary_dataarray6_rank1_i4p->interface~b64_encode program~volatile_doctest~338 volatile_doctest program~volatile_doctest~338->interface~b64_encode program~volatile_doctest~537 volatile_doctest program~volatile_doctest~537->interface~b64_encode proc~encode_binary_dataarray1_rank4_r8p encode_binary_dataarray1_rank4_R8P proc~encode_binary_dataarray1_rank4_r8p->interface~b64_encode proc~encode~2 encode proc~encode~2->interface~b64_encode program~volatile_doctest~926 volatile_doctest program~volatile_doctest~926->interface~b64_encode proc~encode_binary_dataarray1_rank1_r8p encode_binary_dataarray1_rank1_R8P proc~encode_binary_dataarray1_rank1_r8p->interface~b64_encode proc~encode_binary_dataarray1_rank2_i4p encode_binary_dataarray1_rank2_I4P proc~encode_binary_dataarray1_rank2_i4p->interface~b64_encode proc~encode_binary_dataarray3_rank1_i1p encode_binary_dataarray3_rank1_I1P proc~encode_binary_dataarray3_rank1_i1p->interface~b64_encode proc~encode_binary_dataarray6_rank1_i2p encode_binary_dataarray6_rank1_I2P proc~encode_binary_dataarray6_rank1_i2p->interface~b64_encode program~volatile_doctest~538 volatile_doctest program~volatile_doctest~538->interface~b64_encode program~volatile_doctest~1084 volatile_doctest program~volatile_doctest~1084->interface~b64_encode proc~encode_binary_dataarray1_rank4_r4p encode_binary_dataarray1_rank4_R4P proc~encode_binary_dataarray1_rank4_r4p->interface~b64_encode program~volatile_doctest~927 volatile_doctest program~volatile_doctest~927->interface~b64_encode program~volatile_doctest~1095 volatile_doctest program~volatile_doctest~1095->interface~b64_encode interface~encode_binary_dataarray encode_binary_dataarray interface~encode_binary_dataarray->proc~encode_binary_dataarray1_rank1_r4p interface~encode_binary_dataarray->proc~encode_binary_dataarray3_rank3_r8p interface~encode_binary_dataarray->proc~encode_binary_dataarray6_rank1_i1p interface~encode_binary_dataarray->proc~encode_binary_dataarray1_rank4_i8p interface~encode_binary_dataarray->proc~encode_binary_dataarray1_rank1_i8p interface~encode_binary_dataarray->proc~encode_binary_dataarray3_rank3_r4p interface~encode_binary_dataarray->proc~encode_binary_dataarray1_rank2_i2p interface~encode_binary_dataarray->proc~encode_binary_dataarray6_rank3_r8p interface~encode_binary_dataarray->proc~encode_binary_dataarray1_rank4_i4p interface~encode_binary_dataarray->proc~encode_binary_dataarray3_rank3_i8p interface~encode_binary_dataarray->proc~encode_binary_dataarray1_rank2_i1p interface~encode_binary_dataarray->proc~encode_binary_dataarray6_rank3_r4p interface~encode_binary_dataarray->proc~encode_binary_dataarray1_rank4_i2p interface~encode_binary_dataarray->proc~encode_binary_dataarray3_rank3_i4p interface~encode_binary_dataarray->proc~encode_binary_dataarray1_rank3_r8p interface~encode_binary_dataarray->proc~encode_binary_dataarray6_rank3_i8p interface~encode_binary_dataarray->proc~encode_binary_dataarray1_rank4_i1p interface~encode_binary_dataarray->proc~encode_binary_dataarray3_rank3_i2p interface~encode_binary_dataarray->proc~encode_binary_dataarray1_rank3_r4p interface~encode_binary_dataarray->proc~encode_binary_dataarray6_rank3_i4p interface~encode_binary_dataarray->proc~encode_binary_dataarray1_rank1_i2p interface~encode_binary_dataarray->proc~encode_binary_dataarray3_rank1_r8p interface~encode_binary_dataarray->proc~encode_binary_dataarray3_rank3_i1p interface~encode_binary_dataarray->proc~encode_binary_dataarray1_rank3_i8p interface~encode_binary_dataarray->proc~encode_binary_dataarray6_rank3_i2p interface~encode_binary_dataarray->proc~encode_binary_dataarray1_rank1_i1p interface~encode_binary_dataarray->proc~encode_binary_dataarray3_rank1_r4p interface~encode_binary_dataarray->proc~encode_binary_dataarray6_rank1_r8p interface~encode_binary_dataarray->proc~encode_binary_dataarray1_rank3_i4p interface~encode_binary_dataarray->proc~encode_binary_dataarray6_rank3_i1p interface~encode_binary_dataarray->proc~encode_binary_dataarray1_rank2_r8p interface~encode_binary_dataarray->proc~encode_binary_dataarray3_rank1_i8p interface~encode_binary_dataarray->proc~encode_binary_dataarray6_rank1_r4p interface~encode_binary_dataarray->proc~encode_binary_dataarray1_rank1_i4p interface~encode_binary_dataarray->proc~encode_binary_dataarray1_rank3_i2p interface~encode_binary_dataarray->proc~encode_binary_dataarray1_rank2_r4p interface~encode_binary_dataarray->proc~encode_binary_dataarray3_rank1_i4p interface~encode_binary_dataarray->proc~encode_binary_dataarray6_rank1_i8p interface~encode_binary_dataarray->proc~encode_binary_dataarray1_rank3_i1p interface~encode_binary_dataarray->proc~encode_binary_dataarray1_rank2_i8p interface~encode_binary_dataarray->proc~encode_binary_dataarray3_rank1_i2p interface~encode_binary_dataarray->proc~encode_binary_dataarray6_rank1_i4p interface~encode_binary_dataarray->proc~encode_binary_dataarray1_rank4_r8p interface~encode_binary_dataarray->proc~encode_binary_dataarray1_rank1_r8p interface~encode_binary_dataarray->proc~encode_binary_dataarray1_rank2_i4p interface~encode_binary_dataarray->proc~encode_binary_dataarray3_rank1_i1p interface~encode_binary_dataarray->proc~encode_binary_dataarray6_rank1_i2p interface~encode_binary_dataarray->proc~encode_binary_dataarray1_rank4_r4p proc~write_dataarray1_rank1_r4p~2 write_dataarray1_rank1_R4P proc~write_dataarray1_rank1_r4p~2->interface~encode_binary_dataarray proc~write_dataarray1_rank3_i1p~2 write_dataarray1_rank3_I1P proc~write_dataarray1_rank3_i1p~2->interface~encode_binary_dataarray proc~write_dataarray1_rank2_i4p~2 write_dataarray1_rank2_I4P proc~write_dataarray1_rank2_i4p~2->interface~encode_binary_dataarray proc~write_dataarray3_rank1_r4p~2 write_dataarray3_rank1_R4P proc~write_dataarray3_rank1_r4p~2->interface~encode_binary_dataarray proc~write_dataarray6_rank1_r4p~2 write_dataarray6_rank1_R4P proc~write_dataarray6_rank1_r4p~2->interface~encode_binary_dataarray proc~write_dataarray6_rank3_i4p~2 write_dataarray6_rank3_I4P proc~write_dataarray6_rank3_i4p~2->interface~encode_binary_dataarray proc~write_dataarray1_rank1_i2p~2 write_dataarray1_rank1_I2P proc~write_dataarray1_rank1_i2p~2->interface~encode_binary_dataarray proc~write_dataarray1_rank3_r8p~2 write_dataarray1_rank3_R8P proc~write_dataarray1_rank3_r8p~2->interface~encode_binary_dataarray proc~write_dataarray1_rank4_i8p~2 write_dataarray1_rank4_I8P proc~write_dataarray1_rank4_i8p~2->interface~encode_binary_dataarray proc~write_dataarray3_rank1_i2p~2 write_dataarray3_rank1_I2P proc~write_dataarray3_rank1_i2p~2->interface~encode_binary_dataarray proc~write_dataarray6_rank1_i2p~2 write_dataarray6_rank1_I2P proc~write_dataarray6_rank1_i2p~2->interface~encode_binary_dataarray proc~write_dataarray1_rank2_r4p~2 write_dataarray1_rank2_R4P proc~write_dataarray1_rank2_r4p~2->interface~encode_binary_dataarray proc~write_dataarray1_rank3_i4p~2 write_dataarray1_rank3_I4P proc~write_dataarray1_rank3_i4p~2->interface~encode_binary_dataarray proc~write_dataarray1_rank4_i1p~2 write_dataarray1_rank4_I1P proc~write_dataarray1_rank4_i1p~2->interface~encode_binary_dataarray proc~write_dataarray3_rank3_r4p~2 write_dataarray3_rank3_R4P proc~write_dataarray3_rank3_r4p~2->interface~encode_binary_dataarray proc~write_dataarray3_rank3_i1p~2 write_dataarray3_rank3_I1P proc~write_dataarray3_rank3_i1p~2->interface~encode_binary_dataarray proc~write_dataarray6_rank3_r4p~2 write_dataarray6_rank3_R4P proc~write_dataarray6_rank3_r4p~2->interface~encode_binary_dataarray proc~write_dataarray1_rank1_i8p~2 write_dataarray1_rank1_I8P proc~write_dataarray1_rank1_i8p~2->interface~encode_binary_dataarray proc~write_dataarray1_rank2_i2p~2 write_dataarray1_rank2_I2P proc~write_dataarray1_rank2_i2p~2->interface~encode_binary_dataarray proc~write_dataarray1_rank4_r8p~2 write_dataarray1_rank4_R8P proc~write_dataarray1_rank4_r8p~2->interface~encode_binary_dataarray proc~write_dataarray3_rank1_i8p~2 write_dataarray3_rank1_I8P proc~write_dataarray3_rank1_i8p~2->interface~encode_binary_dataarray proc~write_dataarray6_rank1_i8p~2 write_dataarray6_rank1_I8P proc~write_dataarray6_rank1_i8p~2->interface~encode_binary_dataarray proc~write_dataarray6_rank3_i2p~2 write_dataarray6_rank3_I2P proc~write_dataarray6_rank3_i2p~2->interface~encode_binary_dataarray proc~write_dataarray1_rank1_i1p~2 write_dataarray1_rank1_I1P proc~write_dataarray1_rank1_i1p~2->interface~encode_binary_dataarray proc~write_dataarray1_rank3_r4p~2 write_dataarray1_rank3_R4P proc~write_dataarray1_rank3_r4p~2->interface~encode_binary_dataarray proc~write_dataarray1_rank4_i4p~2 write_dataarray1_rank4_I4P proc~write_dataarray1_rank4_i4p~2->interface~encode_binary_dataarray proc~write_dataarray3_rank1_i1p~2 write_dataarray3_rank1_I1P proc~write_dataarray3_rank1_i1p~2->interface~encode_binary_dataarray proc~write_dataarray3_rank3_i4p~2 write_dataarray3_rank3_I4P proc~write_dataarray3_rank3_i4p~2->interface~encode_binary_dataarray proc~write_dataarray6_rank1_i1p~2 write_dataarray6_rank1_I1P proc~write_dataarray6_rank1_i1p~2->interface~encode_binary_dataarray proc~write_dataarray1_rank1_r8p~2 write_dataarray1_rank1_R8P proc~write_dataarray1_rank1_r8p~2->interface~encode_binary_dataarray proc~write_dataarray1_rank2_i8p~2 write_dataarray1_rank2_I8P proc~write_dataarray1_rank2_i8p~2->interface~encode_binary_dataarray proc~write_dataarray1_rank3_i2p~2 write_dataarray1_rank3_I2P proc~write_dataarray1_rank3_i2p~2->interface~encode_binary_dataarray proc~write_dataarray3_rank1_r8p~2 write_dataarray3_rank1_R8P proc~write_dataarray3_rank1_r8p~2->interface~encode_binary_dataarray proc~write_dataarray3_rank3_i8p~2 write_dataarray3_rank3_I8P proc~write_dataarray3_rank3_i8p~2->interface~encode_binary_dataarray proc~write_dataarray6_rank1_r8p~2 write_dataarray6_rank1_R8P proc~write_dataarray6_rank1_r8p~2->interface~encode_binary_dataarray proc~write_dataarray6_rank3_i8p~2 write_dataarray6_rank3_I8P proc~write_dataarray6_rank3_i8p~2->interface~encode_binary_dataarray proc~write_dataarray1_rank1_i4p~2 write_dataarray1_rank1_I4P proc~write_dataarray1_rank1_i4p~2->interface~encode_binary_dataarray proc~write_dataarray1_rank2_i1p~2 write_dataarray1_rank2_I1P proc~write_dataarray1_rank2_i1p~2->interface~encode_binary_dataarray proc~write_dataarray1_rank4_r4p~2 write_dataarray1_rank4_R4P proc~write_dataarray1_rank4_r4p~2->interface~encode_binary_dataarray proc~write_dataarray3_rank1_i4p~2 write_dataarray3_rank1_I4P proc~write_dataarray3_rank1_i4p~2->interface~encode_binary_dataarray proc~write_dataarray6_rank1_i4p~2 write_dataarray6_rank1_I4P proc~write_dataarray6_rank1_i4p~2->interface~encode_binary_dataarray proc~write_dataarray6_rank3_i1p~2 write_dataarray6_rank3_I1P proc~write_dataarray6_rank3_i1p~2->interface~encode_binary_dataarray proc~write_dataarray1_rank2_r8p~2 write_dataarray1_rank2_R8P proc~write_dataarray1_rank2_r8p~2->interface~encode_binary_dataarray proc~write_dataarray1_rank3_i8p~2 write_dataarray1_rank3_I8P proc~write_dataarray1_rank3_i8p~2->interface~encode_binary_dataarray proc~write_dataarray1_rank4_i2p~2 write_dataarray1_rank4_I2P proc~write_dataarray1_rank4_i2p~2->interface~encode_binary_dataarray proc~write_dataarray3_rank3_r8p~2 write_dataarray3_rank3_R8P proc~write_dataarray3_rank3_r8p~2->interface~encode_binary_dataarray proc~write_dataarray3_rank3_i2p~2 write_dataarray3_rank3_I2P proc~write_dataarray3_rank3_i2p~2->interface~encode_binary_dataarray proc~write_dataarray6_rank3_r8p~2 write_dataarray6_rank3_R8P proc~write_dataarray6_rank3_r8p~2->interface~encode_binary_dataarray

Contents

Source Code


Source Code

   pure subroutine encode_bits(bits, padd, code)
   !< Encode a bits stream (must be multiple of 24 bits) into base64 charcaters code (of length multiple of 4).
   !<
   !< The bits stream are encoded in chunks of 24 bits as the following example (in little endian order)
   !<```
   !< +--first octet--+-second octet--+--third octet--+
   !< |7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|
   !< +-----------+---+-------+-------+---+-----------+
   !< |5 4 3 2 1 0|5 4 3 2 1 0|5 4 3 2 1 0|5 4 3 2 1 0|
   !< +--1.index--+--2.index--+--3.index--+--4.index--+
   !<```
   !< @note The 4 indexes are stored into 4 elements 8 bits array, thus 2 bits of each array element are not used.
   !<
   !< @note The number of paddings must be computed outside this procedure, into the calling scope.
   !<
   !< @warning This procedure is the backend of encoding, thus it must be never called outside the module.
   integer(I1P), intent(in)  :: bits(1:)  !< Bits to be encoded.
   integer(I4P), intent(in)  :: padd      !< Number of padding characters ('=').
   character(*), intent(out) :: code      !< Characters code.
   integer(I1P)              :: sixb(1:4) !< 6 bits slices (stored into 8 bits integer) of 24 bits input.
   integer(I8P)              :: c         !< Counter.
   integer(I8P)              :: e         !< Counter.
   integer(I8P)              :: Nb        !< Length of bits array.

   Nb=size(bits,dim=1,kind=I8P)
   c = 1_I8P
   do e=1_I8P,Nb,3_I8P ! loop over array elements: 3 bytes (24 bits) scanning
      sixb = 0_I1P
         call mvbits(bits(e  ),2,6,sixb(1),0)
         call mvbits(bits(e  ),0,2,sixb(2),4)
      if (e+1<=Nb) then
         call mvbits(bits(e+1),4,4,sixb(2),0)
         call mvbits(bits(e+1),0,4,sixb(3),2)
      endif
      if (e+2<=Nb) then
         call mvbits(bits(e+2),6,2,sixb(3),0)
         call mvbits(bits(e+2),0,6,sixb(4),0)
      endif
      sixb = sixb + 1_I1P
      code(c  :c  ) = base64(sixb(1):sixb(1))
      code(c+1:c+1) = base64(sixb(2):sixb(2))
      code(c+2:c+2) = base64(sixb(3):sixb(3))
      code(c+3:c+3) = base64(sixb(4):sixb(4))
      c = c + 4_I8P
   enddo
   if (padd>0) code(len(code)-padd+1:)=repeat('=',padd)
   endsubroutine encode_bits