ESMF_ArraySpecEQ Function

private impure elemental function ESMF_ArraySpecEQ(arrayspec1, arrayspec2)

Arguments

Type IntentOptional Attributes Name
type(ESMF_ArraySpec), intent(in) :: arrayspec1
type(ESMF_ArraySpec), intent(in) :: arrayspec2

Return Value logical


Source Code

  impure elemental function ESMF_ArraySpecEQ(arrayspec1, arrayspec2)
!
! !RETURN VALUE:
    logical :: ESMF_ArraySpecEQ
!
! !ARGUMENTS:
    type(ESMF_ArraySpec), intent(in) :: arrayspec1
    type(ESMF_ArraySpec), intent(in) :: arrayspec2
!
! !DESCRIPTION:
!   This method overloads the (==) operator for the {\tt ESMF\_ArraySpec} class.
!   See "interface operator(==)" above for complete description.
!
!EOPI
!------------------------------------------------------------------------------
    integer :: localrc

    ! Initialize output value in case of error
    ESMF_ArraySpecEQ = .false.

    ! check inputs
    ESMF_INIT_CHECK_SHALLOW(ESMF_ArraySpecGetInit, arrayspec1, localrc)
    ESMF_INIT_CHECK_SHALLOW(ESMF_ArraySpecGetInit, arrayspec2, localrc)

    if ((arrayspec1%rank == arrayspec2%rank) .and. &
      arrayspec1%typekind == arrayspec2%typekind) &
      ESMF_ArraySpecEQ = .true.

  end function ESMF_ArraySpecEQ