/[lmdze]/trunk/Sources/phylmd/CV30_routines/cv30_trigger.f
ViewVC logotype

Diff of /trunk/Sources/phylmd/CV30_routines/cv30_trigger.f

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 189 by guez, Tue Mar 29 15:20:23 2016 UTC revision 195 by guez, Wed May 18 17:56:44 2016 UTC
# Line 4  module cv30_trigger_m Line 4  module cv30_trigger_m
4    
5  contains  contains
6    
7    SUBROUTINE cv30_trigger(len, nd, icb, plcl, p, th, tv, tvp, pbase, buoybase, &    SUBROUTINE cv30_trigger(icb1, plcl1, p1, th1, tv1, tvp1, pbase1, buoybase1, &
8         iflag, sig, w0)         iflag1, sig1, w01)
   
     ! TRIGGERING  
9    
10        ! Triggering:
11      ! - computes the cloud base      ! - computes the cloud base
12      ! - triggering (crude in this version)      ! - triggering (crude in this version)
13      ! - relaxation of sig and w0 when no convection      ! - relaxation of sig1 and w01 when no convection
14    
15      ! Caution 1: if no convection, we set iflag=4      ! Caution 1: if no convection, we set iflag1 = 4
     ! (it used to be 0 in convect3)  
16    
17      ! Caution 2: at this stage, tvp (and thus buoy) are known up      ! Caution 2: at this stage, tvp1 (and thus buoy) are known up
18      ! through icb only!      ! through icb1 only!  -> the buoyancy below cloud base not (yet)
19      ! -> the buoyancy below cloud base not (yet) set to the cloud base buoyancy      ! set to the cloud base buoyancy
20    
21      use cv30_param_m, only: alpha, beta, dpbase, dtcrit, dttrig, nl      use cv30_param_m, only: alpha, beta, dtcrit, nl
22        USE dimphy, ONLY: klev, klon
23    
24      ! input:      integer, intent(in):: icb1(klon)
25      integer, intent(in):: len, nd      real, intent(in):: plcl1(klon), p1(klon, klev)
26      integer icb(len)      real, intent(in):: th1(klon, klev), tv1(klon, klev), tvp1(klon, klev)
     real, intent(in):: plcl(len), p(len, nd)  
     real th(len, nd), tv(len, nd), tvp(len, nd)  
27    
28      ! output:      real, intent(out):: pbase1(klon), buoybase1(klon)
     real pbase(len), buoybase(len)  
29    
30      ! input AND output:      integer, intent(inout):: iflag1(klon)
31      integer iflag(len)      real, intent(inout):: sig1(klon, klev), w01(klon, klev)
     real, intent(inout):: sig(len, nd), w0(len, nd)  
32    
33      ! local variables:      ! Local:
34        real, parameter:: dttrig = 5. ! (loose) condition for triggering
35        real, parameter:: dpbase = - 40. ! definition cloud base (400 m above LCL)
36      integer i, k      integer i, k
37      real tvpbase, tvbase, tdif, ath, ath1      real tvpbase, tvbase
38    
39      !---------------------------------------------------------------------      !---------------------------------------------------------------------
40    
41      ! set cloud base buoyancy at (plcl+dpbase) level buoyancy      ! Set cloud base buoyancy at plcl1 + dpbase level buoyancy:
42        do i = 1, klon
43      do i=1, len         pbase1(i) = plcl1(i) + dpbase
44         pbase(i) = plcl(i) + dpbase         tvpbase = tvp1(i, icb1(i)) * (pbase1(i) - p1(i, icb1(i) + 1)) &
45         tvpbase = tvp(i, icb(i))*(pbase(i)-p(i, icb(i)+1)) &              /(p1(i, icb1(i)) - p1(i, icb1(i) + 1)) &
46              /(p(i, icb(i))-p(i, icb(i)+1)) &              + tvp1(i, icb1(i) + 1) * (p1(i, icb1(i)) - pbase1(i)) &
47              + tvp(i, icb(i)+1)*(p(i, icb(i))-pbase(i)) &              /(p1(i, icb1(i)) - p1(i, icb1(i) + 1))
48              /(p(i, icb(i))-p(i, icb(i)+1))         tvbase = tv1(i, icb1(i)) * (pbase1(i) - p1(i, icb1(i) + 1)) &
49         tvbase = tv(i, icb(i))*(pbase(i)-p(i, icb(i)+1)) &              /(p1(i, icb1(i)) - p1(i, icb1(i) + 1)) &
50              /(p(i, icb(i))-p(i, icb(i)+1)) &              + tv1(i, icb1(i) + 1) * (p1(i, icb1(i)) - pbase1(i)) &
51              + tv(i, icb(i)+1)*(p(i, icb(i))-pbase(i)) &              /(p1(i, icb1(i)) - p1(i, icb1(i) + 1))
52              /(p(i, icb(i))-p(i, icb(i)+1))         buoybase1(i) = tvpbase - tvbase
        buoybase(i) = tvpbase - tvbase  
53      end do      end do
54    
55      ! Make sure that column is dry adiabatic between the surface and      ! Make sure that column is dry adiabatic between the surface and
56      ! cloud base, and that lifted air is positively buoyant at cloud      ! cloud base, and that lifted air is positively buoyant at cloud
57      ! base.  If not, return to calling program after resetting sig(i)      ! base.  If not, return to calling program after resetting sig1(i)
58      ! and w0(i).      ! and w01(i).
59        do k = 1, nl
60      do k=1, nl         do i = 1, klon
61         do i=1, len            if (buoybase1(i) < dtcrit .or. th1(i, icb1(i) - 1) - dttrig &
62            tdif = buoybase(i)                 > th1(i, 1)) then
63            ath1 = th(i, 1)               sig1(i, k) = MAX(beta * sig1(i, k) - 2. * alpha &
64            ath = th(i, icb(i)-1) - dttrig                    * buoybase1(i)**2, 0.)
65                 w01(i, k) = beta * w01(i, k)
66            if (tdif < dtcrit .or. ath > ath1) then               iflag1(i) = 4
              sig(i, k) = beta*sig(i, k) - 2.*alpha*tdif*tdif  
              sig(i, k) = AMAX1(sig(i, k), 0.0)  
              w0(i, k) = beta*w0(i, k)  
              iflag(i)=4 ! pour version vectorisee  
67            endif            endif
68         end do         end do
69      end do      end do

Legend:
Removed from v.189  
changed lines
  Added in v.195

  ViewVC Help
Powered by ViewVC 1.1.21