diff --git a/src/Superstructure/StateReconcile/src/ESMF_StateReconcile.F90 b/src/Superstructure/StateReconcile/src/ESMF_StateReconcile.F90 index e5421182ba..45ee517d42 100644 --- a/src/Superstructure/StateReconcile/src/ESMF_StateReconcile.F90 +++ b/src/Superstructure/StateReconcile/src/ESMF_StateReconcile.F90 @@ -1840,7 +1840,7 @@ subroutine ESMF_ReconcileSingleCompCase(state, vm, vmId, attreconflag, siwrap, r if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, & ESMF_CONTEXT, rcToReturn=rc)) return - if (localPet/=rootPet) allocate(buffer(sizeBuffer(1))) + if (localPet/=rootPet) allocate(buffer(0:sizeBuffer(1)-1)) call ESMF_VMBroadcast(vm, buffer, count=sizeBuffer(1), rootPet=rootPet, & rc=localrc) @@ -2591,7 +2591,7 @@ subroutine ESMF_ReconcileDeserializeAll(state, vm, buffer, attreconflag, rc) rcToReturn=rc)) return ! Set start position of buffer - posBuffer = 1 + posBuffer = 0 ! Get the number of items to add numNewItems = transfer ( & @@ -4485,7 +4485,7 @@ subroutine ESMF_ReconcileSerializeAll(state, vm, vmid, siwrap, & sizeBuffer=ESMF_SIZEOF_DEFINT ! Allocate a fake buffer for passing in when asking for size - allocate(fakeBuffer(ESMF_SIZEOF_DEFINT)) + allocate(fakeBuffer(0:ESMF_SIZEOF_DEFINT-1)) ! Fake buffer size sizeFakeBuffer=size(fakeBuffer) @@ -4658,7 +4658,7 @@ subroutine ESMF_ReconcileSerializeAll(state, vm, vmid, siwrap, & deallocate(fakeBuffer) !!!!! Allocate buffer to serialize into !!!!! - allocate(buffer(sizeBuffer), stat=memstat) + allocate(buffer(0:sizeBuffer-1), stat=memstat) if (ESMF_LogFoundAllocError(memstat, ESMF_ERR_PASSTHRU, & ESMF_CONTEXT, & rcToReturn=rc)) return @@ -4667,12 +4667,12 @@ subroutine ESMF_ReconcileSerializeAll(state, vm, vmid, siwrap, & !!!!! Serialize information into buffer !!!!! ! Start position of buffer - posBuffer = 1 + posBuffer = 0 ! Put item count in buffer buffer(posBuffer:posBuffer+ESMF_SIZEOF_DEFINT-1) = transfer ( & source=numStateItems, & - mold=buffer(1:ESMF_SIZEOF_DEFINT)) + mold=buffer(0:ESMF_SIZEOF_DEFINT-1)) posBuffer = posbuffer + ESMF_SIZEOF_DEFINT ! Set flag to actually serialize @@ -4690,7 +4690,7 @@ subroutine ESMF_ReconcileSerializeAll(state, vm, vmid, siwrap, & ! Add item type to buffer buffer(posBuffer:posBuffer+ESMF_SIZEOF_DEFINT-1) = transfer (& source=itemType, & - mold =buffer(1:ESMF_SIZEOF_DEFINT)) + mold =buffer(0:ESMF_SIZEOF_DEFINT-1)) posBuffer = posbuffer + ESMF_SIZEOF_DEFINT ! Add serialized items