- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Hi,
I have an array as follows:
ARRAY1(50,78)
I want to perform an EOSHIFT for only one value of dimension 1. For example, I want to shift all of the following values:
ARRAY1(16,1:78)
My example has 16 but I want this to be dynamic. I want to leave all other values unchanged. ARRAY1(1:15,1:78) and ARRAY1(17:50,1:78) should be unchanged.
I think I can use this:
INTEGER SHIFT(50)
INTEGER MY_INT
SHIFT=0
MY_INT = 16
SHIFT(MY_INT) = 1
ARRAY1 = EOSHIFT(ARRAY1, SHIFT, DIM=2)
I'm pretty sure this will work butis therea more efficient way?
Can I eliminate the SHIFT array with 50 elements?
Thanks,
Ernie P.
- Etiquetas:
- Intel® Fortran Compiler
1 Solución
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Perhaps
[fortran]array1(my_int,:) = EOSHIFT(array1(my_int,:), 1)[/fortran]The compiler may (?) still create temporary arrays for the expression and assignment, but at least it's reasonably clear from the line of source what your intent is.
Enlace copiado
2 Respuestas
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Perhaps
[fortran]array1(my_int,:) = EOSHIFT(array1(my_int,:), 1)[/fortran]The compiler may (?) still create temporary arrays for the expression and assignment, but at least it's reasonably clear from the line of source what your intent is.
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
IanH,
Works. Thanks a lot!
Ernie P.

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