1 program ex10f90 2 3#include "petsc/finclude/petsc.h" 4 use petsc 5 implicit none 6 7 PetscErrorCode :: ierr 8 Character(len=256) :: filename 9 PetscBool :: flg 10 PetscInt :: n 11 12 PetscCallA(PetscInitialize(ierr)) 13 PetscCallA(PetscOptionsGetString(PETSC_NULL_OPTIONS,PETSC_NULL_CHARACTER,'-f',filename,flg,ierr)) 14 if (flg) then 15 PetscCallA(PetscOptionsInsertFileYAML(PETSC_COMM_WORLD,PETSC_NULL_OPTIONS,filename,PETSC_TRUE,ierr)) 16 end if 17 PetscCallA(PetscOptionsView(PETSC_NULL_OPTIONS,PETSC_VIEWER_STDOUT_WORLD,ierr)) 18 PetscCallA(PetscOptionsAllUsed(PETSC_NULL_OPTIONS,n,ierr)) 19 PetscCallA(PetscFinalize(ierr)) 20 end program ex10f90 21 22! 23!/*TEST 24! 25! testset: 26! test: 27! suffix: 1 28! args: -f petsc.yml -options_left 0 29! localrunfiles: petsc.yml 30! 31! test: 32! suffix: 2 33! args: -options_file_yaml petsc.yml -options_left 0 34! localrunfiles: petsc.yml 35! 36!TEST*/ 37