--- trunk/Sources/phylmd/CV3_routines/cv3_mixing.f 2015/06/16 15:23:29 145 +++ trunk/Sources/phylmd/CV30_routines/cv30_mixing.f 2016/04/14 15:15:56 190 @@ -1,24 +1,24 @@ -module cv3_mixing_m +module cv30_mixing_m implicit none contains - SUBROUTINE cv3_mixing(nloc, ncum, nd, na, icb, nk, inb, t, rr, rs, u, v, h, & + SUBROUTINE cv30_mixing(nloc, ncum, nd, na, icb, nk, inb, t, rr, rs, u, v, h, & lv, hp, ep, clw, m, sig, ment, qent, uent, vent, nent, sij, elij, & ments, qents) - use cv3_param_m - use cvthermo + use cv30_param_m + use cv_thermo_m - !--------------------------------------------------------------------- + ! ! a faire: ! - changer rr(il, 1) -> qnk(il) ! - vectorisation de la partie normalisation des flux (do 789) - !--------------------------------------------------------------------- + ! ! inputs: integer, intent(in):: ncum, nd, na, nloc - integer icb(nloc), inb(nloc), nk(nloc) + integer, intent(in):: icb(nloc), inb(nloc), nk(nloc) real sig(nloc, nd) real t(nloc, nd), rr(nloc, nd), rs(nloc, nd) real u(nloc, nd), v(nloc, nd) @@ -31,7 +31,6 @@ real uent(nloc, na, na), vent(nloc, na, na) real sij(nloc, na, na), elij(nloc, na, na) real ments(nloc, nd, nd), qents(nloc, nd, nd) - real sigij(nloc, nd, nd) integer nent(nloc, nd) ! local variables: @@ -45,12 +44,12 @@ real zm(nloc, na) logical lwork(nloc) - ! --- INITIALIZE VARIOUS ARRAYS USED IN THE COMPUTATIONS + ! INITIALIZE VARIOUS ARRAYS USED IN THE COMPUTATIONS do j=1, nl do i=1, ncum nent(i, j)=0 - ! in convect3, m is computed in cv3_closure + ! in convect3, m is computed in cv30_closure ! ori m(i, 1)=0.0 end do end do @@ -74,9 +73,9 @@ zm(:, :)=0. - ! --- CALCULATE ENTRAINED AIR MASS FLUX (ment), TOTAL WATER MIXING - ! --- RATIO (QENT), TOTAL CONDENSED WATER (elij), AND MIXING - ! --- FRACTION (sij) + ! CALCULATE ENTRAINED AIR MASS FLUX (ment), TOTAL WATER MIXING + ! RATIO (QENT), TOTAL CONDENSED WATER (elij), AND MIXING + ! FRACTION (sij) do i=minorig+1, nl @@ -121,10 +120,8 @@ end do end do - ! *** if no air can entrain at level i assume that updraft detrains *** - ! *** at that level and calculate detrained air flux and properties *** - - !@ do 170 i=icb(il), inb(il) + ! if no air can entrain at level i assume that updraft detrains + ! at that level and calculate detrained air flux and properties do il=1, ncum if ((i >= icb(il)).and.(i <= inb(il)).and.(nent(il, i) == 0)) then @@ -140,26 +137,11 @@ end do end do - do j=minorig, nl - do i=minorig, nl - do il=1, ncum - if ((j >= (icb(il)-1)).and.(j <= inb(il)) & - .and.(i >= icb(il)).and.(i <= inb(il)))then - sigij(il, i, j)=sij(il, i, j) - endif - end do - end do - end do - !@ enddo - - !@170 continue - - ! --- NORMALIZE ENTRAINED AIR MASS FLUXES - ! --- TO REPRESENT EQUAL PROBABILITIES OF MIXING + ! NORMALIZE ENTRAINED AIR MASS FLUXES + ! TO REPRESENT EQUAL PROBABILITIES OF MIXING - call zilch(asum, nloc*nd) - call zilch(csum, nloc*nd) - call zilch(csum, nloc*nd) + asum = 0. + csum = 0. do il=1, ncum lwork(il) = .FALSE. @@ -331,6 +313,6 @@ enddo enddo - end SUBROUTINE cv3_mixing + end SUBROUTINE cv30_mixing -end module cv3_mixing_m +end module cv30_mixing_m