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