[petsc-users] variable declaration in Fortran90
Roc Wang
pengxwang at hotmail.com
Tue Aug 28 15:45:49 CDT 2012
Hello,
I am developing Fortran90 code with PETSc. Several Modules are defined in the code. Such as
Module MyParameter
Implicit none
#include "finclude/petscsys.h"
#include "finclude/petscvec.h"
#include "finclude/petscmat.h"
#include "finclude/petscpc.h"
#include "finclude/petscksp.h"
#include "finclude/petscvec.h90"
#include "finclude/petscmat.h90"
Integer:: ... ...
Real:: ... ...
End Module MyParameter
Module MySub
Use Myparameter
Contains
... ...
Call MatSetType(A_Mat, MATAIJ, ierr)
... ...
EndModule MySub
Main Program
Use MyParameter
Use MySub
... ...
... ...
End
If I put all the modules in a single .F90 file, the compilation can be done successfully. However, If I put the modules in separated files, the following error information comes out:
Error: Symbol 'mataij' at (1) has no IMPLICIT type.
In addition, if I use PetscInt, PetscErrorCode to declare variables in Module MySub, the similar errors come out. How declare the variable with PETSc type in separate files? Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120828/02e1155e/attachment-0001.html>
More information about the petsc-users
mailing list