, . v, , ( , ..) ( ) OpenMP .
, - , , , , ; , , v (64, 64) , .
, , :
...
real*8 :: left, right, up, down, centre
nx=256
ny=256
i=(blockIdx%x-1)*blockDim%x+threadIdx%x
j=(blockIdx%y-1)*blockDim%y+threadIdx%y
if (i<nx .and. j<ny .and. i>1 .and. j>1) then
left = v(i-1,j)
right = v(i+1,j)
up = v(i, j+1)
down = v(i, j-1)
centre= v(i,j)
endif
call syncthreads()
if (i<nx .and. j<ny .and. i>1 .and. j>1) then
v(i,j) = centre + diffconst*(left+right+up+down-4.*centre)
if (i==64 .and. j==64) v(i,j)=v(i,j)+1
endif
, ; , / v. - .
, parallelism. - , , vnew; , . , timestep vnew, timestep .