This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Passing class arrays as dummy argument - not working - gfortran 4.8 and 5.3
- From: Paolo Orsini <paolo dot orsini at gmail dot com>
- To: Dominique d'Humières <dominiq at lps dot ens dot fr>
- Cc: fortran at gcc dot gnu dot org, Andre Vehreschild <vehre at gmx dot de>
- Date: Tue, 23 Aug 2016 18:30:11 +0200
- Subject: Re: Passing class arrays as dummy argument - not working - gfortran 4.8 and 5.3
- Authentication-results: sourceware.org; auth=none
- References: <89788475-6641-47B1-AB71-AF7F56A5AA22@lps.ens.fr> <5ABEC670-64AC-4CE5-AABC-611C9A040454@lps.ens.fr>
Thanks everybody for the prompt reply.
It sounds like the problem has been fixed in later releases, which sounds good.
I am writing code for a collaborative projects
(http://www.pflotran.org/), and unfortunately I don't think we will be
able to update to the latest gcc version straight away.
At the moment I am using a work around: in the called function I
replace "class" with "type", and if casting is required to parent
classes, I do this with pointer before passing the array in the
calling program.
Do you see any problem with that?
Damian, thanks a lot for your observation.
I have used "double precision" only in this simple example, in the
collaborative project things are a bit more complicated (we use Petsc
wrapper for Real definitions, PETSc is a external math library)
But I see how real(real64) is cleaner, and I just tested on gcc4.8, it works.
Regarding the choice of using pointer array to allocate, rather than
"allocatable", is mainly due to portability.
Other PFLOTRAN developer experienced many problem with the
"allocatable" option, when using other compiler.
For this reason we don't use allocatable at all. Also, pointer
simplify things a bit, for pointing operations (do not need to use
target all the times)
I also tried allocatable for the simple program I emailed you, and it
doesn't make any difference.
Thanks again for your help
Paolo
2016-08-23 17:25 GMT+02:00 Dominique d'Humières <dominiq@lps.ens.fr>:
> Likely revision r222361 (pr60322).
>
> Dominique
>
>> Le 23 août 2016 à 17:14, Dominique d'Humières <dominiq@lps.ens.fr> a écrit :
>>
>> This seems to be fixed on gcc-6.2.0 and trunk.
>>
>> Cheers,
>>
>> Dominique
>>
>