next up previous contents
Next: Reading the step input Up: Allocation of the fields Previous: readinput   Contents

allocate

In the subroutine allocate.f the input is read to determine upper bounds for the fields in the program. These upper bounds are printed so that the user can verify them. These upper bounds are used in the subsequent allocation statements in ccx_2.7.c. This procedure might seem slightly awkward, however, since the subroutines reading the input later on are in FORTRAN77, a reallocation is not possible at that stage. Therefore, upper bounds must have been defined.

It is important to know where fields are allocated, reallocated and deallocated. Most (re-, de-) allocation is done in ccx_2.7.c. Table (18) gives an overview where the allocation (A), reallocation (R) and deallocation (D) is done in file ccx_2.7.c. A fundamental mark in this file is the call of subroutine calinput, where the input data is interpreted. A couple of examples: field kon contains the topology of the elements and is allocated with size nkon, which is an upper bound estimate, before all steps. After reading the input up to and including the first step in subroutine calinput the field is reallocated with the correct size, since at that point all elements are read and the exact size is known. This size cannot change in subsequent steps since it is not allowed to define new elements within steps. The field xforc is allocated with the upper bound estimate nforc_ before entering subroutine calinput. After reading the input up to and including the first step its size is reallocated with the true size nforc. Before entering calinput to read the second step (or any subsequent step) xforc is reallocated with size nforc_, since new forces can be defined in step two (and in any subsequent step). After reading step two, the field is reallocated with the momentary value of nforc, and so on. All field which can change due to step information must be reallocated in each step.




next up previous contents
Next: Reading the step input Up: Allocation of the fields Previous: readinput   Contents
guido dhondt 2014-03-02