- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I had some troubles with file opening (see below).
Can you tell me why options 2 & 3 are not working ?
Thanks
Have a nice day,
Philippe
!
implicit none
INTEGER :: i,n,ind,opt
character (LEN=15) :: fichier,fich
fichier='test_o'
!
n=75000
write(*,*) ' Select option:'
read(*,*) opt
!
do i=1,N
write(*,*) ' Start',i,n
if(opt==1) open(15,file='test_o.dat',status='old') ! ok
if(opt==2) open(15,file=TRIM(fichier)//'.dat',status='old') ! program ends at i= 63913
if(opt==3) then ! program ends at i= 63913
ind=index(fichier,' ')-1
open(15, FILE=fichier(1:ind)//'.dat',status='old')
endif
if(opt==4) then ! ok
fich=TRIM(fichier)//'.dat'
open(15,file=fich,status='old')
endif
close(15)
write(*,*) ' end do'
enddo
stop
!
END PROGRAM test_o
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Philippe,
with option 2 & 3 you using the open command to construct the file name. For this the stack is used and every time a bit more. It ends with an not shown stack overflow. This bug is old. (http://redfort-software.intel.com/en-us/forums/showthread.php?t=42116&o=a&s=lr).
To solve the problem you have to construct the file name in advance:
character(len=400) :: filename
filename=''
filename=TRIM(fichier)//'.dat'
open(15,file=filename,status='old')
This problem should be solved with IVF 12 Update 2 (see http://redfort-software.intel.com/en-us/forums/showthread.php?t=77857)
Frank
with option 2 & 3 you using the open command to construct the file name. For this the stack is used and every time a bit more. It ends with an not shown stack overflow. This bug is old. (http://redfort-software.intel.com/en-us/forums/showthread.php?t=42116&o=a&s=lr).
To solve the problem you have to construct the file name in advance:
character(len=400) :: filename
filename=''
filename=TRIM(fichier)//'.dat'
open(15,file=filename,status='old')
This problem should be solved with IVF 12 Update 2 (see http://redfort-software.intel.com/en-us/forums/showthread.php?t=77857)
Frank
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Frank for your answer.
What had troubled me is that no debug option is able to detect the problem...
Philippe
What had troubled me is that no debug option is able to detect the problem...
Philippe

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