to_real_R8P Function

private elemental function to_real_R8P(self, kind) result(to_number)

Arguments

Type IntentOptional AttributesName
class(string), intent(in) :: self

The string.

real(kind=R8P), intent(in) :: kind

Mold parameter for kind detection.

Return Value real(kind=R8P)

The number into the string.

Description

Cast string to real (R8P).


Source Code

  elemental function to_real_R8P(self, kind) result(to_number)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< Cast string to real (R8P).
  !---------------------------------------------------------------------------------------------------------------------------------
  class(string), intent(in) :: self      !< The string.
  real(R8P),     intent(in) :: kind      !< Mold parameter for kind detection.
  real(R8P)                 :: to_number !< The number into the string.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  if (allocated(self%raw)) then
    if (self%is_real()) read(self%raw, *) to_number
  endif
  return
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction to_real_R8P