cpp: #include<stdio.h>\n\nint main(int argc, char* argv[])\n{\n  int i;\n  int len=100;\n  int a[len], b[len];\n\n  for (i=0;i<len;i++)\n  {  a[i]=i; b[i]=i;} \n/* static storage for a local variable */\n#pragma omp parallel \n  {\n    static int tmp;\n#pragma omp for\n    for (i=0;i<len;i++)\n    {\n      tmp = a[i]+i;\n      a[i] = tmp;\n    }\n  }\n\n/* automatic storage for a local variable */\n#pragma omp parallel \n  {\n    int tmp;\n#pragma omp for\n    for (i=0;i<len;i++)\n    {\n      tmp = b[i]+i;\n      b[i] = tmp;\n    }\n  }\n\n  printf("a[50]=%d b[50]=%d\n", a[50], b[50]);\n \n  return 0;\n}\n
fortran: program DRB090_static_local_orig_yes\n    use omp_lib\n    implicit none\n\n    integer :: i, len\n    integer, dimension(:), allocatable :: a, b\n    integer, save :: tmp\n    integer :: tmp2\n\n    len = 100\n    allocate (a(len))\n    allocate (b(len))\n\n    do i = 1, len\n        a(i) = i\n        b(i) = i\n    end do\n\n    !$omp parallel\n        !$omp do\n        do i = 1, len\n            tmp = a(i)+i\n            a(i) = tmp\n        end do\n        !$omp end do\n    !$omp end parallel\n\n    !$omp parallel\n        !$omp do\n        do i = 1, len\n            tmp2 = b(i)+i\n            b(i) = tmp2\n        end do\n        !$omp end do\n    !$omp end parallel\n\n    print 100, a(50), b(50)\n    100 format (i3,3x,i3)\n\n    deallocate(a,b)\n\nend program