get_cla_list_varying_I2P Subroutine

private subroutine get_cla_list_varying_I2P(self, val, pref)

Get CLA (multiple) value with varying size, integer(I2P).

Type Bound

command_line_argument

Arguments

Type IntentOptional Attributes Name
class(command_line_argument), intent(inout) :: self

CLA data.

integer(kind=I2P), intent(out), allocatable :: val(:)

CLA values.

character(len=*), intent(in), optional :: pref

Prefixing string.


Calls

proc~~get_cla_list_varying_i2p~~CallsGraph proc~get_cla_list_varying_i2p flap_command_line_argument_t::command_line_argument%get_cla_list_varying_I2P cton cton proc~get_cla_list_varying_i2p->cton proc~check_list_size flap_command_line_argument_t::command_line_argument%check_list_size proc~get_cla_list_varying_i2p->proc~check_list_size proc~errored~2 flap_command_line_argument_t::command_line_argument%errored proc~get_cla_list_varying_i2p->proc~errored~2 proc~is_required_passed~2 flap_command_line_argument_t::command_line_argument%is_required_passed proc~get_cla_list_varying_i2p->proc~is_required_passed~2 proc~tokenize flap_utils_m::tokenize proc~get_cla_list_varying_i2p->proc~tokenize proc~check_list_size->proc~errored~2 interface~colorize face::colorize proc~errored~2->interface~colorize proc~print_error_message flap_object_t::object%print_error_message proc~errored~2->proc~print_error_message str str proc~errored~2->str proc~is_required_passed~2->proc~errored~2 proc~colorize_default face::colorize_default interface~colorize->proc~colorize_default proc~color_index face::color_index proc~colorize_default->proc~color_index proc~style_index face::style_index proc~colorize_default->proc~style_index proc~upper face::upper proc~colorize_default->proc~upper

Called by

proc~~get_cla_list_varying_i2p~~CalledByGraph proc~get_cla_list_varying_i2p flap_command_line_argument_t::command_line_argument%get_cla_list_varying_I2P none~get_varying flap_command_line_argument_t::command_line_argument%get_varying none~get_varying->proc~get_cla_list_varying_i2p proc~get_cla_list_varying_char~2 flap_command_line_interface_t::command_line_interface%get_cla_list_varying_char proc~get_cla_list_varying_char~2->none~get_varying proc~get_cla_list_varying_i1p~2 flap_command_line_interface_t::command_line_interface%get_cla_list_varying_I1P proc~get_cla_list_varying_i1p~2->none~get_varying proc~get_cla_list_varying_i2p~2 flap_command_line_interface_t::command_line_interface%get_cla_list_varying_I2P proc~get_cla_list_varying_i2p~2->none~get_varying proc~get_cla_list_varying_i4p~2 flap_command_line_interface_t::command_line_interface%get_cla_list_varying_I4P proc~get_cla_list_varying_i4p~2->none~get_varying proc~get_cla_list_varying_i8p~2 flap_command_line_interface_t::command_line_interface%get_cla_list_varying_I8P proc~get_cla_list_varying_i8p~2->none~get_varying proc~get_cla_list_varying_logical~2 flap_command_line_interface_t::command_line_interface%get_cla_list_varying_logical proc~get_cla_list_varying_logical~2->none~get_varying proc~get_cla_list_varying_r16p~2 flap_command_line_interface_t::command_line_interface%get_cla_list_varying_R16P proc~get_cla_list_varying_r16p~2->none~get_varying proc~get_cla_list_varying_r4p~2 flap_command_line_interface_t::command_line_interface%get_cla_list_varying_R4P proc~get_cla_list_varying_r4p~2->none~get_varying proc~get_cla_list_varying_r8p~2 flap_command_line_interface_t::command_line_interface%get_cla_list_varying_R8P proc~get_cla_list_varying_r8p~2->none~get_varying none~get_varying~2 flap_command_line_interface_t::command_line_interface%get_varying none~get_varying~2->proc~get_cla_list_varying_char~2 none~get_varying~2->proc~get_cla_list_varying_i1p~2 none~get_varying~2->proc~get_cla_list_varying_i2p~2 none~get_varying~2->proc~get_cla_list_varying_i4p~2 none~get_varying~2->proc~get_cla_list_varying_i8p~2 none~get_varying~2->proc~get_cla_list_varying_logical~2 none~get_varying~2->proc~get_cla_list_varying_r4p~2 none~get_varying~2->proc~get_cla_list_varying_r8p~2 program~flap_test_action_store flap_test_action_store program~flap_test_action_store->none~get_varying~2 program~flap_test_basic flap_test_basic program~flap_test_basic->none~get_varying~2

Source Code

  subroutine get_cla_list_varying_I2P(self, val, pref)
  !< Get CLA (multiple) value with varying size, integer(I2P).
  class(command_line_argument), intent(inout) :: self     !< CLA data.
  integer(I2P), allocatable,    intent(out)   :: val(:)   !< CLA values.
  character(*), optional,       intent(in)    :: pref     !< Prefixing string.
  integer(I4P)                                :: Nv       !< Number of values.
  character(len=len(self%val)), allocatable   :: valsV(:) !< String array of values based on self%val.
  character(len=len(self%def)), allocatable   :: valsD(:) !< String array of values based on self%def.
  integer(I4P)                                :: v        !< Values counter.

  if (.not.self%is_required_passed(pref=pref)) return
  if (.not.allocated(self%nargs)) then
    call self%errored(pref=pref, error=ERROR_NO_LIST)
    return
  endif
  if (self%act==action_store) then
    if (self%is_passed) then
      call tokenize(strin=self%val, delimiter=ARGS_SEP, toks=valsV, Nt=Nv)
      if (.not.self%check_list_size(Nv=Nv, val=valsV(1), pref=pref)) return
      allocate(integer(I2P):: val(1:Nv))
      do v=1, Nv
        val(v) = cton(pref=pref, error=self%error, str=trim(adjustl(valsV(v))), knd=1_I2P)
        if (self%error/=0) exit
      enddo
    else ! using default value
      call tokenize(strin=self%def, delimiter=ARGS_SEP, toks=valsD, Nt=Nv)
      if (.not.self%check_list_size(Nv=Nv, val=valsD(1), pref=pref)) return
      allocate(integer(I2P):: val(1:Nv))
      do v=1, Nv
        val(v) = cton(pref=pref, error=self%error, str=trim(adjustl(valsD(v))), knd=1_I2P)
        if (self%error/=0) exit
      enddo
    endif
  endif
  endsubroutine get_cla_list_varying_I2P