HP Fortran Programmer's Reference (September 2007)

HP Fortran statements
TASK COMMON (extension)
Chapter 10 479
TASK COMMON (extension)
Declares a common block to be local to a thread during parallel execution.
NOTE A program that uses the TASK COMMON statement should be compiled with the
+Oparallel or +parallel option; otherwise, the compiler treats the TASK
COMMON statement as a COMMON statement.
NOTE In case of Fortran Version 3.2 and higher, the +Oparallel option is not
available on Integrity systems. You can use the +Oautopar option instead of
+Oparallel on Integrity systems.
Syntax
TASK COMMON /cbn/nlist[,/cbn/nlist...]
cbn
is a symbolic name for a common block that is declared in a TASK
COMMON statement. Unnamed common blocks are not allowed in a TASK
COMMON statement.
nlist
is a list of variable names, array names, and array declarators. These
variables cannot appear in a DATA statement, but otherwise can be used
like other variables in common storage.
Description
The TASK COMMON statement is an extension to the Fortran 90 standard and is provided
for compatibility with programs that use the Cray TASK COMMON feature. TASK
COMMON blocks can only be declared in functions and subroutines.
A program should already be running multiple threads before calling a subroutine that
contains a TASK COMMON block.
When used in a program executing multiple threads, the TASK COMMON statement declares
all variables in a common block as local to a thread (also called a task). If multiple threads
execute code that uses the same TASK COMMON block, each thread has a private copy of the
block.
All occurrences of the TASK COMMON block must be declared with the TASK COMMON
statement; a common block cannot be declared in both a COMMON statement and a TASK
COMMON statement.