1 |
|
|
! |
2 |
|
|
! $Header$ |
3 |
|
|
! |
4 |
|
|
SUBROUTINE divergst(klevel,x,y,div) |
5 |
|
|
IMPLICIT NONE |
6 |
|
|
c |
7 |
|
|
c P. Le Van |
8 |
|
|
c |
9 |
|
|
c ****************************************************************** |
10 |
|
|
c ... calcule la divergence a tous les niveaux d'1 vecteur de compos. x et y... |
11 |
|
|
c x et y etant des composantes contravariantes ... |
12 |
|
|
c **************************************************************** |
13 |
|
|
c x et y sont des arguments d'entree pour le s-prog |
14 |
|
|
c div est un argument de sortie pour le s-prog |
15 |
|
|
c |
16 |
|
|
c |
17 |
|
|
c ------------------------------------------------------------------- |
18 |
|
|
c |
19 |
|
|
INCLUDE "dimensions.h" |
20 |
|
|
INCLUDE "paramet.h" |
21 |
|
|
INCLUDE "comgeom.h" |
22 |
|
|
|
23 |
|
|
INTEGER klevel |
24 |
|
|
REAL x( ip1jmp1,klevel ),y( ip1jm,klevel ),div( ip1jmp1,klevel ) |
25 |
|
|
INTEGER ij,l,i |
26 |
|
|
REAL aiy1( iip1 ) , aiy2( iip1 ) |
27 |
|
|
REAL sumypn,sumyps |
28 |
|
|
|
29 |
|
|
REAL SSUM |
30 |
|
|
c |
31 |
|
|
c |
32 |
|
|
DO 10 l = 1,klevel |
33 |
|
|
c |
34 |
|
|
DO 1 ij = iip2, ip1jm - 1 |
35 |
|
|
div( ij + 1, l ) = x(ij+1,l) - x(ij,l)+ y(ij-iim,l)-y(ij+1,l) |
36 |
|
|
1 CONTINUE |
37 |
|
|
c |
38 |
|
|
c .... correction pour div( 1,j,l) ...... |
39 |
|
|
c .... div(1,j,l)= div(iip1,j,l) .... |
40 |
|
|
c |
41 |
|
|
CDIR$ IVDEP |
42 |
|
|
DO 3 ij = iip2,ip1jm,iip1 |
43 |
|
|
div( ij,l ) = div( ij + iim,l ) |
44 |
|
|
3 CONTINUE |
45 |
|
|
c |
46 |
|
|
c .... calcul aux poles ..... |
47 |
|
|
c |
48 |
|
|
c |
49 |
|
|
DO 5 i = 1,iim |
50 |
|
|
aiy1(i)= y(i,l) |
51 |
|
|
aiy2(i)= y(i+ip1jmi1,l) |
52 |
|
|
5 CONTINUE |
53 |
|
|
sumypn = SSUM ( iim,aiy1,1 ) |
54 |
|
|
sumyps = SSUM ( iim,aiy2,1 ) |
55 |
|
|
DO 7 i = 1,iip1 |
56 |
|
|
div( i , l ) = - sumypn/iim |
57 |
|
|
div( i + ip1jm, l ) = sumyps/iim |
58 |
|
|
7 CONTINUE |
59 |
|
|
c |
60 |
|
|
10 CONTINUE |
61 |
|
|
RETURN |
62 |
|
|
END |