Lahey Support
08-15-2003, 01:19 AM
This program works well on Windows and on the HP
computer of my firm (SPP2000
http://www.cilea.it/~miglioli/ARCHITETTURA/spp2000.htm )
I did not tested it in other (non Intel) Unix environments...
Sincerely
Giampaolo Bottoni
e-mail: [address removed]
http://www.cilea.it/~bottoni
================================================== ======
program scopro_win
implicit none
integer::x
character(4)::cx
x=1
cx=transfer(x,cx)
if(cx(1:1).ne.cx(2:2)) then
write(*,*) "I am working in Windows"
else
write(*,*) "I am working in Unix"
end if
write(*,*)"Invia..."
read(*,*)
stop
end program scopro_win
================================================== ====
> I think that the second message should read:
> "I should throw out my Fortran compiler & buy one which works!"
> DEC f90 on a Dec Alpha outputs the first message, i.e.
> "I am working in Windows".
> Sun's f90 gives the second message, but then very little
> Fortran code runs correctly using this compiler.
OOPS! Sorry about my last message!
The program is really testing the format in which a REAL number
is stored. i.e. whether the high order or low-order bytes
are stored first. If cx(1:1) = cx(2:2), then the high-order
bytes are stored first (they are both zero when x = 1.0)
Alan.Miller @ vic.cmis.CSIRO.AU = Alan Miller, Honorary Research Fellow (Retired)
CSIRO Mathematical & Information Sciences, Melbourne, Australia
Phone: +61 3 9545-8036 Fax: +61 3 9545-8080 URL: http://www.ozemail.com.au/~milleraj
Mail: CSIRO CMIS, Private Bag 10, Clayton South MDC, Vic. 3169, Australia
computer of my firm (SPP2000
http://www.cilea.it/~miglioli/ARCHITETTURA/spp2000.htm )
I did not tested it in other (non Intel) Unix environments...
Sincerely
Giampaolo Bottoni
e-mail: [address removed]
http://www.cilea.it/~bottoni
================================================== ======
program scopro_win
implicit none
integer::x
character(4)::cx
x=1
cx=transfer(x,cx)
if(cx(1:1).ne.cx(2:2)) then
write(*,*) "I am working in Windows"
else
write(*,*) "I am working in Unix"
end if
write(*,*)"Invia..."
read(*,*)
stop
end program scopro_win
================================================== ====
> I think that the second message should read:
> "I should throw out my Fortran compiler & buy one which works!"
> DEC f90 on a Dec Alpha outputs the first message, i.e.
> "I am working in Windows".
> Sun's f90 gives the second message, but then very little
> Fortran code runs correctly using this compiler.
OOPS! Sorry about my last message!
The program is really testing the format in which a REAL number
is stored. i.e. whether the high order or low-order bytes
are stored first. If cx(1:1) = cx(2:2), then the high-order
bytes are stored first (they are both zero when x = 1.0)
Alan.Miller @ vic.cmis.CSIRO.AU = Alan Miller, Honorary Research Fellow (Retired)
CSIRO Mathematical & Information Sciences, Melbourne, Australia
Phone: +61 3 9545-8036 Fax: +61 3 9545-8080 URL: http://www.ozemail.com.au/~milleraj
Mail: CSIRO CMIS, Private Bag 10, Clayton South MDC, Vic. 3169, Australia