The END IF statement ends the block IF that the IF began and requires the following syntax:
For each block IF statement there must be a corresponding END IF statement in the same program unit. An END IF statement matches if it is at the same IF level as the block IF statement.
IF ( N .GT. 0 )THEN N = N+1 END IF
IF ( N .EQ. 0 ) THEN N = N+1 ELSE N = N-1 END IF