programmer's documentation
Basic example

Local variables to be added

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

integer iel, ii, jj
double precision x, pormin, pormax, hc, ll, dhc
double precision, dimension(:), pointer :: cpro_porosi

Test to remove for use of subroutine end

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

Retrieve porosity field

! Retrieve porosity field
call field_get_val_s(ipori, cpro_porosi)

Example: fixe a linear by part porosity profile

! Example: fixe a linear by part porosity profile
do iel = 1, ncel
x = xyzcen(1,iel)
if (x.le.(ll/2.d0)) then
hc = 1.d0 - 2.d0*dhc*x/ll
else
hc = 1.d0 - dhc + dhc*(2.d0*x-ll)/ll
endif
cpro_porosi(iel) = hc
pormin = min(pormin,cpro_porosi(iel))
pormax = max(pormax,cpro_porosi(iel))
enddo

Periodicity and parallelism treatment:

! Periodicity and parallelism treatment
if (irangp.ge.0) then
call parmax (pormax)
call parmin (pormin)
endif