usercpl_init Subroutine

private subroutine usercpl_init(comp, importState, exportState, clock, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_CplComp) :: comp
type(ESMF_State) :: importState
type(ESMF_State) :: exportState
type(ESMF_Clock) :: clock
integer, intent(out) :: rc

Source Code

  subroutine usercpl_init(comp, importState, exportState, clock, rc)
    type(ESMF_CplComp) :: comp
    type(ESMF_State) :: importState, exportState
    type(ESMF_Clock) :: clock
    integer, intent(out) :: rc

    type(ESMF_AttPack)                   :: attpack
    integer                              :: petCount, status, myPet
    character(ESMF_MAXSTR), dimension(3) :: attrList

    rc = ESMF_SUCCESS

    attrList(1) = "name1"
    attrList(2) = "name2"
    attrList(3) = "name3"

    call ESMF_AttributeAdd(comp, convention="Comp", purpose="Top", &
      attrList=attrList, attpack=attpack, rc=status)
    if (status .ne. ESMF_SUCCESS) return

    call ESMF_AttributeSet(comp, "name1", attpack=attpack, value="value1", &
      rc=status)
    call ESMF_AttributeSet(comp, "name2", attpack=attpack, value="value2", &
      rc=status)
    call ESMF_AttributeSet(comp, "name3", attpack=attpack, value="value3", &
      rc=status)
    if (status .ne. ESMF_SUCCESS) return

  end subroutine usercpl_init