xref: /petsc/src/sys/tests/ex47f.F90 (revision 66af8762ec03dbef0e079729eb2a1734a35ed7ff)
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      PetscCallA(PetscInitialize(ierr))
14      PetscCallA(PetscOptionsGetString(PETSC_NULL_OPTIONS,PETSC_NULL_CHARACTER,'-f',filename,flg,ierr))
15      if (flg) then
16        PetscCallA(PetscOptionsInsertFileYAML(PETSC_COMM_WORLD,PETSC_NULL_OPTIONS,filename,PETSC_TRUE,ierr))
17      end if
18
19      PetscCallA(PetscOptionsView(PETSC_NULL_OPTIONS,PETSC_VIEWER_STDOUT_WORLD,ierr))
20      PetscCallA(PetscFinalize(ierr))
21
22!/*TEST
23!
24! testset:
25!   test:
26!      suffix: 1
27!      args: -f petsc.yml -options_left 0
28!      localrunfiles: petsc.yml
29!      output_file: output/ex47_1.out
30!
31!   test:
32!      suffix: 2
33!      args: -options_file_yaml petsc.yml -options_left 0
34!      localrunfiles: petsc.yml
35!      output_file: output/ex47_2.out
36!
37!TEST*/
38end program main
39