{"id":169,"date":"2017-09-13T10:44:40","date_gmt":"2017-09-13T13:44:40","guid":{"rendered":"http:\/\/www.professores.uff.br\/diomarcesarlobao\/?page_id=169"},"modified":"2017-09-13T10:44:40","modified_gmt":"2017-09-13T13:44:40","slug":"sums-f","status":"publish","type":"page","link":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/sums-f\/","title":{"rendered":"sums.f"},"content":{"rendered":"<pre>c\r\nc &lt;html&gt;\r\nc &lt;head&gt;&lt;title&gt;&lt;\/title&gt;&lt;\/head&gt;\r\nc &lt;body&gt;\r\nc &lt;pre&gt;\r\nc\r\nc program sums\r\nc\r\nc Demonstrate Fortran 90 SUM function with MASK option\r\nc\r\nc John Mahaffy 2\/16\/96\r\nc\r\n implicit none\r\n integer nd,ndh,nduh, j\r\n parameter (nd=10,ndh=nd\/2,nduh=nd-ndh)\r\n real csum,cpsum,cbpsum\r\nc&lt;a name=\"dim\"&gt;&lt;font color=\"FF0000\"&gt;\r\n real, dimension(nd):: c=(\/(j,j=-1,nd-2)\/), b\r\nc&lt;\/font&gt;&lt;\/a&gt;\r\n data b\/ndh*-1.0,nduh*2.0\/\r\n csum = sum(c(1:nd))\r\n cpsum= sum (c(1:nd),mask=c.gt.0)\r\n cbpsum= sum(c(1:nd),mask=b.gt.0.0)\r\nc&lt;a name=\"print\"&gt;&lt;font color=\"FF0000\"&gt;\r\n print *, 'Sum of all elements in c = ' , csum\r\n print *, 'Sum of Positive elements in c = ', cpsum\r\n print *, 'Sum of elements in c when corresponding elements in b&gt;0'\r\n # ,' =',cbpsum\r\nc&lt;\/font&gt;&lt;\/a&gt;\r\n stop\r\n end\r\nc &lt;\/pre&gt;\r\nc &lt;\/body&gt;\r\nc &lt;\/html&gt;\r\nc<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>c c &lt;html&gt; c &lt;head&gt;&lt;title&gt;&lt;\/title&gt;&lt;\/head&gt; c &lt;body&gt; c &lt;pre&gt; c c program sums c c Demonstrate Fortran 90 SUM function with MASK option c c John Mahaffy 2\/16\/96 c implicit none integer nd,ndh,nduh, j parameter (nd=10,ndh=nd\/2,nduh=nd-ndh) real csum,cpsum,cbpsum c&lt;a name=&#8221;dim&#8221;&gt;&lt;font color=&#8221;FF0000&#8243;&gt; real, dimension(nd):: c=(\/(j,j=-1,nd-2)\/), b c&lt;\/font&gt;&lt;\/a&gt; data b\/ndh*-1.0,nduh*2.0\/ csum = sum(c(1:nd)) cpsum= sum (c(1:nd),mask=c.gt.0) cbpsum= [&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-169","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/169","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=169"}],"version-history":[{"count":1,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/169\/revisions"}],"predecessor-version":[{"id":170,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/169\/revisions\/170"}],"wp:attachment":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/media?parent=169"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/categories?post=169"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/tags?post=169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}