cpp: void kernel_fdtd_2d(int tmax,\nint nx,\nint ny,\nDATA_TYPE POLYBENCH_2D(ex,NX,NY,nx,ny),\nDATA_TYPE POLYBENCH_2D(ey,NX,NY,nx,ny),\nDATA_TYPE POLYBENCH_2D(hz,NX,NY,nx,ny),\nDATA_TYPE POLYBENCH_1D(_fict_,TMAX,tmax))\n{\nint t, i, j;\n\n#pragma scop\n\nfor(t = 0; t < _PB_TMAX; t++)\n{\nfor (j = 0; j < _PB_NY; j++)\ney[0][j] = _fict_[t];\nfor (i = 1; i < _PB_NX; i++)\nfor (j = 0; j < _PB_NY; j++)\ney[i][j] = ey[i][j] - 0.5*(hz[i][j]-hz[i-1][j]);\nfor (i = 0; i < _PB_NX; i++)\nfor (j = 1; j < _PB_NY; j++)\nex[i][j] = ex[i][j] - 0.5*(hz[i][j]-hz[i][j-1]);\nfor (i = 0; i < _PB_NX - 1; i++)\nfor (j = 0; j < _PB_NY - 1; j++)\nhz[i][j] = hz[i][j] - 0.7*  (ex[i][j+1] - ex[i][j] +\ney[i+1][j] - ey[i][j]);\n}\n\n#pragma endscop\n}
fortran: subroutine kernel_fdtd_2d(tmax, nx, ny, ex, ey, hz, fict)\nimplicit none\n\ninteger :: tmax, nx, ny\nDATA_TYPE, dimension(tmax) :: fict\nDATA_TYPE, dimension(ny, nx) :: ex\nDATA_TYPE, dimension(ny, nx) :: ey\nDATA_TYPE, dimension(ny, nx) :: hz\ninteger :: i, j, t\n\n!$pragma scop\ndo t = 1, _PB_TMAX\ndo j = 1, _PB_NY\ney(j, 1) = fict(t)\nend do\ndo i = 2, _PB_NX\ndo j = 1, _PB_NY\ney(j, i) = ey(j, i) - (0.5D0 * (hz(j, i) - hz(j, i - 1)))\nend do\nend do\ndo i = 1, _PB_NX\ndo j = 2, _PB_NY\nex(j, i) = ex(j, i) - (0.5D0 * (hz(j, i) - hz(j - 1, i)))\nend do\nend do\ndo i = 1, _PB_NX - 1\ndo j = 1, _PB_NY - 1\nhz(j, i) = hz(j, i) - (0.7D0 * (ex(j + 1, i) - ex(j, i)  &\n+ ey(j, i + 1) - ey(j, i)))\nend do\nend do\nend do\n!$pragma endscop\nend subroutine