SUBROUTINE AddShadowRelateTableEntry(castingField,receivingField,receivingKind)
          ! SUBROUTINE INFORMATION:
          !       AUTHOR         Jason Glazer
          !       DATE WRITTEN   July 2007
          !       MODIFIED
          !       RE-ENGINEERED  na
          ! PURPOSE OF THIS SUBROUTINE:
          !   Creates an entry for any shadow hierarchy tables that consist
          !   of items and one or more subitems for each item.
          ! METHODOLOGY EMPLOYED:
          !   Simple assignments to public variables.
          ! REFERENCES:
          ! na
          ! USE STATEMENTS:
IMPLICIT NONE    ! Enforce explicit typing of all variables in this routine
          ! SUBROUTINE ARGUMENT DEFINITIONS:
!CHARACTER(len=*),INTENT(IN)  :: castingField
!CHARACTER(len=*),INTENT(IN)  :: receivingField
INTEGER,INTENT(IN)  :: castingField
INTEGER,INTENT(IN)  :: receivingField
INTEGER, INTENT(IN)          :: receivingKind
          ! SUBROUTINE PARAMETER DEFINITIONS:
          ! na
          ! INTERFACE BLOCK SPECIFICATIONS:
          ! na
          ! DERIVED TYPE DEFINITIONS:
          ! na
          ! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
IF (.NOT. ALLOCATED(ShadowRelate)) THEN
  ALLOCATE(ShadowRelate(sizeIncrement))
  sizeShadowRelate = sizeIncrement
  numShadowRelate = 1
ELSE
  numShadowRelate = numShadowRelate + 1
  ! if larger then current size then make a temporary array of the same
  ! type and put stuff into it while reallocating the main array
  IF (numShadowRelate .GT. sizeShadowRelate) THEN
    ALLOCATE(ShadowRelateCopy(sizeShadowRelate))
    ShadowRelateCopy = ShadowRelate
    DEALLOCATE(ShadowRelate)
    ALLOCATE(ShadowRelate(sizeShadowRelate + sizeIncrement))
    ShadowRelate(1:sizeShadowRelate) = ShadowRelateCopy
    DEALLOCATE(ShadowRelateCopy)
    sizeShadowRelate = sizeShadowRelate + sizeIncrement
  END IF
END IF
ShadowRelate(numShadowRelate)%castSurf =   castingField
ShadowRelate(numShadowRelate)%recSurf =    receivingField
ShadowRelate(numShadowRelate)%recKind =    receivingKind
END SUBROUTINE AddShadowRelateTableEntry