copy_node Subroutine

private recursive subroutine copy_node(destination, source)

Deep copy of a node and everything below it.

This replaces intrinsic assignment, which gfortran 13 implements incorrectly for recursive allocatable components (the copies share storage and are freed twice). The source is staged into local variables first so that the destination may be part of the source, as in node = node%at(1).

Type Bound

cable_yaml_node_t

Arguments

Type IntentOptional Attributes Name
class(cable_yaml_node_t), intent(inout) :: destination
type(cable_yaml_node_t), intent(in) :: source