- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
please see the following test program.
[fortran]
program counter
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
implicit none
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
integer (kind = 4) :: icel,ncc
! initiate
ncc = 10
! loop
do icel = 1,ncc
write(*,*)icel,ncc
enddo ! icel
!
write(*,*)'================================='
write(*,*)icel,ncc
end program counter
[/fortran]
[plain]
screen output
1 10
2 10
3 10
4 10
5 10
6 10
7 10
8 10
9 10
10 10
=================================
11 10
[/plain]
Why is icel one more after the loop? I am not new to fortran, but I have never observed that before. I am using using composer_xe_2011_sp1.9.293 on an 64bit opensuse 12.1 with kernel 3.1.10-1.16. If someone could explain that to me, would be fine!
Eide
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Because that is what the Fortran Standard specifies. See the explanation at http://software.intel.com/sites/products/documentation/doclib/stdxe/2013/composerxe/compiler/fortran-win/index.htm or see section 8.1.6.6.2-1(3) of the Fortran-2008 Standard.
- 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

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