MODULE period_mandates_table_def IMPLICIT NONE ! Table of management operation dates to use for testing TYPE :: mandate_type INTEGER :: d, m, y END TYPE mandate_type END MODULE period_mandates_table_def MODULE period_mandates_var USE period_mandates_table_def IMPLICIT NONE ! Specify the "mandate var" structure TYPE (mandate_type), DIMENSION(:), TARGET, ALLOCATABLE :: mandate_var END MODULE period_mandates_var FUNCTION alloc_period_mandates (nrot_yrs) USE period_mandates_var IMPLICIT NONE INTEGER :: nrot_yrs INTEGER :: alloc_status = 0 TYPE (mandate_type), POINTER :: alloc_period_mandates ALLOCATE (mandate_var(nrot_yrs + 50), STAT = alloc_status) IF (alloc_status /= 0) THEN print *, "Error allocating mandate_var(nrot_yrs + 50)" END IF alloc_period_mandates = mandate_var(1) ! ptr to array END FUNCTION alloc_period_mandates