Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(ESMF_GridComp), | intent(inout) | :: | GC | |||
type(ESMF_Method_Flag), | intent(in) | :: | registeredMethod | |||
real | :: | usersRoutine | ||||
integer, | intent(out), | optional | :: | RC |
subroutine MAPL_GridCompSetEntryPoint(GC, registeredMethod, usersRoutine, RC) !ARGUMENTS: type(ESMF_GridComp), intent(INOUT) :: GC ! Gridded component type(ESMF_Method_Flag), intent(IN ) :: registeredMethod external :: usersRoutine integer, optional, intent( OUT) :: RC ! Return code !EOPI integer :: status type (MAPL_MetaComp), pointer :: META integer :: phase type(runEntryPoint) :: run_entry_point call MAPL_InternalStateRetrieve( GC, META, RC=status) _VERIFY(status) if (registeredMethod == ESMF_METHOD_INITIALIZE) then phase = MAPL_AddMethod(META%phase_init, RC=status) else if (registeredMethod == ESMF_METHOD_RUN) then phase = MAPL_AddMethod(META%phase_run, RC=status) run_entry_point%run_entry_point => usersRoutine call META%run_entry_points%push_back(run_entry_point) else if (registeredMethod == ESMF_METHOD_FINALIZE) then phase = MAPL_AddMethod(META%phase_final, RC=status) else if (registeredMethod == ESMF_METHOD_WRITERESTART) then phase = MAPL_AddMethod(META%phase_record, RC=status) else if (registeredMethod == ESMF_METHOD_READRESTART) then phase = MAPL_AddMethod(META%phase_coldstart, RC=status) else _RETURN(ESMF_FAILURE) endif _VERIFY(status) if (phase > MAPL_MAX_PHASES) then print *, 'ERROR: exceeded maximum number of run phases. Increase MAPL_MAX_PHASES and recompile' end if call ESMF_GridCompSetEntryPoint(GC, registeredMethod, MAPL_GenericWrapper, & phase=phase, rc=status) _VERIFY(status) call ESMF_GridCompSetEntryPoint(GC, registeredMethod, usersRoutine, & phase=MAPL_MAX_PHASES+phase, rc=status) _VERIFY(status) _RETURN(ESMF_SUCCESS) end subroutine MAPL_GridCompSetEntryPoint