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