Skip to content

Commit 1bbe7a5

Browse files
committed
Ensure State object Base part exists on all PETs, not only actual PETs
when created with specified VM.
1 parent 74b7e02 commit 1bbe7a5

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/Superstructure/State/src/ESMF_StateAPI.cppF90

+8-9
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,14 @@ StateAddRepListMacro(ESMF_State,State,nestedStateList,state,nestedStateList(i)%s
921921
! Initialize return code; assume failure until success is certain
922922
if (present(rc)) rc = ESMF_RC_NOT_IMPL
923923

924+
! Initialize the pointers to null.
925+
nullify(ESMF_StateCreate%statep)
926+
nullify(stypep)
927+
928+
allocate(stypep, stat=memstat)
929+
if (ESMF_LogFoundAllocError(memstat, msg="State type", &
930+
ESMF_CONTEXT, rcToReturn=rc)) return
931+
924932
! Must make sure the local PET is associated with an actual member
925933
actualFlag = .true.
926934
if (present(vm)) then
@@ -965,15 +973,6 @@ ESMF_INIT_CHECK_DEEP(ESMF_RouteHandleGetInit,routehandleList(i),rc)
965973
enddo
966974
endif
967975

968-
969-
! Initialize the pointers to null.
970-
nullify(ESMF_StateCreate%statep)
971-
nullify(stypep)
972-
973-
allocate(stypep, stat=memstat)
974-
if (ESMF_LogFoundAllocError(memstat, msg="State type", &
975-
ESMF_CONTEXT, rcToReturn=rc)) return
976-
977976
call ESMF_StateConstruct(stypep, &
978977
statename=name, stateintent=stateintent, &
979978
arrays=arrayList, arraybundles=arraybundleList, &

0 commit comments

Comments
 (0)