1! 2! Simple PETSc Program written in Fortran 3! 4 program main 5#include <petsc/finclude/petscsys.h> 6 use petscmpi ! or mpi or mpi_f08 7 use petscsys 8 implicit none 9 10 PetscErrorCode ierr 11 PetscInt f(1) 12 PetscCallA(PetscInitialize(ierr)) 13 f(1) = 1 14 PetscCallMPIA(MPI_Allreduce(MPI_IN_PLACE,f,1,MPIU_INTEGER,MPI_MIN,PETSC_COMM_WORLD,ierr)) 15 PetscCallA(PetscFinalize(ierr)) 16 end 17 18!/*TEST 19! 20! test: 21! 22!TEST*/ 23