- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Does Fortran provide any sort of internal namlist read from a character array buffer?
If so, how does the character data in the namelistget read?
- Etiquetas:
- Intel® Fortran Compiler
Enlace copiado
5 Respuestas
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Fortran 95 disallows it but Fortran 2003 allows it. Intel Fortran does not yet support this.
Here's what it would look like:
namelist /n/ i,j,k
integer i,j
character(10) k
character(20) lines(3)
lines(1) = '&n i=1,'
lines(2) = 'j=3'
lines(3) = 'k="abcde" '
read (lines,n)
write (*, n)
end
Here's what it would look like:
namelist /n/ i,j,k
integer i,j
character(10) k
character(20) lines(3)
lines(1) = '&n i=1,'
lines(2) = 'j=3'
lines(3) = 'k="abcde" '
read (lines,n)
write (*, n)
end
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
What release of Intel Fortran is expected to provide this feature? How soon will it be available?
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
This feature has not yet been targeted to a specific release, so I have no answer for you. I suggest you look for alternatives, such as writing the data to a temp file and reading it from the file.
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Steve,
Alternate name list seems quite neat. Takes me back to the days of FOCAL (1968) and some of the other interpreter languages (BASIC)where you could execute the contents of a string variable.
Questions:
Can expressions exist to right of '=' or are you limited to initialization statements only?
If expressions are supported, can userfunctions be called?
Jim
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
The values follow the same rules as list-directed input. No expressions. All that is being asked for here is Namelist input from an internal file. Namelist input is already supported from a "regular" file - that's a F90 feature (and a popular extension to F77.)

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