[petsc-users] CHKERRQ in Fortran

Barry Smith bsmith at mcs.anl.gov
Wed Oct 6 09:56:05 CDT 2010


  It is simply 

  CHKERRQ(ierr)

  NOT 

   call CHKERRQ(ierr)


   if it was call CHKERRQ() then the action would only happen inside the subroutine that was called which won't provide any useful information.

   Barry

On Oct 6, 2010, at 9:35 AM, Gaetan Kenway wrote:

> 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