I have an old Fortran(77+) program which was made parallel using OpenMP.
It could be compiled using older version of (perhaps around v4.8) GNU gfortran, but recently it can't; the compilation failed with the following message:
Code: Select all
Error: !$OMP THREADPRIVATE statement is not allowed inside of BLOCK DATA at (1)
Code: Select all
GNU Fortran (GCC) 5.1.1 20150618 (Red Hat 5.1.1-4)
Copyright (C) 2015 Free Software Foundation, Inc.

I learned OpenMP by reading "Parallel Programming in OpenMP" by Rohit Chandra et al; in section '4.4.1 The threadprivate Directive' of the book it reads (p106)
and I never thought it was wrong to do so (and the statements were compiled without any problems using the older versions of GNU gfortran!).... in Fortran, a threadprivate variable would be intialized only if the program contained block data statements providing initial values for the common blocks.

By the way, it was compiled without any problems using recent versions of Intel Fortran (v14.?).
Any advices/comments are welcome...
Thanks in advance,
Kazuyoshi