1 | REAL u(0:nx,0:ny), A(100,100) , fact , avg |
2 | u= fact * (u -avg) Scales and translates all elements of u |
3 | avg = .25*( CSHIFT(u,1,1) + CSHIFT(u,-1,1) + CSHIFT(u,1,2) + CSHIFT(u,-1,2) |
4 | calculates of average of 4 array elements surrounding each point. Note third argument in CSHIFT is label for axis (1=x 2=y) |
5 | SQRT( A(1:100) ) calculates a new array containing 100 square roots |
6 | SUM(A) is a reduction operator sumimg all elements of array A as a scalar |
7 | SIZE(A,1) is an Array Query Intrinsic giving size of A in the first dimension and is particularly useful for "assumed-shape" arrays passed into subroutines |