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

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

Private Member Functions

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

Detailed Description

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

Currently works only for strings, reals and integers always can be (0=false, otherwise true)

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

Definition at line 100 of file conversions.F90.

Member Function/Subroutine Documentation

◆ string_is_logical()

logical function conversions_mod::conv_is_logical::string_is_logical ( character(len=*), intent(in)  string)
private

Determines whether a string is a logical or not.

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

Definition at line 167 of file conversions.F90.

168  character(len=*), intent(in) :: string
169 
170  string_is_logical = .false.
171  if (trim(adjustl(string)) .eq. "true" .or. trim(adjustl(string)) .eq. "false" .or. &
172  trim(adjustl(string)) .eq. ".true." .or. trim(adjustl(string)) .eq. ".false." .or. &
173  trim(adjustl(string)) .eq. ".true" .or. trim(adjustl(string)) .eq. "true." .or. &
174  trim(adjustl(string)) .eq. ".false" .or. trim(adjustl(string)) .eq. "false.") string_is_logical = .true.

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