ctor_R16P Function

private function ctor_R16P(str, knd) result(n)

The function ctor_R16P converts string to real. This function achieves casting of string to real.

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: str
real(kind=R16P), intent(in) :: knd

Return Value real(kind=R16P)


Called by

proc~~ctor_r16p~~CalledByGraph proc~ctor_r16p ctor_R16P interface~cton cton interface~cton->proc~ctor_r16p

Contents

Source Code


Source Code

  function ctor_R16P(str,knd) result(n)
  !---------------------------------------------------------------------------------------------------------------------------------
  !!The function ctor\_R16P converts string to real. This function achieves casting of string to real.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  implicit none
  character(*), intent(IN):: str   ! String containing input number.
  real(R16P),   intent(IN):: knd   ! Number kind.
  real(R16P)::               n     ! Number returned.
  integer(I4P)::             E_IO  ! Input/Output debug flag.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  read(str,*,iostat=E_IO) n ! Casting of str to n.
  if (E_IO/=0) then
    write(6,'(A)')             'Conversion of string "'//str//'" to real failed'
    write(6,'(A,'//FR16P//')') 'Kind parameter ',knd
    write(6,'(A)')             'Function used "ctor_R16P"'
  endif
  return
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction ctor_R16P