ESMF_MeshDeserialize Function

public function ESMF_MeshDeserialize(buffer, offset, attreconflag, rc)

Arguments

Type IntentOptional Attributes Name
character(len=1), pointer, dimension(:) :: buffer
integer, intent(inout) :: offset
type(ESMF_AttReconcileFlag), intent(in), optional :: attreconflag
integer, intent(out), optional :: rc

Return Value type(ESMF_Mesh)


Source Code

      function ESMF_MeshDeserialize(buffer, offset, attreconflag, rc)
!
! !RETURN VALUE:
      type(ESMF_Mesh) :: ESMF_MeshDeserialize
!
! !ARGUMENTS:
      character, pointer, dimension(:) :: buffer
      integer, intent(inout) :: offset
      type(ESMF_AttReconcileFlag), intent(in), optional :: attreconflag
      integer, intent(out), optional :: rc
!
! !DESCRIPTION:
!      Takes a byte-stream buffer and reads the information needed to
!      recreate a Mesh object.  Recursively calls the deserialize routines
!      needed to recreate the subobjects.
!      Expected to be used by {\tt ESMF\_StateReconcile()}.
!
!     The arguments are:
!     \begin{description}
!     \item [buffer]
!           Data buffer which holds the serialized information.
!     \item [offset]
!           Current read offset in the current buffer.  This will be
!           updated by this routine and return pointing to the next
!           unread byte in the buffer.
!     \item[{[attreconflag]}]
!           Flag to tell if Attribute serialization is to be done
!     \item [{[rc]}]
!           Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
!     \end{description}
!
!EOPI

      integer :: localrc
      type(ESMF_Logical) :: isfree
      integer :: i
      type(ESMF_AttReconcileFlag) :: lattreconflag
      integer :: spatialDim, parametricDim
      integer :: intIsPresentNDG, intIsPresentEDG
      type(ESMF_CoordSys_Flag) :: coordSys

       ! Initialize
      localrc = ESMF_RC_NOT_IMPL
      if  (present(rc)) rc = ESMF_RC_NOT_IMPL
      
      ! deal with optional attreconflag
      if (present(attreconflag)) then
        lattreconflag = attreconflag
      else
        lattreconflag = ESMF_ATTRECONCILE_OFF
      endif

      call C_ESMC_MeshDeserialize(ESMF_MeshDeserialize%this, buffer, &
                                  offset, lattreconflag, localrc)
      if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
          ESMF_CONTEXT, rcToReturn=rc)) return

     ! Set init status
     ESMF_INIT_SET_CREATED(ESMF_MeshDeserialize)

     if  (present(rc)) rc = ESMF_SUCCESS

     end function ESMF_MeshDeserialize