Allocatable Arrays: dynamic allocation from the heap

Rather than
    INTEGER, DIMENSION(1:10) :: numbers             ! -- declare both rank and
                                                    !    bounds (size);
we have
    INTEGER, DIMENSION(:), ALLOCATABLE :: numbers    ! -- declare only rank;

Example:
    INTEGER                            :: num_to_sort
    INTEGER, DIMENSION(:), ALLOCATABLE :: numbers

    READ(UNIT=*,FTM=*) num_to_sort
    ALLOCATE(numbers(1:num_to_sort))

    !
    ! -- read in values and sort them!
    ! 


...previousup (conts)next...



About this document:

Produced from the SGML: /home/isd/public_html/_course_fortran_90/_reml_grp/index.reml
On: 10/2/2003 at 10:33:52
Options: reml2 -i noindex -l long -o html -p multiple