057. Use .true. and .false. for Booleans, not 1 and 0#

topic: Data types

Note

This tip is a draft1.

Use .true. and .false. for Booleans and use the expression

merge(1,0,logical_variable)

if needed. Fortran standards have never specified an equivalence between integers and Booleans.



1

From the perspective of FortranTip Browser, “draft” means that it hasn’t been edited for formatting, hasn’t had corresponding Fortran programs added, the text content hasn’t been enhanced, etc. Draft texts are extracted from the corresponding Tweet using the Twitter API.