Purpose
The block IF statement is the first statement in an IF construct.
Format
>>-+----------------------+-------------------------------------> '-IF_construct_name--:-' >--IF--(--scalar_logical_expr--)--THEN------------------------->< |
Rules
The block IF statement evaluates a logical expression and executes at most one of the blocks contained within the IF construct.
If the IF_construct_name is specified, it must appear on the END IF statement, and optionally on any ELSE IF or ELSE statements in the IF construct.
Examples
WHICHC: IF (CMD .EQ. 'RETRY') THEN IF (LIMIT .GT. FIVE) THEN ! Nested IF constructs
·
·
·
CALL STOP ELSE CALL RETRY END IF ELSE IF (CMD .EQ. 'STOP') THEN WHICHC CALL STOP ELSE IF (CMD .EQ. 'ABORT') THEN CALL ABORT ELSE WHICHC GO TO 100 END IF WHICHC
Related Information