[petsc-users] EXTERNAL: How to run Petsc in Fortran

Wadud.Miah at awe.co.uk Wadud.Miah at awe.co.uk
Mon Apr 29 06:07:04 CDT 2013


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.

Regards,
Wadud.

________________________________
From: petsc-users-bounces at mcs.anl.gov [mailto:petsc-users-bounces at mcs.anl.gov] On Behalf Of Sonya Blade
Sent: 29 April 2013 11:59
To: petsc-users at mcs.anl.gov
Subject: EXTERNAL: [petsc-users] How to run Petsc in Fortran

Dear All,
I'm experiencing the difficulties with running the Petsc in Fortran Language, I'm using gfortran
integrated in the CodeBlock editor. I've compiled/installed the Petsc , Slepc and having no
problems calling the Petsc/Slepc functions in C, it works perfectly.

When it comes to using Petsc in Fortran I follow the instructions given in that article, especially the item 3
http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/UsingFortran.html

but so far I couldn't succeed to run them succesfully in Fortran,  my main code is as follow:

program main
implicit none
#include <finclude/petscsys.h>
#include <finclude/petscvec.h>
#include <finclude/petscvec.h90>

PetscReal norm

print *,"Hello World "
end

I've added all the related include folders to search path (Petsc_Dir\include\finclude etc..) and library
file "libpetsc.a" which results after Petsc compilation, but still compiler complains about the
"Error: Unclassifiable statement at (1)" PetscReal norm. Which means that compiler is unaware of type
identifier PetscReal. What am I missing here ?

Your help will be appreciated,

Regards,




___________________________________________________
____________________________

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130429/ab95f949/attachment.html>


More information about the petsc-users mailing list