growing_allocator_mod.F90 Source File


Files dependent on this one

sourcefile~~growing_allocator_mod.f90~~AfferentGraph sourcefile~growing_allocator_mod.f90 growing_allocator_mod.F90 sourcefile~buffered_allocator_mod.f90 buffered_allocator_mod.F90 sourcefile~buffered_allocator_mod.f90->sourcefile~growing_allocator_mod.f90 sourcefile~hicblas_mod.f90 hicblas_mod.F90 sourcefile~hicblas_mod.f90->sourcefile~growing_allocator_mod.f90 sourcefile~tpm_hicfft.f90 tpm_hicfft.F90 sourcefile~tpm_hicfft.f90->sourcefile~growing_allocator_mod.f90 sourcefile~tpm_trans.f90 tpm_trans.F90 sourcefile~tpm_trans.f90->sourcefile~growing_allocator_mod.f90 sourcefile~asre1b_mod.f90 asre1b_mod.F90 sourcefile~asre1b_mod.f90->sourcefile~tpm_trans.f90 sourcefile~asre1bad_mod.f90 asre1bad_mod.F90 sourcefile~asre1bad_mod.f90->sourcefile~tpm_trans.f90 sourcefile~cdmap_mod.f90 cdmap_mod.F90 sourcefile~cdmap_mod.f90->sourcefile~tpm_trans.f90 sourcefile~cdmap_mod.f90~2 cdmap_mod.F90 sourcefile~cdmap_mod.f90~2->sourcefile~tpm_trans.f90 sourcefile~dealloc_resol_mod.f90 dealloc_resol_mod.F90 sourcefile~dealloc_resol_mod.f90->sourcefile~tpm_hicfft.f90 sourcefile~set_resol_mod.f90 set_resol_mod.F90 sourcefile~dealloc_resol_mod.f90->sourcefile~set_resol_mod.f90 sourcefile~dir_trans.f90 dir_trans.F90 sourcefile~dir_trans.f90->sourcefile~tpm_trans.f90 sourcefile~dir_trans_ctl_mod.f90 dir_trans_ctl_mod.F90 sourcefile~dir_trans.f90->sourcefile~dir_trans_ctl_mod.f90 sourcefile~dir_trans.f90->sourcefile~set_resol_mod.f90 sourcefile~dir_trans.f90~2 dir_trans.F90 sourcefile~dir_trans.f90~2->sourcefile~tpm_trans.f90 sourcefile~dir_trans.f90~2->sourcefile~dir_trans_ctl_mod.f90 sourcefile~dir_trans.f90~2->sourcefile~set_resol_mod.f90 sourcefile~dir_trans_ctl_mod.f90->sourcefile~buffered_allocator_mod.f90 sourcefile~dir_trans_ctl_mod.f90->sourcefile~tpm_trans.f90 sourcefile~ftdir_mod.f90 ftdir_mod.F90 sourcefile~dir_trans_ctl_mod.f90->sourcefile~ftdir_mod.f90 sourcefile~ltdir_mod.f90 ltdir_mod.F90 sourcefile~dir_trans_ctl_mod.f90->sourcefile~ltdir_mod.f90 sourcefile~trgtol_mod.f90 trgtol_mod.F90 sourcefile~dir_trans_ctl_mod.f90->sourcefile~trgtol_mod.f90 sourcefile~trltom_mod.f90 trltom_mod.F90 sourcefile~dir_trans_ctl_mod.f90->sourcefile~trltom_mod.f90 sourcefile~trltom_pack_unpack.f90 trltom_pack_unpack.F90 sourcefile~dir_trans_ctl_mod.f90->sourcefile~trltom_pack_unpack.f90 sourcefile~dir_transad.f90~2 dir_transad.F90 sourcefile~dir_transad.f90~2->sourcefile~tpm_trans.f90 sourcefile~dir_transad.f90~2->sourcefile~set_resol_mod.f90 sourcefile~dir_trans_ctlad_mod.f90 dir_trans_ctlad_mod.F90 sourcefile~dir_transad.f90~2->sourcefile~dir_trans_ctlad_mod.f90 sourcefile~fourier_in_mod.f90 fourier_in_mod.F90 sourcefile~fourier_in_mod.f90->sourcefile~tpm_trans.f90 sourcefile~fourier_inad_mod.f90 fourier_inad_mod.F90 sourcefile~fourier_inad_mod.f90->sourcefile~tpm_trans.f90 sourcefile~fourier_out_mod.f90 fourier_out_mod.F90 sourcefile~fourier_out_mod.f90->sourcefile~tpm_trans.f90 sourcefile~fourier_outad_mod.f90 fourier_outad_mod.F90 sourcefile~fourier_outad_mod.f90->sourcefile~tpm_trans.f90 sourcefile~fsc_mod.f90 fsc_mod.F90 sourcefile~fsc_mod.f90->sourcefile~buffered_allocator_mod.f90 sourcefile~fsc_mod.f90->sourcefile~tpm_trans.f90 sourcefile~fsc_mod.f90~2 fsc_mod.F90 sourcefile~fsc_mod.f90~2->sourcefile~tpm_trans.f90 sourcefile~fscad_mod.f90 fscad_mod.F90 sourcefile~fscad_mod.f90->sourcefile~tpm_trans.f90 sourcefile~fspgl_int_mod.f90 fspgl_int_mod.F90 sourcefile~fspgl_int_mod.f90->sourcefile~tpm_trans.f90 sourcefile~ftdir_ctl_mod.f90 ftdir_ctl_mod.F90 sourcefile~ftdir_ctl_mod.f90->sourcefile~tpm_trans.f90 sourcefile~ftdir_ctl_mod.f90->sourcefile~fourier_out_mod.f90 sourcefile~ftdir_ctl_mod.f90->sourcefile~ftdir_mod.f90 sourcefile~ftdir_ctl_mod.f90->sourcefile~trgtol_mod.f90 sourcefile~ftdir_mod.f90->sourcefile~buffered_allocator_mod.f90 sourcefile~ftdir_mod.f90->sourcefile~tpm_hicfft.f90 sourcefile~ftinv_ctl_mod.f90 ftinv_ctl_mod.F90 sourcefile~ftinv_ctl_mod.f90->sourcefile~tpm_trans.f90 sourcefile~ftinv_ctl_mod.f90->sourcefile~fourier_in_mod.f90 sourcefile~ftinv_ctl_mod.f90->sourcefile~fsc_mod.f90 sourcefile~ftinv_mod.f90 ftinv_mod.F90 sourcefile~ftinv_ctl_mod.f90->sourcefile~ftinv_mod.f90 sourcefile~trltog_mod.f90 trltog_mod.F90 sourcefile~ftinv_ctl_mod.f90->sourcefile~trltog_mod.f90 sourcefile~ftinv_ctlad_mod.f90 ftinv_ctlad_mod.F90 sourcefile~ftinv_ctlad_mod.f90->sourcefile~tpm_trans.f90 sourcefile~ftinv_ctlad_mod.f90->sourcefile~fourier_inad_mod.f90 sourcefile~ftinv_ctlad_mod.f90->sourcefile~fscad_mod.f90 sourcefile~ftinv_ctlad_mod.f90->sourcefile~trgtol_mod.f90 sourcefile~ftinv_mod.f90->sourcefile~buffered_allocator_mod.f90 sourcefile~ftinv_mod.f90->sourcefile~tpm_hicfft.f90 sourcefile~gpnorm_trans.f90 gpnorm_trans.F90 sourcefile~gpnorm_trans.f90->sourcefile~buffered_allocator_mod.f90 sourcefile~gpnorm_trans.f90->sourcefile~tpm_trans.f90 sourcefile~gpnorm_trans.f90->sourcefile~set_resol_mod.f90 sourcefile~gpnorm_trans.f90->sourcefile~trgtol_mod.f90 sourcefile~gpnorm_trans_ctl_mod.f90 gpnorm_trans_ctl_mod.F90 sourcefile~gpnorm_trans_ctl_mod.f90->sourcefile~tpm_trans.f90 sourcefile~gpnorm_trans_ctl_mod.f90->sourcefile~set_resol_mod.f90 sourcefile~gpnorm_trans_ctl_mod.f90->sourcefile~trgtol_mod.f90 sourcefile~gpnorm_trans_gpu.f90 gpnorm_trans_gpu.F90 sourcefile~gpnorm_trans_gpu.f90->sourcefile~tpm_trans.f90 sourcefile~gpnorm_trans_gpu.f90->sourcefile~set_resol_mod.f90 sourcefile~gpnorm_trans_gpu.f90->sourcefile~trgtol_mod.f90 sourcefile~inigptr_mod.f90 inigptr_mod.F90 sourcefile~inigptr_mod.f90->sourcefile~tpm_trans.f90 sourcefile~inigptr_mod.f90~2 inigptr_mod.F90 sourcefile~inigptr_mod.f90~2->sourcefile~tpm_trans.f90 sourcefile~inv_trans.f90 inv_trans.F90 sourcefile~inv_trans.f90->sourcefile~tpm_trans.f90 sourcefile~inv_trans_ctl_mod.f90 inv_trans_ctl_mod.F90 sourcefile~inv_trans.f90->sourcefile~inv_trans_ctl_mod.f90 sourcefile~inv_trans.f90->sourcefile~set_resol_mod.f90 sourcefile~inv_trans.f90~2 inv_trans.F90 sourcefile~inv_trans.f90~2->sourcefile~tpm_trans.f90 sourcefile~inv_trans.f90~2->sourcefile~inv_trans_ctl_mod.f90 sourcefile~inv_trans.f90~2->sourcefile~set_resol_mod.f90 sourcefile~inv_trans_ctl_mod.f90->sourcefile~buffered_allocator_mod.f90 sourcefile~inv_trans_ctl_mod.f90->sourcefile~tpm_trans.f90 sourcefile~inv_trans_ctl_mod.f90->sourcefile~fsc_mod.f90 sourcefile~inv_trans_ctl_mod.f90->sourcefile~ftinv_mod.f90 sourcefile~ltinv_mod.f90 ltinv_mod.F90 sourcefile~inv_trans_ctl_mod.f90->sourcefile~ltinv_mod.f90 sourcefile~inv_trans_ctl_mod.f90->sourcefile~trltog_mod.f90 sourcefile~trmtol_mod.f90 trmtol_mod.F90 sourcefile~inv_trans_ctl_mod.f90->sourcefile~trmtol_mod.f90 sourcefile~trmtol_pack_unpack.f90 trmtol_pack_unpack.F90 sourcefile~inv_trans_ctl_mod.f90->sourcefile~trmtol_pack_unpack.f90 sourcefile~inv_trans_ctl_mod.f90~2 inv_trans_ctl_mod.F90 sourcefile~inv_trans_ctl_mod.f90~2->sourcefile~tpm_trans.f90 sourcefile~inv_trans_ctl_mod.f90~2->sourcefile~ftinv_ctl_mod.f90 sourcefile~ltinv_ctl_mod.f90 ltinv_ctl_mod.F90 sourcefile~inv_trans_ctl_mod.f90~2->sourcefile~ltinv_ctl_mod.f90 sourcefile~inv_trans_ctlad_mod.f90 inv_trans_ctlad_mod.F90 sourcefile~inv_trans_ctlad_mod.f90->sourcefile~tpm_trans.f90 sourcefile~inv_trans_ctlad_mod.f90->sourcefile~ftinv_ctlad_mod.f90 sourcefile~ltinv_ctlad_mod.f90 ltinv_ctlad_mod.F90 sourcefile~inv_trans_ctlad_mod.f90->sourcefile~ltinv_ctlad_mod.f90 sourcefile~inv_transad.f90~2 inv_transad.F90 sourcefile~inv_transad.f90~2->sourcefile~tpm_trans.f90 sourcefile~inv_transad.f90~2->sourcefile~inv_trans_ctlad_mod.f90 sourcefile~inv_transad.f90~2->sourcefile~set_resol_mod.f90 sourcefile~ledir_mod.f90 ledir_mod.F90 sourcefile~ledir_mod.f90->sourcefile~buffered_allocator_mod.f90 sourcefile~ledir_mod.f90->sourcefile~hicblas_mod.f90 sourcefile~leinv_mod.f90 leinv_mod.F90 sourcefile~leinv_mod.f90->sourcefile~buffered_allocator_mod.f90 sourcefile~leinv_mod.f90->sourcefile~hicblas_mod.f90 sourcefile~ltdir_ctl_mod.f90 ltdir_ctl_mod.F90 sourcefile~ltdir_ctl_mod.f90->sourcefile~tpm_trans.f90 sourcefile~ltdir_ctl_mod.f90->sourcefile~ltdir_mod.f90 sourcefile~ltdir_ctl_mod.f90->sourcefile~trltom_mod.f90 sourcefile~ltdir_ctlad_mod.f90 ltdir_ctlad_mod.F90 sourcefile~ltdir_ctlad_mod.f90->sourcefile~tpm_trans.f90 sourcefile~ltdir_ctlad_mod.f90->sourcefile~trmtol_mod.f90 sourcefile~ltdirad_mod.f90 ltdirad_mod.F90 sourcefile~ltdir_ctlad_mod.f90->sourcefile~ltdirad_mod.f90 sourcefile~ltdir_mod.f90->sourcefile~buffered_allocator_mod.f90 sourcefile~ltdir_mod.f90->sourcefile~tpm_trans.f90 sourcefile~ltdir_mod.f90->sourcefile~ledir_mod.f90 sourcefile~updsp_mod.f90 updsp_mod.F90 sourcefile~ltdir_mod.f90->sourcefile~updsp_mod.f90 sourcefile~ltdir_mod.f90~2 ltdir_mod.F90 sourcefile~ltdir_mod.f90~2->sourcefile~tpm_trans.f90 sourcefile~ltdir_mod.f90~2->sourcefile~cdmap_mod.f90 sourcefile~ltdir_mod.f90~2->sourcefile~ledir_mod.f90 sourcefile~ltdir_mod.f90~2->sourcefile~updsp_mod.f90 sourcefile~prfi2_mod.f90 prfi2_mod.F90 sourcefile~ltdir_mod.f90~2->sourcefile~prfi2_mod.f90 sourcefile~ltinv_ctl_mod.f90->sourcefile~tpm_trans.f90 sourcefile~ltinv_ctl_mod.f90->sourcefile~ltinv_mod.f90 sourcefile~ltinv_ctl_mod.f90->sourcefile~trmtol_mod.f90 sourcefile~ltinv_ctlad_mod.f90->sourcefile~tpm_trans.f90 sourcefile~ltinvad_mod.f90 ltinvad_mod.F90 sourcefile~ltinv_ctlad_mod.f90->sourcefile~ltinvad_mod.f90 sourcefile~ltinv_ctlad_mod.f90->sourcefile~trltom_mod.f90 sourcefile~ltinv_mod.f90->sourcefile~buffered_allocator_mod.f90 sourcefile~ltinv_mod.f90->sourcefile~tpm_trans.f90 sourcefile~ltinv_mod.f90->sourcefile~leinv_mod.f90 sourcefile~ltinv_mod.f90~2 ltinv_mod.F90 sourcefile~ltinv_mod.f90~2->sourcefile~tpm_trans.f90 sourcefile~ltinv_mod.f90~2->sourcefile~asre1b_mod.f90 sourcefile~ltinv_mod.f90~2->sourcefile~cdmap_mod.f90 sourcefile~ltinv_mod.f90~2->sourcefile~fspgl_int_mod.f90 sourcefile~ltinv_mod.f90~2->sourcefile~leinv_mod.f90 sourcefile~ltinvad_mod.f90->sourcefile~tpm_trans.f90 sourcefile~ltinvad_mod.f90->sourcefile~asre1bad_mod.f90 sourcefile~prfi2b_mod.f90 prfi2b_mod.F90 sourcefile~prfi2b_mod.f90->sourcefile~tpm_trans.f90 sourcefile~prfi2bad_mod.f90 prfi2bad_mod.F90 sourcefile~prfi2bad_mod.f90->sourcefile~tpm_trans.f90 sourcefile~set_resol_mod.f90->sourcefile~tpm_hicfft.f90 sourcefile~setup_trans.f90 setup_trans.F90 sourcefile~setup_trans.f90->sourcefile~tpm_hicfft.f90 sourcefile~setup_trans.f90->sourcefile~set_resol_mod.f90 sourcefile~sufft_mod.f90 sufft_mod.F90 sourcefile~setup_trans.f90->sourcefile~sufft_mod.f90 sourcefile~sufft_mod.f90->sourcefile~tpm_hicfft.f90 sourcefile~trans_end.f90 trans_end.F90 sourcefile~trans_end.f90->sourcefile~tpm_trans.f90 sourcefile~trans_end.f90->sourcefile~dealloc_resol_mod.f90 sourcefile~trans_end.f90->sourcefile~set_resol_mod.f90 sourcefile~trans_end.f90~2 trans_end.F90 sourcefile~trans_end.f90~2->sourcefile~tpm_trans.f90 sourcefile~trans_end.f90~2->sourcefile~dealloc_resol_mod.f90 sourcefile~trans_end.f90~2->sourcefile~set_resol_mod.f90 sourcefile~trgtol_mod.f90->sourcefile~buffered_allocator_mod.f90 sourcefile~trgtol_mod.f90->sourcefile~tpm_trans.f90 sourcefile~trgtol_mod.f90~2 trgtol_mod.F90 sourcefile~trgtol_mod.f90~2->sourcefile~tpm_trans.f90 sourcefile~trgtol_mod.f90~2->sourcefile~inigptr_mod.f90 sourcefile~trltog_mod.f90->sourcefile~buffered_allocator_mod.f90 sourcefile~trltog_mod.f90->sourcefile~tpm_trans.f90 sourcefile~trltog_mod.f90~2 trltog_mod.F90 sourcefile~trltog_mod.f90~2->sourcefile~tpm_trans.f90 sourcefile~trltog_mod.f90~2->sourcefile~inigptr_mod.f90 sourcefile~trltom_mod.f90->sourcefile~buffered_allocator_mod.f90 sourcefile~trltom_pack_unpack.f90->sourcefile~buffered_allocator_mod.f90 sourcefile~trltom_pack_unpack.f90->sourcefile~ledir_mod.f90 sourcefile~trmtol_mod.f90->sourcefile~buffered_allocator_mod.f90 sourcefile~trmtol_pack_unpack.f90->sourcefile~buffered_allocator_mod.f90 sourcefile~trmtol_pack_unpack.f90->sourcefile~leinv_mod.f90 sourcefile~updsp_mod.f90->sourcefile~tpm_trans.f90 sourcefile~updsp_mod.f90~2 updsp_mod.F90 sourcefile~updsp_mod.f90~2->sourcefile~tpm_trans.f90 sourcefile~updspad_mod.f90 updspad_mod.F90 sourcefile~updspad_mod.f90->sourcefile~tpm_trans.f90 sourcefile~asre1_mod.f90 asre1_mod.F90 sourcefile~asre1_mod.f90->sourcefile~asre1b_mod.f90 sourcefile~asre1ad_mod.f90 asre1ad_mod.F90 sourcefile~asre1ad_mod.f90->sourcefile~asre1bad_mod.f90 sourcefile~dealloc_resol_mod.f90~2 dealloc_resol_mod.F90 sourcefile~dealloc_resol_mod.f90~2->sourcefile~set_resol_mod.f90 sourcefile~dir_trans_ctl_mod.f90~2 dir_trans_ctl_mod.F90 sourcefile~dir_trans_ctl_mod.f90~2->sourcefile~ftdir_ctl_mod.f90 sourcefile~dir_trans_ctl_mod.f90~2->sourcefile~ltdir_ctl_mod.f90 sourcefile~dir_trans_ctlad_mod.f90->sourcefile~ltdir_ctlad_mod.f90 sourcefile~ftdir_ctlad_mod.f90 ftdir_ctlad_mod.F90 sourcefile~dir_trans_ctlad_mod.f90->sourcefile~ftdir_ctlad_mod.f90 sourcefile~dist_grid.f90 dist_grid.F90 sourcefile~dist_grid.f90->sourcefile~set_resol_mod.f90 sourcefile~dist_grid.f90~2 dist_grid.F90 sourcefile~dist_grid.f90~2->sourcefile~set_resol_mod.f90 sourcefile~dist_grid_32.f90 dist_grid_32.F90 sourcefile~dist_grid_32.f90->sourcefile~set_resol_mod.f90 sourcefile~dist_grid_32.f90~2 dist_grid_32.F90 sourcefile~dist_grid_32.f90~2->sourcefile~set_resol_mod.f90 sourcefile~dist_spec.f90 dist_spec.F90 sourcefile~dist_spec.f90->sourcefile~set_resol_mod.f90 sourcefile~dist_spec.f90~2 dist_spec.F90 sourcefile~dist_spec.f90~2->sourcefile~set_resol_mod.f90 sourcefile~ftdir_ctlad_mod.f90->sourcefile~fourier_outad_mod.f90 sourcefile~ftdir_ctlad_mod.f90->sourcefile~trltog_mod.f90 sourcefile~gath_grid.f90 gath_grid.F90 sourcefile~gath_grid.f90->sourcefile~set_resol_mod.f90 sourcefile~gath_grid.f90~2 gath_grid.F90 sourcefile~gath_grid.f90~2->sourcefile~set_resol_mod.f90 sourcefile~gath_grid_32.f90 gath_grid_32.F90 sourcefile~gath_grid_32.f90->sourcefile~set_resol_mod.f90 sourcefile~gath_grid_32.f90~2 gath_grid_32.F90 sourcefile~gath_grid_32.f90~2->sourcefile~set_resol_mod.f90 sourcefile~gath_spec.f90 gath_spec.F90 sourcefile~gath_spec.f90->sourcefile~set_resol_mod.f90 sourcefile~gath_spec.f90~2 gath_spec.F90 sourcefile~gath_spec.f90~2->sourcefile~set_resol_mod.f90 sourcefile~gpnorm_trans.f90~2 gpnorm_trans.F90 sourcefile~gpnorm_trans.f90~2->sourcefile~gpnorm_trans_ctl_mod.f90 sourcefile~gpnorm_trans.f90~2->sourcefile~set_resol_mod.f90 sourcefile~ltdirad_mod.f90->sourcefile~updspad_mod.f90 sourcefile~prfi2ad_mod.f90 prfi2ad_mod.F90 sourcefile~ltdirad_mod.f90->sourcefile~prfi2ad_mod.f90 sourcefile~prfi2_mod.f90->sourcefile~prfi2b_mod.f90 sourcefile~prfi2ad_mod.f90->sourcefile~prfi2bad_mod.f90 sourcefile~setup_trans.f90~2 setup_trans.F90 sourcefile~setup_trans.f90~2->sourcefile~set_resol_mod.f90 sourcefile~specnorm.f90 specnorm.F90 sourcefile~specnorm.f90->sourcefile~set_resol_mod.f90 sourcefile~specnorm.f90~2 specnorm.F90 sourcefile~specnorm.f90~2->sourcefile~set_resol_mod.f90 sourcefile~trans_inq.f90 trans_inq.F90 sourcefile~trans_inq.f90->sourcefile~set_resol_mod.f90 sourcefile~trans_inq.f90~2 trans_inq.F90 sourcefile~trans_inq.f90~2->sourcefile~set_resol_mod.f90 sourcefile~trans_pnm.f90 trans_pnm.F90 sourcefile~trans_pnm.f90->sourcefile~set_resol_mod.f90 sourcefile~trans_pnm.f90~2 trans_pnm.F90 sourcefile~trans_pnm.f90~2->sourcefile~set_resol_mod.f90 sourcefile~trans_release.f90 trans_release.F90 sourcefile~trans_release.f90->sourcefile~dealloc_resol_mod.f90 sourcefile~trans_release.f90~2 trans_release.F90 sourcefile~trans_release.f90~2->sourcefile~dealloc_resol_mod.f90 sourcefile~vordiv_to_uv.f90 vordiv_to_uv.F90 sourcefile~vordiv_to_uv.f90->sourcefile~set_resol_mod.f90 sourcefile~vordiv_to_uv.f90~2 vordiv_to_uv.F90 sourcefile~vordiv_to_uv.f90~2->sourcefile~set_resol_mod.f90

Source Code

MODULE GROWING_ALLOCATOR_MOD

  USE ISO_C_BINDING, ONLY: C_INT8_T

  PRIVATE
  PUBLIC :: GROWING_ALLOCATION_TYPE
  PUBLIC :: REALLOCATE_GROWING_ALLOCATION, REGISTER_FREE_FUNCTION

  ABSTRACT INTERFACE
    SUBROUTINE FREE_FUNC_PROC(PTR, SZ) BIND(C)
      USE ISO_C_BINDING, ONLY: C_SIZE_T, C_INT8_T
      IMPLICIT NONE
      INTEGER(KIND=C_INT8_T), TARGET :: PTR(:)
      INTEGER(C_SIZE_T), VALUE :: SZ
    END SUBROUTINE
  END INTERFACE

  TYPE FREE_FUNC_TYPE
    PROCEDURE(FREE_FUNC_PROC), POINTER, NOPASS :: FUNC => NULL ()
  END TYPE

  TYPE GROWING_ALLOCATION_TYPE
    INTEGER(KIND=C_INT8_T), POINTER :: PTR(:)
    TYPE(FREE_FUNC_TYPE) :: FREE_FUNCS(10)
    INTEGER :: FREE_FUNCS_SZ
  END TYPE

CONTAINS

  SUBROUTINE REALLOCATE_GROWING_ALLOCATION(ALLOC, SZ)
    USE ISO_C_BINDING, ONLY: C_SIZE_T
    IMPLICIT NONE
    TYPE(GROWING_ALLOCATION_TYPE), INTENT(INOUT) :: ALLOC
    INTEGER(C_SIZE_T) :: SZ
    INTEGER :: I

    ! Deallocate existing pointer
    IF (ASSOCIATED(ALLOC%PTR) .AND. SZ > SIZE(ALLOC%PTR, 1, C_SIZE_T)) THEN
      PRINT *, "WARNING: REALLOCATING GROWING POINTER CAUSING GRAPH REINSTANTIATION"
      DO I = 1, ALLOC%FREE_FUNCS_SZ
        CALL ALLOC%FREE_FUNCS(I)%FUNC(ALLOC%PTR, &
                                      SIZE(ALLOC%PTR, 1, C_SIZE_T))
      ENDDO
      !$ACC EXIT DATA DELETE(ALLOC%PTR)
      DEALLOCATE(ALLOC%PTR)
      NULLIFY(ALLOC%PTR)
    ENDIF

    IF (.NOT. ASSOCIATED(ALLOC%PTR)) THEN
      ALLOCATE(ALLOC%PTR(SZ))
      !$ACC ENTER DATA CREATE(ALLOC%PTR)
      ALLOC%FREE_FUNCS_SZ = 0
    ENDIF
  END SUBROUTINE

  SUBROUTINE REGISTER_FREE_FUNCTION(ALLOC, FREE_FUNC)
    IMPLICIT NONE
    TYPE(GROWING_ALLOCATION_TYPE) :: ALLOC
    PROCEDURE(FREE_FUNC_PROC) :: FREE_FUNC

    INTEGER :: I

    DO I = 1, ALLOC%FREE_FUNCS_SZ
      IF (ASSOCIATED(ALLOC%FREE_FUNCS(I)%FUNC, FREE_FUNC)) &
        RETURN
    ENDDO

    ALLOC%FREE_FUNCS_SZ = ALLOC%FREE_FUNCS_SZ + 1
    IF (ALLOC%FREE_FUNCS_SZ > SIZE(ALLOC%FREE_FUNCS)) THEN
      PRINT *, "TOO MANY FREE FUNCTIONS REGISTERED"
      STOP 4
    ENDIF
    ALLOC%FREE_FUNCS(ALLOC%FREE_FUNCS_SZ)%FUNC => FREE_FUNC
  END SUBROUTINE

  SUBROUTINE REGISTER_FREE_C(ALLOC_C, FREE_FUNC_C) BIND(C, NAME="growing_allocator_register_free_c")
    USE ISO_C_BINDING, ONLY: C_FUNPTR, C_PTR, C_F_PROCPOINTER, C_F_POINTER
    IMPLICIT NONE
    TYPE(C_PTR), VALUE :: ALLOC_C
    TYPE(C_FUNPTR), VALUE :: FREE_FUNC_C

    TYPE(GROWING_ALLOCATION_TYPE), POINTER :: ALLOC
    PROCEDURE(FREE_FUNC_PROC), POINTER :: FREE_FUNC

    CALL C_F_POINTER(ALLOC_C, ALLOC)
    CALL C_F_PROCPOINTER(FREE_FUNC_C, FREE_FUNC)
    CALL REGISTER_FREE_FUNCTION(ALLOC, FREE_FUNC)

  END SUBROUTINE

END MODULE