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

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

Private Member Functions

logical function string_is_integer (string)
 Determines whether a string is an integer or not. More...
 

Detailed Description

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

Currently works only for strings, reals always can be (strips the fractional component) and logicals go to one or zero

Parameters
dataThe data to test
Returns
Logical whether or not the data can be represented as an integer

Definition at line 79 of file conversions.F90.

Member Function/Subroutine Documentation

◆ string_is_integer()

logical function conversions_mod::conv_is_integer::string_is_integer ( character(len=*), intent(in)  string)
private

Determines whether a string is an integer or not.

Parameters
stringThe string to test
Returns
Logical whether or not the string can be represented as an integer

Definition at line 123 of file conversions.F90.

123  character(len=*), intent(in) :: string
124 
125  integer :: integer_value, ierr
126 
127  if (len(trim(string)) .ne. 0) then
128  read(string, '(i10)', iostat=ierr ) integer_value
129  string_is_integer = ierr == 0
130  else
131  string_is_integer=.false.
132  end if

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