{"id":2929761,"date":"2011-10-09T02:29:48","date_gmt":"2011-10-09T12:29:48","guid":{"rendered":"https:\/\/math.hawaii.edu\/wordpress\/?p=2929761"},"modified":"2013-10-18T01:42:55","modified_gmt":"2013-10-18T11:42:55","slug":"fortran-2","status":"publish","type":"post","link":"https:\/\/math.hawaii.edu\/wordpress\/fortran-2\/","title":{"rendered":"Fortran: Lesson 2"},"content":{"rendered":"\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<h4>\n\t\t\t\t\t\t\t\t\tLesson topics\n\t\t\t\t\t\t\t\t<\/h4>\n\t\t\t\t\t\t\t\t<div style=\"width:290px;float:left;\">\n\t\t\t\t\t\t\t\t\t<a href=\"http:\/\/math.hawaii.edu\/wordpress\/fortran-2\/#logic\">Logical Expressions<\/a><br \/>\n\t\t\t\t\t\t\t\t\t<a href=\"http:\/\/math.hawaii.edu\/wordpress\/fortran-2\/#if\">If ... Then ... Else<\/a><br \/>\n\t\t\t\t\t\t\t\t\t<a href=\"http:\/\/math.hawaii.edu\/wordpress\/fortran-2\/#stop\">Stop<\/a><br \/>\n\t\t\t\t\t\t\t\t\t<a href=\"http:\/\/math.hawaii.edu\/wordpress\/fortran-2\/#labels\">Labels<\/a><br \/>\n\t\t\t\t\t\t\t\t<\/div>\n\n\t\t\t\t\t\t\t\t<div style=\"width:290px;float:left;\">\n\t\t\t\t\t\t\t\t\t<a href=\"http:\/\/math.hawaii.edu\/wordpress\/fortran-2\/#labels\">Go To<\/a><br \/>\n\t\t\t\t\t\t\t\t\t<a href=\"http:\/\/math.hawaii.edu\/wordpress\/fortran-2\/#char\">Character Variables<\/a><br \/>\n\t\t\t\t\t\t\t\t\t<a href=\"http:\/\/math.hawaii.edu\/wordpress\/fortran-2\/#do\">Do Loops<\/a><br \/>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<div class=\"clearer\"><\/div>\n\t\t\t\t\t\t\t\t<br \/>\n\n\t\t\t\t\t\t\t\t<div style=\"width:290px;float:left;\">\n\t\t\t\t\t\t\t\t\t<h5>\n\t\t\t\t\t\t\t\t\t\tView Demos\n\t\t\t\t\t\t\t\t\t<\/h5>\n\t\t\t\t\t\t\t\t\t<a href=\"http:\/\/math.hawaii.edu\/wordpress\/fortran-2\/?demo=1\"># 1<\/a>\n\t\t\t\t\t\t\t\t\t<a href=\"http:\/\/math.hawaii.edu\/wordpress\/fortran-2\/?demo=2\"># 2<\/a>\n\t\t\t\t\t\t\t\t\t<a href=\"http:\/\/math.hawaii.edu\/wordpress\/fortran-2\/?demo=3\"># 3<\/a>\n\t\t\t\t\t\t\t\t\t<a href=\"http:\/\/math.hawaii.edu\/wordpress\/fortran-2\/?demo=4\"># 4<\/a>\n\t\t\t\t\t\t\t\t\t<a href=\"http:\/\/math.hawaii.edu\/wordpress\/fortran-2\/?demo=5\"># 5<\/a>\n\t\t\t\t\t\t\t\t\t<a href=\"http:\/\/math.hawaii.edu\/wordpress\/fortran-2\/?demo=6\"># 6<\/a>\n\t\t\t\t\t\t\t\t\t<a href=\"http:\/\/math.hawaii.edu\/wordpress\/fortran-2\/?demo=7\"># 7<\/a>\n\t\t\t\t\t\t\t\t\t<a href=\"http:\/\/math.hawaii.edu\/wordpress\/fortran-2\/?demo=8\"># 8<\/a>\n\t\t\t\t\t\t\t\t\t<a href=\"http:\/\/math.hawaii.edu\/wordpress\/fortran-2\/?demo=9\"># 9<\/a>\n\t\t\t\t\t\t\t\t\t<a href=\"http:\/\/math.hawaii.edu\/wordpress\/fortran-2\/?demo=10\"># 10<\/a><br \/>\n\t\t\t\t\t\t\t\t<\/div>\n\n\t\t\t\t\t\t\t\t<div style=\"width:290px;float:left;\">\n\t\t\t\t\t\t\t\t\t<h5>\n\t\t\t\t\t\t\t\t\t\tDownload Demos\n\t\t\t\t\t\t\t\t\t<\/h5>\n\t\t\t\t\t\t\t\t\t<a href=\"http:\/\/math.hawaii.edu\/lab\/197\/fortran\/demo2-1.f\"># 1<\/a>\n\t\t\t\t\t\t\t\t\t<a href=\"http:\/\/math.hawaii.edu\/lab\/197\/fortran\/demo2-2.f\"># 2<\/a>\n\t\t\t\t\t\t\t\t\t<a href=\"http:\/\/math.hawaii.edu\/lab\/197\/fortran\/demo2-3.f\"># 3<\/a>\n\t\t\t\t\t\t\t\t\t<a href=\"http:\/\/math.hawaii.edu\/lab\/197\/fortran\/demo2-4.f\"># 4<\/a>\n\t\t\t\t\t\t\t\t\t<a href=\"http:\/\/math.hawaii.edu\/lab\/197\/fortran\/demo2-5.f\"># 5<\/a>\n\t\t\t\t\t\t\t\t\t<a href=\"http:\/\/math.hawaii.edu\/lab\/197\/fortran\/demo2-6.f\"># 6<\/a>\n\t\t\t\t\t\t\t\t\t<a href=\"http:\/\/math.hawaii.edu\/lab\/197\/fortran\/demo2-7.f\"># 7<\/a>\n\t\t\t\t\t\t\t\t\t<a href=\"http:\/\/math.hawaii.edu\/lab\/197\/fortran\/demo2-8.f\"># 8<\/a>\n\t\t\t\t\t\t\t\t\t<a href=\"http:\/\/math.hawaii.edu\/lab\/197\/fortran\/demo2-9.f\"># 9<\/a>\n\t\t\t\t\t\t\t\t\t<a href=\"http:\/\/math.hawaii.edu\/lab\/197\/fortran\/demo2-10.f\"># 10<\/a><br \/>\n\t\t\t\t\t\t\t\t<\/div>\n\n\t\t\t\t\t\t\t\t<div class=\"clearer\"><\/div>\n\t\t\t\t\t\t\t\t<br \/>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\tWe look at more of the commonly used features and commands of Fortran.\n\t\t\t\t\t\t\t\t<\/p>\n\n\t\t\t\t\t\t\t\t<h3><a id=\"logic\"><\/a>Logical Expressions<\/h3>\n\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\tA <i>logical expression<\/i> is a relation between variables or expressions that can have a value of TRUE or FALSE. Such expressions are used in \"if \u00d6 then\" constructions and in loops, when testing whether to execute certain steps of a program. Relations and connectives appearing in logical expressions are listed in the following table; you will see how some of these are used in later examples.\n\t\t\t\t\t\t\t\t<\/p>\n\t\t\t\t\t\t\t\t<table>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td><b>Relation\/Connective&#160;&#160;<\/b><\/td>\n\t\t\t\t\t\t\t\t\t<td><b>Meaning<\/b><\/td>\n\t\t\t\t\t\t\t\t<\/tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>.lt.<\/td>\n\t\t\t\t\t\t\t\t\t<td>less than<\/td>\n\t\t\t\t\t\t\t\t<\/tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>.gt.<\/td>\n\t\t\t\t\t\t\t\t\t<td>greater than<\/td>\n\t\t\t\t\t\t\t\t<\/tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>.le.<\/td>\n\t\t\t\t\t\t\t\t\t<td>less than or equal to<\/td>\n\t\t\t\t\t\t\t\t<\/tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>.ge.<\/td>\n\t\t\t\t\t\t\t\t\t<td>greater than or equal to<\/td>\n\t\t\t\t\t\t\t\t<\/tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>.eq.<\/td>\n\t\t\t\t\t\t\t\t\t<td>equals<\/td>\n\t\t\t\t\t\t\t\t<\/tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>.ne.<\/td>\n\t\t\t\t\t\t\t\t\t<td>not equal to<\/td>\n\t\t\t\t\t\t\t\t<\/tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>.and.<\/td>\n\t\t\t\t\t\t\t\t\t<td>and<\/td>\n\t\t\t\t\t\t\t\t<\/tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>.or.<\/td>\n\t\t\t\t\t\t\t\t\t<td>or<\/td>\n\t\t\t\t\t\t\t\t<\/tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>.not.<\/td>\n\t\t\t\t\t\t\t\t\t<td>not<\/td>\n\t\t\t\t\t\t\t\t<\/tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>.xor.<\/td>\n\t\t\t\t\t\t\t\t\t<td>\"exclusive\" or (i.e., only one is true)<\/td>\n\t\t\t\t\t\t\t\t<\/tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>.eqv.<\/td>\n\t\t\t\t\t\t\t\t\t<td>equivalent (i.e., same truth values)<\/td>\n\t\t\t\t\t\t\t\t<\/tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>.neqv.<\/td>\n\t\t\t\t\t\t\t\t\t<td>not equivalent<\/td>\n\t\t\t\t\t\t\t\t<\/tr>\n\t\t\t\t\t\t\t\t<\/table><br \/>\n\n\t\t\t\t\t\t\t\t<h3><a id=\"if\"><\/a>If ... Then ... Else Constructions<\/h3>\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\"If &#8230; Then &#8230; Else\" constructions in Fortran are pretty much like those in Basic, with but a few minor modifications. First, instead of using in the tests symbols like \"=\", \"&lt;\", \"&gt;=\", etc., as in Basic, you must use the abbreviations in the preceding table. Also, tests must be enclosed in parentheses, and \"else if\" may be two words. Here are several examples:\n\t\t\t\t\t\t\t\t<\/p>\n\t\t\t\t\t\t\t\t<ol>\n\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t<pre class=\"brush:fortran;gutter:false;\">if (x .gt. 0) print *, \"x is positive\"<\/pre>\n\t\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t<pre class=\"brush:fortran;gutter:false;\">if (x .ge. y .and. x .ge. z) go to 40<\/pre>\n\t\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t<pre class=\"brush:fortran;gutter:false;\">\n\t\t\t\t\t\t\t\t\t\t\tif (x .ge. 0) then\n\t\t\t\t\t\t\t\t\t\t\t\ty = sqrt(x)\n\t\t\t\t\t\t\t\t\t\t\t\tprint *, y, \" squared = \", x\n\t\t\t\t\t\t\t\t\t\t\tend if<\/pre>\n\t\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t<pre class=\"brush:fortran;gutter:false;\">\n\t\t\t\t\t\t\t\t\t\t\tif (x .ge. 0) then\n\t\t\t\t\t\t\t\t\t\t\t\ty = sqrt(x)\n\t\t\t\t\t\t\t\t\t\t\t\tprint *, y, \" squared = \", x\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\tprint *, \"x has no square root\"\n\t\t\t\t\t\t\t\t\t\t\tend if<\/pre>\n\t\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t<pre class=\"brush:fortran;gutter:false;\">\n\t\t\t\t\t\t\t\t\t\t\tif (x .ge. 0) then\n\t\t\t\t\t\t\t\t\t\t\t\tprint *, \"x is positive\"\n\t\t\t\t\t\t\t\t\t\t\t\ty = sqrt(x)\n\t\t\t\t\t\t\t\t\t\t\telse if (x .lt. 0) then\n\t\t\t\t\t\t\t\t\t\t\t\tprint *, \"x is negative\"\n\t\t\t\t\t\t\t\t\t\t\t\tgo to 60\n\t\t\t\t\t\t\t\t\t\t\telse if (x .eq. 0) then\n\t\t\t\t\t\t\t\t\t\t\t\tprint *, \"x is zero\"\n\t\t\t\t\t\t\t\t\t\t\t\ty = 0\n\t\t\t\t\t\t\t\t\t\t\tend if<\/pre>\n\t\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t\t\t<\/ol>\n\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\tObserve that, as in examples 1) and 2), the one-line \"if\" statement does not use \"then\". Moreover, \"else\" appears on a line by itself, while \"else if\" shares the line with the test condition and \"then\".\n\t\t\t\t\t\t\t\t<\/p>\n\n\t\t\t\t\t\t\t\t<h3><a id=\"stop\"><\/a>Stop<\/h3>\n\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\tA <i>stop<\/i> statement stops the execution of a program. For instance, the sequence of statements below terminates the program whenever n is less than zero:\n\t\t\t\t\t\t\t\t<\/p>\n\t\t\t\t\t\t\t\t<pre class=\"brush:fortran;\">\n\t\t\t\t\t\t\t\t\tif (n .lt. 0) then\n\t\t\t\t\t\t\t\t\t\tprint *, \"Error - your age cannot be negative!\"\n\t\t\t\t\t\t\t\t\t\tstop\n\t\t\t\t\t\t\t\t\tend if<\/pre>\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\tDo not confuse <i>stop<\/i> and <i>end<\/i>. Use <i>end<\/i> only as the very last statement in the program, and use <i>stop<\/i> only to terminate the program before this last statement. Violating these rules will fatally confuse the compiler - it regards an <i>end<\/i> statement as the program's physical end.\n\t\t\t\t\t\t\t\t<\/p>\n\n\t\t\t\t\t\t\t\t<h3><a id=\"labels\"><\/a>Labels and Go To<\/h3>\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\tLabels and the \"go to\" statement work as in Basic, except that a label must be a number, and it must be typed in columns 2-5. Here is an example of a <i>go to<\/i> command directing the action to a labeled statement:\n\t\t\t\t\t\t\t\t<\/p>\n\t\t\t\t\t\t\t\t<pre class=\"brush:fortran;\">\n\t\t\t\t\t\t\t\t\tif (x .lt. 0) go to 10\n\t\t\t\t\t\t\t\t\tprint *, \"The square root of x is \", sqrt(x)\n\t\t\t\t\t\t\t\t\tstop\n\t\t\t\t\t\t\t\t10\tprint *, \"x is negative and has no square root\"<\/pre>\n\t\t\t\t\t\t\t\t<!--\n\t\t\t\t\t\t\t\t<table class=\"data_table\">\n\t\t\t\t\t\t\t\t<tr><td><\/td>\n\t\t\t\t\t\t\t\t\t<td>if (x .lt. 0) go to 10<\/td>\n\t\t\t\t\t\t\t\t<\/tr>\n\t\t\t\t\t\t\t\t<tr><td><\/td>\n\t\t\t\t\t\t\t\t\t<td>print *, \"The square root of x is \", sqrt(x)<\/td>\n\t\t\t\t\t\t\t\t<\/tr>\n\t\t\t\t\t\t\t\t<tr><td><\/td>\n\t\t\t\t\t\t\t\t\t<td>stop<\/td>\n\t\t\t\t\t\t\t\t<\/tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>10&#160;&#160;&#160;&#160;&#160;&#160;&#160;<\/td>\n\t\t\t\t\t\t\t\t\t<td>print *, \"x is negative and has no square root\"<\/td>\n\t\t\t\t\t\t\t\t<\/tr>\n\t\t\t\t\t\t\t\t<\/table><br \/>\n\t\t\t\t\t\t\t\t-->\n\n\t\t\t\t\t\t\t\t<h3><a id=\"char\"><\/a>Character Variables<\/h3>\n\n\t\t\t\t\t\t\t\tA <i>character variable<\/i> is analogous to a string variable in Basic. A character variable must be declared at the beginning of the program, and attached to it in the declaration must be a number following an asterisk \"*\"; this number indicates the maximum number of symbols in the string. For example, the declaration statement<br \/>\n\t\t\t\t\t\t\t\t<pre class=\"brush:fortran;gutter:false;\">character name*20, ans*1<\/pre>\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\tindicates that \"name\" is a character variable holding no more than 20 symbols, while \"ans\" is a character variable holding only one symbol.\n\t\t\t\t\t\t\t\t<\/p>\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\tA string in Fortran may be enclosed in either double quotes, as in \"hello\", or in single quotes, as in 'goodbye'.\n\t\t\t\t\t\t\t\t<\/p>\n\n\t\t\t\t\t\t\t\t<h3><a id=\"do\"><\/a>Do Loops<\/h3>\n\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\"For &#8230; Next\" loops in Basic become \"Do Loops\" in Fortran. Such a loop begins with a <i>do<\/i> statement, and ends with either <i>end do<\/i>, or a labeled <i>continue<\/i> statement. Here are two loops that add the squares of the integers from 1 to 10:\n\t\t\t\t\t\t\t\t<\/p>\n\t\t\t\t\t\t\t\t<div style=\"width:290px;float:left;\">\n\t\t\t\t\t\t\t\t\t<pre class=\"brush:fortran;\">\n\t\t\t\t\t\t\t\t\t\tsum = 0\n\t\t\t\t\t\t\t\t\t\tdo i = 1, 10\n\t\t\t\t\t\t\t\t\t\t\tsum = sum + i ** 2\n\t\t\t\t\t\t\t\t\t\tend do\n\t\t\t\t\t\t\t\t\t\tprint *, \"The sum is\", sum<\/pre>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<div style=\"width:290px;float:left;\">\n\t\t\t\t\t\t\t\t\t<pre class=\"brush:fortran;\">\n\t\t\t\t\t\t\t\t\tsum = 0\n\t\t\t\t\t\t\t\t\tdo 5 i = 1, 10\n\t\t\t\t\t\t\t\t\tsum = sum + i ** 2\n\t\t\t\t\t\t\t\t5\tcontinue\n\t\t\t\t\t\t\t\t\tprint *, \"The sum is\", sum<\/pre>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\tThe <i>end do<\/i> and <i>continue<\/i> statements serve only to identify the end of the loop. The limits of the loop may be variables as well as numbers (e.g.:   do i = m, n). As in Basic you may indicate a step size, which can be positive or negative. For example, the statement\n\t\t\t\t\t\t\t\t<\/p>\n\t\t\t\t\t\t\t\t<pre class=\"brush:fortran;gutter:false;\">do i = 1, 9, 2<\/pre>\n\t\t\t\t\t\t\t\tspecifies that the loop variable i run over the odd numbers 1, 3, 5, 7, 9.<br \/>\n\t\t\t\t\t\t\t\tLoops can be nested, and nested loops can end on the same <i>continue<\/i> statement (but <i>not<\/i> on the same <i>end do<\/i> statement). Here are two instances of nested loops assigning the entries of a 10 x 10 matrix:<br \/>\n\t\t\t\t\t\t\t\t<!--\n\t\t\t\t\t\t\t\t<table class=\"data_table\">\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>do i = 1, 10<\/td>\n\t\t\t\t\t\t\t\t\t<td width=\"100\">|<\/td>\n\t\t\t\t\t\t\t\t\t<td width=\"60\"><\/td>\n\t\t\t\t\t\t\t\t\t<td>do 5 i = 1, 10<\/td>\n\t\t\t\t\t\t\t\t<\/tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>do j = 1, 10<\/td>\n\t\t\t\t\t\t\t\t\t<td>|<\/td>\n\t\t\t\t\t\t\t\t\t<td><\/td>\n\t\t\t\t\t\t\t\t\t<td>do 5 j = 1, 10<\/td>\n\t\t\t\t\t\t\t\t<\/tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>a(i,j) = i + j<\/td>\n\t\t\t\t\t\t\t\t\t<td>|<\/td>\n\t\t\t\t\t\t\t\t\t<td><\/td>\n\t\t\t\t\t\t\t\t\t<td>a(i,j) = i + j<\/td>\n\t\t\t\t\t\t\t\t<\/tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>end do<\/td>\n\t\t\t\t\t\t\t\t\t<td>|<\/td>\n\t\t\t\t\t\t\t\t\t<td>5<\/td>\n\t\t\t\t\t\t\t\t\t<td>continue<\/td>\n\t\t\t\t\t\t\t\t<\/tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>end do<\/td>\n\t\t\t\t\t\t\t\t\t<td>|<\/td>\n\t\t\t\t\t\t\t\t\t<td><\/td>\n\t\t\t\t\t\t\t\t\t<td><\/td>\n\t\t\t\t\t\t\t\t<\/tr>\n\t\t\t\t\t\t\t\t<\/table>\n\t\t\t\t\t\t\t\t-->\n\t\t\t\t\t\t\t\t<div style=\"width:290px;float:left;\">\n\t\t\t\t\t\t\t\t\t<pre class=\"brush:fortran;\">\n\t\t\t\t\t\t\t\t\t\tdo i = 1, 10\n\t\t\t\t\t\t\t\t\t\t\tdo j = 1, 10\n\t\t\t\t\t\t\t\t\t\t\t\ta(i,j) = i + j\n\t\t\t\t\t\t\t\t\t\t\tend do\n\t\t\t\t\t\t\t\t\t\tend do<\/pre>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<div style=\"width:290px;float:left;\">\n\t\t\t\t\t\t\t\t\t<pre class=\"brush:fortran;\">\n\t\t\t\t\t\t\t\t\tdo 5 i = 1, 10\n\t\t\t\t\t\t\t\t\tdo 5 j = 1, 10\n\t\t\t\t\t\t\t\t\ta(i,j) = i + j\n\t\t\t\t\t\t\t\t5\tcontinue<\/pre>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\n\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[68],"tags":[],"class_list":["post-2929761","post","type-post","status-publish","format-standard","hentry","category-fortran-lessons"],"_links":{"self":[{"href":"https:\/\/math.hawaii.edu\/wordpress\/wp-json\/wp\/v2\/posts\/2929761","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/math.hawaii.edu\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/math.hawaii.edu\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/math.hawaii.edu\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/math.hawaii.edu\/wordpress\/wp-json\/wp\/v2\/comments?post=2929761"}],"version-history":[{"count":4,"href":"https:\/\/math.hawaii.edu\/wordpress\/wp-json\/wp\/v2\/posts\/2929761\/revisions"}],"predecessor-version":[{"id":2976475,"href":"https:\/\/math.hawaii.edu\/wordpress\/wp-json\/wp\/v2\/posts\/2929761\/revisions\/2976475"}],"wp:attachment":[{"href":"https:\/\/math.hawaii.edu\/wordpress\/wp-json\/wp\/v2\/media?parent=2929761"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/math.hawaii.edu\/wordpress\/wp-json\/wp\/v2\/categories?post=2929761"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/math.hawaii.edu\/wordpress\/wp-json\/wp\/v2\/tags?post=2929761"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}