- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
When I try to close some files I'm getting
forrtl: severe (157): Program Exception - access violation
Other files accessed in the same way in the same run close just fine.
The file is opened with
open(kElanFile,file=trim(ElanFileName),status='unknown')
Some ascii data is written to it.
The close statement is simply
close(kElanFile)
I never had trouble closing a file before. Does anyone have any ideas?
Thanks, Andy
forrtl: severe (157): Program Exception - access violation
Other files accessed in the same way in the same run close just fine.
The file is opened with
open(kElanFile,file=trim(ElanFileName),status='unknown')
Some ascii data is written to it.
The close statement is simply
close(kElanFile)
I never had trouble closing a file before. Does anyone have any ideas?
Thanks, Andy
- Etiquetas:
- Intel® Fortran Compiler
Enlace copiado
3 Respuestas
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Hi Andy,
It looks like you already get the run-timeerror number, but would it help to add the IOSTAT option to the CLOSE statement? Perhaps it could provide another error code to help diagnose the problem.
Is it possible that the kElanFile unit number gets changed as the program runs, or another file is using the same unit number? I've had file close errors when there is an unexpected change to a file unit number. I've also had file close problems with file shared across the local network (my PC to the server) if there is a network interuption. Does using a different file unit value help, or does the error still occur?
Regards,
Greg
It looks like you already get the run-timeerror number, but would it help to add the IOSTAT option to the CLOSE statement? Perhaps it could provide another error code to help diagnose the problem.
Is it possible that the kElanFile unit number gets changed as the program runs, or another file is using the same unit number? I've had file close errors when there is an unexpected change to a file unit number. I've also had file close problems with file shared across the local network (my PC to the server) if there is a network interuption. Does using a different file unit value help, or does the error still occur?
Regards,
Greg
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Getting Error 157 on a CLOSE suggests that there has been a corruption of a run-time library data structure. The way I usually try to diagnose this is to selectively remove code before the close to see which, when removed, makes the error go away.
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Thanks for the input guys.
It turned out that boundaries of an array were being violated,
but traceback was making it appear that the error occurred when a file was being closed.
It turned out that boundaries of an array were being violated,
but traceback was making it appear that the error occurred when a file was being closed.

Responder
Opciones de temas
- Suscribirse a un feed RSS
- Marcar tema como nuevo
- Marcar tema como leído
- Flotar este Tema para el usuario actual
- Favorito
- Suscribir
- Página de impresión sencilla