1 | ! |
---|
2 | ! AC 2011-01-05 |
---|
3 | ! |
---|
4 | SUBROUTINE calltherm_interface (firstcall, & |
---|
5 | & long,lati,zzlev,zzlay, & |
---|
6 | & ptimestep,pu,pv,pt,pq,pdu,pdv,pdt,pdq,q2, & |
---|
7 | & pplay,pplev,pphi,zpopsk, & |
---|
8 | & pdu_th,pdv_th,pdt_th,pdq_th,lmax_th,zmax_th,pbl_dtke,hfmax,wmax) |
---|
9 | |
---|
10 | USE ioipsl_getincom |
---|
11 | |
---|
12 | implicit none |
---|
13 | #include "callkeys.h" |
---|
14 | #include "dimensions.h" |
---|
15 | #include "dimphys.h" |
---|
16 | |
---|
17 | !-------------------------------------------------------- |
---|
18 | ! Variables d'entree |
---|
19 | !-------------------------------------------------------- |
---|
20 | |
---|
21 | REAL, INTENT(IN) :: ptimestep |
---|
22 | REAL, INTENT(IN) :: pplev(ngridmx,nlayermx+1),pplay(ngridmx,nlayermx) |
---|
23 | REAL, INTENT(IN) :: pphi(ngridmx,nlayermx) |
---|
24 | REAL, INTENT(IN) :: pu(ngridmx,nlayermx),pv(ngridmx,nlayermx) |
---|
25 | REAL, INTENT(IN) :: pt(ngridmx,nlayermx),pq(ngridmx,nlayermx,nqmx) |
---|
26 | REAL, INTENT(IN) :: zzlay(ngridmx,nlayermx) |
---|
27 | REAL, INTENT(IN) :: zzlev(ngridmx,nlayermx+1) |
---|
28 | LOGICAL, INTENT(IN) :: firstcall |
---|
29 | REAL, INTENT(IN) :: pdu(ngridmx,nlayermx),pdv(ngridmx,nlayermx) |
---|
30 | REAL, INTENT(IN) :: pdq(ngridmx,nlayermx,nqmx),pdt(ngridmx,nlayermx) |
---|
31 | REAL, INTENT(IN) :: q2(ngridmx,nlayermx+1) |
---|
32 | REAL, INTENT(IN) :: long(ngridmx),lati(ngridmx) |
---|
33 | REAL, INTENT(IN) :: zpopsk(ngridmx,nlayermx) |
---|
34 | |
---|
35 | !-------------------------------------------------------- |
---|
36 | ! Variables de sortie (ou entree/sortie) |
---|
37 | !-------------------------------------------------------- |
---|
38 | |
---|
39 | REAL pdu_th(ngridmx,nlayermx),pdv_th(ngridmx,nlayermx) |
---|
40 | REAL pdt_th(ngridmx,nlayermx),pdq_th(ngridmx,nlayermx,nqmx) |
---|
41 | INTEGER lmax_th(ngridmx) |
---|
42 | REAL zmax_th(ngridmx) |
---|
43 | REAL pbl_dtke(ngridmx,nlayermx+1) |
---|
44 | |
---|
45 | !-------------------------------------------------------- |
---|
46 | ! Variables du thermique |
---|
47 | !-------------------------------------------------------- |
---|
48 | REAL u_seri(ngridmx,nlayermx), v_seri(ngridmx,nlayermx) |
---|
49 | REAL t_seri(ngridmx,nlayermx) |
---|
50 | REAL d_t_ajs(ngridmx,nlayermx) |
---|
51 | REAL d_u_ajs(ngridmx,nlayermx), d_q_ajs(ngridmx,nlayermx,nqmx) |
---|
52 | REAL d_v_ajs(ngridmx,nlayermx) |
---|
53 | REAL fm_therm(ngridmx,nlayermx+1), entr_therm(ngridmx,nlayermx) |
---|
54 | REAL detr_therm(ngridmx,nlayermx) |
---|
55 | REAL zw2(ngridmx,nlayermx+1) |
---|
56 | REAL fraca(ngridmx,nlayermx+1) |
---|
57 | REAL ztla(ngridmx,nlayermx) |
---|
58 | REAL q_therm(ngridmx,nlayermx), pq_therm(ngridmx,nlayermx,nqmx) |
---|
59 | REAL dq_therm(ngridmx,nlayermx), dq_thermdown(ngridmx,nlayermx) |
---|
60 | REAL q2_therm(ngridmx,nlayermx), dq2_therm(ngridmx,nlayermx) |
---|
61 | |
---|
62 | LOGICAL qtransport_thermals,dtke_thermals |
---|
63 | |
---|
64 | INTEGER l,ig,iq |
---|
65 | |
---|
66 | ! Variable de diagnostique : flux de chaleur vertical |
---|
67 | |
---|
68 | REAL heatFlux(ngridmx,nlayermx) |
---|
69 | REAL heatFlux_down(ngridmx,nlayermx) |
---|
70 | REAL buoyancyOut(ngridmx,nlayermx) |
---|
71 | REAL buoyancyEst(ngridmx,nlayermx) |
---|
72 | REAL hfmax(ngridmx),wmax(ngridmx) |
---|
73 | |
---|
74 | REAL tstart,tstop |
---|
75 | |
---|
76 | !--------------------------------------------------------- |
---|
77 | !--------------------------------------------------------- |
---|
78 | ! ********************************************************************** |
---|
79 | ! Thermique |
---|
80 | ! ********************************************************************** |
---|
81 | |
---|
82 | ! Initialisation des sorties |
---|
83 | |
---|
84 | lmax_th(:)=1 |
---|
85 | pdu_th(:,:)=0. |
---|
86 | pdv_th(:,:)=0. |
---|
87 | pdt_th(:,:)=0. |
---|
88 | entr_therm(:,:)=0. |
---|
89 | detr_therm(:,:)=0. |
---|
90 | q2_therm(:,:)=0. |
---|
91 | dq2_therm(:,:)=0. |
---|
92 | dq_therm(:,:)=0. |
---|
93 | dq_thermdown(:,:)=0. |
---|
94 | ztla(:,:)=0. |
---|
95 | pbl_dtke(:,:)=0. |
---|
96 | fm_therm(:,:)=0. |
---|
97 | zw2(:,:)=0. |
---|
98 | fraca(:,:)=0. |
---|
99 | if (tracer) then |
---|
100 | pdq_th(:,:,:)=0. |
---|
101 | end if |
---|
102 | |
---|
103 | ! Dans le model terrestres, les seri sont des q+dq tendances déja cumulées. Il n'y a donc pas de |
---|
104 | ! cumulage à l'intérieur de la routine comme dans le model martien. On le fait ici : |
---|
105 | |
---|
106 | u_seri(:,:)=pu(:,:)+pdu(:,:)*ptimestep |
---|
107 | v_seri(:,:)=pv(:,:)+pdv(:,:)*ptimestep |
---|
108 | t_seri(:,:)=pt(:,:)+pdt(:,:)*ptimestep |
---|
109 | |
---|
110 | pq_therm(:,:,:)=0. |
---|
111 | qtransport_thermals=.true. |
---|
112 | call getin("qtransport_thermals",qtransport_thermals) |
---|
113 | if(qtransport_thermals) then |
---|
114 | if(tracer) then |
---|
115 | pq_therm(:,:,:)=pq(:,:,:)+pdq(:,:,:)*ptimestep |
---|
116 | endif |
---|
117 | endif |
---|
118 | |
---|
119 | d_t_ajs(:,:)=0. |
---|
120 | d_u_ajs(:,:)=0. |
---|
121 | d_v_ajs(:,:)=0. |
---|
122 | d_q_ajs(:,:,:)=0. |
---|
123 | heatFlux(:,:)=0. |
---|
124 | heatFlux_down(:,:)=0. |
---|
125 | buoyancyOut(:,:)=0. |
---|
126 | buoyancyEst(:,:)=0. |
---|
127 | |
---|
128 | dtke_thermals=.false. |
---|
129 | call getin("dtke_thermals",dtke_thermals) |
---|
130 | if(dtke_thermals) then |
---|
131 | |
---|
132 | DO l=1,nlayermx |
---|
133 | q2_therm(:,l)=0.5*(q2(:,l)+q2(:,l+1)) |
---|
134 | ENDDO |
---|
135 | endif |
---|
136 | |
---|
137 | call cpu_time(tstart) |
---|
138 | |
---|
139 | CALL calltherm_mars(ptimestep,zzlev,zzlay & |
---|
140 | & ,pplay,pplev,pphi & |
---|
141 | & ,u_seri,v_seri,t_seri,pq_therm, q2_therm & |
---|
142 | & ,d_u_ajs,d_v_ajs,d_t_ajs,d_q_ajs, dq2_therm & |
---|
143 | & ,fm_therm,entr_therm,detr_therm & |
---|
144 | & ,lmax_th,zmax_th & |
---|
145 | & ,zw2,fraca & |
---|
146 | & ,zpopsk,ztla,heatFlux,heatFlux_down & |
---|
147 | & ,buoyancyOut,buoyancyEst,hfmax,wmax) |
---|
148 | call cpu_time(tstop) |
---|
149 | print*,'TOTAL elapsed time in thermals : ',tstop-tstart |
---|
150 | |
---|
151 | |
---|
152 | ! Accumulation des tendances. On n'accumule pas les quantités de traceurs car celle ci n'a pas du changer |
---|
153 | ! étant donné qu'on ne prends en compte que q_seri de la vap d'eau = 0 |
---|
154 | |
---|
155 | ! INCREMENTATION : les d_u_ sont des tendances alors que les pdu sont des dérivees, attention ! |
---|
156 | |
---|
157 | pdu_th(:,:)=d_u_ajs(:,:)/ptimestep |
---|
158 | pdv_th(:,:)=d_v_ajs(:,:)/ptimestep |
---|
159 | pdt_th(:,:)=d_t_ajs(:,:)/ptimestep |
---|
160 | if(qtransport_thermals) then |
---|
161 | if(tracer) then |
---|
162 | pdq_th(:,:,:)=d_q_ajs(:,:,:)/ptimestep |
---|
163 | endif |
---|
164 | endif |
---|
165 | |
---|
166 | |
---|
167 | DO l=2,nlayermx |
---|
168 | pbl_dtke(:,l)=0.5*(dq2_therm(:,l-1)+dq2_therm(:,l))/ptimestep |
---|
169 | ENDDO |
---|
170 | |
---|
171 | pbl_dtke(:,1)=0.5*dq2_therm(:,1)/ptimestep |
---|
172 | pbl_dtke(:,nlayermx+1)=0. |
---|
173 | !! DIAGNOSTICS |
---|
174 | |
---|
175 | if(outptherm) then |
---|
176 | if (ngridmx .eq. 1) then |
---|
177 | call WRITEDIAGFI(ngridmx,'entr_therm','entrainement thermique',& |
---|
178 | & 'kg/m-2',1,entr_therm) |
---|
179 | call WRITEDIAGFI(ngridmx,'detr_therm','detrainement thermique',& |
---|
180 | & 'kg/m-2',1,detr_therm) |
---|
181 | call WRITEDIAGFI(ngridmx,'fm_therm','flux masse thermique',& |
---|
182 | & 'kg/m-2',1,fm_therm) |
---|
183 | call WRITEDIAGFI(ngridmx,'zw2','vitesse verticale thermique',& |
---|
184 | & 'm/s',1,zw2) |
---|
185 | call WRITEDIAGFI(ngridmx,'heatFlux_up','heatFlux_updraft',& |
---|
186 | & 'SI',1,heatFlux) |
---|
187 | call WRITEDIAGFI(ngridmx,'heatFlux_down','heatFlux_downdraft',& |
---|
188 | & 'SI',1,heatFlux_down) |
---|
189 | call WRITEDIAGFI(ngridmx,'fraca','fraction coverage',& |
---|
190 | & 'percent',1,fraca) |
---|
191 | call WRITEDIAGFI(ngridmx,'buoyancyOut','buoyancyOut',& |
---|
192 | & 'm.s-2',1,buoyancyOut) |
---|
193 | call WRITEDIAGFI(ngridmx,'buoyancyEst','buoyancyEst',& |
---|
194 | & 'm.s-2',1,buoyancyEst) |
---|
195 | call WRITEDIAGFI(ngridmx,'d_t_th', & |
---|
196 | & 'tendance temp TH','K',1,d_t_ajs) |
---|
197 | call WRITEDIAGFI(ngridmx,'zmax', & |
---|
198 | & 'pbl height','m',0,zmax_th) |
---|
199 | else |
---|
200 | |
---|
201 | call WRITEDIAGFI(ngridmx,'entr_therm','entrainement thermique',& |
---|
202 | & 'kg/m-2',3,entr_therm) |
---|
203 | call WRITEDIAGFI(ngridmx,'detr_therm','detrainement thermique',& |
---|
204 | & 'kg/m-2',3,detr_therm) |
---|
205 | call WRITEDIAGFI(ngridmx,'fm_therm','flux masse thermique',& |
---|
206 | & 'kg/m-2',3,fm_therm) |
---|
207 | call WRITEDIAGFI(ngridmx,'zw2','vitesse verticale thermique',& |
---|
208 | & 'm/s',3,zw2) |
---|
209 | call WRITEDIAGFI(ngridmx,'heatFlux','heatFlux',& |
---|
210 | & 'SI',3,heatFlux) |
---|
211 | call WRITEDIAGFI(ngridmx,'buoyancyOut','buoyancyOut',& |
---|
212 | & 'SI',3,buoyancyOut) |
---|
213 | call WRITEDIAGFI(ngridmx,'d_t_th', & |
---|
214 | & 'tendance temp TH','K',3,d_t_ajs) |
---|
215 | |
---|
216 | endif |
---|
217 | endif |
---|
218 | |
---|
219 | END |
---|