File1: #include <stdio.h>\n/*\nTwo-dimension array computation with a vectorization directive\ncollapse(2) makes simd associate with 2 loops.\nLoop iteration variables should be predetermined as lastprivate. \n*/\nint main()\n{\n  int len=100;\n  double a[len][len], b[len][len], c[len][len];\n  int i,j;\n\n  for (i=0;i<len;i++)\n    for (j=0;j<len;j++)\n    {\n      a[i][j]=((double)i)/2.0; \n      b[i][j]=((double)i)/3.0; \n      c[i][j]=((double)i)/7.0; \n    }\n\n#pragma omp simd collapse(2)\n  for (i=0;i<len;i++)\n    for (j=0;j<len;j++)\n      c[i][j]=a[i][j]*b[i][j];\n\n  printf ("c[50][50]=%f\n",c[50][50]);\n  return 0;\n}\n
File2: program DRB098_simd2_orig_no\n    use omp_lib\n    implicit none\n\n    integer, parameter :: dp = kind(1.0d0)\n    real(dp), dimension(:,:), allocatable :: a,b,c\n    integer :: len, i, j\n\n    len = 100\n    allocate (a(len,len))\n    allocate (b(len,len))\n    allocate (c(len,len))\n\n    do i = 1, len\n        do j = 1, len\n            a(i,j) = real(i,dp)/2.0\n            b(i,j) = real(i,dp)/3.0\n            c(i,j) = real(i,dp)/7.0\n        end do\n    end do\n\n    !$omp simd collapse(2)\n    do i = 1, len\n        do j = 1, len\n            c(i,j)=a(i,j)*b(i,j)\n        end do\n    end do\n    !$omp end simd\n\n    print*,'c(50,50) =',c(50,50)\n\n    deallocate(a,b,c)\nend program