- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It seems that while integer and real allocatable arrays are fine with namelist in version 11.1.046, the allocatable character arrays still have a problem.
The snippet below has correct values for arrays I and R but the character array changes to undefined pointer/array if the length of character is greater than or equal to 5. If it is less than 5 then the debugger shows undefined address.
Abhi
---
Program Test_Namelist
Implicit None
Integer, Allocatable :: I(:)
Real, Allocatable :: R(:)
Character(1), Allocatable :: C(:)
NameList /Test/ I, R, C
Integer, Parameter :: Linp = 71, nMax = 5
Integer :: n
Allocate(I(nMax), R(nMax), C(nMax))
I = 0; R = 1.0; C = ' '
Open(Linp, File='Test.inp', Form='Formatted', Status='Old')
Rewind(Linp)
Read(Linp,NML=Test)
Close(Linp)
Print *, I
Print *, R
Print *, C
End Program Test_Namelist
The contents of Test.inp:
&Test
I = 1, 2, 3
R = 2.0, 3.0
C = 'A', 'B', 'C', 'D'
/
Link Copied
- 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
Thanks.
Abhi
- 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
Hi,
I still have a problem with intel 11.1.056 for characters array.
When reading namelist (with the exemple below), I have a error message of "SIGSEGV, segmentation fault occurred".
When writing namelist, I have ugly symbol into characters array.
Everything is fine with REAL and INT. I attached my test files.
Any ideas ?
Xavier
Just for information :
Intel Fortran IA-64 Compiler Professional for applications running on IA-64, Version 11.1 Build 20090827 Package ID: l_cprof_p_11.1.056
Copyright (C) 1985-2009 Intel Corporation. All rights reserved
UPDATE :
The segmentation faultduring the reading was due to a delimiter problem. so the reading almost works. the segmentation fault occurs when I print the characters array. Now the character arrays contains ugly symbol or piece of code... wired ?!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Xavier
With the program snippet attached, I neither get a segmentation fault nor the character arrays contain ugly symbol. I am using WinXP64 with VS2005 and the compiler version is 11.1.054.
Abhi
- 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
Steve,
thank you for your quick answer. I 'll ask my sysadmin to install...
@+
Xavier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steve,
A little question : compilation (see lines below) doesn't work with "-stand f03" option, The use of allocatable array into namelist is a F2003 feature, isn't it ?
@+
Xavier
=== test file ===
PROGRAM MAIN
REAL, DIMENSION(:), ALLOCATABLE :: TAB
NAMELIST/TOTO/TAB
END PROGRAM MAIN
==========
- 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