Actual source code: somefort.F

  1: !
  2: !
  3: !     Utility routine used to set constants into the
  4: !     PETSc Fortran common block
  5: !

  7:       subroutine PetscSetCommonBlock(c1,c2)
  8:       implicit none

 10:  #include ../../../include/finclude/petsc.h

 12:       integer c1,c2

 14:       PETSC_COMM_WORLD    = c1
 15:       PETSC_COMM_SELF     = c2

 17:       call PetscSetFortranBasePointers(PETSC_NULL_CHARACTER,            &
 18:      &     PETSC_NULL_INTEGER,PETSC_NULL,PETSC_NULL_SCALAR,             &
 19:      &     PETSC_NULL_DOUBLE,PETSC_NULL_REAL,PETSC_NULL_OBJECT,         &
 20:      &     PETSC_NULL_FUNCTION)

 22:       return
 23:       end

 25:       subroutine PetscGetCommonCOMM(c1)
 26:       implicit none
 27:  #include ../../../include/finclude/petsc.h
 28:       integer c1

 30:       c1 = PETSC_COMM_WORLD
 31:       return
 32:       end

 34:       block data PetscCommInit
 35:       implicit none
 36: !
 37: !     this code is duplicated - because including finclude/petsc.h here
 38: !     gives compile errors.
 39: !
 40:       MPI_Comm PETSC_COMM_WORLD,PETSC_COMM_SELF
 41:       common /petscfortran7/ PETSC_COMM_WORLD,PETSC_COMM_SELF
 42:       data   PETSC_COMM_WORLD /0/
 43:       data   PETSC_COMM_SELF /0/
 44:       end