GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
fortran

Fortran: Auto deallocate coarrays allocated in team blocks

Fortran compiler now automatically deallocates coarrays declared within team blocks, adhering to F2018 standards.

The Fortran compiler now correctly deallocates coarrays that are allocated within a team block. Previously, these coarrays were not automatically deallocated before the END TEAM statement, violating the F2018 standard. This change ensures compliance by tracking team contexts and stashing allocate expressions for automatic deallocation.

In Details

Gfortran now enforces F2018 standard 11.1.5.2 regarding coarray deallocation within team blocks. Coarrays allocated in a TEAM block are now automatically deallocated before END TEAM. This is achieved by managing a stack of team contexts and a hash map to store allocate expressions associated with each context, with deallocation code generated in st.cc.

For Context
coarray
A Fortran language feature for parallel programming that allows for data to be shared and accessed across different processing units or images.
team block
A construct in Fortran's parallel programming features (Coarray Fortran) that defines a scope for a group of images (processing units) to cooperate.
END TEAM
The statement that terminates a team block in Coarray Fortran, signaling the end of a cooperative execution scope for a team of images.
Filed Under: fortranparallelismstandard compliance