{"id":123,"date":"2017-09-13T10:18:26","date_gmt":"2017-09-13T13:18:26","guid":{"rendered":"http:\/\/www.professores.uff.br\/diomarcesarlobao\/?page_id=123"},"modified":"2017-09-13T10:18:26","modified_gmt":"2017-09-13T13:18:26","slug":"inter1-f","status":"publish","type":"page","link":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/inter1-f\/","title":{"rendered":"inter1.f"},"content":{"rendered":"<pre>c&lt;html&gt;\r\nc&lt;body&gt;\r\nc&lt;pre&gt;\r\n      program interpolate\r\n      implicit none\r\nc\r\nc     Demonstation of 2 simple interpolation methods for\r\nc     smoothly joining results from 2 disjoint regions\r\nc\r\nc     John Mahaffy 2\/3\/96\r\nc\r\nc    Open up two files in your current directory to receive results\r\nc\r\n      open(10,file='linint')\r\n      open(11,file='cubeint')\r\nc\r\nc   First a linear interpolation\r\nc\r\n      call linenrgy \r\nc\r\nc   Next a cubic interpolation\r\nc\r\n      call cubenrgy\r\nc\r\nc   If you are in Hammond Lab, change this subroutine to plot results\r\nc\r\n      call plotit\r\nc\r\n      stop\r\n      end\r\n      subroutine linenrgy\r\nc\r\nc    Generate internal energy and Cv of a gas for Temperatures\r\nc    between 300 and 3000K in steps of 10K using a linear interpolation\r\nc    between 2 regions of constant Cv\r\nc\r\nc     John Mahaffy 2\/3\/96\r\nc\r\n      implicit none\r\n      real Cv,u,T,w\r\nc\r\nc   Cv  -  specific heat at constant volume\r\nc   u   -  internal energy per kilogram\r\nc   T   -  temperature\r\nc   w   -  interpolation weighting function\r\nc\r\n      T=300.\r\n      do 100 while (T.le.3000.)\r\n        if(T.lt.1600.) then\r\n           Cv=5000.\r\n        else if (T.gt.2200.)  then\r\n           Cv=7000.\r\n        else\r\n           w=(T-1600.)\/(2200.-1600.)\r\n           Cv= (1.-w)*5000.+w*7000.\r\n        endif\r\n        u=Cv*T\r\n        write(10,*)T,Cv,u\r\n        T=T+10.\r\n  100 continue\r\n      return\r\n      end\r\n      subroutine cubenrgy\r\nc\r\nc    Generate internal energy and Cv of a gas for Temperatures\r\nc    between 300 and 3000K in steps of 10K using a cubic interpolation\r\nc    between 2 regions of constant Cv.  \r\nc    The cubic is chosen so that derivatives are continuous.\r\nc\r\nc     John Mahaffy 2\/3\/96\r\nc\r\n      implicit none\r\n      real Cv,u,T,ST,w\r\nc\r\nc   Cv  -  specific heat at constant volume\r\nc   u   -  internal energy per kilogram\r\nc   T   -  temperature\r\nc   ST  -  Scaled temperature\r\nc   w   -  interpolation weighting function\r\nc\r\n      T=300.\r\n      do 200 while (T.le.3000.)\r\n        if(T.lt.1600.) then\r\n           Cv=5000.\r\n        else if (T.gt.2200.) then\r\n           Cv=7000.\r\n        else\r\n           ST=(T-1600.)\/(2200.-1600.)\r\n           w= ST**2*(3.-2.*ST)\r\n           Cv= (1.-w)*5000.+w*7000.\r\n        endif\r\n        u=Cv*T\r\n        write(11,2000)T,Cv,u\r\n        T=T+10.\r\n  200 continue\r\n2000  format(1x,f7.1,1p,2e12.5)\r\n      return\r\n      end\r\n      subroutine plotit\r\nc\r\nc    This subroutine is for those of you who are getting bored.  At this\r\nc    stage of the class you will not be held responsible new material here.\r\nc\r\nc&lt;a name=\"logical\"&gt;&lt;font color=\"FF0000\"&gt;\r\n       logical fexist\r\nc&lt;\/font&gt;&lt;\/a&gt;\r\n\r\nc      fexist -  flag indicating whether or not the gnuin file exists\r\n\r\nc   First check to see if a file containing commands to the graphic program\r\nc   exists in your local directory\r\nc\r\n      inquire (file='gp-int1',exist=fexist)\r\nc\r\nc   If it doesn't then issue a unix command to copy it from my directory\r\nc   the subroutine \"system\" is not a standard part of Fortran, but is\r\nc   provided by some Unix systems to give a crude form of what is called\r\nc   a \"system call\".  Any computer will supply an equivalent command, and\r\nc   other functions or subroutines that give more direct access to system\r\nc   support.\r\nc\r\n      if (.not.fexist) then\r\n        call system('cp ~jhm\/201\/gp-int1 .')\r\n         print *, ' Graphics input file copied'\r\n      endif\r\nc\r\nc   Close the data files so they are ready for reading by gnuplot\r\nc\r\n      close ( 11 )\r\n      close ( 10 )\r\nc\r\nc   If you are sitting at a Hammond lab work station remove the \"c\" in\r\nc   column 1 of the following \"call system\" to plot your results.  If you\r\nc   are running from NCSA\/BYU Telnet on a Mac, you can see plots by\r\nc   making the same change, and by following instructions in \"gp-int1\"\r\nc   to change that file for Tektronics emulation in gnuplot.\r\nc\r\nc      call system ('gnuplot gp-int1')\r\nc\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 interpolate implicit none c c Demonstation of 2 simple interpolation methods for c smoothly joining results from 2 disjoint regions c c John Mahaffy 2\/3\/96 c c Open up two files in your current directory to receive results c open(10,file=&#8217;linint&#8217;) open(11,file=&#8217;cubeint&#8217;) c c First a linear interpolation c call linenrgy c [&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-123","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/123","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=123"}],"version-history":[{"count":1,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/123\/revisions"}],"predecessor-version":[{"id":124,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/123\/revisions\/124"}],"wp:attachment":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/media?parent=123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/categories?post=123"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/tags?post=123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}