- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Hello,
using IVF 9.0.x the following code was working
logical :: bSt
if (bSt==.true.) then
else
end if
using IVF 10.0 it is not working. Every time the else statement is used.
Is this code incorrect according to fortran standard?
Thanks in advance
Frank
using IVF 9.0.x the following code was working
logical :: bSt
if (bSt==.true.) then
else
end if
using IVF 10.0 it is not working. Every time the else statement is used.
Is this code incorrect according to fortran standard?
Thanks in advance
Frank
- Marcas:
- Intel® Fortran Compiler
Link copiado
2 Respostas
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
The code is not standard and not correct. == is not defined for logical values, though Intel Fortran supports this as an extension. You should be using .EQV. instead. For much more information, see my article It's only LOGICAL.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
I suppose I should add that your test could be simplified to:
if (bSt) then
...
Typically one does not need to compare against .TRUE. and .FALSE. explicitly. But if you do, use .EQV. or .NEQV..
if (bSt) then
...
Typically one does not need to compare against .TRUE. and .FALSE. explicitly. But if you do, use .EQV. or .NEQV..
Responder
Opções do tópico
- 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