- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
I had assumed that for an optional logical dummy argument one can do this:
if(present(dummyLogicalArg) .and. dummyLogicalArg)then
But if the dummyLogicalArg is in fact missing then I get an access violation about the second operand. Am I missing something or do I need a certain level of optimization so that if the first operand fails the second part of an AND need not get evaluated.
Tim
if(present(dummyLogicalArg) .and. dummyLogicalArg)then
But if the dummyLogicalArg is in fact missing then I get an access violation about the second operand. Am I missing something or do I need a certain level of optimization so that if the first operand fails the second part of an AND need not get evaluated.
Tim
- Etiquetas:
- Intel® Fortran Compiler
Enlace copiado
1 Responder
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Fortran does not have "short circuit evaluation" for logical expressions. You need to protect the second subexpression in an IF-THEN. You can't rely on a particular order of evaluation - the compiler is free to evaluate both sides of the .and. and to do so in any order that is logically equivalent.
Steve
Steve
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