[petsc-users] Error in VecGetArrayF90 and MatGetArrayF90

Alexander Grayver agrayver at gfz-potsdam.de
Fri Jun 17 04:42:02 CDT 2011


Hello!

I use petsc-3.1.7 on Windows x64 and Intel Fortran Compiler 10.1.
Whenever I call VecGetArrayF90/MatGetArrayF90 it crashes.

For example:

subroutine VecRealPart(v)

     implicit none
#include "finclude/petscsys.h"
#include "finclude/petscvec.h"
#include "finclude/petscis.h"

   ! input variables
   Vec :: v

   ! local variables
   integer(kind=int32)  :: ierr          !error index
   integer(kind=int32)  :: i,istart,iend !counters for loops and indices
   PetscScalar,pointer  :: lv_v(:)  ! localy owned part of the vector

   call VecGetOwnershipRange(v,istart,iend,ierr)
   call VecGetArrayF90(v,lv_v,ierr)        ! <<<<<<<<<<<<<< crash

   do i=1,iend-istart
     lv_v(i) = dcmplx(real(lv_v(i)))
   enddo

   call VecRestoreArrayF90(v,lv_v,ierr)

end subroutine VecRealPart

When I trace into these procedures during debuging I see that parameter 
ptr is always 0x00000000:
void PETSC_STDCALL matgetarrayf90_(Mat *mat,F90Array2d *ptr,int *ierr 
PETSC_F90_2PTR_PROTO(ptrd))
void PETSC_STDCALL vecgetarrayf90_(Vec *x,F90Array1d *ptr,int *__ierr 
PETSC_F90_2PTR_PROTO(ptrd))

What could be the possible reason for such behavior?

Regards,
Alexander


More information about the petsc-users mailing list