The TASKCOMMON directive declares variables in a global COMMON block as private. Every variable declared in a task common block becomes a private variable. Only named COMMON blocks can be declared TASK COMMON.
The syntax of the directive is:
C$PAR TASKCOMMON common_block_name
The directive must appear immediately after the defining COMMON declaration.
This directive is effective only when compiled with -explicitpar or -parallel. Otherwise, the directive is ignored and the block is treated as a regular common block.
Variables declared in task common blocks are treated as private variables in all the DOALL loops they appear in explicitly, and in the routines called from a loop where the specified common block is in its scope.
It is an error to declare a common block as task common in some but not all compilation units where the block is defined. A check at runtime for task common consistency can be enabled by compiling the program with the -xcommonchk=yes flag. (Enable the runtime check only during program development, as it can degrade performance.)