View previous topic :: View next topic |
Author |
Message |
Kenneth_Smith
Joined: 18 May 2012 Posts: 813 Location: Hamilton, Lanarkshire, Scotland.
|
Posted: Thu May 22, 2025 10:48 am Post subject: CAST to REAL/INTEGER in array constructor |
|
|
FTN95 version 8.95 added cast to CHARACTER(LEN=n) or to REAL within an array constructor. However the write statements in the code below show that the type conversion from integer to real is not occurring.
Code: | program p
implicit none
write(*,*) [real :: 1,2,3] ! FTN95 prints integers not reals
write(*,'(3F6.3)') [real :: 1,2,3] ! Runtime error with FTN95 - format mismatch
end program p |
Casting to integer is not supported in FTN95, perhaps this could be added to the wish-list? It was a program with the following call which caused me to look at this:
CALL SUB1([integer :: ])
i.e. SUB1 has as input an integer array of size zero (which does make sense following the programmer's methodology)! |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8208 Location: Salford, UK
|
Posted: Sat May 24, 2025 7:10 am Post subject: |
|
|
Ken
Thank you for the feedback. I have logged these issues for investigattion. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8208 Location: Salford, UK
|
Posted: Sat May 24, 2025 2:24 pm Post subject: |
|
|
These issues have now been fixed for the next release of FTN95. |
|
Back to top |
|
 |
|