ESMF_BaseSerialize Subroutine

public subroutine ESMF_BaseSerialize(base, buffer, offset, attreconflag, inquireflag, rc)

Arguments

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

Source Code

  subroutine ESMF_BaseSerialize(base, buffer, offset, &
      attreconflag, inquireflag, rc) 
!
! !ARGUMENTS:
    type(ESMF_Base), intent(in)    :: base
    character,       intent(inout) :: buffer(:)
    integer,         intent(inout) :: offset
    type(ESMF_AttReconcileFlag), intent(in) :: attreconflag
    type(ESMF_InquireFlag),      intent(in) :: inquireflag
    integer,         intent(out), optional  :: rc 
!
! !DESCRIPTION:
!      Takes an {\tt ESMF\_Base} object and adds all the information needed
!      to save the information to a file or recreate the object based on this
!      information.   Expected to be used by {\tt ESMF\_StateReconcile()}.
!
!     The arguments are:
!     \begin{description}
!     \item [base]
!           {\tt ESMF\_Base} object to be serialized.
!     \item [buffer]
!           Data buffer which will hold the serialized information.
!     \item [offset]
!           Current write offset in the current buffer.  This will be
!           updated by this routine and return pointing to the next
!           available byte in the buffer.  Note that the offset might be
!           overestimated when the ESMF\_INQUIREONLY option is used.
!     \item[attreconflag]
!           Flag to tell if Attribute serialization is to be done
!     \item[inquireflag]
!           Flag to tell if serialization is to be done (ESMF\_NOINQUIRE)
!           or if this is simply a size inquiry (ESMF\_INQUIREONLY)
!     \item [rc]
!           Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
!     \end{description}
!
!EOPI
    integer :: localrc

    ! Initialize
    localrc = ESMF_RC_NOT_IMPL
    if (present(rc)) rc = ESMF_RC_NOT_IMPL

    call c_ESMC_BaseSerialize(base, buffer, size (buffer), offset, &
        attreconflag, inquireflag, localrc)
    if (ESMF_LogFoundError(localrc, &
        msg="Top level Base serialize", &
        ESMF_CONTEXT,  &
        rcToReturn=rc)) return

    ! Return successfully
    if (present (rc)) rc = ESMF_SUCCESS

  end subroutine ESMF_BaseSerialize