@@ -155,14 +155,17 @@ subroutine allocate(this, other_aspects, rc)
155155 type (AspectMap), intent (in ) :: other_aspects
156156 integer , optional , intent (out ) :: rc
157157
158- integer :: status
159- integer :: i
158+ type (ESMF_Field), allocatable :: field
159+ integer :: i, status
160160
161161 do i = 1 , NUM_COMPONENTS
162162 call this% component_specs(i)% create(other_aspects, _RC)
163163 call update_payload(this% component_specs(i), other_aspects, _RC)
164164 call this% component_specs(i)% allocate (other_aspects, _RC)
165165 call this% component_specs(i)% add_to_bundle(this% payload, _RC)
166+ ! update the name of the component
167+ call this% component_specs(i)% get_payload(field= field, _RC)
168+ call ESMF_FieldSet(field, name= trim (this% short_names% at(i)), _RC)
166169 end do
167170
168171 _RETURN(ESMF_SUCCESS)
@@ -338,13 +341,6 @@ subroutine add_to_state(this, multi_state, actual_pt, rc)
338341 end if
339342 call ESMF_StateAddReplace(substate, [alias], _RC)
340343
341- ! Also update the names of the components
342- call MAPL_FieldBundleGet(this% payload, fieldList= field_list, _RC)
343- if (size (field_list) > 0 ) then ! might be empty if import item
344- call ESMF_FieldSet(field_list(1 ), name= trim (this% short_names% at(1 )), _RC)
345- call ESMF_FieldSet(field_list(2 ), name= trim (this% short_names% at(2 )), _RC)
346- end if
347-
348344 _RETURN(_SUCCESS)
349345 end subroutine add_to_state
350346
0 commit comments