      module GwfRchModule
        
        public
        
        INTEGER, SAVE, POINTER                 ::NRCHOP,IRCHCB
        INTEGER, SAVE, POINTER                 ::NPRCH,IRCHPF
        double precision,  SAVE,   DIMENSION(:,:),  POINTER   ::RECH
        INTEGER, SAVE,   DIMENSION(:,:),  POINTER      ::IRCH
      TYPE GWFRCHTYPE
        INTEGER,  POINTER                 ::NRCHOP,IRCHCB
        INTEGER,  POINTER                 ::NPRCH,IRCHPF
        double precision,       DIMENSION(:,:),  POINTER      ::RECH
        INTEGER,    DIMENSION(:,:),  POINTER      ::IRCH
      END TYPE
      TYPE(GWFRCHTYPE), SAVE ::GWFRCHDAT(10)
      
      contains

      SUBROUTINE GWF2RCH7DA(IGRID)
C  Deallocate RCH DATA
C
        DEALLOCATE(GWFRCHDAT(IGRID)%NRCHOP)
        DEALLOCATE(GWFRCHDAT(IGRID)%IRCHCB)
        DEALLOCATE(GWFRCHDAT(IGRID)%NPRCH)
        DEALLOCATE(GWFRCHDAT(IGRID)%IRCHPF)
        DEALLOCATE(GWFRCHDAT(IGRID)%RECH)
        DEALLOCATE(GWFRCHDAT(IGRID)%IRCH)
C
      RETURN
      END SUBROUTINE GWF2RCH7DA

      SUBROUTINE SGWF2RCH7PNT(IGRID)
C  Set RCH pointers for grid.
C
        NRCHOP=>GWFRCHDAT(IGRID)%NRCHOP
        IRCHCB=>GWFRCHDAT(IGRID)%IRCHCB
        NPRCH=>GWFRCHDAT(IGRID)%NPRCH
        IRCHPF=>GWFRCHDAT(IGRID)%IRCHPF
        RECH=>GWFRCHDAT(IGRID)%RECH
        IRCH=>GWFRCHDAT(IGRID)%IRCH
C
      RETURN
      END SUBROUTINE SGWF2RCH7PNT

      SUBROUTINE SGWF2RCH7PSV(IGRID)
C  Save RCH pointers for grid.
C
        GWFRCHDAT(IGRID)%NRCHOP=>NRCHOP
        GWFRCHDAT(IGRID)%IRCHCB=>IRCHCB
        GWFRCHDAT(IGRID)%NPRCH=>NPRCH
        GWFRCHDAT(IGRID)%IRCHPF=>IRCHPF
        GWFRCHDAT(IGRID)%RECH=>RECH
        GWFRCHDAT(IGRID)%IRCH=>IRCH
C
      RETURN
      END SUBROUTINE SGWF2RCH7PSV

      end module GwfRchModule
