Convert a root method name to the corresponding root_method enum type.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | name |
method name |
the root_method enum type for that method
pure function root_name_to_method(name) result(r) implicit none character(len=*),intent(in) :: name !! method name type(root_method) :: r !! the [[root_method]] enum type for that method integer :: i !! counter character(len=len(name)) :: name_lowercase !! lowercase version of `name` ! convert to lowercase: name_lowercase = lowercase(name) ! find the name in the list: do i = 1, size(set_of_root_methods) if (name_lowercase == set_of_root_methods(i)%name) then r = set_of_root_methods(i) return end if end do ! if the name was not found r = root_method_null end function root_name_to_method