<div dir="ltr"><div><div><div><div><br><br></div>Well, when dealing with Fortran I also often encounter software which cannot be changed or upgraded to a more modern style. <br><br></div>What was in my mind is to create an interface additional to what is already there in petsc. So this should be compiled along with anyone's code if the used ocmpiler supports F03 or the necessary features of F03. This way the older codes can be kept with the original F77 interface. Same thing they did for Mpi and F03, F08 in the Mpi 3 standard if I'm not mistaken.<br>
<br></div><br></div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Oct 27, 2013 at 8:51 PM, Tabrez Ali <span dir="ltr"><<a href="mailto:stali@geology.wisc.edu" target="_blank">stali@geology.wisc.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"><div class="im">
On 10/27/2013 12:36 PM, Hossein Talebi wrote:
<blockquote type="cite">
<div dir="ltr">Thank you for your answer.
<div><br>
</div>
<div>It is not true that F2003 support is that limited:
Gfortran, Intel Fortran, Cray Fortran, IBM Fortran and PGI
Fortran all support nearly full F2003. Some other ones support
the C portability of F2003 although not supporting the rest.</div>
</div>
</blockquote>
<br></div>
You're 100% right but many systems often have older versions of
these compilers that don't support the Fortran C interoperability.
There is absolutely no excuse to not upgrade but then its not always
possible.<br>
<br>
Unless there is a significant gain in functionality (or ease of
support) by moving to a Fortran 2003 compiler it would be better to
be conservative. One advantage of being able to build PETSc on a old
enough system (e.g., Debian Etch with GCC 4.1; glibc 2.4) is that
you can very easily build a static binary of your code and it will
run pretty much on every Linux machine out there.<div><div class="h5"><br>
<br>
T<br>
<br>
<blockquote type="cite">
<div dir="ltr">
<div>* I can contribute on creating this interface. I have
experience with F2003 to C++ and it works fine while C is a
lot easier. My idea is to create the F03 interface to petsc as
a separate tool. So, anyone trying to use petsc with a F03
compiler can compile this interface again to avoid the
compiler inconsistency of Modules. <br>
</div>
<div><br>
</div>
<div>We can work on a python (or similar) script to generate the
interfaces. For example, a project called gtk-fortran uses
this method. Can any of you guys help a little for planning
the interface design?</div>
<div><br>
</div>
<div><br>
</div>
<div>Cheers</div>
<div>Hossein</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div> </div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div> </div>
<div class="gmail_extra">
<br>
<br>
<div class="gmail_quote">On Sun, Oct 27, 2013 at 4:42 PM,
Satish Balay <span dir="ltr"><<a href="mailto:balay@mcs.anl.gov" target="_blank">balay@mcs.anl.gov</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On Sun, 27 Oct 2013, Matthew Knepley wrote:<br>
<br>
> On Sun, Oct 27, 2013 at 6:16 AM, Hossein Talebi
<<a href="mailto:talebi.hossein@gmail.com" target="_blank">talebi.hossein@gmail.com</a>>wrote:<br>
><br>
> > Hello All,<br>
> ><br>
> > I am trying to use petsc with Fortran. The
initial mechanism to use petsc<br>
> > with FORTRAN77 that works fine. However, I
found the Fortran 90 interfaces<br>
> > difficult to work with. The very first issue
is one has to recompile petsc<br>
> > with the Fortran compiler in case different to
the one which was used to<br>
> > create the Fortran Mod files.<br>
<br>
</div>
Yes - one cannot mix fortran code compiled with 2
different compilers<br>
- or 2 different version of the same compiler wrt modules.<br>
<br>
But we generally recommend not mixing compilers for C
aswell as this<br>
can cause problems.<br>
<br>
Also you don't need to use modules to get f90 interfaces.
You can include<br>
the f90 interface include files directly in your code.<br>
<br>
#incude "finclude/petsc.h90"<br>
<div><br>
> > Also, we would still need to use C type<br>
> > #include statements along with Fortran 'use'
statement which is not so<br>
> > optimal.<br>
<br>
</div>
Even if you were to use f90 modules #include is
unavoidable as we still<br>
have other stuff in include files.<br>
<br>
check include/finclude/petscsysdef.h
include/finclude/petscsys.h<br>
<div><br>
> > Since Fortran 2003 offers great interface to
C, did anyone try to write a<br>
> > F03 interface to petsc? Using F03 features, we
can have very low data<br>
> > access to petsc database as well.<br>
> ><br>
><br>
> F2003 support is fairly thin in the compiler world,
and we have not had<br>
> much call for it. We do gratefully accept
contributions.<br>
<br>
</div>
Currently we have the f90 interfaces [in
include/finclude/ftn-auto/]<br>
automatically generated by bfort tool from the C
interface. So to<br>
support F03 it would be ideal if there is such a tool. [or
update<br>
bfort to do it]<br>
<span><font color="#888888"><br>
Satish<br>
</font></span></blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
</div>
</div>
</blockquote>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888"><pre cols="72">--
No one trusts a model except the one who wrote it; Everyone trusts an observation except the one who made it- Harlow Shapley</pre>
</font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><div>Dr.-Ing. Hossein Talebi</div><div><br></div><div>Bauhaus-Universität Weimar</div><div>Graudate Research School 1462 "Evaluation of Coupled Numerical and Experimental Partial Models in Structural Engineering " </div>
<div>Postdoctoral Researcher</div><div><br></div><div>Berkaer Str. 9</div><div>99425 Weimar</div><div>Tel.: +49/3643/58 41 03</div><div>Fax: +49/3643/58 41 01</div><div>E-Mail: hossein.talebi<a href="mailto:maximilian.huber@uni-weimar.de" target="_blank">@uni-weimar.de</a></div>
<div><a href="http://www.uni-weimar.de/grk1462" target="_blank">www.uni-weimar.de/grk1462</a></div></div>
</div>