[petsc-users] CHKERRQ in Fortran

Gaetan Kenway kenway at utias.utoronto.ca
Wed Oct 6 09:35:27 CDT 2010


  Hello

I use PETSc with fortran. I was wondering if the CHKERRQ(ierr) command 
is supposed to work in Fortran?  My compiler (mpif90 with ifort). If I 
do something like this:

call VecCreate(WARP_COMM_WORLD,globalSurfForce,ierr)
CHKERRQ(ierr)
ifort complains there is a syntax error.

I also tried:
call VecCreate(WARP_COMM_WORLD,globalSurfForce,ierr)
call CHKERRQ(ierr)

But then it complains that it can't find the chkerrq function while linking.

I'm using PETSc-3.1-p3 which was compiled with the following options:

--with-shared --download-superlu_dist=yes --download-spooles=yes 
--download-parmetis=yes --with-fortran-interfaces=1

The subroutine includes:
#include "include/finclude/petsc.h"

Am I missing something obvious?

Gaetan


More information about the petsc-users mailing list