1! 2! Program to test object composition from Fortran 3! 4program main 5 6#include <petsc/finclude/petscsys.h> 7 use petscsys 8 implicit none 9 10 PetscErrorCode ierr 11 PetscViewer o1, o2, o3 12 character*(4) name 13 PetscCopyMode :: mode = PETSC_COPY_VALUES 14 15 PetscCallA(PetscInitialize(ierr)) 16 PetscCallA(PetscViewerASCIIOpen(PETSC_COMM_WORLD, "stdout", o1, ierr)) 17 PetscCallA(PetscViewerASCIIOpen(PETSC_COMM_WORLD, "stderr", o2, ierr)) 18 name = 'matt' 19 PetscCallA(PetscObjectCompose(o1, name, o2, ierr)) 20 PetscCallA(PetscObjectQuery(o1, name, o3, ierr)) 21 PetscCheckA(o2 == o3, PETSC_COMM_SELF, PETSC_ERR_PLIB, 'PetscObjectQuery failed') 22 23 if (mode == PETSC_COPY_VALUES) then 24 PetscCallA(PetscViewerDestroy(o1, ierr)) 25 end if 26 PetscCallA(PetscViewerDestroy(o2, ierr)) 27 PetscCallA(PetscFinalize(ierr)) 28end 29 30! 31!/*TEST 32! 33! build: 34! requires: defined(PETSC_HAVE_FORTRAN_TYPE_STAR) 35! 36! test: 37! suffix: 0 38! output_file: output/empty.out 39! 40!TEST*/ 41