Get CLA (multiple) value with varying size, real(R16P).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_argument), | intent(inout) | :: | self |
CLA data. |
||
real(kind=R16P), | intent(out), | allocatable | :: | val(:) |
CLA values. |
|
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
subroutine get_cla_list_varying_R16P(self, val, pref) !< Get CLA (multiple) value with varying size, real(R16P). class(command_line_argument), intent(inout) :: self !< CLA data. real(R16P), 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(real(R16P):: val(1:Nv)) do v=1, Nv val(v) = cton(pref=pref, error=self%error, str=trim(adjustl(valsV(v))), knd=1._R16P) 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 if (Nv==1) then if (trim(adjustl(valsD(1)))=='') then if (self%nargs=='+') then call self%errored(pref=pref, error=ERROR_NARGS_INSUFFICIENT) endif return endif endif allocate(real(R16P):: val(1:Nv)) do v=1, Nv val(v) = cton(pref=pref, error=self%error, str=trim(adjustl(valsD(v))), knd=1._R16P) if (self%error/=0) exit enddo endif endif endsubroutine get_cla_list_varying_R16P