1 | PROGRAM hpf_finite_difference |
2 | !HPF$ PROCESSORS pr(4) |
3 | REAL x(100,100), new(100,100) |
4 | !HPF$ ALIGN new(:,:) WITH x(:,:) |
5 | !HPF$ DISTRIBUTE x(BLOCK, *) ONTO pr |
6 | new(2:99,2:99) = (x(1:98,2:99)+x(3:100,2:99)+ & |
7 | & x(2:99,1:98)+x(2:99,3:100)) / 4 |
8 | diff = MAXVAL(ABS(new-x)) |
9 | end |