{"id":129,"date":"2017-09-13T10:20:44","date_gmt":"2017-09-13T13:20:44","guid":{"rendered":"http:\/\/www.professores.uff.br\/diomarcesarlobao\/?page_id=129"},"modified":"2017-09-13T10:20:44","modified_gmt":"2017-09-13T13:20:44","slug":"interface-f","status":"publish","type":"page","link":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/interface-f\/","title":{"rendered":"interface.f"},"content":{"rendered":"<pre>c&lt;html&gt;\r\nc&lt;body&gt;\r\nc&lt;pre&gt;\r\n      program interface\r\nc\r\nc      Simple demonstration of the INTERFACE structure\r\nc      to permit the creation of FUNCTIONS returning\r\nc      arrays rather than single values.\r\nc\r\nc      John Mahaffy   4\/3\/96\r\nc\r\n      implicit none\r\n      integer i\r\n      real, dimension(10) :: z,y,x=(\/(i,i=1,10)\/)\r\n      data y \/5*1,5*2\/\r\nc\r\nc   interface block to permit a vector valued\r\nc   function named saxpy\r\nc\r\n      interface saxpy\r\n         function saxpy (a,x,y)\r\n            real x(:),y(:),a\r\n            real saxpy (size(x))\r\nc\r\nc    Declare x,y,a as input only to saxpy\r\nc\r\nc&lt;a name=\"intent\"&gt;&lt;font color=\"FF0000\"&gt;\r\n            intent (in) x,y,a\r\nc&lt;\/font&gt;&lt;\/a&gt;\r\n         end function saxpy\r\nc\r\nc&lt;a name=\"end\"&gt;&lt;font color=\"FF0000\"&gt;\r\n      end interface\r\nc&lt;\/font&gt;&lt;\/a&gt;\r\nc\r\nc   Begin  Executable Statements\r\nc\r\n      z = saxpy(2.,x,y)\r\n      write (*,2001)'a', 2.0\r\n      write(*,2001) 'x', x\r\n      write(*,2001) 'y', y\r\n      write(*,*) ' For z = a x + y '\r\n      write(*,2001) 'z',z\r\n      stop\r\n 2001 format (\/, 1x,a1,' = ', 5f8.1,\/, (5x,5f8.1))\r\n      end\r\nc\r\n      function saxpy(a,x,y)\r\nc\r\nc   Multply all contents of an array \"x\" by the scalar \"a\"\r\nc   then add the result to the array \"y\"\r\nc\r\nc   John Mahaffy    4\/3\/96\r\nc\r\n      implicit none\r\n      real, dimension (:), intent(in):: x,y\r\n      real saxpy (size(x))\r\n      real a\r\n      saxpy =  a*x + y\r\n      return\r\n      end\r\nc&lt;\/pre&gt;\r\nc&lt;\/body&gt;\r\nc&lt;\/html&gt;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>c&lt;html&gt; c&lt;body&gt; c&lt;pre&gt; program interface c c Simple demonstration of the INTERFACE structure c to permit the creation of FUNCTIONS returning c arrays rather than single values. c c John Mahaffy 4\/3\/96 c implicit none integer i real, dimension(10) :: z,y,x=(\/(i,i=1,10)\/) data y \/5*1,5*2\/ c c interface block to permit a vector valued c function [&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-129","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/129","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=129"}],"version-history":[{"count":1,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/129\/revisions"}],"predecessor-version":[{"id":130,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/129\/revisions\/130"}],"wp:attachment":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/media?parent=129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/categories?post=129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/tags?post=129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}