! 初始化流体变量
do X = 1, lx
do Y = 1, ly
do Z = 1, lz
rho(X, Y, Z) = 1.0d0
u_x(X, Y, Z) = 0.0d0
u_y(X, Y, Z) = 0.0d0
u_z(X, Y, Z) = 0.0d0
obst(X, Y, Z) = 2 !
end do
end do
end do
!分布函数
do X = 1, lx
do Y = 1, ly
do Z = 1, lz
do q = 0, 18
ff(q, lx, ly, lz) = 0
ff_old(q, lx, ly, lz) = 0
end do
end do
end do
end do
! 初始化分布函数
!这里加并行 omp parallel do private schedule(daynamic)
do X = 1, lx
do Y = 1, ly
do Z = 1, lz
do k = 0, 18
ff_eq(k, x, y, z) = t_s(k) * rho(X, Y, Z) * &
(1.0d0 + 3.0d0 * (u_x(X, Y, Z) * ex(k) + u_y(X, Y, Z) * ey(k) + u_z(X, Y, Z) * ez(k)) + &
4.5d0 * (u_x(X, Y, Z) * ex(k) + u_y(X, Y, Z) * ey(k) + u_z(X, Y, Z) * ez(k))**2 - &
1.5d0 * (u_x(X, Y, Z)**2 + u_y(X, Y, Z)**2 + u_z(X, Y, Z)**2)
end do
do q = 0, 18
ff_old(q, X, Y, Z) = ff_eq(q, X, Y, Z)
ff(q, X, Y, Z) = ff_eq(q, X, Y, Z)
end do
end do
end do
end do
报错为 error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ) ,
具体位置在原文这一行1.5d0 * (u_x(X, Y, Z)**2 + u_y(X, Y, Z)**2 + u_z(X, Y, Z)**2)