主题:采用openmp并行生成计算的exe,结果为0……
增加 !$OMP Parallel DO 语句~~
结果运行结果为0~
问题在哪儿呢
另外,如果我只想对代码的 CALL PCALC 并行计算,如何处理呢?
谢谢大家~~
代码如下:
!$OMP Parallel DO
C Begin Source LOOP
SOURCE_LOOP: DO ISRC = 1, NUMSRC
IF (SRCTYP(ISRC)(1:5) .EQ. 'POINT') THEN
C Calculate Point Source Values --- CALL PCALC
CALL PCALC
ELSE IF (SRCTYP(ISRC) .EQ. 'VOLUME') THEN
C Calculate Volume Source Values --- CALL VCALC
CALL VCALC
ELSE IF (SRCTYP(ISRC)(1:4) .EQ. 'AREA') THEN
C Calculate AREA/AREAPOLY/AREACIRC Source Values --- CALL ACALC
CALL ACALC
ELSE IF (SRCTYP(ISRC) .EQ. 'OPENPIT') THEN
C Calculate OpenPit Source Values --- CALL OCALC
CALL OCALC
END IF
C Check for runtime error (RUNERR) before continuing loop
C IF (RUNERR) EXIT
END DO SOURCE_LOOP
!$OMP End Parallel DO
C End Source LOOP