[Patch, fortran-dev] SELECT TYPE execution and allocatable scalar components
Steve Kargl
sgk@troutmask.apl.washington.edu
Wed Sep 23 21:27:00 GMT 2009
On Wed, Sep 23, 2009 at 11:12:28PM +0200, Janus Weil wrote:
> 2009/9/23 Steve Kargl <sgk@troutmask.apl.washington.edu>:
> >
> > Janus, I looked over the patch and believe that the
> > modification to the code is correct. In fact, it may
> > fix a bug in my implementation. ?The following code
> > gives
> >
> > troutmask:sgk[203] ./z
> > 42 23 42 23
> > 1 2 1 2
> > 42 4 42 4
> > 42 23 42 23
> > 42 23 42 23
> > 42 23 42 23
> >
> > where the last 3 lines are incorrect. ?The comments in
> > the code give the expected values. ?I don't have the
> > fortran-dev branch checked out. ?Can you see what the
> > output is for the code below.
>
> Actually I have made some more modifications to the patch already, but
> currently it gives the following output for your program
>
> 42 23 42 23
> 1 2 1 2
> 42 4 42 4
> 1 2 1 2
> 1 2 1 2
> 42 4 42 4
>
> which matches the comments in your code, so I guess it works :)
>
> Thanks for looking at the patch. I guess the bug was that both the
> default initializer *and* the SOURCE expression were being used for
> initialization, the default initializer coming last, and thereby
> effectively determining the value. Right?
Yes, that's the problem afaict. I posted the code to
comp.lang.fortran. The responses so far agree that
your output is the correct result.
PS: I'm checking out fortran-dev as I write.
--
Steve
More information about the Fortran
mailing list