(TranslationUnit
    [(Program
        coarrays_02
        (TriviaNode
            [(EndOfLine)
            (Comment
                "! Source https://j3-fortran.org/doc/year/18/18-007r1.pdf Page no - 541"
            )]
            []
        )
        [(Use
            [(SimpleAttribute
                AttrIntrinsic
            )]
            iso_fortran_env
            []
            .false.
            ()
        )]
        []
        [(Declaration
            (AttrType
                TypeInteger
                []
                ()
                ()
                None
            )
            [(SimpleAttribute
                AttrAllocatable
            )]
            [(node
            [(()
            ()
            DimensionExpr)]
            []
            ()
            ()
            None
            ())]
            (TriviaNode
                []
                [(EOLComment
                    "! tree nodes that this image handles."
                )]
            )
        )
        (Declaration
            (AttrType
                TypeInteger
                []
                ()
                ()
                None
            )
            [(SimpleAttribute
                AttrAllocatable
            )]
            [(nc
            [(()
            ()
            DimensionExpr)]
            []
            ()
            ()
            None
            ())]
            (TriviaNode
                []
                [(EndOfLine)
                (Comment
                    "! node(i) has nc(i) children."
                )]
            )
        )
        (Declaration
            (AttrType
                TypeInteger
                []
                ()
                ()
                None
            )
            [(SimpleAttribute
                AttrAllocatable
            )]
            [(parent
            [(()
            ()
            DimensionExpr)]
            []
            ()
            ()
            None
            ())
            (sub
            [(()
            ()
            DimensionExpr)]
            []
            ()
            ()
            None
            ())]
            (TriviaNode
                []
                [(EndOfLine)
                (Comment
                    "! the parent of node (i) is node (sub (i)) [parent (i)]."
                )]
            )
        )
        (Declaration
            (AttrType
                TypeType
                []
                ()
                event_type
                None
            )
            [(SimpleAttribute
                AttrAllocatable
            )]
            [(done
            [(()
            ()
            DimensionExpr)]
            [(()
            ()
            CodimensionExpr)]
            ()
            ()
            None
            ())]
            ()
        )
        (Declaration
            (AttrType
                TypeInteger
                []
                ()
                ()
                None
            )
            []
            [(i
            []
            []
            ()
            ()
            None
            ())
            (j
            []
            []
            ()
            ()
            None
            ())
            (status
            []
            []
            ()
            ()
            None
            ())]
            (TriviaNode
                []
                [(EndOfLine)
                (Comment
                    "! set up the tree, including allocation of all arrays."
                )]
            )
        )]
        [(DoLoop
            0
            ()
            0
            i
            1
            (FuncCallOrArray
                size
                []
                [(()
                node
                ()
                0)]
                []
                []
                []
            )
            ()
            [(If
                0
                ()
                (> (FuncCallOrArray
                    nc
                    []
                    [(()
                    i
                    ()
                    0)]
                    []
                    []
                    []
                ) 0)
                [(EventWait
                    0
                    (FuncCallOrArray
                        done
                        []
                        [(()
                        i
                        ()
                        0)]
                        []
                        []
                        []
                    )
                    [(AttrEventWaitKwArg
                        until_count
                        (FuncCallOrArray
                            nc
                            []
                            [(()
                            i
                            ()
                            0)]
                            []
                            []
                            []
                        )
                    )
                    (AttrStat
                        status
                    )]
                    ()
                )
                (If
                    0
                    ()
                    (/= status 0)
                    [(Exit
                        0
                        ()
                        ()
                    )]
                    []
                    ()
                    ()
                    ()
                )]
                []
                ()
                ()
                (TriviaNode
                    []
                    [(EndOfLine)
                    (EndOfLine)
                    (Comment
                        "! process node, using data from children."
                    )]
                )
            )
            (If
                0
                ()
                (> (FuncCallOrArray
                    parent
                    []
                    [(()
                    i
                    ()
                    0)]
                    []
                    []
                    []
                ) 0)
                [(EventPost
                    0
                    (CoarrayRef
                        done
                        []
                        [(()
                        (FuncCallOrArray
                            sub
                            []
                            [(()
                            i
                            ()
                            0)]
                            []
                            []
                            []
                        )
                        ()
                        0)]
                        []
                        [(()
                        (FuncCallOrArray
                            parent
                            []
                            [(()
                            i
                            ()
                            0)]
                            []
                            []
                            []
                        )
                        ()
                        CodimensionExpr)]
                        []
                    )
                    [(AttrStat
                        status
                    )]
                    ()
                )
                (If
                    0
                    ()
                    (/= status 0)
                    [(Exit
                        0
                        ()
                        ()
                    )]
                    []
                    ()
                    ()
                    ()
                )]
                []
                (TriviaNode
                    []
                    [(EndOfLine)
                    (Comment
                        "! node is not the root."
                    )
                    (Comment
                        "! place result on image parent (i) for node node (sub) [parent (i)]"
                    )
                    (Comment
                        "! tell parent (i) that this has been done."
                    )]
                )
                ()
                ()
            )]
            (TriviaNode
                []
                [(EndOfLine)
                (Comment
                    "! wait for children to complete"
                )]
            )
            ()
        )]
        []
    )]
)
