4 SUBROUTINE vlspltgen_p( q,iadv,pente_max,masse,w,pbaru,pbarv,pdt,
7 c auteurs: p.le van,
f.hourdin,
f.forget,
f.codron
9 c ********************************************************************
14 'advection " pseudo amont " .c + test sur humidite specifique: Q advecte< Qsat avalc (F. Codron, 10/99)c ********************************************************************c q,pbaru,pbarv,w sont des arguments d'entree pour le s-pg ....
16 c pente_max facteur
de limitation des pentes: 2 en general
17 c 0 pour un schema amont
18 c pbaru,pbarv,w flux
de masse en
u ,
v ,w
22 c pk exner au milieu des couches necessaire pour calculer qsat
23 c --------------------------------------------------------------------
32 #include "dimensions.h"
42 REAL masse(
ip1jmp1,llm),pente_max
54 REAL,
DIMENSION(:,:,:),
ALLOCATABLE,
SAVE :: zm
56 REAL,
SAVE :: mv(
ip1jm,llm)
58 REAL,
DIMENSION(:,:,:),
ALLOCATABLE,
SAVE :: zq
62 DATA qmin,qmax/0.,1.e33/
64 c--pour rapport
de melange saturant--
66 REAL rtt,retv,r2es,r3les,r3ies,r4les,r4ies,
play
67 REAL ptarg,pdelarg,foeew,zdelta
70 LOGICAL,
SAVE :: firstcall=.true.
77 foeew( ptarg,pdelarg ) = exp(
78 * (r3les*(1.-pdelarg)+r3ies*pdelarg) * (ptarg-rtt)
79 * / (ptarg-(r4les*(1.-pdelarg)+r4ies*pdelarg)) )
89 c Allocate variables depending on dynamic variable nqtot
99 c-- calcul
de qsat en chaque point
100 c-- approximation: au milieu des couches
play(
l)=(p(
l)+p(
l+1))/2
101 c pour eviter une exponentielle.
103 call
settag(myrequest1,100)
104 call
settag(myrequest2,101)
109 if (pole_nord) ijb=ij_begin
110 if (pole_sud) ije=ij_end
112 c$omp
DO schedule(static,omp_chunk)
118 zdelta = max( 0., sign(1., rtt - tempe(
ij)) )
120 qsat(
ij,
l) = min(0.5, r2es* foeew(tempe(
ij),zdelta) /
play )
121 qsat(
ij,
l) = qsat(
ij,
l) / ( 1. - retv * qsat(
ij,
l) )
125 c print*,
'Debut vlsplt version debug sans vlyqs'
132 if (pole_nord) ijb=ijb+iip1
133 if (pole_sud) ije=ije-iip1
135 c$omp
DO schedule(static,omp_chunk)
145 if (pole_nord) ijb=ij_begin
146 if (pole_sud) ije=ij_end-iip1
148 c$omp
DO schedule(static,omp_chunk)
151 mv(
ij,
l)=pbarv(
ij,
l) * zzpbar
159 c$omp
DO schedule(static,omp_chunk)
174 c CALL
scopy(ijp1llm,masse,1,zm,1)
180 c$omp
DO schedule(static,omp_chunk)
182 zq(ijb:ije,
l,iq)=
q(ijb:ije,
l,iq)
183 zm(ijb:ije,
l,iq)=masse(ijb:ije,
l)
192 if(iadv(iq) == 0)
then
196 else if (iadv(iq)==10)
then
199 call
vlx_p(zq(1,1,iq),pente_max,zm(1,1,iq),
mu,
200 & ij_begin,ij_begin+2*iip1-1)
201 call
vlx_p(zq(1,1,iq),pente_max,zm(1,1,iq),
mu,
202 & ij_end-2*iip1+1,ij_end)
204 call
vlx_p(zq(1,1,iq),pente_max,zm(1,1,iq),
mu,
217 else if (iadv(iq)==14)
then
220 call
vlxqs_p(zq(1,1,iq),pente_max,zm(1,1,iq),
mu,qsat,
221 & ij_begin,ij_begin+2*iip1-1)
222 call
vlxqs_p(zq(1,1,iq),pente_max,zm(1,1,iq),
mu,qsat,
223 & ij_end-2*iip1+1,ij_end)
226 call
vlxqs_p(zq(1,1,iq),pente_max,zm(1,1,iq),
mu,qsat,
242 stop
'vlspltgen_p : schema non parallelise'
262 if(iadv(iq) == 0)
then
266 else if (iadv(iq)==10)
then
269 call
vlx_p(zq(1,1,iq),pente_max,zm(1,1,iq),
mu,
270 & ij_begin+2*iip1,ij_end-2*iip1)
272 else if (iadv(iq)==14)
then
274 call
vlxqs_p(zq(1,1,iq),pente_max,zm(1,1,iq),
mu,qsat,
275 & ij_begin+2*iip1,ij_end-2*iip1)
279 stop
'vlspltgen_p : schema non parallelise'
302 if(iadv(iq) == 0)
then
306 else if (iadv(iq)==10)
then
308 call
vly_p(zq(1,1,iq),pente_max,zm(1,1,iq),mv)
310 else if (iadv(iq)==14)
then
312 call
vlyqs_p(zq(1,1,iq),pente_max,zm(1,1,iq),mv,qsat)
316 stop
'vlspltgen_p : schema non parallelise'
325 if(iadv(iq) == 0)
then
329 else if (iadv(iq)==10 .or. iadv(iq)==14 )
then
333 call
vlz_p(zq(1,1,iq),pente_max,zm(1,1,iq),mw,
334 & ij_begin,ij_begin+2*iip1-1)
335 call
vlz_p(zq(1,1,iq),pente_max,zm(1,1,iq),mw,
336 & ij_end-2*iip1+1,ij_end)
338 call
vlz_p(zq(1,1,iq),pente_max,zm(1,1,iq),mw,
356 stop
'vlspltgen_p : schema non parallelise'
376 if(iadv(iq) == 0)
then
380 else if (iadv(iq)==10 .or. iadv(iq)==14 )
then
384 call
vlz_p(zq(1,1,iq),pente_max,zm(1,1,iq),mw,
385 & ij_begin+2*iip1,ij_end-2*iip1)
391 stop
'vlspltgen_p : schema non parallelise'
415 if(iadv(iq) == 0)
then
419 else if (iadv(iq)==10)
then
421 call
vly_p(zq(1,1,iq),pente_max,zm(1,1,iq),mv)
423 else if (iadv(iq)==14)
then
425 call
vlyqs_p(zq(1,1,iq),pente_max,zm(1,1,iq),mv,qsat)
429 stop
'vlspltgen_p : schema non parallelise'
437 if(iadv(iq) == 0)
then
441 else if (iadv(iq)==10)
then
443 call
vlx_p(zq(1,1,iq),pente_max,zm(1,1,iq),
mu,
446 else if (iadv(iq)==14)
then
448 call
vlxqs_p(zq(1,1,iq),pente_max,zm(1,1,iq),
mu,qsat,
453 stop
'vlspltgen_p : schema non parallelise'
467 c$omp
DO schedule(static,omp_chunk)
470 c print *,
'zq-->',
ij,
l,iq,zq(
ij,
l,iq)
477 c$omp
DO schedule(static,omp_chunk)
479 DO ij=ijb,ije-iip1+1,iip1