- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there any caveat in using custom indices for allocatables? For example
real, dimension (:,:), allocatable :: T
allocate ( T(0:2,5:7) )
T = 0
T(0,5) = 1
T(2,7) = 9
print *, T
works great, but it would be to be sure there is no side effects
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I posted the first thread, an error occurred and I clicked the submit button two other times... Maybe you can delete two of the three posts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In 1957. Backus stood on the top of the highest mountain, God spoke to Backus, I give thee Fortran and all its quirks. Backus set off down the mountain to IBM HQ to report on his success, about half way down the mountain, the bag got heavy, so he looked at God's code and decided we do not need that part about Implicit None, he wandered on and the bag was heavier, so he looked again and thought - no one will ever need that part about dynamic arrays, so he tossed away more.
Finally he reached the holy place called the Watson Lab and held out the code, in 54 pages.
The leader looked at Backus and said - what is a PDF file?
!****************************************************************************
!
! PROGRAM: Console15
!
! PURPOSE: Entry point for the console application.
!
!****************************************************************************
program Console15
implicit none
! Variables
! Body of Console15
integer A(10), BigA, N,I
A(1) = 100
A(2) = 20
A(3) = 35
A(4) = 400
A(5) = 200
A(6) = 100
A(7) = 2
A(8) = -1
A(9) = 13
A(10) = 20
N = 10
write(*,*)"The earliest known Fortran Program - 1956"
BigA = A(1)
DO 20 I = 1, N
if(BigA - A(i)) 10,20,20
10 BigA = A(i)
20 Continue
write(*,*)bigA
end program Console15
The program is on Page 7 of the first manual - I merely declared the numbers. It runs on the latest compiler without change.
In anthropology they call these creation myths.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We will never know if the programmer in 1956 had a sense of humour in naming the variable BigA - I like to think she did.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The debugger was five sense lights - command
SENSE LIGHT 1
Does not work in modern Fortran

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page