Intel bug with extending array of derived types in sim_data_t
I found out, that the Intel compiler has problems with extending an array as we do it:
if (allocated(this%variables)) then
this%variables = [this%variables, add_data]
else
allocate(this%variables(1))
this%variables(1)=add_data
end if
No error is risen by that, but the old variables will have all attributes reset (what a stupid behavior).
We should actually use move_alloc:
integer(i4) :: i
type(sim_var_t), allocatable :: new_variables
i = 0_i4
if (allocated(this%variables)) i = size(this%variables)
allocate(new_variables(i+1))
if (allocated(this%variables)) new_variables(1:i) = this%variables
new_variables(i+1) = add_data
call move_alloc(new_variables, this%variables)