The last line on the page you linked to is reading
However, there is no implicit conversion of INTEGER values ββin if-statements, [...].
I would suggest that this is somehow related to this.
Edit: This seems to be not the whole truth. Just doing l1 = .not. 0 l1 = .not. 0 (when l1 is a boolean variable) gives the same error you received. Thus, in this case, there is no implicit conversion.
source share