[petsc-dev] Fortran 2003 enum

Blaise Bourdin bourdin at lsu.edu
Tue Dec 7 11:39:13 CST 2010


On Dec 7, 2010, at 11:34 AM, Jed Brown wrote:

> On Tue, Dec 7, 2010 at 18:24, Matthew Knepley <knepley at gmail.com> wrote:
> It is present and mandated to be interoperable with C enums. Blaise pointed this
> out to me. Do any compilers at MCS support this?
> 
> Gfortran got it in version 4.1, I think, all the major commercial compilers support it.

intel has it in 11.1 (maybe in 10.1 too). PGI says it has it too, but I was not able to compile my silly example with the antyique 7.1 installed on ranger
> 
> http://gcc.gnu.org/wiki/Fortran2003Status
> 
> On that note, calling C functions from Fortran 2003 is much easier and you don't have to play the name mangling game.  How many people use F2003?

Everybody that uses a compiler that supports it. they may not take advantage of it, but the fortran 2003 functionalities should be available.
Another goodie is interoperability of C structs and fortran derived types.

Back to enum, I was hoping that direct translations between C and fortran enum would make it possible to write PetscOptionsGetENum and PetscBagRegisterEnum fortran bindings.

Blaise


> 
> Jed

-- 
Department of Mathematics and Center for Computation & Technology
Louisiana State University, Baton Rouge, LA 70803, USA
Tel. +1 (225) 578 1612, Fax  +1 (225) 578 4276 http://www.math.lsu.edu/~bourdin







-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20101207/08b2c28a/attachment.html>


More information about the petsc-dev mailing list