How to get gfortran to do INTEGER - LOGIC conversion

According to this , gfortran can do an integer boolean conversion, but I get this error:

if (.not.bDropped.and.(zz_unif01() .lt. (1 - (Test_Dru 1 Error: Operand of .not. operator at (1) is INTEGER(4) 

I know that it would be better to change the code from .not.bDropped to (bDropped.eq.0) , but that would not be easy, because it generated the code.

I tried various flags -std=xxx , but they did not matter.

+6
source share
1 answer

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.

+1
source

Source: https://habr.com/ru/post/887221/


All Articles