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
Does src/vec/is/examples/tests/ex1f.F work for you? That has CHKERRQ. Thanks, Matt On Wed, Oct 6, 2010 at 2:35 PM, Gaetan Kenway <[email protected]>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
-- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener
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
participants (3)
-
Barry Smith -
Gaetan Kenway -
Matthew Knepley