| programmer's documentation

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Basic example

# Basic example

## Local variables to be added

The following local variables need to be defined for the examples in this section:

integer iel, iutile
integer, allocatable, dimension(:) :: lstelt

## Allocation

Before user initialization, work arrays must be allocated.

allocate(lstelt(ncel)) ! temporary array for cells selection

## Initialization

isca(1) is the number related to the first user-defined scalar variable. rtp(iel,isca(1)) is the value of this variable in cell number iel.

ONLY done if there is no restart computation.

if (isuite.eq.0) then
do iel = 1, ncel
rtp(iel,isca(1)) = 25.d0
enddo
endif

## Finalization

At the end of the subroutine, it is recommended to deallocate the work array:

deallocate(lstelt) ! temporary array for cells selection