The simple logical if is an executable statement. It is Fortran's oldest decision making tool. Despite its age, the simple logical if can still be very useful.
The logical if provides a simple decision making construct. It will execute a single statement as long as the expression provided to it evaluates to true.
if ( logical expression ) executable statement
With a simple logical if, you must provide it a logical expression to evaluate. If the expression is false, the program will go to the next line of code. If the expression evaluates as true, the executable statement that follows the logical expression will be performed.
The following is what a Logical IF looks like. Remember that the print statement that follows the logical expression will only be executed by the computer if ldata is greater than or equal to 100.
if (ldata.ge.100) print *,'There are to many data', & ' points'
Written by Jason Wehr : email@example.com and Maintained by John Mahaffy : firstname.lastname@example.org