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 81 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 134 of file conversions.F90.

135  character(len=*), intent(in) :: string
136 
137  integer :: integer_value, ierr
138 
139  if (len(trim(string)) .ne. 0) then
140  read(string, '(i11)', iostat=ierr ) integer_value
141  string_is_integer = ierr == 0
142  else
143  string_is_integer=.false.
144  end if

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