[1632] | 1 | ! |
---|
| 2 | ! $Header$ |
---|
| 3 | ! |
---|
[4368] | 4 | SUBROUTINE vlspltgen_loc( q,pente_max,masse,w,pbaru,pbarv, |
---|
[1632] | 5 | & pdt, p,pk,teta ) |
---|
| 6 | |
---|
| 7 | c |
---|
| 8 | c Auteurs: P.Le Van, F.Hourdin, F.Forget, F.Codron |
---|
| 9 | c |
---|
| 10 | c ******************************************************************** |
---|
| 11 | c Shema d'advection " pseudo amont " . |
---|
| 12 | c + test sur humidite specifique: Q advecte< Qsat aval |
---|
| 13 | c (F. Codron, 10/99) |
---|
| 14 | c ******************************************************************** |
---|
| 15 | c q,pbaru,pbarv,w sont des arguments d'entree pour le s-pg .... |
---|
| 16 | c |
---|
| 17 | c pente_max facteur de limitation des pentes: 2 en general |
---|
| 18 | c 0 pour un schema amont |
---|
| 19 | c pbaru,pbarv,w flux de masse en u ,v ,w |
---|
| 20 | c pdt pas de temps |
---|
| 21 | c |
---|
| 22 | c teta temperature potentielle, p pression aux interfaces, |
---|
| 23 | c pk exner au milieu des couches necessaire pour calculer Qsat |
---|
| 24 | c -------------------------------------------------------------------- |
---|
[1823] | 25 | USE parallel_lmdz |
---|
[1632] | 26 | USE mod_hallo |
---|
| 27 | USE Write_Field_loc |
---|
| 28 | USE VAMPIR |
---|
[2270] | 29 | ! CRisi: on rajoute variables utiles d'infotrac |
---|
[4368] | 30 | USE infotrac, ONLY : nqtot, tracers, isoCheck |
---|
[1632] | 31 | USE vlspltgen_mod |
---|
[2597] | 32 | USE comconst_mod, ONLY: cpp |
---|
[1632] | 33 | IMPLICIT NONE |
---|
| 34 | |
---|
| 35 | c |
---|
[2597] | 36 | include "dimensions.h" |
---|
| 37 | include "paramet.h" |
---|
[1632] | 38 | |
---|
| 39 | c |
---|
| 40 | c Arguments: |
---|
| 41 | c ---------- |
---|
| 42 | REAL masse(ijb_u:ije_u,llm),pente_max |
---|
| 43 | REAL pbaru( ijb_u:ije_u,llm ),pbarv( ijb_v:ije_v,llm) |
---|
| 44 | REAL q(ijb_u:ije_u,llm,nqtot) |
---|
| 45 | REAL w(ijb_u:ije_u,llm),pdt |
---|
| 46 | REAL p(ijb_u:ije_u,llmp1),teta(ijb_u:ije_u,llm) |
---|
| 47 | REAL pk(ijb_u:ije_u,llm) |
---|
| 48 | c |
---|
| 49 | c Local |
---|
| 50 | c --------- |
---|
| 51 | c |
---|
| 52 | INTEGER ij,l |
---|
| 53 | c |
---|
| 54 | REAL zzpbar, zzw |
---|
| 55 | |
---|
| 56 | REAL qmin,qmax |
---|
| 57 | DATA qmin,qmax/0.,1.e33/ |
---|
| 58 | |
---|
| 59 | c--pour rapport de melange saturant-- |
---|
| 60 | |
---|
| 61 | REAL rtt,retv,r2es,r3les,r3ies,r4les,r4ies,play |
---|
| 62 | REAL ptarg,pdelarg,foeew,zdelta |
---|
| 63 | REAL tempe(ijb_u:ije_u) |
---|
[2270] | 64 | INTEGER ijb,ije,iq,iq2,ifils |
---|
[1632] | 65 | LOGICAL, SAVE :: firstcall=.TRUE. |
---|
| 66 | !$OMP THREADPRIVATE(firstcall) |
---|
[1848] | 67 | type(request),SAVE :: MyRequest1 |
---|
| 68 | !$OMP THREADPRIVATE(MyRequest1) |
---|
| 69 | type(request),SAVE :: MyRequest2 |
---|
| 70 | !$OMP THREADPRIVATE(MyRequest2) |
---|
[1632] | 71 | c fonction psat(T) |
---|
| 72 | |
---|
| 73 | FOEEW ( PTARG,PDELARG ) = EXP ( |
---|
| 74 | * (R3LES*(1.-PDELARG)+R3IES*PDELARG) * (PTARG-RTT) |
---|
| 75 | * / (PTARG-(R4LES*(1.-PDELARG)+R4IES*PDELARG)) ) |
---|
| 76 | |
---|
| 77 | r2es = 380.11733 |
---|
| 78 | r3les = 17.269 |
---|
| 79 | r3ies = 21.875 |
---|
| 80 | r4les = 35.86 |
---|
| 81 | r4ies = 7.66 |
---|
| 82 | retv = 0.6077667 |
---|
| 83 | rtt = 273.16 |
---|
| 84 | |
---|
| 85 | c Allocate variables depending on dynamic variable nqtot |
---|
| 86 | |
---|
| 87 | IF (firstcall) THEN |
---|
| 88 | firstcall=.FALSE. |
---|
| 89 | END IF |
---|
| 90 | c-- Calcul de Qsat en chaque point |
---|
| 91 | c-- approximation: au milieu des couches play(l)=(p(l)+p(l+1))/2 |
---|
| 92 | c pour eviter une exponentielle. |
---|
| 93 | |
---|
| 94 | call SetTag(MyRequest1,100) |
---|
| 95 | call SetTag(MyRequest2,101) |
---|
| 96 | |
---|
| 97 | |
---|
[2597] | 98 | ijb=ij_begin-iip1 |
---|
| 99 | ije=ij_end+iip1 |
---|
| 100 | if (pole_nord) ijb=ij_begin |
---|
| 101 | if (pole_sud) ije=ij_end |
---|
| 102 | |
---|
[1632] | 103 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
[2597] | 104 | DO l = 1, llm |
---|
[1632] | 105 | DO ij = ijb, ije |
---|
| 106 | tempe(ij) = teta(ij,l) * pk(ij,l) /cpp |
---|
| 107 | ENDDO |
---|
| 108 | DO ij = ijb, ije |
---|
| 109 | zdelta = MAX( 0., SIGN(1., rtt - tempe(ij)) ) |
---|
| 110 | play = 0.5*(p(ij,l)+p(ij,l+1)) |
---|
| 111 | qsat(ij,l) = MIN(0.5, r2es* FOEEW(tempe(ij),zdelta) / play ) |
---|
| 112 | qsat(ij,l) = qsat(ij,l) / ( 1. - retv * qsat(ij,l) ) |
---|
| 113 | ENDDO |
---|
| 114 | ENDDO |
---|
| 115 | c$OMP END DO NOWAIT |
---|
| 116 | c PRINT*,'Debut vlsplt version debug sans vlyqs' |
---|
| 117 | |
---|
| 118 | zzpbar = 0.5 * pdt |
---|
| 119 | zzw = pdt |
---|
| 120 | |
---|
| 121 | ijb=ij_begin |
---|
| 122 | ije=ij_end |
---|
| 123 | if (pole_nord) ijb=ijb+iip1 |
---|
| 124 | if (pole_sud) ije=ije-iip1 |
---|
| 125 | |
---|
| 126 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 127 | DO l=1,llm |
---|
| 128 | DO ij = ijb,ije |
---|
| 129 | mu(ij,l)=pbaru(ij,l) * zzpbar |
---|
| 130 | ENDDO |
---|
| 131 | ENDDO |
---|
| 132 | c$OMP END DO NOWAIT |
---|
| 133 | |
---|
| 134 | ijb=ij_begin-iip1 |
---|
| 135 | ije=ij_end |
---|
| 136 | if (pole_nord) ijb=ij_begin |
---|
| 137 | if (pole_sud) ije=ij_end-iip1 |
---|
| 138 | |
---|
| 139 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 140 | DO l=1,llm |
---|
| 141 | DO ij=ijb,ije |
---|
| 142 | mv(ij,l)=pbarv(ij,l) * zzpbar |
---|
| 143 | ENDDO |
---|
| 144 | ENDDO |
---|
| 145 | c$OMP END DO NOWAIT |
---|
| 146 | |
---|
| 147 | ijb=ij_begin |
---|
| 148 | ije=ij_end |
---|
| 149 | |
---|
[2270] | 150 | DO iq=1,nqtot |
---|
[1632] | 151 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 152 | DO l=1,llm |
---|
| 153 | DO ij=ijb,ije |
---|
[2270] | 154 | mw(ij,l,iq)=w(ij,l) * zzw |
---|
[1632] | 155 | ENDDO |
---|
| 156 | ENDDO |
---|
| 157 | c$OMP END DO NOWAIT |
---|
[2270] | 158 | ENDDO |
---|
[1632] | 159 | |
---|
[2270] | 160 | DO iq=1,nqtot |
---|
[1632] | 161 | c$OMP MASTER |
---|
| 162 | DO ij=ijb,ije |
---|
[2270] | 163 | mw(ij,llm+1,iq)=0. |
---|
[1632] | 164 | ENDDO |
---|
| 165 | c$OMP END MASTER |
---|
[2270] | 166 | ENDDO |
---|
[1632] | 167 | |
---|
| 168 | c CALL SCOPY(ijp1llm,q,1,zq,1) |
---|
| 169 | c CALL SCOPY(ijp1llm,masse,1,zm,1) |
---|
| 170 | |
---|
| 171 | ijb=ij_begin |
---|
| 172 | ije=ij_end |
---|
| 173 | |
---|
[2270] | 174 | DO iq=1,nqtot |
---|
[1632] | 175 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 176 | DO l=1,llm |
---|
| 177 | zq(ijb:ije,l,iq)=q(ijb:ije,l,iq) |
---|
| 178 | zm(ijb:ije,l,iq)=masse(ijb:ije,l) |
---|
| 179 | ENDDO |
---|
| 180 | c$OMP END DO NOWAIT |
---|
| 181 | ENDDO |
---|
| 182 | |
---|
[2270] | 183 | #ifdef DEBUG_IO |
---|
[1632] | 184 | CALL WriteField_u('mu',mu) |
---|
| 185 | CALL WriteField_v('mv',mv) |
---|
| 186 | CALL WriteField_u('mw',mw) |
---|
| 187 | CALL WriteField_u('qsat',qsat) |
---|
| 188 | #endif |
---|
| 189 | |
---|
[2270] | 190 | ! verif temporaire |
---|
[2281] | 191 | ijb=ij_begin |
---|
| 192 | ije=ij_end |
---|
[4368] | 193 | call check_isotopes(zq,ijb,ije,'vlspltgen_loc 191') |
---|
[2270] | 194 | |
---|
[1632] | 195 | c$OMP BARRIER |
---|
[4368] | 196 | DO iq=1,nqtot |
---|
| 197 | ! CRisi: on ne boucle que sur les pères= ceux qui sont transportés directement par l'air |
---|
| 198 | IF(tracers(iq)%parent /= 'air') CYCLE |
---|
| 199 | !write(*,*) 'vlspltgen 192: iq,iadv=',iq,tracers(iq)%iadv |
---|
[1632] | 200 | #ifdef DEBUG_IO |
---|
[4368] | 201 | CALL WriteField_u('zq',zq(:,:,iq)) |
---|
| 202 | CALL WriteField_u('zm',zm(:,:,iq)) |
---|
[1632] | 203 | #endif |
---|
[4368] | 204 | SELECT CASE(tracers(iq)%iadv) |
---|
| 205 | CASE(0); CYCLE |
---|
| 206 | CASE(10) |
---|
[1632] | 207 | #ifdef _ADV_HALO |
---|
[2270] | 208 | ! CRisi: on ajoute les nombres de fils et tableaux des fils |
---|
| 209 | ! On suppose qu'on ne peut advecter les fils que par le schéma 10. |
---|
| 210 | call vlx_loc(zq,pente_max,zm,mu, |
---|
[2597] | 211 | & ij_begin,ij_begin+2*iip1-1,iq) |
---|
| 212 | call vlx_loc(zq,pente_max,zm,mu, |
---|
[2270] | 213 | & ij_end-2*iip1+1,ij_end,iq) |
---|
[1632] | 214 | #else |
---|
[2597] | 215 | call vlx_loc(zq,pente_max,zm,mu, |
---|
| 216 | & ij_begin,ij_end,iq) |
---|
[1632] | 217 | #endif |
---|
| 218 | |
---|
| 219 | c$OMP MASTER |
---|
| 220 | call VTb(VTHallo) |
---|
| 221 | c$OMP END MASTER |
---|
| 222 | call Register_Hallo_u(zq(:,:,iq),llm,2,2,2,2,MyRequest1) |
---|
| 223 | call Register_Hallo_u(zm(:,:,iq),llm,1,1,1,1,MyRequest1) |
---|
[2270] | 224 | ! CRisi |
---|
[4368] | 225 | do ifils=1,tracers(iq)%nqDescen |
---|
| 226 | iq2=tracers(iq)%iqDescen(ifils) |
---|
[2270] | 227 | call Register_Hallo_u(zq(:,:,iq2),llm,2,2,2,2,MyRequest1) |
---|
| 228 | call Register_Hallo_u(zm(:,:,iq2),llm,1,1,1,1,MyRequest1) |
---|
| 229 | enddo |
---|
[1632] | 230 | |
---|
| 231 | c$OMP MASTER |
---|
| 232 | call VTe(VTHallo) |
---|
| 233 | c$OMP END MASTER |
---|
[4368] | 234 | CASE(14) |
---|
[1632] | 235 | #ifdef _ADV_HALO |
---|
[2270] | 236 | call vlxqs_loc(zq,pente_max,zm,mu, |
---|
| 237 | & qsat,ij_begin,ij_begin+2*iip1-1,iq) |
---|
| 238 | call vlxqs_loc(zq,pente_max,zm,mu, |
---|
| 239 | & qsat,ij_end-2*iip1+1,ij_end,iq) |
---|
[1632] | 240 | #else |
---|
[2270] | 241 | call vlxqs_loc(zq,pente_max,zm,mu, |
---|
| 242 | & qsat,ij_begin,ij_end,iq) |
---|
[1632] | 243 | #endif |
---|
| 244 | |
---|
| 245 | c$OMP MASTER |
---|
| 246 | call VTb(VTHallo) |
---|
| 247 | c$OMP END MASTER |
---|
| 248 | |
---|
| 249 | call Register_Hallo_u(zq(:,:,iq),llm,2,2,2,2,MyRequest1) |
---|
| 250 | call Register_Hallo_u(zm(:,:,iq),llm,1,1,1,1,MyRequest1) |
---|
[4368] | 251 | do ifils=1,tracers(iq)%nqDescen |
---|
| 252 | iq2=tracers(iq)%iqDescen(ifils) |
---|
[2270] | 253 | call Register_Hallo_u(zq(:,:,iq2),llm,2,2,2,2,MyRequest1) |
---|
| 254 | call Register_Hallo_u(zm(:,:,iq2),llm,1,1,1,1,MyRequest1) |
---|
| 255 | enddo |
---|
[1632] | 256 | |
---|
| 257 | c$OMP MASTER |
---|
| 258 | call VTe(VTHallo) |
---|
| 259 | c$OMP END MASTER |
---|
[4368] | 260 | CASE DEFAULT |
---|
[2597] | 261 | stop 'vlspltgen_p : schema non parallelise' |
---|
[1632] | 262 | |
---|
[4368] | 263 | END SELECT |
---|
[1632] | 264 | |
---|
[4368] | 265 | enddo !DO iq=1,nqtot |
---|
[1632] | 266 | |
---|
| 267 | |
---|
| 268 | c$OMP BARRIER |
---|
| 269 | c$OMP MASTER |
---|
| 270 | call VTb(VTHallo) |
---|
| 271 | c$OMP END MASTER |
---|
| 272 | |
---|
| 273 | call SendRequest(MyRequest1) |
---|
| 274 | |
---|
| 275 | c$OMP MASTER |
---|
| 276 | call VTe(VTHallo) |
---|
| 277 | c$OMP END MASTER |
---|
| 278 | c$OMP BARRIER |
---|
| 279 | |
---|
[2270] | 280 | ! verif temporaire |
---|
| 281 | ijb=ij_begin-2*iip1 |
---|
| 282 | ije=ij_end+2*iip1 |
---|
| 283 | if (pole_nord) ijb=ij_begin |
---|
| 284 | if (pole_sud) ije=ij_end |
---|
[4368] | 285 | call check_isotopes(zq,ij_begin,ij_end,'vlspltgen_loc 280') |
---|
[2270] | 286 | |
---|
[4368] | 287 | do iq=1,nqtot |
---|
| 288 | IF(tracers(iq)%parent /= 'air') CYCLE |
---|
[2286] | 289 | !write(*,*) 'vlspltgen 279: iq=',iq |
---|
[2270] | 290 | |
---|
[4368] | 291 | SELECT CASE(tracers(iq)%iadv) |
---|
| 292 | CASE(0); CYCLE |
---|
| 293 | CASE(10) |
---|
[1632] | 294 | #ifdef _ADV_HALLO |
---|
[2270] | 295 | call vlx_loc(zq,pente_max,zm,mu, |
---|
| 296 | & ij_begin+2*iip1,ij_end-2*iip1,iq) |
---|
[1632] | 297 | #endif |
---|
[4368] | 298 | CASE(14) |
---|
[1632] | 299 | #ifdef _ADV_HALLO |
---|
[2270] | 300 | call vlxqs_loc(zq,pente_max,zm,mu, |
---|
| 301 | & qsat,ij_begin+2*iip1,ij_end-2*iip1,iq) |
---|
[1632] | 302 | #endif |
---|
[4368] | 303 | CASE DEFAULT |
---|
[2597] | 304 | stop 'vlspltgen_p : schema non parallelise' |
---|
[1632] | 305 | |
---|
[4368] | 306 | END SELECT |
---|
[1632] | 307 | |
---|
| 308 | enddo |
---|
| 309 | c$OMP BARRIER |
---|
| 310 | c$OMP MASTER |
---|
| 311 | call VTb(VTHallo) |
---|
| 312 | c$OMP END MASTER |
---|
| 313 | |
---|
| 314 | ! call WaitRecvRequest(MyRequest1) |
---|
| 315 | ! call WaitSendRequest(MyRequest1) |
---|
| 316 | c$OMP BARRIER |
---|
| 317 | call WaitRequest(MyRequest1) |
---|
| 318 | |
---|
| 319 | |
---|
| 320 | c$OMP MASTER |
---|
| 321 | call VTe(VTHallo) |
---|
| 322 | c$OMP END MASTER |
---|
| 323 | c$OMP BARRIER |
---|
| 324 | |
---|
[2270] | 325 | |
---|
[4368] | 326 | IF(isoCheck) THEN |
---|
[2270] | 327 | call check_isotopes(zq,ij_begin,ij_end,'vlspltgen_loc 326') |
---|
| 328 | ijb=ij_begin-2*iip1 |
---|
| 329 | ije=ij_end+2*iip1 |
---|
| 330 | if (pole_nord) ijb=ij_begin |
---|
| 331 | if (pole_sud) ije=ij_end |
---|
| 332 | call check_isotopes(zq,ijb,ije,'vlspltgen_loc 336') |
---|
[4368] | 333 | END IF |
---|
[1632] | 334 | |
---|
[4368] | 335 | do iq = 1, nqtot |
---|
| 336 | IF(tracers(iq)%parent /= 'air') CYCLE |
---|
[2286] | 337 | !write(*,*) 'vlspltgen 321: iq=',iq |
---|
[1632] | 338 | #ifdef DEBUG_IO |
---|
| 339 | CALL WriteField_u('zq',zq(:,:,iq)) |
---|
| 340 | CALL WriteField_u('zm',zm(:,:,iq)) |
---|
| 341 | #endif |
---|
[2270] | 342 | |
---|
[4368] | 343 | SELECT CASE(tracers(iq)%iadv) |
---|
| 344 | CASE(0); CYCLE |
---|
| 345 | CASE(10); call vly_loc(zq,pente_max,zm,mv, iq) |
---|
| 346 | CASE(14); call vlyqs_loc(zq,pente_max,zm,mv,qsat,iq) |
---|
| 347 | CASE DEFAULT |
---|
[2597] | 348 | stop 'vlspltgen_p : schema non parallelise' |
---|
[4368] | 349 | END SELECT |
---|
[1632] | 350 | |
---|
| 351 | enddo |
---|
| 352 | |
---|
[4368] | 353 | call check_isotopes(zq,ij_begin,ij_end,'vlspltgen_loc 357') |
---|
[1632] | 354 | |
---|
[4368] | 355 | do iq = 1, nqtot |
---|
| 356 | IF(tracers(iq)%parent /= 'air') CYCLE |
---|
[2286] | 357 | !write(*,*) 'vlspltgen 349: iq=',iq |
---|
[1632] | 358 | #ifdef DEBUG_IO |
---|
| 359 | CALL WriteField_u('zq',zq(:,:,iq)) |
---|
| 360 | CALL WriteField_u('zm',zm(:,:,iq)) |
---|
| 361 | #endif |
---|
[4368] | 362 | SELECT CASE(tracers(iq)%iadv) |
---|
| 363 | CASE(0); CYCLE |
---|
| 364 | CASE(10,14) |
---|
[1632] | 365 | c$OMP BARRIER |
---|
| 366 | #ifdef _ADV_HALLO |
---|
[2270] | 367 | call vlz_loc(zq,pente_max,zm,mw, |
---|
| 368 | & ij_begin,ij_begin+2*iip1-1,iq) |
---|
| 369 | call vlz_loc(zq,pente_max,zm,mw, |
---|
| 370 | & ij_end-2*iip1+1,ij_end,iq) |
---|
[1632] | 371 | #else |
---|
[2270] | 372 | call vlz_loc(zq,pente_max,zm,mw, |
---|
| 373 | & ij_begin,ij_end,iq) |
---|
[1632] | 374 | #endif |
---|
| 375 | c$OMP BARRIER |
---|
| 376 | |
---|
| 377 | c$OMP MASTER |
---|
| 378 | call VTb(VTHallo) |
---|
| 379 | c$OMP END MASTER |
---|
| 380 | |
---|
| 381 | call Register_Hallo_u(zq(:,:,iq),llm,2,2,2,2,MyRequest2) |
---|
| 382 | call Register_Hallo_u(zm(:,:,iq),llm,1,1,1,1,MyRequest2) |
---|
[2270] | 383 | ! CRisi |
---|
[4368] | 384 | do ifils=1,tracers(iq)%nqDescen |
---|
| 385 | iq2=tracers(iq)%iqDescen(ifils) |
---|
[2270] | 386 | call Register_Hallo_u(zq(:,:,iq2),llm,2,2,2,2,MyRequest2) |
---|
| 387 | call Register_Hallo_u(zm(:,:,iq2),llm,1,1,1,1,MyRequest2) |
---|
| 388 | enddo |
---|
[1632] | 389 | c$OMP MASTER |
---|
| 390 | call VTe(VTHallo) |
---|
[2597] | 391 | c$OMP END MASTER |
---|
[1632] | 392 | c$OMP BARRIER |
---|
[4368] | 393 | CASE DEFAULT |
---|
[2597] | 394 | stop 'vlspltgen_p : schema non parallelise' |
---|
[1632] | 395 | |
---|
[4368] | 396 | END SELECT |
---|
[1632] | 397 | |
---|
| 398 | enddo |
---|
| 399 | c$OMP BARRIER |
---|
| 400 | |
---|
| 401 | c$OMP MASTER |
---|
| 402 | call VTb(VTHallo) |
---|
| 403 | c$OMP END MASTER |
---|
| 404 | |
---|
| 405 | call SendRequest(MyRequest2) |
---|
| 406 | |
---|
| 407 | c$OMP MASTER |
---|
| 408 | call VTe(VTHallo) |
---|
[2597] | 409 | c$OMP END MASTER |
---|
[1632] | 410 | |
---|
[2270] | 411 | |
---|
[4368] | 412 | call check_isotopes(zq,ij_begin,ij_end,'vlspltgen_loc 429') |
---|
[2270] | 413 | |
---|
[1632] | 414 | c$OMP BARRIER |
---|
[4368] | 415 | do iq=1,nqtot |
---|
| 416 | IF(tracers(iq)%parent /= 'air') CYCLE |
---|
[2286] | 417 | !write(*,*) 'vlspltgen 409: iq=',iq |
---|
[1632] | 418 | |
---|
[4368] | 419 | SELECT CASE(tracers(iq)%iadv) |
---|
| 420 | CASE(0); CYCLE |
---|
| 421 | CASE(10,14) |
---|
[1632] | 422 | c$OMP BARRIER |
---|
| 423 | |
---|
| 424 | #ifdef _ADV_HALLO |
---|
[2270] | 425 | call vlz_loc(zq,pente_max,zm,mw, |
---|
| 426 | & ij_begin+2*iip1,ij_end-2*iip1,iq) |
---|
[1632] | 427 | #endif |
---|
| 428 | |
---|
| 429 | c$OMP BARRIER |
---|
[4368] | 430 | CASE DEFAULT |
---|
[2597] | 431 | stop 'vlspltgen_p : schema non parallelise' |
---|
[4368] | 432 | END SELECT |
---|
[1632] | 433 | |
---|
| 434 | enddo |
---|
[2286] | 435 | !write(*,*) 'vlspltgen_loc 476' |
---|
[1632] | 436 | |
---|
| 437 | c$OMP BARRIER |
---|
[2286] | 438 | !write(*,*) 'vlspltgen_loc 477' |
---|
[1632] | 439 | c$OMP MASTER |
---|
| 440 | call VTb(VTHallo) |
---|
| 441 | c$OMP END MASTER |
---|
| 442 | |
---|
| 443 | ! call WaitRecvRequest(MyRequest2) |
---|
| 444 | ! call WaitSendRequest(MyRequest2) |
---|
| 445 | c$OMP BARRIER |
---|
| 446 | CALL WaitRequest(MyRequest2) |
---|
| 447 | |
---|
| 448 | c$OMP MASTER |
---|
| 449 | call VTe(VTHallo) |
---|
| 450 | c$OMP END MASTER |
---|
| 451 | c$OMP BARRIER |
---|
| 452 | |
---|
| 453 | |
---|
[2286] | 454 | !write(*,*) 'vlspltgen_loc 494' |
---|
[4368] | 455 | call check_isotopes(zq,ij_begin,ij_end,'vlspltgen_loc 461') |
---|
[2270] | 456 | |
---|
[4368] | 457 | do iq=1,nqtot |
---|
| 458 | IF(tracers(iq)%parent /= 'air') CYCLE |
---|
[2286] | 459 | !write(*,*) 'vlspltgen 449: iq=',iq |
---|
[1632] | 460 | #ifdef DEBUG_IO |
---|
| 461 | CALL WriteField_u('zq',zq(:,:,iq)) |
---|
| 462 | CALL WriteField_u('zm',zm(:,:,iq)) |
---|
| 463 | #endif |
---|
[4368] | 464 | SELECT CASE(tracers(iq)%iadv) |
---|
| 465 | CASE(0); CYCLE |
---|
| 466 | CASE(10); call vly_loc(zq,pente_max,zm,mv, iq) |
---|
| 467 | CASE(14); call vlyqs_loc(zq,pente_max,zm,mv,qsat,iq) |
---|
| 468 | CASE DEFAULT; stop 'vlspltgen_p : schema non parallelise' |
---|
| 469 | END SELECT |
---|
[1632] | 470 | |
---|
[4368] | 471 | enddo !do iq=1,nqtot |
---|
[1632] | 472 | |
---|
[4368] | 473 | call check_isotopes(zq,ij_begin,ij_end,'vlspltgen_loc 493') |
---|
[1632] | 474 | |
---|
[4368] | 475 | do iq=1,nqtot |
---|
| 476 | IF(tracers(iq)%parent /= 'air') CYCLE |
---|
[2286] | 477 | !write(*,*) 'vlspltgen 477: iq=',iq |
---|
[1632] | 478 | #ifdef DEBUG_IO |
---|
| 479 | CALL WriteField_u('zq',zq(:,:,iq)) |
---|
| 480 | CALL WriteField_u('zm',zm(:,:,iq)) |
---|
| 481 | #endif |
---|
[4368] | 482 | SELECT CASE(tracers(iq)%iadv) |
---|
| 483 | CASE(0); CYCLE |
---|
| 484 | CASE(10); call vlx_loc(zq,pente_max,zm,mu, |
---|
[2270] | 485 | & ij_begin,ij_end,iq) |
---|
[4368] | 486 | CASE(14); call vlxqs_loc(zq,pente_max,zm,mu, |
---|
[2270] | 487 | & qsat, ij_begin,ij_end,iq) |
---|
[4368] | 488 | CASE DEFAULT; stop 'vlspltgen_p : schema non parallelise' |
---|
| 489 | END SELECT |
---|
[1632] | 490 | |
---|
[4368] | 491 | enddo !do iq=1,nqtot |
---|
[1632] | 492 | |
---|
[2286] | 493 | !write(*,*) 'vlspltgen 550: apres derniere serie de call vlx' |
---|
[4368] | 494 | call check_isotopes(zq,ij_begin,ij_end,'vlspltgen_loc 521') |
---|
[1632] | 495 | |
---|
| 496 | ijb=ij_begin |
---|
| 497 | ije=ij_end |
---|
[2286] | 498 | !write(*,*) 'vlspltgen_loc 557' |
---|
[1632] | 499 | c$OMP BARRIER |
---|
| 500 | |
---|
[2286] | 501 | !write(*,*) 'vlspltgen_loc 559' |
---|
[1632] | 502 | DO iq=1,nqtot |
---|
[2286] | 503 | !write(*,*) 'vlspltgen_loc 561, iq=',iq |
---|
[1632] | 504 | #ifdef DEBUG_IO |
---|
| 505 | CALL WriteField_u('zq',zq(:,:,iq)) |
---|
| 506 | CALL WriteField_u('zm',zm(:,:,iq)) |
---|
| 507 | #endif |
---|
| 508 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 509 | DO l=1,llm |
---|
| 510 | DO ij=ijb,ije |
---|
| 511 | c print *,'zq-->',ij,l,iq,zq(ij,l,iq) |
---|
[2597] | 512 | c print *,'q-->',ij,l,iq,q(ij,l,iq) |
---|
| 513 | q(ij,l,iq)=zq(ij,l,iq) |
---|
[1632] | 514 | ENDDO |
---|
| 515 | ENDDO |
---|
[2270] | 516 | c$OMP END DO NOWAIT |
---|
[2286] | 517 | !write(*,*) 'vlspltgen_loc 575' |
---|
[1632] | 518 | |
---|
| 519 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 520 | DO l=1,llm |
---|
| 521 | DO ij=ijb,ije-iip1+1,iip1 |
---|
| 522 | q(ij+iim,l,iq)=q(ij,l,iq) |
---|
| 523 | ENDDO |
---|
| 524 | ENDDO |
---|
| 525 | c$OMP END DO NOWAIT |
---|
[2286] | 526 | !write(*,*) 'vlspltgen_loc 583' |
---|
[2270] | 527 | ENDDO !DO iq=1,nqtot |
---|
| 528 | |
---|
[4368] | 529 | call check_isotopes(q,ij_begin,ij_end,'vlspltgen_loc 557') |
---|
[1632] | 530 | |
---|
| 531 | c$OMP BARRIER |
---|
| 532 | |
---|
| 533 | cc$OMP MASTER |
---|
| 534 | c call WaitSendRequest(MyRequest1) |
---|
| 535 | c call WaitSendRequest(MyRequest2) |
---|
| 536 | cc$OMP END MASTER |
---|
| 537 | cc$OMP BARRIER |
---|
| 538 | |
---|
[2286] | 539 | !write(*,*) 'vlspltgen 597: sortie' |
---|
[1632] | 540 | RETURN |
---|
| 541 | END |
---|