INCLAN: do: Difference between revisions
Jump to navigation
Jump to search
Line 20: | Line 20: | ||
== Examples == | == Examples == | ||
do | '''do''' | ||
if (filename.eq.' ') break | '''if (filename.eq.' ') break''' | ||
. | '''.''' | ||
. | '''.''' | ||
end do | '''end do''' | ||
do i 1 10 | '''do i 1 10''' | ||
print "Iteration $i." | '''print "Iteration $i."''' | ||
end do | '''end do''' | ||
== See also == | == See also == | ||
[[INCLAN: nproc|nproc]] | [[INCLAN: nproc|nproc]] |
Revision as of 13:55, 13 August 2009
Synopsis
do
- ...
end do
do variable start end [step] [parallel [continue]]
- ...
end do
Description
Executes a loop within a macro. Without parameters the loop is executed unconditionally, i.e. until one of the statements break, exit, quit or return is encountered.
do followed by parameters executes a FORTRAN-style do-loop within a macro. The loop counter variable and the integer expressions start, end, and step have the usual meaning. Parallel loops are executed in parallel on nproc processors.
If the keyword continue is present, the program continues immediately with the execution of the next statement after the parallel loop. Otherwise, the next statement after the loop is executed when the parallel loop is finished.
Examples
do if (filename.eq.' ') break . . end do
do i 1 10 print "Iteration $i." end do