% $Id$
%

\label{PhaseMaps}

The NUOPC layer adds an abstraction on top of the ESMF phase index. ESMF introduces the concept of standard component methods: {\tt Initialize}, {\tt Run}, and {\tt Finalize}. ESMF further recognizes the need for being able to split each of the standard methods into multiple phases. On the ESMF level, phases are implemented by a simple integer {\tt phase} index. With NUOPC, logical phase labels are introduced that are mapped to the ESMF phase indices.

The NUOPC Layer introducing three component level attributes: {\tt InitializePhaseMap}, {\tt RunPhaseMap}, and {\tt FinalizePhaseMap}. These attributes map logical NUOPC phase labels to integer ESMF phase indices. A NUOPC compliant component fully documents its available phases through the phase maps.

The generic {\tt NUOPC\_Driver} uses the {\tt InitializePhaseMap} on each of its child component during the initialization stage to correctly interact with each component. The {\tt RunPhaseMap} is used when setting up run sequences in the Driver. The {\tt NUOPC\_DriverAddRunElement()} takes the {\tt phaseLabel} argument, and uses the {\tt RunPhaseMap} attribute internally to translates the label into the corresponding ESMF phase index. The {\tt FinalizePhaseMap} is currently not used by the NUOPC Layer

Appendix B, section \ref{IPD}, lists the supported logical phase labels for reference. User code very rare needs to interact with the {\tt InitializePhaseMap} or its entries directly. Instead, user code specializes the initialization behavior of a component through the semantic specialization labels discussed below.

NUOPC implements a very powerful initialization procedure. This procedure is, among other functions, capable of handling component hierarchies, transfer of geometries, reference sharing, and resolving data dependencies during initialization. The initialization features are discussed in detail in their respective sections of this document.

From the user level, specialization of the initialization is accessbile through the {\em semantic specialization labels}. These labels are predefined named constants that are passed into the {\tt NUOPC\_CompSpecialize()} method, together with the user provided routine, implementing the required actions. On a technical level, the user routine must follow the standard interface defined by NUOPC. Semantically, the purpose of each specialization point is indicated by the name of the predefined specialization label. For a definition of the labels,  and the ascribed purpose, see the {\sf SEMANTIC SPECIALIZATION LABELS} section under each of the generic component kinds. (Driver: \ref{NUOPC_Driver}, Model: \ref{NUOPC_Model}, Mediator: \ref{NUOPC_Mediator}, Connector: \ref{NUOPC_Connector})

Finally, under NUOPC, each component is associated with a label when it is added to a driver through the {\tt NUOPC\_DriverAddComp()} call. Multiple instances of the same component can be added to a driver, provided each instance is given a unique label. Connectors between components are identified by providing the label of the source component and destination component.

