[petsc-dev] two quick questions on Fortran style/includes
Barry Smith
bsmith at mcs.anl.gov
Tue May 10 12:59:15 CDT 2011
On May 10, 2011, at 12:22 PM, Ethan Coon wrote:
> On Tue, 2011-05-10 at 19:06 +0200, Jed Brown wrote:
>> On Tue, May 10, 2011 at 19:01, Ethan Coon <ecoon at lanl.gov> wrote:
>> Then why are there both .F90 and .F examples (e.g.
>> src/ksp/ksp/examples/tutorials/{ex1f.F,ex44f.F90}) if both
>> must work in
>> both formats?
>>
>> Use of Fortran 90 features (e.g. modules) instead of strict F77 does
>> not require switching from fixed to free form. I agree that the long
>> lines in ex44f.F90 require free form. It is also nothing like a
>> "tutorial".
>
> Ah, I think I missed that .F examples don't use modules and could
> technically be F77 files (though must still be preprocessed).
>
Yes .F examples should be buildable with a f77 compiler (if such things still exist).
.F90 codes require an f90 compiler but still support both fixed and free format (yes it is ugly) because we don't want to monkey with making sure the right compiler options are set for free format. Different compilers have different defaults and different option names and we don't want to need to figure that all out. In writing your own code you are completely free to use free format. But you need to make sure PETSc fortran is built with the appropriate options to let that happen.
Barry
> Have I mentioned that I hate fortran?
>
> Ethan
>
> --
> ------------------------------------
> Ethan Coon
> Post-Doctoral Researcher
> Applied Mathematics - T-5
> Los Alamos National Laboratory
> 505-665-8289
>
> http://www.ldeo.columbia.edu/~ecoon/
> ------------------------------------
>
More information about the petsc-dev
mailing list