1! 2! Simple PETSc Program written in Fortran 3! 4 program main 5#include <petsc/finclude/petscsys.h> 6 use petscsys 7 implicit none 8 9 PetscErrorCode ierr 10 PetscInt f(1) 11 call PetscInitialize(PETSC_NULL_CHARACTER,ierr) 12 if (ierr .ne. 0) then 13 print*, 'Unable to begin PETSc program' 14 endif 15 16 f(1) = 1 17 call MPI_Allreduce(MPI_IN_PLACE,f,1,MPIU_INTEGER,MPI_MIN,PETSC_COMM_WORLD,ierr) 18 call PetscFinalize(ierr) 19 end 20 21!/*TEST 22! 23! test: 24! 25!TEST*/ 26