8 c auteurs: p.le van,
f.hourdin,
f.forget,
f.codron
10 c ********************************************************************
15 '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 ....
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
23 c pk exner au milieu des couches necessaire pour calculer qsat
24 c --------------------------------------------------------------------
34 #include "dimensions.h"
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)
59 DATA qmin,qmax/0.,1.e33/
61 c--pour rapport
de melange saturant--
63 REAL rtt,retv,r2es,r3les,r3ies,r4les,r4ies,
play
64 REAL ptarg,pdelarg,foeew,zdelta
65 REAL tempe(ijb_u:ije_u)
67 LOGICAL,
SAVE :: firstcall=.true.
74 foeew( ptarg,pdelarg ) = exp(
75 * (r3les*(1.-pdelarg)+r3ies*pdelarg) * (ptarg-rtt)
76 * / (ptarg-(r4les*(1.-pdelarg)+r4ies*pdelarg)) )
86 c Allocate variables depending on dynamic variable nqtot
91 c-- calcul
de qsat en chaque point
92 c-- approximation: au milieu des couches
play(
l)=(p(
l)+p(
l+1))/2
93 c pour eviter une exponentielle.
95 call
settag(myrequest1,100)
96 call
settag(myrequest2,101)
101 if (pole_nord) ijb=ij_begin
102 if (pole_sud) ije=ij_end
104 c$omp
DO schedule(static,omp_chunk)
110 zdelta = max( 0., sign(1., rtt - tempe(
ij)) )
112 qsat(
ij,
l) = min(0.5, r2es* foeew(tempe(
ij),zdelta) /
play )
113 qsat(
ij,
l) = qsat(
ij,
l) / ( 1. - retv * qsat(
ij,
l) )
117 c print*,
'Debut vlsplt version debug sans vlyqs'
124 if (pole_nord) ijb=ijb+iip1
125 if (pole_sud) ije=ije-iip1
127 c$omp
DO schedule(static,omp_chunk)
137 if (pole_nord) ijb=ij_begin
138 if (pole_sud) ije=ij_end-iip1
140 c$omp
DO schedule(static,omp_chunk)
143 mv(
ij,
l)=pbarv(
ij,
l) * zzpbar
151 c$omp
DO schedule(static,omp_chunk)
166 c CALL
scopy(ijp1llm,masse,1,zm,1)
172 c$omp
DO schedule(static,omp_chunk)
174 zq(ijb:ije,
l,iq)=
q(ijb:ije,
l,iq)
175 zm(ijb:ije,
l,iq)=masse(ijb:ije,
l)
194 if(iadv(iq) == 0)
then
198 else if (iadv(iq)==10)
then
201 call
vlx_loc(zq(ijb_u,1,iq),pente_max,zm(ijb_u,1,iq),
mu,
202 & ij_begin,ij_begin+2*iip1-1)
203 call
vlx_loc(zq(ijb_u,1,iq),pente_max,zm(ijb_u,1,iq),
mu,
204 & ij_end-2*iip1+1,ij_end)
206 call
vlx_loc(zq(ijb_u,1,iq),pente_max,zm(ijb_u,1,iq),
mu,
219 else if (iadv(iq)==14)
then
222 call
vlxqs_loc(zq(ijb_u,1,iq),pente_max,zm(ijb_u,1,iq),
mu,
223 & qsat,ij_begin,ij_begin+2*iip1-1)
224 call
vlxqs_loc(zq(ijb_u,1,iq),pente_max,zm(ijb_u,1,iq),
mu,
225 & qsat,ij_end-2*iip1+1,ij_end)
228 call
vlxqs_loc(zq(ijb_u,1,iq),pente_max,zm(ijb_u,1,iq),
mu,
229 & qsat,ij_begin,ij_end)
244 stop
'vlspltgen_p : schema non parallelise'
264 if(iadv(iq) == 0)
then
268 else if (iadv(iq)==10)
then
271 call
vlx_loc(zq(ijb_u,1,iq),pente_max,zm(ijb_u,1,iq),
mu,
272 & ij_begin+2*iip1,ij_end-2*iip1)
274 else if (iadv(iq)==14)
then
276 call
vlxqs_loc(zq(ijb_u,1,iq),pente_max,zm(ijb_u,1,iq),
mu,
277 & qsat,ij_begin+2*iip1,ij_end-2*iip1)
281 stop
'vlspltgen_p : schema non parallelise'
308 if(iadv(iq) == 0)
then
312 else if (iadv(iq)==10)
then
314 call
vly_loc(zq(ijb_u,1,iq),pente_max,zm(ijb_u,1,iq),mv)
316 else if (iadv(iq)==14)
then
318 call
vlyqs_loc(zq(ijb_u,1,iq),pente_max,zm(ijb_u,1,iq),mv,
323 stop
'vlspltgen_p : schema non parallelise'
335 if(iadv(iq) == 0)
then
339 else if (iadv(iq)==10 .or. iadv(iq)==14 )
then
343 call
vlz_loc(zq(ijb_u,1,iq),pente_max,zm(ijb_u,1,iq),mw,
344 & ij_begin,ij_begin+2*iip1-1)
345 call
vlz_loc(zq(ijb_u,1,iq),pente_max,zm(ijb_u,1,iq),mw,
346 & ij_end-2*iip1+1,ij_end)
348 call
vlz_loc(zq(ijb_u,1,iq),pente_max,zm(ijb_u,1,iq),mw,
366 stop
'vlspltgen_p : schema non parallelise'
386 if(iadv(iq) == 0)
then
390 else if (iadv(iq)==10 .or. iadv(iq)==14 )
then
394 call
vlz_loc(zq(ijb_u,1,iq),pente_max,zm(ijb_u,1,iq),mw,
395 & ij_begin+2*iip1,ij_end-2*iip1)
401 stop
'vlspltgen_p : schema non parallelise'
428 if(iadv(iq) == 0)
then
432 else if (iadv(iq)==10)
then
434 call
vly_loc(zq(ijb_u,1,iq),pente_max,zm(ijb_u,1,iq),mv)
436 else if (iadv(iq)==14)
then
438 call
vlyqs_loc(zq(ijb_u,1,iq),pente_max,zm(ijb_u,1,iq),mv,
443 stop
'vlspltgen_p : schema non parallelise'
455 if(iadv(iq) == 0)
then
459 else if (iadv(iq)==10)
then
461 call
vlx_loc(zq(ijb_u,1,iq),pente_max,zm(ijb_u,1,iq),
mu,
464 else if (iadv(iq)==14)
then
466 call
vlxqs_loc(zq(ijb_u,1,iq),pente_max,zm(ijb_u,1,iq),
mu,
467 & qsat, ij_begin,ij_end)
471 stop
'vlspltgen_p : schema non parallelise'
488 c$omp
DO schedule(static,omp_chunk)
491 c print *,
'zq-->',
ij,
l,iq,zq(
ij,
l,iq)
498 c$omp
DO schedule(static,omp_chunk)
500 DO ij=ijb,ije-iip1+1,iip1