投稿

検索キーワード「code fortran」に一致する投稿を表示しています

Fortran allocate array in subroutine 220858

イメージ
Module numz integer, parameter b8 = selected_real_kind(14) end module program bla use numz real(b8The address of x is passed to the subroutine, which interprets it as the address of the starting point of an array of length 3 The subroutine sets the value of x to 5 and also sets the values of the next 2 memory locations (based on 8byte real numbers) to 5 Because y, i, and j were declared after x and hence happen to occupy memory after x, these values are corrupted by the subroutineThe array reduction intrinsic function NORM2(X,DIM) reduces Real arrays using the L 2norm operation This operates exactly the same as SUM and PRODUCT , except for the operation involved The L 2 norm of an array is the square root of the sum of the squares of the elements Subroutines 2 Springerlink Fortran allocate array in subroutine