Actual source code: ex8f90.F90

petsc-3.5.4 2015-05-23
Report Typos and Errors

 3:  #include finclude/petscdef.h
  4:       use petsc
  5:       implicit none

  7:       PetscErrorCode                            :: ierr
  8:       Character(len=99) list1(6)
  9:       PetscEnum                                 :: opt=-1
 10:       PetscBool                                 :: set=PETSC_FALSE

 12:       Call PetscInitialize(PETSC_NULL_CHARACTER,ierr)
 13:       list1(1) = 'a123'
 14:       list1(2) = 'b456'
 15:       list1(3) = 'c789'
 16:       list1(4) = 'list1'
 17:       list1(5) = 'prefix_'
 18:       list1(6) = ''

 20:       print*, list1(1)
 21:       call PetscOptionsGetEnum('joe_','-jeff',list1,opt,set,ierr)
 22:       write(*,*) 'opt is ', opt
 23:       write(*,*) 'set is ', set

 25:       Call PetscFinalize(ierr)
 26:       end