xref: /petsc/src/sys/tests/ex47f.F90 (revision b1b17bd547dd4caae783b804fcef58fccbbc4eab)
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!   filter: egrep -v "(options_left|malloc_dump|malloc_test|saws_port_auto_select|display|check_pointer_intensity|error_output_stdout|nox|vecscatter_mpi1|checkstack|use_gpu_aware_mpi)"
26!
27!   test:
28!      suffix: 1
29!      args: -f petsc.yml -options_left 0
30!      localrunfiles: petsc.yml
31!      output_file: output/ex47_1.out
32!
33!   test:
34!      suffix: 2
35!      args: -options_file_yaml petsc.yml -options_left 0
36!      localrunfiles: petsc.yml
37!      output_file: output/ex47_2.out
38!
39!TEST*/
40end program main
41