ESMF_CplCompInitialize Subroutine

public recursive subroutine ESMF_CplCompInitialize(cplcomp, keywordEnforcer, importState, exportState, clock, syncflag, phase, timeout, timeoutFlag, userRc, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_CplComp), intent(inout) :: cplcomp
type(ESMF_KeywordEnforcer), optional :: keywordEnforcer
type(ESMF_State), intent(inout), optional :: importState
type(ESMF_State), intent(inout), optional :: exportState
type(ESMF_Clock), intent(inout), optional :: clock
type(ESMF_Sync_Flag), intent(in), optional :: syncflag
integer, intent(in), optional :: phase
integer, intent(in), optional :: timeout
logical, intent(out), optional :: timeoutFlag
integer, intent(out), optional :: userRc
integer, intent(out), optional :: rc

Calls

proc~~esmf_cplcompinitialize~~CallsGraph proc~esmf_cplcompinitialize ESMF_CplCompInitialize proc~esmf_compexecute ESMF_CompExecute proc~esmf_cplcompinitialize->proc~esmf_compexecute proc~esmf_compisdualconnected ESMF_CompIsDualConnected proc~esmf_cplcompinitialize->proc~esmf_compisdualconnected proc~esmf_cplcompgetinit ESMF_CplCompGetInit proc~esmf_cplcompinitialize->proc~esmf_cplcompgetinit proc~esmf_imerr ESMF_IMErr proc~esmf_cplcompinitialize->proc~esmf_imerr proc~esmf_logfounderror ESMF_LogFoundError proc~esmf_cplcompinitialize->proc~esmf_logfounderror proc~esmf_logseterror ESMF_LogSetError proc~esmf_cplcompinitialize->proc~esmf_logseterror proc~esmf_compexecute->proc~esmf_imerr proc~esmf_compexecute->proc~esmf_logfounderror proc~esmf_compexecute->proc~esmf_logseterror c_esmc_compwait c_esmc_compwait proc~esmf_compexecute->c_esmc_compwait c_esmc_ftablecallentrypointvm c_esmc_ftablecallentrypointvm proc~esmf_compexecute->c_esmc_ftablecallentrypointvm c_esmc_ftablesetstateargs c_esmc_ftablesetstateargs proc~esmf_compexecute->c_esmc_ftablesetstateargs proc~esmf_basegetstatus ESMF_BaseGetStatus proc~esmf_compexecute->proc~esmf_basegetstatus proc~esmf_clocksetthis ESMF_ClockSetThis proc~esmf_compexecute->proc~esmf_clocksetthis proc~esmf_compclassgetinit ESMF_CompClassGetInit proc~esmf_compexecute->proc~esmf_compclassgetinit proc~esmf_vmbarrier ESMF_VMBarrier proc~esmf_compexecute->proc~esmf_vmbarrier proc~esmf_vmgetcurrent ESMF_VMGetCurrent proc~esmf_compexecute->proc~esmf_vmgetcurrent proc~esmf_vmwtime ESMF_VMWtime proc~esmf_compexecute->proc~esmf_vmwtime proc~esmf_compisdualconnected->proc~esmf_imerr proc~esmf_compisdualconnected->proc~esmf_logfounderror proc~esmf_compisdualconnected->proc~esmf_logseterror proc~esmf_compisdualconnected->proc~esmf_basegetstatus proc~esmf_compisdualconnected->proc~esmf_compclassgetinit proc~esmf_imerr->proc~esmf_logfounderror proc~esmf_initcheckdeep ESMF_InitCheckDeep proc~esmf_imerr->proc~esmf_initcheckdeep esmf_breakpoint esmf_breakpoint proc~esmf_logfounderror->esmf_breakpoint proc~esmf_logrc2msg ESMF_LogRc2Msg proc~esmf_logfounderror->proc~esmf_logrc2msg proc~esmf_logwrite ESMF_LogWrite proc~esmf_logfounderror->proc~esmf_logwrite proc~esmf_logseterror->esmf_breakpoint proc~esmf_logseterror->proc~esmf_logrc2msg proc~esmf_logseterror->proc~esmf_logwrite proc~esmf_basegetstatus->proc~esmf_logfounderror c_esmc_basegetstatus c_esmc_basegetstatus proc~esmf_basegetstatus->c_esmc_basegetstatus c_esmc_loggeterrormsg c_esmc_loggeterrormsg proc~esmf_logrc2msg->c_esmc_loggeterrormsg c_esmc_vmwtime c_esmc_vmwtime proc~esmf_logwrite->c_esmc_vmwtime proc~esmf_logclose ESMF_LogClose proc~esmf_logwrite->proc~esmf_logclose proc~esmf_logflush ESMF_LogFlush proc~esmf_logwrite->proc~esmf_logflush proc~esmf_logopenfile ESMF_LogOpenFile proc~esmf_logwrite->proc~esmf_logopenfile proc~esmf_utiliounitflush ESMF_UtilIOUnitFlush proc~esmf_logwrite->proc~esmf_utiliounitflush proc~esmf_utilstring2array ESMF_UtilString2Array proc~esmf_logwrite->proc~esmf_utilstring2array proc~esmf_vmbarrier->proc~esmf_imerr proc~esmf_vmbarrier->proc~esmf_logfounderror proc~esmf_vmbarrier->proc~esmf_vmgetcurrent c_esmc_vmbarrier c_esmc_vmbarrier proc~esmf_vmbarrier->c_esmc_vmbarrier proc~esmf_vmgetinit ESMF_VMGetInit proc~esmf_vmbarrier->proc~esmf_vmgetinit proc~esmf_vmgetcurrent->proc~esmf_logfounderror c_esmc_vmgetcurrent c_esmc_vmgetcurrent proc~esmf_vmgetcurrent->c_esmc_vmgetcurrent proc~esmf_vmwtime->proc~esmf_logfounderror proc~esmf_vmwtime->c_esmc_vmwtime

Called by

AttributeUpdateReconcilewESMF_CplCompInitialize
w
ConcurrentComponentw
w
ESMF_AppMainExw
w
ESMF_AppMainExw
w
ESMF_ArrayBundleRedistSTestw
w
ESMF_ArrayBundleSparseMMSTestw
w
ESMF_ArrayRedist3DSTestw
w
ESMF_ArrayRedistOpenACCSTestw
w
ESMF_ArrayRedistOpenMPSTestw
w
ESMF_ArrayRedistSharedObjSTestw
w
ESMF_ArrayRedistSTestw
w
ESMF_ArrayRedistSTestw
w
ESMF_ArrayRedistSTestw
w
ESMF_ArrayScatterGatherSTestw
w
ESMF_ArraySparseMatMulSTestw
w
ESMF_AttributeSTestw
w
ESMF_ComplianceCheckerSTestw
w
ESMF_ConcurrentEnsembleSTestw
w
ESMF_DirectCouplingSTestw
w
ESMF_FieldBundleLSRedistArb2ArbSTestw
w
ESMF_FieldBundleLSRedistArb2ArbUngrdDimSTestw
w
ESMF_FieldBundleRedistPackedSTestw
w
ESMF_FieldBundleRegridPackedSTestw
w
ESMF_FieldBundleSMMPackedSTestw
w
ESMF_FieldBundleSMMSTestw
w
ESMF_FieldLSRedistArb2ArbSTestw
w
ESMF_FieldLSRedistArb2ArbUngrdDimSTestw
w
ESMF_FieldLSSMMSTestw
w
ESMF_FieldMeshSMMSTestw
w
ESMF_FieldRegridLSSTestw
w
ESMF_FieldRegridMeshSTestw
w
ESMF_FieldRegridMeshToMeshSTestw
w
ESMF_FieldRegridPatchDisjointSTestw
w
ESMF_FieldRegridSTestw
w
ESMF_FieldRegridSTestw
w
ESMF_FieldRegridSTestw
w
ESMF_FieldSparseMatMulSTestw
w
ESMF_SequentialEnsembleSTestw
w
ESMF_StdCompMethodsUTestw
w
ESMF_TraceSTestw
w
ESMF_TransferGridSTestw
w
ESMF_TransferMeshSTestw
w
ESMF_WebServCplCompWaitForRqstw
w
ESMF_XGridConcurrentSTestw
w
ESMF_XGridSerialSTestw
w
f_esmf_cplcompinitializew
w
f_esmf_cplcompprocessinitw
w
FieldConcurrentComponentw
w
FieldRegridConservw
w
FieldRegridMultiw
w
FieldRegridOrderw
w
InitializeIPDv02p1w
w
loopConnectorCompsSw
w
MapperSimpleTwoConcurrentCompsw
w
MapperTwoConcurrentCompsw
w
my_initw
w
NUOPC_DriverAddCplCompw
w

Source Code

  recursive subroutine ESMF_CplCompInitialize(cplcomp, keywordEnforcer, &
    importState, exportState, clock, syncflag, phase, timeout, timeoutFlag, &
    userRc, rc)
!
!
! !ARGUMENTS:
    type(ESMF_CplComp),   intent(inout)           :: cplcomp
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
    type(ESMF_State),     intent(inout), optional :: importState
    type(ESMF_State),     intent(inout), optional :: exportState
    type(ESMF_Clock),     intent(inout), optional :: clock
    type(ESMF_Sync_Flag), intent(in),    optional :: syncflag
    integer,              intent(in),    optional :: phase
    integer,              intent(in),    optional :: timeout
    logical,              intent(out),   optional :: timeoutFlag
    integer,              intent(out),   optional :: userRc
    integer,              intent(out),   optional :: rc
!
! !STATUS:
! \begin{itemize}
! \item\apiStatusCompatibleVersion{5.2.0r}
! \item\apiStatusModifiedSinceVersion{5.2.0r}
! \begin{description}
! \item[5.3.0] Added argument {\tt timeout}.
!              Added argument {\tt timeoutFlag}.
!              The new arguments provide access to the fault-tolerant component
!              features.
! \end{description}
! \end{itemize}
!
! !DESCRIPTION:
! Call the associated user initialization routine for
! an {\tt ESMF\_CplComp}.
!
! The arguments are:
! \begin{description}
! \item[cplcomp]
!   {\tt ESMF\_CplComp} to call initialize routine for.
! \item[{[importState]}]
!   {\tt ESMF\_State} containing import data for coupling. If not present, a dummy
!   argument will be passed to the user-supplied routine.  The
!   importState argument in the user code cannot be optional.
! \item[{[exportState]}]
!   {\tt ESMF\_State} containing export data for coupling. If not present, a dummy
!   argument will be passed to the user-supplied routine.  The
!   exportState argument in the user code cannot be optional.
! \item[{[clock]}]
!   External {\tt ESMF\_Clock} for passing in time information.
!   This is generally the parent component's clock, and will be treated
!   as read-only by the child component.  The child component can maintain
!   a private clock for its own internal time computations. If not present, a dummy
!   argument will be passed to the user-supplied routine.  The
!   clock argument in the user code cannot be optional.
! \item[{[syncflag]}]
!   Blocking behavior of this method call. See section \ref{const:sync}
!   for a list of valid blocking options. Default option is
!   {\tt ESMF\_SYNC\_VASBLOCKING} which blocks PETs and their spawned off threads
!   across each VAS but does not synchronize PETs that run in different VASs.
! \item[{[phase]}]
!   Component providers must document whether each of their
!   routines are {\em single-phase} or {\em multi-phase}.
!   Single-phase routines require only one invocation to complete
!   their work.
!   Multi-phase routines provide multiple subroutines to accomplish
!   the work, accommodating components which must complete part of their
!   work, return to the caller and allow other processing to occur,
!   and then continue the original operation.
!   For multiple-phase child components, this is the integer phase
!   number to be invoked.
!   For single-phase child components this argument is optional. The default is
!   1.
! \item[{[timeout]}]
!   The maximum period in seconds that this call will wait in communications
!   with the actual component, before returning with a timeout condition.
!   The default is 3600, i.e. 1 hour. The {\tt timeout} argument is only
!   supported for connected dual components.
! \item[{[timeoutFlag]}]
!   Returns {\tt .true.} if the timeout was reached, {\tt .false.} otherwise.
!   If {\tt timeoutFlag} was {\em not} provided, a timeout condition will lead
!   to a return code of {\tt rc \textbackslash = ESMF\_SUCCESS}. Otherwise the
!   return value of {\tt timeoutFlag} is the sole indicator of a timeout
!   condition.
! \item[{[userRc]}]
!   Return code set by {\tt userRoutine} before returning.
! \item[{[rc]}]
!   Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
! \end{description}
!
!EOP
!------------------------------------------------------------------------------
    integer :: localrc                        ! local return code
    integer :: timeoutArg

    ! initialize return code; assume routine not implemented
    if (present(rc)) rc = ESMF_RC_NOT_IMPL
    localrc = ESMF_RC_NOT_IMPL

    ESMF_INIT_CHECK_DEEP(ESMF_CplCompGetInit,cplcomp,rc)

    ! check consistency between timeout argument and component argument
    if (present(timeout).and. &
      .not.ESMF_CompIsDualConnected(cplcomp%compp, rc=localrc)) then
      call ESMF_LogSetError(ESMF_RC_ARG_INCOMP, &
        msg="'timeout' argument is only allowed for connected dual components",&
        ESMF_CONTEXT, rcToReturn=rc)
      return
    endif

    timeoutArg = ESMF_DEFAULT_TIMEOUT ! default 1h
    if (present(timeout)) timeoutArg = timeout

    ! call Comp method
    call ESMF_CompExecute(cplcomp%compp, method=ESMF_METHOD_INITIALIZEIC, &
      importState=importState, exportState=exportState, clock=clock, &
      syncflag=syncflag, phase=phase, timeout=timeoutArg, &
      userRc=userRc, rc=localrc)
    ! conditionally filter out the RC_TIMEOUT and return success
    if (present(timeoutFlag)) then
      timeoutFlag = .false. ! initialize
      if ((localrc==ESMF_RC_TIMEOUT).or.(localrc==ESMC_RC_TIMEOUT)) then
        timeoutFlag = .true.      ! indicate timeout through flag argument
        localrc = ESMF_SUCCESS    ! do not raise error condition on user level
      endif
    endif
    if (ESMF_LogFoundError(localrc, &
      ESMF_ERR_PASSTHRU, &
      ESMF_CONTEXT, rcToReturn=rc)) return

    ! return successfully
    if (present(rc)) rc = ESMF_SUCCESS
  end subroutine ESMF_CplCompInitialize