MAPL_CapGridCompCreate Subroutine

public subroutine MAPL_CapGridCompCreate(cap, cap_rc, name, final_file, unusable, n_run_phases, root_set_services, root_dso, rc)

Uses

  • proc~~mapl_capgridcompcreate~~UsesGraph proc~mapl_capgridcompcreate MAPL_CapGridCompCreate module~mapl_stubcomponent MAPL_StubComponent proc~mapl_capgridcompcreate->module~mapl_stubcomponent ESMF ESMF module~mapl_stubcomponent->ESMF module~mapl_errorhandlingmod MAPL_ErrorHandlingMod module~mapl_stubcomponent->module~mapl_errorhandlingmod module~mapl_keywordenforcermod MAPL_KeywordEnforcerMod module~mapl_stubcomponent->module~mapl_keywordenforcermod module~mapl_maplcomponent mapl_MaplComponent module~mapl_stubcomponent->module~mapl_maplcomponent module~mapl_throwmod MAPL_ThrowMod module~mapl_errorhandlingmod->module~mapl_throwmod mpi mpi module~mapl_errorhandlingmod->mpi module~mapl_maplcomponent->ESMF module~mapl_maplcomponent->module~mapl_errorhandlingmod module~mapl_maplcomponent->module~mapl_keywordenforcermod module~mapl_basecomponent mapl_BaseComponent module~mapl_maplcomponent->module~mapl_basecomponent module~mapl_surrogateframeworkcomponent mapl_SurrogateFrameworkComponent module~mapl_maplcomponent->module~mapl_surrogateframeworkcomponent module~pflogger pflogger module~mapl_maplcomponent->module~pflogger module~mapl_basecomponent->module~pflogger module~mapl_abstractcomponent mapl_AbstractComponent module~mapl_basecomponent->module~mapl_abstractcomponent 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(MAPL_CapGridComp), intent(out), target :: cap
character(len=*), intent(in) :: cap_rc
character(len=*), intent(in) :: name
character(len=*), intent(in), optional :: final_file
class(KeywordEnforcer), intent(in), optional :: unusable
integer, intent(in), optional :: n_run_phases
procedure, optional :: root_set_services
character(len=*), intent(in), optional :: root_dso
integer, intent(out), optional :: rc

Calls

proc~~mapl_capgridcompcreate~~CallsGraph proc~mapl_capgridcompcreate MAPL_CapGridCompCreate ESMF_ConfigCreate ESMF_ConfigCreate proc~mapl_capgridcompcreate->ESMF_ConfigCreate ESMF_ConfigLoadFile ESMF_ConfigLoadFile proc~mapl_capgridcompcreate->ESMF_ConfigLoadFile ESMF_GridCompCreate ESMF_GridCompCreate proc~mapl_capgridcompcreate->ESMF_GridCompCreate ESMF_UserCompSetInternalState ESMF_UserCompSetInternalState proc~mapl_capgridcompcreate->ESMF_UserCompSetInternalState interface~mapl_assert MAPL_Assert proc~mapl_capgridcompcreate->interface~mapl_assert interface~mapl_set MAPL_Set proc~mapl_capgridcompcreate->interface~mapl_set proc~mapl_internalstatecreate MAPL_InternalStateCreate proc~mapl_capgridcompcreate->proc~mapl_internalstatecreate proc~mapl_return MAPL_Return proc~mapl_capgridcompcreate->proc~mapl_return proc~mapl_verify MAPL_Verify proc~mapl_capgridcompcreate->proc~mapl_verify proc~mapl_internalstatecreate->ESMF_UserCompSetInternalState proc~mapl_internalstatecreate->proc~mapl_return proc~mapl_internalstatecreate->proc~mapl_verify ESMF_GridCompGet ESMF_GridCompGet proc~mapl_internalstatecreate->ESMF_GridCompGet none~get_component~2 ConcreteComposite%get_component proc~mapl_internalstatecreate->none~get_component~2 none~initialize~15 ConcreteComposite%initialize proc~mapl_internalstatecreate->none~initialize~15 none~set_composite~2 CompositeComponent%set_composite proc~mapl_internalstatecreate->none~set_composite~2 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

Called by

proc~~mapl_capgridcompcreate~~CalledByGraph proc~mapl_capgridcompcreate MAPL_CapGridCompCreate none~initialize_cap_gc MAPL_Cap%initialize_cap_gc none~initialize_cap_gc->proc~mapl_capgridcompcreate none~run_model MAPL_Cap%run_model none~run_model->none~initialize_cap_gc none~run_member MAPL_Cap%run_member none~run_member->none~run_model none~run_ensemble MAPL_Cap%run_ensemble none~run_ensemble->none~run_member

Source Code

   subroutine MAPL_CapGridCompCreate(cap, cap_rc, name, final_file, unusable, n_run_phases, root_set_services, root_dso,  rc)
      use mapl_StubComponent
    type(MAPL_CapGridComp), intent(out), target :: cap
    character(*), intent(in) :: cap_rc, name
    character(len=*), optional, intent(in) :: final_file
    class(KeywordEnforcer), optional, intent(in) :: unusable
    procedure(), optional :: root_set_services
    character(len=*), optional, intent(in) :: root_dso
    integer, optional, intent(in)  :: n_run_phases
    integer, optional, intent(out) :: rc

    type(MAPL_CapGridComp_Wrapper) :: cap_wrapper
    type(MAPL_MetaComp), pointer :: meta => null()
    integer :: status
    character(*), parameter :: cap_name = "CAP"
    type(StubComponent) :: stub_component

    _UNUSED_DUMMY(unusable)

    cap%cap_rc_file = cap_rc
    if (present(root_set_services)) cap%root_set_services => root_set_services
    if (present(root_dso)) cap%root_dso = root_dso
    if (present(root_dso) .and. present(root_set_services)) then
       _FAIL("can only specify a setservice pointer or a dso to use")
    end if
    if (present(final_file)) then
       allocate(cap%final_file, source=final_file)
    end if
    cap%n_run_phases = 1
    if (present(n_run_phases)) cap%n_run_phases = n_run_phases

    cap%config = ESMF_ConfigCreate(_RC)
    call ESMF_ConfigLoadFile(cap%config, cap%cap_rc_file,_RC)

    allocate(cap%name, source=name)
    cap%gc = ESMF_GridCompCreate(name=cap_name, config=cap%config, _RC)

    meta => null()
    call MAPL_InternalStateCreate(cap%gc, meta, _RC)
    call MAPL_Set(meta, CF=cap%config, _RC)

    call MAPL_Set(meta, name=cap_name, component=stub_component, _RC)

    cap_wrapper%ptr => cap
    call ESMF_UserCompSetInternalState(cap%gc, internal_cap_name, cap_wrapper, status)
    _VERIFY(status)


    _RETURN(_SUCCESS)

  end subroutine MAPL_CapGridCompCreate