The basic form is,
IF(logical-expression
)
exec-stmt
![]()
If logical-expression
evaluates to .TRUE.
then the
exec-stmt
is executed otherwise control of the program
passes to the next line.
A logical-expression
is often:
expression
![]()
relational-operator
![]()
expression
![]()
For example,
IF (bool_val) A = 3 IF (x .GT. y) GOTO 56 IF (i .NE. 0 .AND. j .EQ. 0) k = 1/(k*j) IF (i /= 0 .AND. j == 0) k = 1/(k*j) ! same
When using real-valued expressions (which are approximate) .EQ. and .NE. have no real meaning.
For more information, click here