Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get gfortran to do INTEGER - LOGICAL conversion

Tags:

gfortran

According to this, gfortran can do integer-logical conversion, but I'm getting 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 it would be better to change the code from .not.bDropped to (bDropped.eq.0), but that would not be simple because it's generated code.

I tried various -std=xxx flags but they made no difference.

like image 468
Mike Dunlavey Avatar asked May 03 '11 18:05

Mike Dunlavey


1 Answers

The last line on the page you linked to reads

However, there is no implicit conversion of INTEGER values in if-statements, [...].

I'd guess that has something to do with it.

Edit: This seems not to be the entire truth. Simply doing l1 = .not. 0 (when l1 is a logical variable) gives the same error you received. So there is no implicit conversion in this case either.

like image 197
eriktous Avatar answered Oct 07 '22 22:10

eriktous