[PATCH] PR fortran/69101 -- IEEE_SELECTED_REAL_KIND part I
Steve Kargl
sgk@troutmask.apl.washington.edu
Mon Jan 21 07:02:00 GMT 2019
On Sun, Jan 20, 2019 at 05:04:24PM -0800, Steve Kargl wrote:
> On Tue, Jan 08, 2019 at 10:27:25PM +0100, Thomas Koenig wrote:
> > Hi Steve,
> >
> > > Well, that was quick. Moving code around is problematic.
> >
> > Thanks for checking. The patch is OK for trunk.
> >
>
> Thanks. I decided to see if long term approach would work.
> It almost does. The attached patch put ieee_selected_real_kind
> into the table of intrinsic functions. It automatically gets
> us a generic routine with argument chekcing and simplification.
> This just works:
>
> program foo
> use ieee_arithmetic, only : ieee_selected_real_kind
> integer, parameter :: n = ieee_selected_real_kind(6_2)
> i = 6
> print *, n, ieee_selected_real_kind(6_8), ieee_selected_real_kind(i)
> end program foo
>
> Now, the downside. I can't finesse rename on USE. This does not
> work, and I'm stuck at the moment.
>
> subroutine bar
> use ieee_arithmetic, only : isrk => ieee_selected_real_kind
> integer, parameter :: n = isrk(6)
> i = 6
> print *, n, isrk(6), isrk(i)
> end subroutine bar
>
> If anyone has an idea, I would be quite happy to hear about it.
>
Well, I found a way to at least deal with the renaming issue.
It is ugly, and won't be pursued.
--
Steve
More information about the Fortran
mailing list