{"id":173,"date":"2017-09-13T10:48:12","date_gmt":"2017-09-13T13:48:12","guid":{"rendered":"http:\/\/www.professores.uff.br\/diomarcesarlobao\/?page_id=173"},"modified":"2017-09-13T10:48:12","modified_gmt":"2017-09-13T13:48:12","slug":"where-f","status":"publish","type":"page","link":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/where-f\/","title":{"rendered":"where.f"},"content":{"rendered":"<pre>c&lt;html&gt;\r\nc&lt;body&gt;\r\nc&lt;pre&gt;\r\n      program test\r\nc\r\nc    Example of WHERE, ELSE WHERE, END WHERE\r\nc\r\nc    John Mahaffy 2\/16\/96\r\nc\r\n      parameter (nd=10,ndh=nd\/2,nduh=nd-ndh-1)\r\nc&lt;a name=\"real\"&gt;&lt;font color=\"FF0000\"&gt;\r\n      real, dimension(nd):: a=(\/(2*j,j=1,nd)\/), b, c\r\nc&lt;\/a&gt;&lt;\/font&gt;\r\n      integer iflag(nd)\r\n      data b\/ndh*1,0.0,nduh*2.\/,c\/nd*-77.77\/\r\n      where (b.ne.0) c=a\/b\r\n      write (*,2000) c(1:nd)\r\n 2000 format ('a\/b = ',\/,(10f7.2))\r\nc\r\nc   The above protects against divide by zero, but doesn't actually assign\r\nc   values to elements in c when the corresponding element in b is zero\r\nc   The following covers that, and sets a flag when a divide by zero is\r\nc   present\r\nc\r\nc&lt;a name=\"where\"&gt;&lt;font color=\"FF0000\"&gt;\r\n      where (b(1:nd).ne.0.0)\r\nc&lt;\/font&gt;&lt;\/a&gt;\r\n         c=a\/b\r\n         iflag=0\r\nc&lt;a name=\"ewhere\"&gt;&lt;font color=\"FF0000\"&gt;\r\n      else where\r\nc&lt;\/font&gt;&lt;\/a&gt;\r\n         c=0.0\r\n         iflag=1\r\nc&lt;a name=\"ew\"&gt;&lt;font color=\"0000FF\"&gt;\r\n      end where\r\nc&lt;\/font&gt;&lt;\/a&gt;\r\n      write (*,2000) c(1:nd)\r\n      write (*,1000) iflag(1:nd)\r\n 1000 format ('iflag= ',\/,(10i7))\r\n      stop\r\n      end\r\nc&lt;\/pre&gt;\r\nc&lt;\/body&gt;\r\nc&lt;\/html&gt;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>c&lt;html&gt; c&lt;body&gt; c&lt;pre&gt; program test c c Example of WHERE, ELSE WHERE, END WHERE c c John Mahaffy 2\/16\/96 c parameter (nd=10,ndh=nd\/2,nduh=nd-ndh-1) c&lt;a name=&#8221;real&#8221;&gt;&lt;font color=&#8221;FF0000&#8243;&gt; real, dimension(nd):: a=(\/(2*j,j=1,nd)\/), b, c c&lt;\/a&gt;&lt;\/font&gt; integer iflag(nd) data b\/ndh*1,0.0,nduh*2.\/,c\/nd*-77.77\/ where (b.ne.0) c=a\/b write (*,2000) c(1:nd) 2000 format (&#8216;a\/b = &#8216;,\/,(10f7.2)) c c The above protects against divide by zero, [&hellip;]<\/p>\n","protected":false},"author":22,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[],"tags":[],"class_list":["post-173","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/173","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/comments?post=173"}],"version-history":[{"count":1,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/173\/revisions"}],"predecessor-version":[{"id":174,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/173\/revisions\/174"}],"wp:attachment":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/media?parent=173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/categories?post=173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/tags?post=173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}