Parallel Programming in Fortran 95 using OpenMP(2002 version)一书中的CRITICAL用法如下:
[Fortran] 纯文本查看复制代码
!$OMP CRITICAL name
!$OMP END CRITICAL name
这样用了之后,编译时报错,错误提示为:Unexpected junk after !$OMP CRITICAL statement at (1).
把名字删掉后,错误消失。然后参考其他资料,在OpenMP Application Program Interface Examples (2013 version4.0.0)中看到的用法如下: