MAPL_MethodAdd Subroutine

public subroutine MAPL_MethodAdd(state, label, userRoutine, rc)

Uses

  • proc~~mapl_methodadd~~UsesGraph proc~mapl_methodadd MAPL_MethodAdd module~mapl_callbackmap mapl_CallbackMap proc~mapl_methodadd->module~mapl_callbackmap module~mapl_esmf_interfaces mapl_ESMF_Interfaces proc~mapl_methodadd->module~mapl_esmf_interfaces module~mapl_openmp_support MAPL_OpenMP_Support proc~mapl_methodadd->module~mapl_openmp_support module~mapl_callbackmap->module~mapl_esmf_interfaces ESMF ESMF module~mapl_openmp_support->ESMF module~mapl_exceptionhandling MAPL_ExceptionHandling module~mapl_openmp_support->module~mapl_exceptionhandling module~mapl_keywordenforcermod MAPL_KeywordEnforcerMod module~mapl_openmp_support->module~mapl_keywordenforcermod module~mapl_maplgrid mapl_MaplGrid module~mapl_openmp_support->module~mapl_maplgrid module~mapl_errorhandlingmod MAPL_ErrorHandlingMod module~mapl_exceptionhandling->module~mapl_errorhandlingmod module~mapl_throwmod MAPL_ThrowMod module~mapl_exceptionhandling->module~mapl_throwmod module~mapl_maplgrid->ESMF module~mapl_maplgrid->module~mapl_keywordenforcermod module~mapl_constantsmod MAPL_ConstantsMod module~mapl_maplgrid->module~mapl_constantsmod module~mapl_maplgrid->module~mapl_errorhandlingmod module~pflogger pflogger module~mapl_maplgrid->module~pflogger module~mapl_constants MAPL_Constants module~mapl_constantsmod->module~mapl_constants module~mapl_errorhandlingmod->module~mapl_throwmod mpi mpi module~mapl_errorhandlingmod->mpi module~pfl_keywordenforcermod PFL_KeywordEnforcerMod module~pflogger->module~pfl_keywordenforcermod module~pfl_logger PFL_Logger module~pflogger->module~pfl_logger module~pfl_loggermanager PFL_LoggerManager module~pflogger->module~pfl_loggermanager module~pfl_severitylevels PFL_SeverityLevels module~pflogger->module~pfl_severitylevels module~pfl_wraparray PFL_WrapArray module~pflogger->module~pfl_wraparray

Arguments

Type IntentOptional Attributes Name
type(ESMF_State), intent(inout) :: state
character(len=*), intent(in) :: label
procedure(I_CallBackMethod) :: userRoutine
integer, intent(out), optional :: rc

Calls

proc~~mapl_methodadd~~CallsGraph proc~mapl_methodadd MAPL_MethodAdd ESMF_MethodAdd ESMF_MethodAdd proc~mapl_methodadd->ESMF_MethodAdd none~insert~189 CallbackMap%insert proc~mapl_methodadd->none~insert~189 proc~get_callbacks get_callbacks proc~mapl_methodadd->proc~get_callbacks proc~mapl_return MAPL_Return proc~mapl_methodadd->proc~mapl_return proc~mapl_verify MAPL_Verify proc~mapl_methodadd->proc~mapl_verify none~insert_pair~19 CallbackMap%insert_pair none~insert~189->none~insert_pair~19 proc~get_callbacks->proc~mapl_return proc~get_callbacks->proc~mapl_verify ESMF_AttributeGet ESMF_AttributeGet proc~get_callbacks->ESMF_AttributeGet ESMF_AttributeSet ESMF_AttributeSet proc~get_callbacks->ESMF_AttributeSet at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception proc~mapl_verify->proc~mapl_throw_exception

Source Code

   subroutine MAPL_MethodAdd(state, label, userRoutine, rc)
      use mapl_ESMF_Interfaces
      use mapl_CallbackMap
      use mapl_OpenMP_Support, only : get_callbacks
      type(ESMF_State), intent(inout) :: state
      character(*), intent(in) :: label
      procedure(I_CallBackMethod) :: userRoutine
      integer, optional, intent(out) :: rc

      integer :: status
      type(CallbackMap), pointer :: callbacks

      call ESMF_MethodAdd(state, label=label, userRoutine=userRoutine, _RC)

      call get_callbacks(state, callbacks, _RC)
      call callbacks%insert(label, wrap(userRoutine))

      _RETURN(ESMF_SUCCESS)
   contains

      function wrap(userRoutine) result(wrapper)
         type(CallbackMethodWrapper) :: wrapper
         procedure(I_CallBackMethod) :: userRoutine
         wrapper%userRoutine => userRoutine
      end function wrap

   end subroutine MAPL_MethodAdd