xref: /petsc/src/sys/tests/ex47f.F90 (revision ccfb0f9f40a0131988d7995ed9679700dae2a75a) !
1! Example for PetscOptionsInsertFileYAML: Fortran Example
2#include <petsc/finclude/petscsys.h>
3program main
4  use petscsys
5
6  implicit none
7  PetscErrorCode                    :: ierr
8  character(len=PETSC_MAX_PATH_LEN) :: filename
9  PetscBool                         ::  flg
10
11  PetscCallA(PetscInitialize(ierr))
12  PetscCallA(PetscOptionsGetString(PETSC_NULL_OPTIONS, PETSC_NULL_CHARACTER, '-f', filename, flg, ierr))
13  if (flg) then
14    PetscCallA(PetscOptionsInsertFileYAML(PETSC_COMM_WORLD, PETSC_NULL_OPTIONS, filename, PETSC_TRUE, ierr))
15  end if
16
17  PetscCallA(PetscOptionsView(PETSC_NULL_OPTIONS, PETSC_VIEWER_STDOUT_WORLD, ierr))
18  PetscCallA(PetscFinalize(ierr))
19
20!/*TEST
21!
22! testset:
23!   test:
24!      suffix: 1
25!      args: -f petsc.yml -options_left 0
26!      localrunfiles: petsc.yml
27!      output_file: output/ex47_1.out
28!
29!   test:
30!      suffix: 2
31!      args: -options_file_yaml petsc.yml -options_left 0
32!      localrunfiles: petsc.yml
33!      output_file: output/ex47_2.out
34!
35!TEST*/
36end program main
37