- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
Hi
Some time after this (https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/532202) , IVF started to do NaN initial-value setting for allocatable arrays.
The snippet below shows that allocatable arrays from type are not getting initialized. Is there anyway to do that?
The compile-line is: ifort /Od /debug:full /Qinit:snan /Qinit:arrays Test.f90
I am using Compiler 17.0 Update 4 with Visual Studio 2015.
Abhi
=====
Module OM
Implicit None
Type newOBJ
Integer :: j
Real(8), Allocatable :: B(:)
End Type newOBJ
Contains
Subroutine SetObject(This)
Type(newOBJ), Intent(OUT) :: This
Allocate(This%B(2)) ! This won't initialize to NaN
End Subroutine
End Module OM
Program Test
Use OM
Implicit None
Real(8), Allocatable :: A(:)
Type(newOBJ) :: OBJ
Allocate(A(3)) ! gets initialized to NaN
!Allocate(OBJ%B(2)) ! OBJ%B will get initialized to NaN
Call SetObject(OBJ)
End Program Test
Ссылка скопирована
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
You've discovered a bug that still exists in the current release.
Please submit a bug report, which you can do by using the big orange button on the top of the main page of this forum.
To answer your question, you could create a variant of SetObject that accepts the component, and does the allocation. For example:
Subroutine SetObject2(This)
real(8), allocatable :: This(:)
Allocate(This(2)) ! This did initialize to NaN
End Subroutine
I did not try that with the 17.0 compiler, but it did work with our latest sources.
--Lorri
- Подписка на RSS-канал
- Отметить тему как новую
- Отметить тему как прочитанную
- Выполнить отслеживание данной Тема для текущего пользователя
- Закладка
- Подписаться
- Страница в формате печати