programmer's documentation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cooling_towers example

cooling_towers example

Local variables to be added

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

integer iel, iutile
integer ilelt, nlelt
double precision d2s3
double precision, dimension(:,:), pointer :: vel
integer, allocatable, dimension(:) :: lstelt
double precision, dimension(:), pointer :: cvar_temp4, cvar_humid

Allocation

Before user initialization, work arrays lstelt must be allocated, like in basic example.

Initialization

The following initialization block needs to be added for the following examples:

allocate(lstelt(ncel)) ! temporary array for cells selection
d2s3 = 2.d0/3.d0
! Map field arrays
!===============================================================================
! Variables initialization:
!
! ONLY done if there is no restart computation
!===============================================================================
if (isuite.eq.0) then
! --- Initialisation de la temperature de l'air a 11 deg Celsius
! de l'humidite de l'air a 0.0063
! pour toutes les cellules
call field_get_val_s(ivarfl(isca(itemp4)), cvar_temp4)
call field_get_val_s(ivarfl(isca(ihumid)), cvar_humid)
do iel = 1, ncel
cvar_temp4(iel) = 11.d0
cvar_humid(iel) = 0.0063d0
enddo
! --- Initialisation de la temperature de l'air a 20 deg Celsius
! de l'humidite de l'air a 0.012
! de la vitesse
! uniquement pour les cellules de couleur 6
call getcel('6', nlelt, lstelt)
!==========
do ilelt = 1, nlelt
iel = lstelt(ilelt)
vel(1,iel) = -0.5d0
cvar_temp4(iel) = 20.d0
cvar_humid(iel) = 0.012d0
enddo
endif

Finalization

At the end of the subroutine, it is recommended to deallocate the work array lstelt, like in basic example.