fortran 90 program with PETSc

tsjb00 tsjb00 at hotmail.com
Wed Jun 24 18:36:27 CDT 2009


compiling passed if:
     use parm
      implicit real*8 (a-h,o-z)
#include "finclude/petsc.h"

Is this ok? Many thanks!
From: tsjb00 at hotmail.com
To: petsc-users at mcs.anl.gov
Subject: RE: fortran 90 program with PETSc
Date: Wed, 24 Jun 2009 22:59:06 +0000








Many thanks for your help! I've tried the method in your email .
In the main program called driver.F, it is coded:
      program main
      use parm
#include "finclude/petsc.h"
      implicit real*8 (a-h,o-z)
.................................
I got the following error information :

 In file driver.F:280

      implicit none                                                     
                                                                       1
 In file /home/jinbei/Soft/petsc-3.0.0-p5/include/finclude/petsc.h:209

     Included at driver.F:279

                    
                   2
Error: IMPLICIT NONE statement at (1) cannot follow data declaration statement at (2)

Would you please tell me what might be wrong?

Many thanks in advance!



> Date: Wed, 24 Jun 2009 16:59:43 -0500
> From: balay at mcs.anl.gov
> To: petsc-users at mcs.anl.gov
> Subject: Re: fortran 90 program with PETSc
> 
> On Wed, 24 Jun 2009, tsjb00 wrote:
> 
> > 
> > Hi!
> 
> >  I am trying to parallelize a fortran 90 program with PETSc. The
> > original program uses a lot of global variables defined using
> > fortran 90 modules.
> 
> >  My question is: Can I use 'include PETSc include file' and 'use
> > MyModule' in the program at the same time?
> 
> yes.
> 
> > If so, in what sequence should I put 'include XXX', 'use XXX' and
> > 'implicit' statements?
> 
> The following should work.
> 
> use foo
> #include "finclude/petsc.h"
> implicit none
> 
> 
> > Another general question is whether I can use fortran 90 features
> > such as 'module' and dynamic allocation on a parallel system of
> > MPI-1 standard? Any reference on such programming work will be also
> > appreciated.
> 
> I don't see why not. f90 issues you mentioned are unrelated to MPI
> 
> Satish
> 
> > Many thanks in advance!
> > 
> > 
> > _________________________________________________________________
> > 约会说不清地方?来试试微软地图最新msn互动功能!
> > http://ditu.live.com/?form=TL&swm=1

立刻下载 MSN 保护盾,保障Messenger 安全稳定! 现在就下载!
_________________________________________________________________
Messenger10年嘉年华,礼品大奖等你拿!
http://10.msn.com.cn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20090624/5d9ea09f/attachment.htm>


More information about the petsc-users mailing list