3 |
,ph,t,rr,rs,u,v,tra,h,lv,qnk & |
,ph,t,rr,rs,u,v,tra,h,lv,qnk & |
4 |
,hp,tv,tvp,ep,clw,m,sig & |
,hp,tv,tvp,ep,clw,m,sig & |
5 |
,ment,qent,uent,vent, nent, sij,elij,ments,qents,traent) |
,ment,qent,uent,vent, nent, sij,elij,ments,qents,traent) |
6 |
use cvparam3 |
use cv3_param_m |
7 |
use cvthermo |
use cvthermo |
8 |
implicit none |
implicit none |
9 |
|
|
15 |
|
|
16 |
|
|
17 |
! inputs: |
! inputs: |
18 |
integer ncum, nd, na, ntra, nloc |
integer, intent(in):: ncum, nd, na, ntra, nloc |
19 |
integer icb(nloc), inb(nloc), nk(nloc) |
integer icb(nloc), inb(nloc), nk(nloc) |
20 |
real sig(nloc,nd) |
real sig(nloc,nd) |
21 |
real qnk(nloc) |
real qnk(nloc) |
51 |
! --- INITIALIZE VARIOUS ARRAYS USED IN THE COMPUTATIONS |
! --- INITIALIZE VARIOUS ARRAYS USED IN THE COMPUTATIONS |
52 |
!===================================================================== |
!===================================================================== |
53 |
|
|
|
! ori do 360 i=1,ncum*nlp |
|
54 |
do 361 j=1,nl |
do 361 j=1,nl |
55 |
do 360 i=1,ncum |
do 360 i=1,ncum |
56 |
nent(i,j)=0 |
nent(i,j)=0 |
78 |
ment(1:ncum,1:nd,1:nd)=0.0 |
ment(1:ncum,1:nd,1:nd)=0.0 |
79 |
sij(1:ncum,1:nd,1:nd)=0.0 |
sij(1:ncum,1:nd,1:nd)=0.0 |
80 |
|
|
|
! do k=1,ntra |
|
|
! do j=1,nd ! instead nlp |
|
|
! do i=1,nd ! instead nlp |
|
|
! do il=1,ncum |
|
|
! traent(il,i,j,k)=tra(il,j,k) |
|
|
! enddo |
|
|
! enddo |
|
|
! enddo |
|
|
! enddo |
|
81 |
zm(:,:)=0. |
zm(:,:)=0. |
82 |
|
|
83 |
!===================================================================== |
!===================================================================== |
133 |
700 continue |
700 continue |
134 |
710 continue |
710 continue |
135 |
|
|
|
! do k=1,ntra |
|
|
! do j=minorig,nl |
|
|
! do il=1,ncum |
|
|
! if( (i.ge.icb(il)).and.(i.le.inb(il)).and. |
|
|
! : (j.ge.(icb(il)-1)).and.(j.le.inb(il)))then |
|
|
! traent(il,i,j,k)=sij(il,i,j)*tra(il,i,k) |
|
|
! : +(1.-sij(il,i,j))*tra(il,nk(il),k) |
|
|
! endif |
|
|
! enddo |
|
|
! enddo |
|
|
! enddo |
|
|
|
|
136 |
! |
! |
137 |
! *** if no air can entrain at level i assume that updraft detrains *** |
! *** if no air can entrain at level i assume that updraft detrains *** |
138 |
! *** at that level and calculate detrained air flux and properties *** |
! *** at that level and calculate detrained air flux and properties *** |
154 |
740 continue |
740 continue |
155 |
750 continue |
750 continue |
156 |
|
|
|
! do j=1,ntra |
|
|
! do i=minorig+1,nl |
|
|
! do il=1,ncum |
|
|
! if (i.ge.icb(il) .and. i.le.inb(il) .and. nent(il,i).eq.0) then |
|
|
! traent(il,i,i,j)=tra(il,nk(il),j) |
|
|
! endif |
|
|
! enddo |
|
|
! enddo |
|
|
! enddo |
|
|
|
|
157 |
do 100 j=minorig,nl |
do 100 j=minorig,nl |
158 |
do 101 i=minorig,nl |
do 101 i=minorig,nl |
159 |
do 102 il=1,ncum |
do 102 il=1,ncum |
173 |
! --- TO REPRESENT EQUAL PROBABILITIES OF MIXING |
! --- TO REPRESENT EQUAL PROBABILITIES OF MIXING |
174 |
!===================================================================== |
!===================================================================== |
175 |
|
|
|
!ym call zilch(asum,ncum*nd) |
|
|
!ym call zilch(bsum,ncum*nd) |
|
|
!ym call zilch(csum,ncum*nd) |
|
176 |
call zilch(asum,nloc*nd) |
call zilch(asum,nloc*nd) |
177 |
call zilch(csum,nloc*nd) |
call zilch(csum,nloc*nd) |
178 |
call zilch(csum,nloc*nd) |
call zilch(csum,nloc*nd) |
318 |
endif |
endif |
319 |
enddo ! il |
enddo ! il |
320 |
|
|
|
! do j=1,ntra |
|
|
! do il=1,ncum |
|
|
! if ( i.ge.icb(il) .and. i.le.inb(il) .and. lwork(il) |
|
|
! : .and. csum(il,i).lt.m(il,i) ) then |
|
|
! traent(il,i,i,j)=tra(il,nk(il),j) |
|
|
! endif |
|
|
! enddo |
|
|
! enddo |
|
321 |
789 continue |
789 continue |
322 |
! |
! |
323 |
! MAF: renormalisation de MENT |
! MAF: renormalisation de MENT |