- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
! 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 copiado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
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.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
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
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
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.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Then this leads the solution to having to use /fpp and #define ...
Something which is frowned upon.
Jim Dempsey
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Given these are all non-standard constructs does it really matter which form of extension is used ie fpp or !dec$ or both.

- Subscrever fonte RSS
- Marcar tópico como novo
- Marcar tópico como lido
- Flutuar este Tópico para o utilizador atual
- Marcador
- Subscrever
- Página amigável para impressora