pgf90 Compile error related to OpenMP

Hi:
I’m experimenting OpenMP recently and find a strange compile error related to THREADPRIVATE derivative when using pgf90 to compile the following code :

MODULE A22_MODULE8
REAL, POINTER :: WORK(:)
SAVE WORK
!$OMP THREADPRIVATE(WORK)
END MODULE A22_MODULE8

SUBROUTINE SUB1(N)
USE A22_MODULE8
!$OMP PARALLEL PRIVATE(THE_SUM)
ALLOCATE(WORK(N))
CALL SUB2(THE_SUM)
WRITE(,)THE_SUM
!$OMP END PARALLEL
END SUBROUTINE SUB1

SUBROUTINE SUB2(THE_SUM)
USE A22_MODULE8
WORK(:) = 10
THE_SUM=SUM(WORK)
END SUBROUTINE SUB2

PROGRAM A22_8_GOOD
N = 10
CALL SUB1(N)
END PROGRAM A22_8_GOOD

The code above comes from the example of www.openmp.org’s latest manual (v2.5, Example A.22, page 162), which intents to test the use of THREADPRIVATE derivative.
When I use
pfg90 -mp -o test test.f90
to compile the file, PGI complier complains that:

PGF90-S-0034-Syntax error at or near identifier work (test.f90: 4)

This indicates that “!$OMP THREADPRIVATE(WORK)” has syntax error. So I’m very comfusing now. Does this mean that this kind of usage is not supported by PGI or it’s just a bug? My version is PGI 5.2.

I will be grateful if someone could hand out a clue on this.

Hi ran,

PGI 5.2 supports OpenMP Version 1.0. You’ll need to upgrade to Version 6.1 or later for OpenMP 2.5 support. You can download the latest release HERE.

Thanks,
Mat