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