Nodes generated on external edges of the unrefined mesh are after the refinement projected onto the unrefined external edges (in projectnodes.f). These edges may be quadratic. In routine midexternaledges.f the external edges are stored in consecutive order (no gaps in the numbering) in field iedgext(1..3,*). The second entry is the middle node, if any, else this entry takes the value 0. Now, for those edges i for which iexternedg(i)=1 at the start of the routine (i.e. the external edges) iexternedg(i) is changed to j, where j is the number of the external edge in field iedgext.
Field iexternedg is dynamic, i.e. it is changed during the mesh refinement. If an edge i is remeshed in two new sub-edges (due to the insertion of a node) and if this edge is external, the value of iexternedg(i) is inherited by the sub-edges it is split into.