9 &
detr,zqla,
zmax,lev_out,lunout1,igout)
25 REAL zlev(ngrid,
klev+1)
26 REAL masse(ngrid,
klev)
28 REAL rhobarz(ngrid,
klev)
35 integer ncorecfm1,ncorecfm2,ncorecfm3,ncorecalpha
36 integer ncorecfm4,ncorecfm5,ncorecfm6,ncorecfm7,ncorecfm8
47 REAL f_old,ddd0,eee0,ddd,eee,zzz
49 REAL fomass_max,alphamax
50 save fomass_max,alphamax
53 character (len=20) :: modname=
'thermcell_flux'
54 character (len=80) :: abort_message
73 write(
lunout,*)
'Dans thermcell_flux 0'
74 write(
lunout,*)
'flux base ',
f(igout)
75 write(
lunout,*)
'lmax ',lmax(igout)
76 write(
lunout,*)
'lalim ',lalim(igout)
77 write(
lunout,*)
'ig= ',igout
78 write(
lunout,*)
' l E* A* D* '
91 if (
l.le.lmax(ig))
then
92 if (entr_star(ig,
l).gt.1.)
then
93 print*,
'WARNING thermcell_flux 1 ig,l,lmax(ig)',ig,
l,lmax(ig)
94 print*,
'entr_star(ig,l)',entr_star(ig,
l)
100 print*,
'cas 1 : ig,l,lmax(ig)',ig,
l,lmax(ig)
101 print*,
'entr_star(ig,l)',entr_star(ig,
l)
121 write(
lunout,*)
'Dans thermcell_flux 1'
122 write(
lunout,*)
'flux base ',
f(igout)
123 write(
lunout,*)
'lmax ',lmax(igout)
124 write(
lunout,*)
'lalim ',lalim(igout)
125 write(
lunout,*)
'ig= ',igout
126 write(
lunout,*)
' l E D W2'
128 & ,
zw2(igout,
l+1),
l=1,lmax(igout))
134 if (
l.lt.lmax(ig))
then
135 fm(ig,
l+1)=fm(ig,
l)+entr(ig,
l)-
detr(ig,
l)
136 elseif(
l.eq.lmax(ig))
then
153 if (
detr(ig,
l).gt.fm(ig,
l))
then
154 ncorecfm8=ncorecfm8+1
162 & ptimestep,masse,entr,
detr,fm,
'2 ')
178 if (
l.lt.lmax(ig))
then
179 fm(ig,
l+1)=fm(ig,
l)+entr(ig,
l)-
detr(ig,
l)
180 elseif(
l.eq.lmax(ig))
then
195 if (fm(ig,
l+1).lt.0.)
then
197 ncorecfm1=ncorecfm1+1
205 &
write(
lunout,
'(i4,4e14.4)')
l,masse(igout,
l)/ptimestep, &
206 & entr(igout,
l),
detr(igout,
l),fm(igout,
l+1)
216 if (
l.ge.lalim(ig).and.
l.le.lmax(ig) &
217 & .and.(
zw2(ig,
l+1).gt.1.e-10).and.(
zw2(ig,
l).gt.1.e-10) )
then
219 zzz=fm(ig,
l)*rhobarz(ig,
l+1)*
zw2(ig,
l+1) &
220 & /(rhobarz(ig,
l)*
zw2(ig,
l))
221 if (fm(ig,
l+1).gt.zzz)
then
224 ncorecfm4=ncorecfm4+1
231 &
write(
lunout,
'(i4,4e14.4)')
l,masse(igout,
l)/ptimestep, &
232 & entr(igout,
l),
detr(igout,
l),fm(igout,
l+1)
235 print*,
'Test sur les fractions croissantes inhibe dans thermcell_flux2'
246 if ((fm(ig,
l+1).gt.fm(ig,
l)).and.(
l.gt.lalim(ig)))
then
250 ncorecfm5=ncorecfm5+1
256 &
write(
lunout,
'(i4,4e14.4)')
l,masse(igout,
l)/ptimestep, &
257 & entr(igout,
l),
detr(igout,
l),fm(igout,
l+1)
267 if (entr(ig,
l)<0.)
then
268 print*,
'N1 ig,l,entr',ig,
l,entr(ig,
l)
269 abort_message =
'entr negatif'
272 if (
detr(ig,
l).gt.fm(ig,
l))
then
273 ncorecfm6=ncorecfm6+1
279 if (
l.gt.lalim(ig))
then
284 ncorecfm7=ncorecfm7+1
288 if(
l.gt.lmax(ig))
then
294 if (entr(ig,
l).lt.0.)
then
295 print*,
'ig,l,lmax(ig)',ig,
l,lmax(ig)
296 print*,
'entr(ig,l)',entr(ig,
l)
297 print*,
'fm(ig,l)',fm(ig,
l)
298 abort_message =
'probleme dans thermcell flux'
307 &
write(
lunout,
'(i4,4e14.4)')
l,masse(igout,
l)/ptimestep, &
308 & entr(igout,
l),
detr(igout,
l),fm(igout,
l+1)
316 if (fm(ig,
l+1).lt.0.)
then
320 ncorecfm2=ncorecfm2+1
322 if (
detr(ig,
l).lt.0.)
then
323 print*,
'cas 2 : ig,l,lmax(ig)',ig,
l,lmax(ig)
324 print*,
'detr(ig,l)',
detr(ig,
l)
325 print*,
'fm(ig,l)',fm(ig,
l)
326 abort_message =
'probleme dans thermcell flux'
333 &
write(
lunout,
'(i4,4e14.4)')
l,masse(igout,
l)/ptimestep, &
334 & entr(igout,
l),
detr(igout,
l),fm(igout,
l+1)
357 if (
zw2(ig,
l+1).gt.1.e-10)
then
358 zfm=rhobarz(ig,
l+1)*
zw2(ig,
l+1)*alphamax
359 if ( fm(ig,
l+1) .gt. zfm)
then
368 ncorecalpha=ncorecalpha+1
377 &
write(
lunout,
'(i4,4e14.4)')
l,masse(igout,
l)/ptimestep, &
378 & entr(igout,
l),
detr(igout,
l),fm(igout,
l+1)
385 & ptimestep,masse,entr,
detr,fm,
'8 ')
398 eee=entr(ig,
l)-masse(ig,
l)*fomass_max/ptimestep
401 ncorecfm3=ncorecfm3+1
402 entr(ig,
l)=entr(ig,
l)-eee
410 if(
l.eq.lmax(ig))
then
413 if(
l.ge.lmax(ig).and.0.eq.1)
then
419 print*,
'entr',entr(ig,
l)
420 print*,
'detr',
detr(ig,
l)
421 print*,
'masse',masse(ig,
l)
422 print*,
'fomass_max',fomass_max
423 print*,
'masse(ig,l)*fomass_max/ptimestep',masse(ig,
l)*fomass_max/ptimestep
424 print*,
'ptimestep',ptimestep
425 print*,
'lmax(ig)',lmax(ig)
426 print*,
'fm(ig,l+1)',fm(ig,
l+1)
427 print*,
'fm(ig,l)',fm(ig,
l)
428 abort_message =
'probleme dans thermcell_flux'
431 entr(ig,
l+1)=entr(ig,
l+1)-ddd
433 fm(ig,
l+1)=fm(ig,
l)+entr(ig,
l)
447 detr(ig,lmax(ig))=fm(ig,lmax(ig))+entr(ig,lmax(ig))
454 if (ncorecfm1+ncorecfm2+ncorecfm3+ncorecfm4+ncorecfm5+ncorecalpha > 0 )
then
456 print*,
'PB thermcell : on a du coriger ',ncorecfm1,
'x fm1',&
457 & ncorecfm2,
'x fm2',ncorecfm3,
'x fm3 et', &
458 & ncorecfm4,
'x fm4',ncorecfm5,
'x fm5 et', &
459 & ncorecfm6,
'x fm6', &
460 & ncorecfm7,
'x fm7', &
461 & ncorecfm8,
'x fm8', &
462 & ncorecalpha,
'x alpha'
468 & ptimestep,masse,entr,
detr,fm,
'fin')
474 subroutine printflux(ngrid,klev,lunout,igout,f,lmax,lalim, &
475 & ptimestep,masse,entr,
detr,fm,descr)
483 real fm(ngrid,
klev+1),
f(ngrid)
487 character (len=20) :: modname=
'thermcell_flux'
488 character (len=80) :: abort_message
493 print*,
'Impression jusque lm=',lm
495 write(
lunout,*)
'Dans thermcell_flux '//descr
496 write(
lunout,*)
'flux base ',
f(igout)
497 write(
lunout,*)
'lmax ',lmax(igout)
498 write(
lunout,*)
'lalim ',lalim(igout)
499 write(
lunout,*)
'ig= ',igout
500 write(
lunout,
'(a3,4a14)')
'l',
'M',
'E',
'D',
'F'
501 write(
lunout,
'(i4,4e14.4)') (
l,masse(igout,
l)/ptimestep, &
502 & entr(igout,
l),
detr(igout,
l) &
503 & ,fm(igout,
l+1),
l=1,lm)
506 do l=lmax(igout)+1,
klev
507 if (abs(entr(igout,
l))+abs(
detr(igout,
l))+abs(fm(igout,
l)).gt.0.)
then
508 print*,
'cas 1 : igout,l,lmax(igout)',igout,
l,lmax(igout)
509 print*,
'entr(igout,l)',entr(igout,
l)
510 print*,
'detr(igout,l)',
detr(igout,
l)
511 print*,
'fm(igout,l)',fm(igout,
l)