This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: LOGICAL intrinsic seems to be broken
- From: Dominique d'Humières <dominiq at lps dot ens dot fr>
- To: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- Cc: gfortran <fortran at gcc dot gnu dot org>
- Date: Sun, 12 Nov 2017 20:03:35 +0100
- Subject: Re: LOGICAL intrinsic seems to be broken
- Authentication-results: sourceware.org; auth=none
Hi Steve,
I don’t think the problem is specific to LOGICAL. AFAIU it is related to
write(*,*) logical(.true., j(i)), logical_kinds(i)
where gfortran does not consider j(i) as a constant. This why I used the convoluted construct
integer, parameter :: j(size(real_kinds)+4)=[REAL_KINDS, [4, 4, 4, 4]]
...
if (i == 1) then
write(astring, '(ru,g0)') 1.0/real(10.0, kind=j(1))
else if (i == 2) then
write(astring, '(ru,g0)') 1.0/real(10.0, kind=j(2))
else if (i == 3) then
write(astring, '(ru,g0)') 1.0/real(10.0, kind=j(3))
else if (i == 4) then
write(astring, '(ru,g0)') 1.0/real(10.0, kind=j(4))
end if
in gfortran.dg/fmt_g0_7.f08.
I did not dig the standard to understand if gfortran is too restrictive in the interpretation of j(i).
Cheers,
Dominique