[petsc-users] TAO setup with modules in Fortran 90

Barry Smith bsmith at mcs.anl.gov
Fri Oct 6 06:36:58 CDT 2017


   Randy,

    First you absolutely must use version 3.8 or the master development copy. We improved and simplified dramatically how Fortran (90) is utilized from PETSc.

    Note that there is only one simple set of include files and modules for Fortran; see the newest documentation.



   Barry


> On Oct 5, 2017, at 11:48 PM, Randy Michael Churchill <rchurchi at pppl.gov> wrote:
> 
> A simple setup question with TAO: if I were to convert the rosenbrock1f.F90 example to use a module instead of common structures, how would I setup the include statements? I've tried various combinations (using petscXXXdef.h, petscXXX.h, petscXXX.h90, along with use petscXXX), but seem to get errors with all. 
> 
> file:rosenbrock1f.h:
> module commondat
>       PetscReal    ::    alpha
>       PetscInt     ::    n
> end module commondat
> 
> file:rosenbrock1f.90:
> program rosenbrock1f
> !!include statements??? which and where???!!!
> use commondat
> ...
> 
> subroutine FormFunctionGradient(tao, X, f, G, dummy, ierr)
>      use commondat
>      implicit none
>      ...
> 
> (https://www.mcs.anl.gov/petsc/petsc-dev/src/tao/unconstrained/examples/tutorials/rosenbrock1f.F90.html)



More information about the petsc-users mailing list