Re: printing logical variables as "true" and "false"



Hello
I prefer the function. But another alternative is:

program test
implicit none
character(len=5), dimension(0:1), parameter :: tf = (/'false','true
'/)
logical a,b

a = .true.
b = .false.

write(*,*) tf(transfer(a,0)), tf(transfer(b,0))

end program


Néstor Grion

.


Quantcast