/[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 72 - (show annotations)
Tue Jul 23 13:00:07 2013 UTC (10 years, 10 months ago) by guez
Original Path: trunk/libf/phylmd/CV3_routines/cv3_trigger.f90
File size: 2570 byte(s)
NaN to signalling NaN in gfortran_debug.mk.

Removed unused procedures in getincom and getincom2. In procedure
conf_interface, replaced call to getincom by new namelist. Moved
procedure conf_interface into module interface_surf.

Added variables sig1 and w01 to startphy.nc and restartphy.nc, for
procedure cv_driver. Renamed (ema_)?work1 and (ema_)?work2 to sig1 and
w01 in concvl and physiq.

Deleted unused arguments of clmain, clqh and intersurf_hq, among which
(y)?sollwdown. Following LMDZ, in physiq, read sollw instead of
sollwdown from startphy.nc, write sollw instead of sollwdown to
restartphy.nc.

In procedure sw, initialized zfs[ud][pn]a[di], for runs where ok_ade
and ok_aie are false. (Following LMDZ.)

Added dimension klev to startphy.nc and restartphy.nc, and deleted
dimension horizon_vertical. Made t_ancien and q_ancien two-dimensional
NetCDF variables. Bug fix: in phyetat0, define ratqs, clwcon and
rnebcon for vertical levels >=2.

Bug fix: set mfg, p[de]n_[ud] to 0. when iflag_con >= 3. (Following LMDZ.)

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 len, nd
25 integer icb(len)
26 real 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