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