<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang="EN-GB" link="blue" vlink="blue">
<div class="Section1">
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">What is the compilation command you are executing? It is probably because you are not running the pre-processor in Fortran which is switched
 off in the PGI compiler by default. <o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">Regards,<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">Wadud.<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<div>
<div class="MsoNormal" align="center" style="text-align:center"><font size="3" face="Times New Roman"><span lang="EN-US" style="font-size:12.0pt">
<hr size="2" width="100%" align="center" tabindex="-1">
</span></font></div>
<p class="MsoNormal"><b><font size="2" face="Tahoma"><span lang="EN-US" style="font-size:10.0pt;font-family:Tahoma;font-weight:bold">From:</span></font></b><font size="2" face="Tahoma"><span lang="EN-US" style="font-size:10.0pt;font-family:Tahoma"> petsc-users-bounces@mcs.anl.gov
 [mailto:petsc-users-bounces@mcs.anl.gov] <b><span style="font-weight:bold">On Behalf Of
</span></b>Sonya Blade<br>
<b><span style="font-weight:bold">Sent:</span></b> 29 April 2013 11:59<br>
<b><span style="font-weight:bold">To:</span></b> petsc-users@mcs.anl.gov<br>
<b><span style="font-weight:bold">Subject:</span></b> EXTERNAL: [petsc-users] How to run Petsc in Fortran</span></font><span lang="EN-US"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt"><o:p> </o:p></span></font></p>
<div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri">Dear All,<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri">I'm experiencing the difficulties with running the Petsc in Fortran Language, I'm using gfortran <o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri">integrated in the CodeBlock editor. I've compiled/installed the Petsc , Slepc and having no<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri">problems calling the Petsc/Slepc functions in C, it works perfectly.<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri"><o:p> </o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri">When it comes to using Petsc in Fortran I follow the instructions given in that article, especially the item 3<o:p></o:p></span></font></p>
</div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri"><a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/UsingFortran.html">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/UsingFortran.html</a><o:p></o:p></span></font></p>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri"><o:p> </o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri">but so far I couldn't succeed to run them succesfully in Fortran,  my main code is as follow:<o:p></o:p></span></font></p>
</div>
<div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri"><o:p> </o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri">program main<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri">implicit none<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri">#include <finclude/petscsys.h><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri">#include <finclude/petscvec.h><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri">#include <finclude/petscvec.h90><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri"><o:p> </o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri">PetscReal norm<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri"><o:p> </o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri">print *,"Hello World "<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri">end<o:p></o:p></span></font></p>
</div>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri"><o:p> </o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri">I've added all the related include folders to search path (Petsc_Dir\include\finclude etc..) and library <o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri">file "libpetsc.a" which results after Petsc compilation, but still compiler complains about the <o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri">"Error: Unclassifiable statement at (1)" PetscReal norm. Which means that compiler is unaware of type <o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri">identifier PetscReal. What am I missing here ?<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri"><o:p> </o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri">Your help will be appreciated,<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri"><o:p> </o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri">Regards,<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri"><o:p> </o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;
font-family:Calibri"><o:p> </o:p></span></font></p>
</div>
</div>
</div>
</body>
</html>

<p>

___________________________________________________
____________________________

The information in this email and in any attachment(s) is 
commercial in confidence. If you are not the named addressee(s) 
or 
if you receive this email in error then any distribution, copying or 
use of this communication or the information in it is strictly 
prohibited. Please notify us immediately by email at 
admin.internet(at)awe.co.uk, and then delete this message from 
your computer. While attachments are virus checked, AWE plc 
does not accept any liability in respect of any virus which is not 
detected.

AWE Plc
Registered in England and Wales
Registration No 02763902
AWE, Aldermaston, Reading, RG7 4PR
</p>