- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm getting SIGSEGV errors when trying to use allocatable arrays with NAMELIST read statements. Code and input that reproduces the error appears below. This is compiled with ifort 11.1.046 on Linux. Am I missing something? Can anyone else reproduce this? Thanks.
---
PROGRAM read_namelist
IMPLICIT NONE
INTEGER :: int1, int2
REAL, ALLOCATABLE, DIMENSION(:) :: response_function
NAMELIST /RESPONSE_DATA/ int1, int2, response_function
ALLOCATE(response_function(1))
read(unit=5,NML=RESPONSE_DATA)
write(*,*) "RESULTS:", response_function(1),int1, int2
END PROGRAM
---
---
&RESPONSE_DATA
int1=13 int2=52
response_function(1) = 1.0 /
---
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
a.out 0000000000402D46 MAIN__ 11 read_namelist.f90
a.out 0000000000402B4C Unknown Unknown Unknown
libc.so.6 00002AF148689184 Unknown Unknown Unknown
a.out 0000000000402A79 Unknown Unknown Unknown
---
PROGRAM read_namelist
IMPLICIT NONE
INTEGER :: int1, int2
REAL, ALLOCATABLE, DIMENSION(:) :: response_function
NAMELIST /RESPONSE_DATA/ int1, int2, response_function
ALLOCATE(response_function(1))
read(unit=5,NML=RESPONSE_DATA)
write(*,*) "RESULTS:", response_function(1),int1, int2
END PROGRAM
---
---
&RESPONSE_DATA
int1=13 int2=52
response_function(1) = 1.0 /
---
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
a.out 0000000000402D46 MAIN__ 11 read_namelist.f90
a.out 0000000000402B4C Unknown Unknown Unknown
libc.so.6 00002AF148689184 Unknown Unknown Unknown
a.out 0000000000402A79 Unknown Unknown Unknown
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Definitely reproducible. I do not see that you're missing anything. The issue relates to the allocatable array; a static array works well, but allocatable I expect should work too.
Restrictions on NAMELIST groups were relaxed in 11.1. The sample code would flag an error with pre-11.1 compilers:
error #6578: A NAMELIST group object must not be an allocatable object, a pointer, or a variable of a type that has an ultimate component that is a pointer or an allocatable array.
I directed this to the development team and will update the thread as I learn more.
(Internal tracking id: DPD200138414)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This doesn't surprise me as just yesterday I reported two other issues relating to allocatable arrays and NAMELIST. My advice is to assume that allocatable and pointer arrays are not yet supported for NAMELIST.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This issue is resolved in the 11.1.056 update.
$ ifort -V -g -traceback u67321.f90
Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20090827 Package ID: l_cprof_p_11.1.056
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.
Intel Fortran 11.1-2582
GNU ld version 2.17.50.0.6-5.el5 20061020
$ ./a.out
RESULTS: 1.000000 13 52

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