My Project
Main Page
Data Types List
Files
File List
File Members
All
Classes
Files
Functions
Variables
Macros
diverg_p.F
Go to the documentation of this file.
1
SUBROUTINE
diverg_p
(klevel,x,y,div)
2
c
3
c P. Le Van
4
c
5
c *********************************************************************
6
c ... calcule la divergence a tous les niveaux d'1 vecteur de compos.
7
c x et y...
8
c x et y etant des composantes covariantes ...
9
c *********************************************************************
10
USE
parallel
11
IMPLICIT NONE
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
c ATTENTION : pendant ce s-pg , ne pas toucher au COMMON/scratch/ .
20
c
21
c ---------------------------------------------------------------------
22
#include "dimensions.h"
23
#include "paramet.h"
24
#include "comgeom.h"
25
c
26
c .......... variables en arguments ...................
27
c
28
INTEGER
klevel
29
REAL
x
(
ip1jmp1
,klevel ),y(
ip1jm
,klevel ),div(
ip1jmp1
,klevel )
30
INTEGER
l
,
ij
31
c
32
c ............... variables locales .........................
33
34
REAL
aiy1( iip1 ) , aiy2( iip1 )
35
REAL
sumypn,sumyps
36
INTEGER
ijb,ije
37
c ...................................................................
38
c
39
EXTERNAL
ssum
40
REAL
ssum
41
c
42
c
43
ijb=ij_begin
44
ije=ij_end
45
if
(pole_nord) ijb=ij_begin+iip1
46
if
(pole_sud) ije=ij_end-iip1
47
48
c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
49
DO
10
l
= 1,klevel
50
c
51
DO
ij
= ijb, ije - 1
52
div(
ij
+ 1,
l
) =
53
*
cvusurcu
(
ij
+1 ) *
x
(
ij
+1,
l
) -
cvusurcu
(
ij
) *
x
(
ij
,
l
) +
54
*
cuvsurcv
(
ij
-
iim
) * y(
ij
-
iim
,
l
) -
cuvsurcv
(
ij
+1) * y(
ij
+1,
l
)
55
ENDDO
56
c
57
c .... correction pour div( 1,j,l) ......
58
c .... div(1,j,l)= div(iip1,j,l) ....
59
c
60
CDIR$ IVDEP
61
DO
ij
= ijb,ije,iip1
62
div(
ij
,
l
) = div(
ij
+
iim
,
l
)
63
ENDDO
64
c
65
c .... calcul aux poles .....
66
c
67
if
(pole_nord)
then
68
DO
ij
= 1,
iim
69
aiy1(
ij
) =
cuvsurcv
(
ij
) * y(
ij
,
l
)
70
ENDDO
71
sumypn =
ssum
(
iim
,aiy1,1 ) /
apoln
72
c
73
DO
ij
= 1,iip1
74
div(
ij
,
l
) = - sumypn
75
ENDDO
76
endif
77
78
if
(pole_sud)
then
79
DO
ij
= 1,
iim
80
aiy2(
ij
) =
cuvsurcv
(
ij
+
ip1jmi1
) * y(
ij
+
ip1jmi1
,
l
)
81
ENDDO
82
sumyps =
ssum
(
iim
,aiy2,1 ) /
apols
83
c
84
DO
ij
= 1,iip1
85
div(
ij
+
ip1jm
,
l
) = sumyps
86
ENDDO
87
endif
88
89
90
10
CONTINUE
91
c$OMP END DO NOWAIT
92
c
93
94
ccc CALL filtreg( div, jjp1, klevel, 2, 2, .TRUE., 1 )
95
96
c
97
c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
98
DO
l
= 1, klevel
99
DO
ij
= ijb,ije
100
div(
ij
,
l
) = div(
ij
,
l
) *
unsaire
(
ij
)
101
ENDDO
102
ENDDO
103
c$OMP END DO NOWAIT
104
c
105
RETURN
106
END
libf
dyn3dmem
diverg_p.F
Generated on Fri Jun 28 2013 15:58:24 for My Project by
1.8.1.2