{"id":81,"date":"2017-09-11T15:20:02","date_gmt":"2017-09-11T18:20:02","guid":{"rendered":"http:\/\/www.professores.uff.br\/diomarcesarlobao\/?page_id=81"},"modified":"2017-09-11T15:20:02","modified_gmt":"2017-09-11T18:20:02","slug":"clobber-f","status":"publish","type":"page","link":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/clobber-f\/","title":{"rendered":"clobber.f"},"content":{"rendered":"<pre>program clobber\r\n\r\nc   This program illustrates the pit-falls of not watching array indices\r\nc\r\nc   John Mahaffy 2\/14\/96\r\nc\r\n      implicit none\r\n      integer ndim,nd2,i\r\n      parameter (ndim=10, nd2=ndim+2)\r\n      real a(ndim),b(ndim),c(ndim),adat,bdat,cdat\r\n      data adat,bdat,cdat\/1.0,2.0,3.0\/\r\n      do i=1,nd2\r\n         a(i)=adat\r\n         b(i)=bdat\r\n         c(i)=cdat\r\n      enddo\r\nc\r\nc   From the above DO loop you would expect all elements of a to be 1.0\r\nc   all elements of b to be 2.0, and all elements of c to be 3.0, but\r\nc   look at the printout and see how the inappropriate DO loop index\r\nc   maximum clobbers the first 2 elements of b and c.\r\nc\r\n      print *, ' i     a     b      c  '\r\n      write (*,2000) (i,a(i),b(i),c(i),i=1,ndim)\r\n 2000 format (i3,3f7.3)\r\n      stop\r\n      end<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>program clobber c This program illustrates the pit-falls of not watching array indices c c John Mahaffy 2\/14\/96 c implicit none integer ndim,nd2,i parameter (ndim=10, nd2=ndim+2) real a(ndim),b(ndim),c(ndim),adat,bdat,cdat data adat,bdat,cdat\/1.0,2.0,3.0\/ do i=1,nd2 a(i)=adat b(i)=bdat c(i)=cdat enddo c c From the above DO loop you would expect all elements of a to be 1.0 c all [&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-81","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/81","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=81"}],"version-history":[{"count":1,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/81\/revisions"}],"predecessor-version":[{"id":82,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/81\/revisions\/82"}],"wp:attachment":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/media?parent=81"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/categories?post=81"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/tags?post=81"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}