1! Example for PetscOptionsInsertFileYAML: Fortran Example 2 3program main 4 5#include <petsc/finclude/petscsys.h> 6 use petscsys 7 8 implicit none 9 PetscErrorCode :: ierr 10 character(len=PETSC_MAX_PATH_LEN) :: filename 11 PetscBool :: flg 12 13 call PetscInitialize(PETSC_NULL_CHARACTER,ierr) 14 if (ierr /= 0) then 15 write(6,*)'Unable to initialize PETSc' 16 stop 17 endif 18 19 call PetscOptionsGetString(PETSC_NULL_OPTIONS,PETSC_NULL_CHARACTER,"-f",filename,flg,ierr) 20 if (flg) then 21 call PetscOptionsInsertFileYAML(PETSC_COMM_WORLD,filename,PETSC_TRUE,ierr) 22 end if 23 24 call PetscOptionsView(PETSC_NULL_OPTIONS,PETSC_VIEWER_STDOUT_WORLD,ierr) 25 call PetscFinalize(ierr) 26 27!/*TEST 28! 29! build: 30! requires: yaml 31! 32! test: 33! suffix: 1 34! requires: yaml 35! args: -f petsc.yml -options_left 0 36! filter: egrep -v "(malloc_dump|malloc_test|saws_port_auto_select|display|check_pointer_intensity|error_output_stdout|nox)" 37! localrunfiles: petsc.yml 38! output_file: output/ex47_1.out 39! 40! test: 41! suffix: 2 42! requires: yaml 43! args: -options_file_yaml petsc.yml -options_left 0 44! filter: egrep -v "(malloc_dump|malloc_test|saws_port_auto_select|display|check_pointer_intensity|error_output_stdout|nox)" 45! localrunfiles: petsc.yml 46! output_file: output/ex47_2.out 47! 48!TEST*/ 49end program main 50