- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
! Console2.f90
module mod_foo
integer, parameter :: n=8
double precision :: a(n)
!dir$ attributes align : sizeof(double precision)*n :: a
double precision :: b(n)
!dir$ attributes align : sizeof(b(1))*n :: b
double precision :: c(n)
!dir$ attributes align : 8*n :: c
end module mod_foo
program tst
use mod_foo
print *, a,b
end program
1>C:\Users\Jim\Source\Repos\Console2\Console2\Console2.f90(5): error #6326: This specifier is invalid for this I/O operation.
1>C:\Users\Jim\Source\Repos\Console2\Console2\Console2.f90(7): error #6326: This specifier is invalid for this I/O operation.
1>C:\Users\Jim\Source\Repos\Console2\Console2\Console2.f90(9): error #6326: This specifier is invalid for this I/O operation.
Jim Dempsey
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Weird error message, but this directive just wants an integer literal there, not an expression. "sizeof(double precision)" would be invalid almost anywhere (exception being fixed-form where you have a variable "DOUBLEPRECISION").
My guess for the message text is that the developer picked a number for an existing message and didn't think about the wording being appropriate.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
sizeof(double precision), sizeof(REAL), sizeof(logical), ... should be a compile time evaluation.
In the actual code, I wanted the compiler to assure that an array of some type, is aligned at a boundary of equal to the sizeof(array) .equiv. to sizeof(type of array)*parameter of number of elements in array.
IMHO sizeof() should be available at compile time in places where identity of what is being sizeof'd can be determined at compile time.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, SIZEOF (an extension) can be evaluated at compile time, but the syntax of directives doesn't provide for expressions or even named (PARAMETER) constants - literals only.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Then this leads the solution to having to use /fpp and #define ...
Something which is frowned upon.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Given these are all non-standard constructs does it really matter which form of extension is used ie fpp or !dec$ or both.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page