- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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
- Balises:
- Intel® Fortran Compiler
Lien copié
2 Réponses
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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

Répondre
Options du sujet
- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable