cpp: void print_array(int cz,\nint cxm,\nint cym,\nDATA_TYPE POLYBENCH_3D(Bza,CZ+1,CYM+1,CXM+1,cz+1,cym+1,cxm+1),\nDATA_TYPE POLYBENCH_3D(Ex,CZ+1,CYM+1,CXM+1,cz+1,cym+1,cxm+1),\nDATA_TYPE POLYBENCH_3D(Ey,CZ+1,CYM+1,CXM+1,cz+1,cym+1,cxm+1),\nDATA_TYPE POLYBENCH_3D(Hz,CZ+1,CYM+1,CXM+1,cz+1,cym+1,cxm+1))\n{\nint i, j, k;\n\nfor (i = 0; i <= cz; i++)\nfor (j = 0; j <= cym; j++)\nfor (k = 0; k <= cxm; k++) {\nfprintf(stderr, DATA_PRINTF_MODIFIER, Bza[i][j][k]);\nfprintf(stderr, DATA_PRINTF_MODIFIER, Ex[i][j][k]);\nfprintf(stderr, DATA_PRINTF_MODIFIER, Ey[i][j][k]);\nfprintf(stderr, DATA_PRINTF_MODIFIER, Hz[i][j][k]);\nif ((i * cxm + j) % 20 == 0) fprintf(stderr, "\n");\n}\nfprintf(stderr, "\n");\n}
fortran: subroutine print_array(cz, cxm, cym, bza, ex, ey, hz)\nimplicit none\n\ninteger :: cz, cxm, cym\nDATA_TYPE, dimension(cxm + 1, cym + 1, cz + 1) :: bza\nDATA_TYPE, dimension(cxm + 1, cym + 1, cz + 1) :: ex\nDATA_TYPE, dimension(cxm + 1, cym + 1, cz + 1) :: ey\nDATA_TYPE, dimension(cxm + 1, cym + 1, cz + 1) :: hz\ninteger :: i, j, k\n\ndo i = 1, cz + 1\ndo j = 1, cym + 1\ndo k = 1, cxm + 1\nwrite(0, DATA_PRINTF_MODIFIER) bza(k, j, i)\nwrite(0, DATA_PRINTF_MODIFIER) ex(k, j, i)\nwrite(0, DATA_PRINTF_MODIFIER) ey(k, j, i)\nwrite(0, DATA_PRINTF_MODIFIER) hz(k, j, i)\nif (mod(((i - 1) * cxm) + j - 1, 20) == 0) then\nwrite(0, *)\nend if\nend do\nend do\nend do\nwrite(0, *)\nend subroutine