% $Id$

\subsubsection{ESMF\_END}
\label{const:endflag}

{\sf DESCRIPTION:\\}
The {\tt ESMF\_End\_Flag} determines how an ESMF application is shut down.

The type of this flag is:

{\tt type(ESMF\_End\_Flag)}

The valid values are:
\begin{description}
   \item [ESMF\_END\_ABORT] 
         Global abort of the ESMF application. There is no guarantee 
         that all PETs will shut down cleanly during an abort. However, all
         attempts are made to prevent the application from hanging and the
         LogErr of at least one PET will be completely flushed during the abort.
         This option should only be used if a condition is detected that
         prevents normal continuation or termination of the application.
         Typical conditions that warrant the use of {\tt ESMF\_END\_ABORT} 
         are those that occur on a per PET basis where other PETs may be blocked
         in communication calls, unable to reach the normal termination point.
         An aborted application returns to the parent process with a system
         dependent indication that a failure occurred during execution.
   \item [ESMF\_END\_NORMAL]
         \begin{sloppypar}
         Normal termination of the ESMF application. Wait for all PETs of the
         global VM to reach 
	{\tt ESMF\_Finalize()} before termination. This is
         the clean way of terminating an application. {\tt MPI\_Finalize()} will
         be called in case of MPI applications.
         \end{sloppypar}
   \item [ESMF\_END\_KEEPMPI]
         Same as {\tt ESMF\_END\_NORMAL} but {\tt MPI\_Finalize()} will {\em not}
         be called. It is the user code's responsibility to shut down MPI
         cleanly if necessary.
\end{description}
