My Project
 All Classes Files Functions Variables Macros
dissip_p.F
Go to the documentation of this file.
1  SUBROUTINE dissip_p( vcov,ucov,teta,p, dv,du,dh )
2 c
3  USE parallel
4  USE write_field_p
5  IMPLICIT NONE
6 
7 
8 c .. Avec nouveaux operateurs star : gradiv2 , divgrad2, nxgraro2 ...
9 c ( 10/01/98 )
10 
11 c=======================================================================
12 c
13 c Auteur: P. Le Van
14 c -------
15 c
16 c Objet:
17 c ------
18 c
19 c Dissipation horizontale
20 c
21 c=======================================================================
22 c-----------------------------------------------------------------------
23 c Declarations:
24 c -------------
25 
26 #include "dimensions.h"
27 #include "paramet.h"
28 #include "comconst.h"
29 #include "comgeom.h"
30 #include "comdissnew.h"
31 #include "comdissipn.h"
32 
33 c Arguments:
34 c ----------
35 
36  REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm),teta(ip1jmp1,llm)
37  REAL p( ip1jmp1,llmp1 )
38  REAL dv(ip1jm,llm),du(ip1jmp1,llm),dh(ip1jmp1,llm)
39 
40 c Local:
41 c ------
42 
43  REAL gdx(ip1jmp1,llm),gdy(ip1jm,llm)
44  REAL grx(ip1jmp1,llm),gry(ip1jm,llm)
45  REAL te1dt(llm),te2dt(llm),te3dt(llm)
46  REAL deltapres(ip1jmp1,llm)
47 
48  INTEGER l,ij
49 
50  REAL ssum
51  integer :: ijb,ije
52 c-----------------------------------------------------------------------
53 c initialisations:
54 c ----------------
55 
56 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
57  DO l=1,llm
58  te1dt(l) = tetaudiv(l) * dtdiss
59  te2dt(l) = tetaurot(l) * dtdiss
60  te3dt(l) = tetah(l) * dtdiss
61  ENDDO
62 c$OMP END DO NOWAIT
63 c CALL initial0( ijp1llm, du )
64 c CALL initial0( ijmllm , dv )
65 c CALL initial0( ijp1llm, dh )
66 
67  ijb=ij_begin
68  ije=ij_end
69 
70 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
71  DO l=1,llm
72  du(ijb:ije,l)=0
73  dh(ijb:ije,l)=0
74  ENDDO
75 c$OMP END DO NOWAIT
76 
77  if (pole_sud) ije=ij_end-iip1
78 
79 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
80  DO l=1,llm
81  dv(ijb:ije,l)=0
82  ENDDO
83 c$OMP END DO NOWAIT
84 
85 c-----------------------------------------------------------------------
86 c Calcul de la dissipation:
87 c -------------------------
88 
89 c Calcul de la partie grad ( div ) :
90 c -------------------------------------
91 
92 
93 
94  IF(lstardis) THEN
95 c IF (.FALSE.) THEN
96  CALL gradiv2_p( llm,ucov,vcov,nitergdiv,gdx,gdy )
97  ELSE
98  CALL gradiv_p( llm,ucov,vcov,nitergdiv,gdx,gdy )
99  ENDIF
100 
101 
102  ijb=ij_begin
103  ije=ij_end
104  if (pole_sud) ije=ij_end-iip1
105 
106 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
107  DO l=1,llm
108  if (pole_nord) then
109  DO ij = 1, iip1
110  gdx( ij ,l) = 0.
111  ENDDO
112  endif
113 
114  if (pole_sud) then
115  DO ij = 1, iip1
116  gdx(ij+ip1jm,l) = 0.
117  ENDDO
118  endif
119 
120  if (pole_nord) ijb=ij_begin+iip1
121  DO ij = ijb,ije
122  du(ij,l) = du(ij,l) - te1dt(l) *gdx(ij,l)
123  ENDDO
124 
125  if (pole_nord) ijb=ij_begin
126  DO ij = ijb,ije
127  dv(ij,l) = dv(ij,l) - te1dt(l) *gdy(ij,l)
128  ENDDO
129 
130  ENDDO
131 c$OMP END DO NOWAIT
132 c calcul de la partie n X grad ( rot ):
133 c ---------------------------------------
134 
135  IF(lstardis) THEN
136 c IF (.FALSE.) THEN
137  CALL nxgraro2_p( llm,ucov, vcov, nitergrot,grx,gry )
138  ELSE
139  CALL nxgrarot_p( llm,ucov, vcov, nitergrot,grx,gry )
140  ENDIF
141 
142 
143 
144  ijb=ij_begin
145  ije=ij_end
146  if (pole_sud) ije=ij_end-iip1
147 
148 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
149  DO l=1,llm
150 
151  if (pole_nord) then
152  DO ij = 1, iip1
153  grx(ij,l) = 0.
154  ENDDO
155  endif
156 
157  if (pole_nord) ijb=ij_begin+iip1
158  DO ij = ijb,ije
159  du(ij,l) = du(ij,l) - te2dt(l) * grx(ij,l)
160  ENDDO
161 
162  if (pole_nord) ijb=ij_begin
163  DO ij = ijb, ije
164  dv(ij,l) = dv(ij,l) - te2dt(l) * gry(ij,l)
165  ENDDO
166 
167  ENDDO
168 c$OMP END DO NOWAIT
169 
170 c calcul de la partie div ( grad ):
171 c -----------------------------------
172 
173 
174  IF(lstardis) THEN
175 c IF (.FALSE.) THEN
176 
177  ijb=ij_begin
178  ije=ij_end
179 
180 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
181  DO l = 1, llm
182  DO ij = ijb, ije
183  deltapres(ij,l) = amax1( 0., p(ij,l) - p(ij,l+1) )
184  ENDDO
185  ENDDO
186 c$OMP END DO NOWAIT
187  CALL divgrad2_p( llm,teta, deltapres ,niterh, gdx )
188  ELSE
189  CALL divgrad_p( llm,teta, niterh, gdx )
190  ENDIF
191 
192 c call write_field3d_p('gdx2',reshape(gdx,(/iip1,jmp1,llm/)))
193 c stop
194 
195  ijb=ij_begin
196  ije=ij_end
197 
198 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
199  DO l = 1,llm
200  DO ij = ijb,ije
201  dh( ij,l ) = dh( ij,l ) - te3dt(l) * gdx( ij,l )
202  ENDDO
203  ENDDO
204 c$OMP END DO NOWAIT
205 
206  RETURN
207  END