You don’t need to look at the source, just the argument attributes (also provided in the gfortran documentation).
The deallocation of an allocatable dummy argument with intent out is part of the Fortran semantics. From a practitioner point of view it’s one of the Fortran “gotchas” you need to be aware of. Here’s the description from MRC (the “red book”), p. 111:
An allocatable dummy argument is permitted to have intent and this applies both to the allocation status (the descriptor) and the object itself. If the intent is
in, the object is not permitted to be allocated or deallocated and the value is not permitted to be altered. If the intent isoutand the object is allocated on entry, it becomes deallocated.
The rule also carries over to derived types with allocatable components.