MONC
Private Member Functions | List of all members
conversions_mod::conv_is_real Interface Reference

Determines whether a data item can be represented as a real or not. More...

Private Member Functions

logical function string_is_real (string)
 Determines whether a string is a real or not. More...
 

Detailed Description

Determines whether a data item can be represented as a real or not.

Currently works only for strings, integers always can be and logicals go to one or zero

Parameters
dataThe data to test
Returns
Logical whether or not the data can be represented as a real

Definition at line 89 of file conversions.F90.

Member Function/Subroutine Documentation

◆ string_is_real()

logical function conversions_mod::conv_is_real::string_is_real ( character(len=*), intent(in)  string)
private

Determines whether a string is a real or not.

Parameters
stringThe string to test
Returns
Logical whether or not the string can be represented as a real

Definition at line 139 of file conversions.F90.

139  character(len=*), intent(in) :: string
140 
141  integer :: ierr
142  real :: real_value
143 
144  if (len(trim(string)) .ne. 0) then
145  read(string, '(f10.2)', iostat=ierr ) real_value
146  string_is_real = ierr == 0
147  else
148  string_is_real=.false.
149  end if

The documentation for this interface was generated from the following file: