/[lmdze]/trunk/phylmd/CV3_routines/cv3_trigger.f
ViewVC logotype

Contents of /trunk/phylmd/CV3_routines/cv3_trigger.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 103 - (show annotations)
Fri Aug 29 13:00:05 2014 UTC (9 years, 8 months ago) by guez
File size: 2598 byte(s)
Renamed module cvparam to cv_param. Deleted procedure
cv_param. Changed variables of module cv_param into parameters.

In procedures cv_driver, cv_uncompress and cv3_uncompress, removed
some arguments giving dimensions and used module variables klon and
klev instead.

In procedures gradiv2, laplacien_gam and laplacien, changed
declarations of local variables because klevel is not always klev.

Removed code for nudging surface pressure.

Removed arguments pim and pjm of tau2alpha. Added assignment of false
to variable first.

Replaced real argument del of procedures foeew and FOEDE by logical
argument.

1
2 SUBROUTINE cv3_trigger(len,nd,icb,plcl,p,th,tv,tvp &
3 ,pbase,buoybase,iflag,sig,w0)
4 use cv3_param_m
5 implicit none
6
7 !-------------------------------------------------------------------
8 ! --- TRIGGERING
9 !
10 ! - computes the cloud base
11 ! - triggering (crude in this version)
12 ! - relaxation of sig and w0 when no convection
13 !
14 ! Caution1: if no convection, we set iflag=4
15 ! (it used to be 0 in convect3)
16 !
17 ! Caution2: at this stage, tvp (and thus buoy) are know up
18 ! through icb only!
19 ! -> the buoyancy below cloud base not (yet) set to the cloud base buoyancy
20 !-------------------------------------------------------------------
21
22
23 ! input:
24 integer, intent(in):: len, nd
25 integer icb(len)
26 real, intent(in):: plcl(len), p(len,nd)
27 real th(len,nd), tv(len,nd), tvp(len,nd)
28
29 ! output:
30 real pbase(len), buoybase(len)
31
32 ! input AND output:
33 integer iflag(len)
34 real, intent(inout):: sig(len,nd), w0(len,nd)
35
36 ! local variables:
37 integer i,k
38 real tvpbase, tvbase, tdif, ath, ath1
39
40 !
41 ! *** set cloud base buoyancy at (plcl+dpbase) level buoyancy
42 !
43 do 100 i=1,len
44 pbase(i) = plcl(i) + dpbase
45 tvpbase = tvp(i,icb(i))*(pbase(i)-p(i,icb(i)+1)) &
46 /(p(i,icb(i))-p(i,icb(i)+1)) &
47 + tvp(i,icb(i)+1)*(p(i,icb(i))-pbase(i)) &
48 /(p(i,icb(i))-p(i,icb(i)+1))
49 tvbase = tv(i,icb(i))*(pbase(i)-p(i,icb(i)+1)) &
50 /(p(i,icb(i))-p(i,icb(i)+1)) &
51 + tv(i,icb(i)+1)*(p(i,icb(i))-pbase(i)) &
52 /(p(i,icb(i))-p(i,icb(i)+1))
53 buoybase(i) = tvpbase - tvbase
54 100 continue
55
56 !
57 ! *** make sure that column is dry adiabatic between the surface ***
58 ! *** and cloud base, and that lifted air is positively buoyant ***
59 ! *** at cloud base ***
60 ! *** if not, return to calling program after resetting ***
61 ! *** sig(i) and w0(i) ***
62 !
63
64 do 60 k=1,nl
65 do 200 i=1,len
66
67 tdif = buoybase(i)
68 ath1 = th(i,1)
69 ath = th(i,icb(i)-1) - dttrig
70
71 if (tdif.lt.dtcrit .or. ath.gt.ath1) then
72 sig(i,k) = beta*sig(i,k) - 2.*alpha*tdif*tdif
73 sig(i,k) = AMAX1(sig(i,k),0.0)
74 w0(i,k) = beta*w0(i,k)
75 iflag(i)=4 ! pour version vectorisee
76 ! convect3 iflag(i)=0
77 endif
78
79 200 continue
80 60 continue
81
82 ! fin oct3 --
83
84 return
85 end

  ViewVC Help
Powered by ViewVC 1.1.21