[petsc-dev] Fortran equivalent + separate output with output_file

Pierre Jolivet pierre.jolivet at enseeiht.fr
Mon Jan 13 09:32:22 CST 2020

This is actually two separate questions, sorry.
1) I’m looking for the Fortran equivalent of the following, but I couldn’t get any help looking at the sources.
  ierr = PetscOptionsBegin(PETSC_COMM_WORLD,"","","");CHKERRQ(ierr);
  ierr = PetscOptionsFList("-mat_type","Matrix type","MatSetType",MatList,deft,type,256,&flg);CHKERRQ(ierr);
  ierr = PetscOptionsEnd();CHKERRQ(ierr);
2) I have Fortran tests which share the same outputs as my C tests. I want to use the same output_file, but my test has a separate output parameter. Is there someway to generate output_file dynamically?
!   test:
!      suffix: foo
!      output_file: output/ex76_foo_bar-%D.out <— how to?
!      nsize: 4
!      args: -bar {{5 15}separate output}
If it’s not possible in Fortran, but possible in C, I can switch things around of course.


More information about the petsc-dev mailing list