ESMF_GeomEQ Function

private impure elemental function ESMF_GeomEQ(geom1, geom2)

Arguments

Type IntentOptional Attributes Name
type(ESMF_Geom), intent(in) :: geom1
type(ESMF_Geom), intent(in) :: geom2

Return Value logical


Calls

proc~~esmf_geomeq~~CallsGraph proc~esmf_geomeq ESMF_GeomEQ proc~esmf_geomgetinit ESMF_GeomGetInit proc~esmf_geomeq->proc~esmf_geomgetinit

Called by

proc~~esmf_geomeq~~CalledByGraph proc~esmf_geomeq ESMF_GeomEQ interface~operator(==)~23 operator(==) interface~operator(==)~23->proc~esmf_geomeq proc~esmf_geomne ESMF_GeomNE proc~esmf_geomne->proc~esmf_geomeq interface~operator(SLASH=)~23 operator(/=) interface~operator(SLASH=)~23->proc~esmf_geomne

Source Code

  impure elemental function ESMF_GeomEQ(geom1, geom2)
!
! !RETURN VALUE:
    logical :: ESMF_GeomEQ

! !ARGUMENTS:
    type(ESMF_Geom), intent(in) :: geom1
    type(ESMF_Geom), intent(in) :: geom2

! !DESCRIPTION:
!   Test if both {\tt geom1} and {\tt geom2} alias the same ESMF Geom
!   object.
!
!EOPI
!-------------------------------------------------------------------------------

    ESMF_INIT_TYPE ginit1, ginit2
    integer :: localrc1, localrc2
    logical :: lval1, lval2

    ! Use the following logic, rather than "ESMF-INIT-CHECK-DEEP", to gain
    ! init checks on both args, and in the case where both are uninitialized,
    ! to distinguish equality based on uninitialized type (uncreated,
    ! deleted).

    ! TODO: Consider moving this logic to C++: use Base class? status?
    !       Or replicate logic for C interface also.

    ! check inputs
    ginit1 = ESMF_GeomGetInit(geom1)
    ginit2 = ESMF_GeomGetInit(geom2)

    ! TODO: this line must remain split in two for SunOS f90 8.3 127000-03
    if (ginit1 == ESMF_INIT_CREATED .and. &
      ginit2 == ESMF_INIT_CREATED) then
      ESMF_GeomEQ = associated(geom1%gbcp, geom2%gbcp)
    else
      ESMF_GeomEQ = .false.
    endif

  end function ESMF_GeomEQ