MAPL_CplCompSetVarSpecs Subroutine

public subroutine MAPL_CplCompSetVarSpecs(CC, SRC_SPEC, DST_SPEC, RC)

Arguments

Type IntentOptional Attributes Name
type(ESMF_CplComp), intent(inout) :: CC
type(MAPL_VarSpec), intent(in), target :: SRC_SPEC(:)
type(MAPL_VarSpec), intent(in), target :: DST_SPEC(:)
integer, intent(out), optional :: RC

Calls

proc~~mapl_cplcompsetvarspecs~~CallsGraph proc~mapl_cplcompsetvarspecs MAPL_CplCompSetVarSpecs ESMF_CplCompGet ESMF_CplCompGet proc~mapl_cplcompsetvarspecs->ESMF_CplCompGet ESMF_CplCompGetInternalState ESMF_CplCompGetInternalState proc~mapl_cplcompsetvarspecs->ESMF_CplCompGetInternalState interface~mapl_assert MAPL_Assert proc~mapl_cplcompsetvarspecs->interface~mapl_assert interface~mapl_varspecget MAPL_VarSpecGet proc~mapl_cplcompsetvarspecs->interface~mapl_varspecget proc~mapl_return MAPL_Return proc~mapl_cplcompsetvarspecs->proc~mapl_return proc~mapl_verify MAPL_Verify proc~mapl_cplcompsetvarspecs->proc~mapl_verify 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_cplcompsetvarspecs~~CalledByGraph proc~mapl_cplcompsetvarspecs MAPL_CplCompSetVarSpecs proc~mapl_genericsetservices MAPL_GenericSetServices proc~mapl_genericsetservices->proc~mapl_cplcompsetvarspecs proc~mapl_setvarspecforcc MAPL_SetVarSpecForCC proc~mapl_setvarspecforcc->proc~mapl_cplcompsetvarspecs proc~setservices~2 SetServices proc~setservices~2->proc~mapl_genericsetservices proc~setservices~4 SetServices proc~setservices~4->proc~mapl_genericsetservices proc~setservices~5 SetServices proc~setservices~5->proc~mapl_genericsetservices proc~setservices~6 SetServices proc~setservices~6->proc~mapl_genericsetservices proc~setservices~7 SetServices proc~setservices~7->proc~mapl_genericsetservices

Source Code

  subroutine MAPL_CplCompSetVarSpecs ( CC, SRC_SPEC, DST_SPEC, RC )
    type (ESMF_CplComp  ),           intent(INOUT) :: CC  
    type (MAPL_VarSpec  ), target,   intent(IN   ) :: SRC_SPEC(:)
    type (MAPL_VarSpec  ), target,   intent(IN   ) :: DST_SPEC(:)
    integer, optional,               intent(  OUT) :: RC
    
! ErrLog Variables

    character(len=ESMF_MAXSTR)    :: IAm
    character(len=ESMF_MAXSTR)    :: COMP_NAME
    integer                       :: STATUS

! Locals

    type (MAPL_GenericCplState), pointer :: STATE
    type (MAPL_GenericCplWrap )          :: WRAP
    character(len=ESMF_MAXSTR)           :: SRC_NAME
    character(len=ESMF_MAXSTR)           :: DST_NAME

    integer                              :: I

! Begin...

! Get this instance's name and set-up traceback handle.
! -----------------------------------------------------

    call ESMF_CplCompGet( CC, name=COMP_NAME, RC=STATUS )
    _VERIFY(STATUS)
    Iam = trim(COMP_NAME) // "MAPL_CplCompSetVarSpecs"

! Retrieve the pointer to the internal state. It comes in a wrapper.
! ------------------------------------------------------------------

    call ESMF_CplCompGetInternalState ( CC, WRAP, STATUS )
    _VERIFY(STATUS)

    STATE  =>  WRAP%INTERNAL_STATE

! Make sure the specs match
!--------------------------

    _ASSERT(size(SRC_SPEC)==size(DST_SPEC),'needs informative message')

    do I=1,size(SRC_SPEC)
       call MAPL_VarSpecGet(SRC_SPEC(I),SHORT_NAME=SRC_NAME,RC=STATUS)
       _VERIFY(STATUS)
       call MAPL_VarSpecGet(DST_SPEC(I),SHORT_NAME=DST_NAME,RC=STATUS)
       _VERIFY(STATUS)

!ALT       _ASSERT(SRC_NAME==DST_NAME,'needs informative message')
    end do

! Put miscellaneous info in the internal state
!---------------------------------------------

    STATE%SRC_SPEC => SRC_SPEC
    STATE%DST_SPEC => DST_SPEC

    STATE%ACTIVE = .true.
    STATE%NAME   = COMP_NAME

    _RETURN(ESMF_SUCCESS)
  end subroutine MAPL_CplCompSetVarSpecs