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 91 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 150 of file conversions.F90.

151  character(len=*), intent(in) :: string
152 
153  integer :: ierr
154  real :: real_value
155 
156  if (len(trim(string)) .ne. 0) then
157  read(string, '(f12.2)', iostat=ierr ) real_value
158  string_is_real = ierr == 0
159  else
160  string_is_real=.false.
161  end if

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