subroutine userm1_init(comp, importState, exportState, clock, rc)
type(ESMF_GridComp) :: comp
type(ESMF_State) :: importState, exportState
type(ESMF_Clock) :: clock
integer, intent(out) :: rc
type(ESMF_AttPack) :: attpack
type(ESMF_VM) :: vm
integer :: petCount, status, myPet
character(ESMF_MAXSTR), dimension(3) :: attrList
rc = ESMF_SUCCESS
call ESMF_GridCompGet(comp, vm=vm, rc=status)
if (status .ne. ESMF_SUCCESS) return
call ESMF_VMGet(vm, petCount=petCount, localPet=myPet, rc=status)
if (status .ne. ESMF_SUCCESS) return
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 userm1_init