{"id":143,"date":"2017-09-13T10:28:36","date_gmt":"2017-09-13T13:28:36","guid":{"rendered":"http:\/\/www.professores.uff.br\/diomarcesarlobao\/?page_id=143"},"modified":"2017-09-13T10:28:36","modified_gmt":"2017-09-13T13:28:36","slug":"module-f","status":"publish","type":"page","link":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/module-f\/","title":{"rendered":"module.f"},"content":{"rendered":"<pre>c&lt;html&gt;\r\nc&lt;body&gt;\r\nc&lt;pre&gt;\r\n      module assign\r\nc    Modules, unlike COMMON may contain allocatable arrays\r\nc\r\nc&lt;a name=\"alable\"&gt;&lt;font color=\"FF0000\"&gt;\r\n         real, allocatable :: a(:)\r\nc&lt;\/font&gt;&lt;\/a&gt;\r\n         integer :: isize=5\r\n      end module\r\nc\r\n      program testmod\r\n      use assign\r\nc\r\nc    By using MODULE to pass information about allocatable arrays\r\nc    we can duck the earlier prohibition against allocating\r\nc    space in a subroutine for use in the main program or\r\nc    other subprograms called by the main program.\r\nc\r\nc      John Mahaffy    4\/13\/96\r\nc\r\nc\r\n      call sub1\r\n      print *,' Main: Array A is still defined, with values:'\r\n      print *, a\r\n      call sub2\r\n      stop\r\n      end\r\n      subroutine sub1\r\n      use assign\r\nc\r\nc     This subroutine allocates space in array \"a\" and\r\nc     loads some values\r\nc\r\nc      John Mahaffy    4\/13\/96\r\nc&lt;a name=\"all\"&gt;&lt;font color=\"FF0000\"&gt;\r\n      allocate(a(isize))\r\nc&lt;\/font&gt;&lt;\/a&gt;\r\n      a=(\/(i,i=1,isize)\/)\r\n      return\r\n      end\r\n      subroutine sub2\r\n      use assign\r\nc\r\nc     This subroutine prints values in array \"a\" and\r\nc     deallocates space\r\nc\r\nc      John Mahaffy    4\/13\/96\r\nc\r\n      print *,' Sub2: Array A is still defined, with values:'\r\n      print *, a\r\nc&lt;a name=\"deall\"&gt;&lt;font color=\"FF0000\"&gt;\r\n      deallocate(a)\r\nc&lt;\/font&gt;&lt;\/a&gt;\r\nc\r\nc    I can actually get away with the following print, but\r\nc    results are strange.\r\nc\r\n      print *,' After Dealloation of A \"print *, a \" gives:'\r\n      print *, a\r\n      return\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; module assign c Modules, unlike COMMON may contain allocatable arrays c c&lt;a name=&#8221;alable&#8221;&gt;&lt;font color=&#8221;FF0000&#8243;&gt; real, allocatable :: a(:) c&lt;\/font&gt;&lt;\/a&gt; integer :: isize=5 end module c program testmod use assign c c By using MODULE to pass information about allocatable arrays c we can duck the earlier prohibition against allocating c space in [&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-143","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/143","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=143"}],"version-history":[{"count":1,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/143\/revisions"}],"predecessor-version":[{"id":144,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/143\/revisions\/144"}],"wp:attachment":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/media?parent=143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/categories?post=143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/tags?post=143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}