1 | ! |
---|
2 | ! $Id: calltherm.F90 1428 2010-09-13 08:43:37Z fairhead $ |
---|
3 | ! |
---|
4 | subroutine calltherm_mars(dtime,zzlev,zzlay & |
---|
5 | & ,pplay,paprs,pphi & |
---|
6 | & ,u_seri,v_seri,t_seri,pq_therm,q2_therm & |
---|
7 | & ,d_u_ajs,d_v_ajs,d_t_ajs,d_q_ajs,dq2_therm & |
---|
8 | & ,fm_therm,entr_therm,detr_therm,lmax,zmax,& |
---|
9 | & zw2,fraca,zpopsk,ztla,heatFlux,heatFlux_down,& |
---|
10 | & buoyancyOut,buoyancyEst,hfmax,wmax) |
---|
11 | |
---|
12 | USE ioipsl_getincom |
---|
13 | implicit none |
---|
14 | |
---|
15 | #include "dimensions.h" |
---|
16 | #include "dimphys.h" |
---|
17 | |
---|
18 | REAL dtime |
---|
19 | LOGICAL logexpr0, logexpr2(ngridmx,nlayermx), logexpr1(ngridmx) |
---|
20 | REAL fact |
---|
21 | INTEGER nbptspb |
---|
22 | |
---|
23 | REAL, INTENT(IN) :: zzlay(ngridmx,nlayermx) |
---|
24 | REAL, INTENT(IN) :: zzlev(ngridmx,nlayermx+1) |
---|
25 | |
---|
26 | REAL u_seri(ngridmx,nlayermx),v_seri(ngridmx,nlayermx) |
---|
27 | REAL t_seri(ngridmx,nlayermx),pq_therm(ngridmx,nlayermx,nqmx) |
---|
28 | REAL q2_therm(ngridmx,nlayermx) |
---|
29 | REAL paprs(ngridmx,nlayermx+1) |
---|
30 | REAL pplay(ngridmx,nlayermx) |
---|
31 | REAL pphi(ngridmx,nlayermx) |
---|
32 | real zlev(ngridmx,nlayermx+1) |
---|
33 | !test: on sort lentr et a* pour alimenter KE |
---|
34 | REAL zw2(ngridmx,nlayermx+1),fraca(ngridmx,nlayermx+1) |
---|
35 | REAL zzw2(ngridmx,nlayermx+1) |
---|
36 | |
---|
37 | !FH Update Thermiques |
---|
38 | REAL d_t_ajs(ngridmx,nlayermx), d_q_ajs(ngridmx,nlayermx,nqmx) |
---|
39 | REAL d_u_ajs(ngridmx,nlayermx),d_v_ajs(ngridmx,nlayermx) |
---|
40 | REAL dq2_therm(ngridmx,nlayermx), dq2_the(ngridmx,nlayermx) |
---|
41 | real fm_therm(ngridmx,nlayermx+1) |
---|
42 | real entr_therm(ngridmx,nlayermx),detr_therm(ngridmx,nlayermx) |
---|
43 | |
---|
44 | !******************************************************** |
---|
45 | ! declarations |
---|
46 | real zpopsk(ngridmx,nlayermx) |
---|
47 | real ztla(ngridmx,nlayermx) |
---|
48 | real wmax(ngridmx) |
---|
49 | real hfmax(ngridmx) |
---|
50 | integer lmax(ngridmx) |
---|
51 | real zmax(ngridmx) |
---|
52 | |
---|
53 | !nouvelles variables pour la convection |
---|
54 | !RC |
---|
55 | !on garde le zmax du pas de temps precedent |
---|
56 | !******************************************************** |
---|
57 | |
---|
58 | |
---|
59 | ! variables locales |
---|
60 | REAL d_t_the(ngridmx,nlayermx), d_q_the(ngridmx,nlayermx,nqmx) |
---|
61 | REAL d_u_the(ngridmx,nlayermx),d_v_the(ngridmx,nlayermx) |
---|
62 | ! |
---|
63 | integer isplit,nsplit_thermals |
---|
64 | real r_aspect_thermals |
---|
65 | |
---|
66 | real zfm_therm(ngridmx,nlayermx+1),zdt |
---|
67 | real zentr_therm(ngridmx,nlayermx),zdetr_therm(ngridmx,nlayermx) |
---|
68 | real heatFlux(ngridmx,nlayermx) |
---|
69 | real heatFlux_down(ngridmx,nlayermx) |
---|
70 | real buoyancyOut(ngridmx,nlayermx) |
---|
71 | real buoyancyEst(ngridmx,nlayermx) |
---|
72 | real zheatFlux(ngridmx,nlayermx) |
---|
73 | real zheatFlux_down(ngridmx,nlayermx) |
---|
74 | real zbuoyancyOut(ngridmx,nlayermx) |
---|
75 | real zbuoyancyEst(ngridmx,nlayermx) |
---|
76 | |
---|
77 | character (len=20) :: modname='calltherm' |
---|
78 | character (len=80) :: abort_message |
---|
79 | |
---|
80 | integer i,k |
---|
81 | logical, save :: first=.true. |
---|
82 | |
---|
83 | REAL tstart,tstop |
---|
84 | |
---|
85 | |
---|
86 | ! Modele du thermique |
---|
87 | ! =================== |
---|
88 | |
---|
89 | r_aspect_thermals=2. |
---|
90 | nsplit_thermals=40 |
---|
91 | call getin("nsplit_thermals",nsplit_thermals) |
---|
92 | |
---|
93 | fm_therm(:,:)=0. |
---|
94 | detr_therm(:,:)=0. |
---|
95 | entr_therm(:,:)=0. |
---|
96 | |
---|
97 | heatFlux(:,:)=0. |
---|
98 | heatFlux_down(:,:)=0. |
---|
99 | buoyancyOut(:,:)=0. |
---|
100 | buoyancyEst(:,:)=0. |
---|
101 | |
---|
102 | zw2(:,:)=0. |
---|
103 | |
---|
104 | zdt=dtime/REAL(nsplit_thermals) |
---|
105 | |
---|
106 | do isplit=1,nsplit_thermals |
---|
107 | |
---|
108 | ! call cpu_time(tstart) |
---|
109 | |
---|
110 | |
---|
111 | ! On reinitialise les flux de masse a zero pour le cumul en |
---|
112 | ! cas de splitting |
---|
113 | |
---|
114 | zfm_therm(:,:)=0. |
---|
115 | zentr_therm(:,:)=0. |
---|
116 | zdetr_therm(:,:)=0. |
---|
117 | |
---|
118 | zheatFlux(:,:)=0. |
---|
119 | zheatFlux_down(:,:)=0. |
---|
120 | zbuoyancyOut(:,:)=0. |
---|
121 | zbuoyancyEst(:,:)=0. |
---|
122 | |
---|
123 | zzw2(:,:)=0. |
---|
124 | |
---|
125 | d_t_the(:,:)=0. |
---|
126 | d_u_the(:,:)=0. |
---|
127 | d_v_the(:,:)=0. |
---|
128 | dq2_the(:,:)=0. |
---|
129 | if (nqmx .ne. 0) then |
---|
130 | d_q_the(:,:,:)=0. |
---|
131 | endif |
---|
132 | |
---|
133 | CALL thermcell_main_mars(zdt & |
---|
134 | & ,pplay,paprs,pphi,zzlev,zzlay & |
---|
135 | & ,u_seri,v_seri,t_seri,pq_therm,q2_therm & |
---|
136 | & ,d_u_the,d_v_the,d_t_the,d_q_the,dq2_the & |
---|
137 | & ,zfm_therm,zentr_therm,zdetr_therm,lmax,zmax & |
---|
138 | & ,r_aspect_thermals & |
---|
139 | & ,zzw2,fraca,zpopsk & |
---|
140 | & ,ztla,zheatFlux,zheatFlux_down & |
---|
141 | & ,zbuoyancyOut,zbuoyancyEst) |
---|
142 | |
---|
143 | fact=1./REAL(nsplit_thermals) |
---|
144 | ! transformation de la derivee en tendance |
---|
145 | |
---|
146 | d_t_the(:,:)=d_t_the(:,:)*dtime*fact |
---|
147 | d_u_the(:,:)=d_u_the(:,:)*fact |
---|
148 | d_v_the(:,:)=d_v_the(:,:)*fact |
---|
149 | dq2_the(:,:)=dq2_the(:,:)*fact |
---|
150 | |
---|
151 | if (nqmx .ne. 0) then |
---|
152 | d_q_the(:,:,:)=d_q_the(:,:,:)*fact |
---|
153 | endif |
---|
154 | |
---|
155 | fm_therm(:,:)=fm_therm(:,:) & |
---|
156 | & +zfm_therm(:,:)*fact |
---|
157 | entr_therm(:,:)=entr_therm(:,:) & |
---|
158 | & +zentr_therm(:,:)*fact |
---|
159 | detr_therm(:,:)=detr_therm(:,:) & |
---|
160 | & +zdetr_therm(:,:)*fact |
---|
161 | |
---|
162 | heatFlux(:,:)=heatFlux(:,:) & |
---|
163 | & +zheatFlux(:,:)*fact |
---|
164 | heatFlux_down(:,:)=heatFlux_down(:,:) & |
---|
165 | & +zheatFlux_down(:,:)*fact |
---|
166 | buoyancyOut(:,:)=buoyancyOut(:,:) & |
---|
167 | & +zbuoyancyOut(:,:)*fact |
---|
168 | buoyancyEst(:,:)=buoyancyEst(:,:) & |
---|
169 | & +zbuoyancyEst(:,:)*fact |
---|
170 | |
---|
171 | zw2(:,:)=zw2(:,:) + zzw2(:,:)*fact |
---|
172 | |
---|
173 | ! accumulation de la tendance |
---|
174 | |
---|
175 | d_t_ajs(:,:)=d_t_ajs(:,:)+d_t_the(:,:) |
---|
176 | d_u_ajs(:,:)=d_u_ajs(:,:)+d_u_the(:,:) |
---|
177 | d_v_ajs(:,:)=d_v_ajs(:,:)+d_v_the(:,:) |
---|
178 | d_q_ajs(:,:,:)=d_q_ajs(:,:,:)+d_q_the(:,:,:) |
---|
179 | dq2_therm(:,:)=dq2_therm(:,:)+dq2_the(:,:) |
---|
180 | ! incrementation des variables meteo |
---|
181 | |
---|
182 | t_seri(:,:) = t_seri(:,:) + d_t_the(:,:) |
---|
183 | u_seri(:,:) = u_seri(:,:) + d_u_the(:,:) |
---|
184 | v_seri(:,:) = v_seri(:,:) + d_v_the(:,:) |
---|
185 | pq_therm(:,:,:) = pq_therm(:,:,:) + d_q_the(:,:,:) |
---|
186 | q2_therm(:,:) = q2_therm(:,:) + dq2_therm(:,:) |
---|
187 | |
---|
188 | |
---|
189 | ! call cpu_time(tstop) |
---|
190 | ! print*,'elapsed time in thermals : ',tstop-tstart |
---|
191 | |
---|
192 | enddo ! isplit |
---|
193 | |
---|
194 | |
---|
195 | !**************************************************************** |
---|
196 | |
---|
197 | ! do i=1,ngridmx |
---|
198 | ! do k=1,nlayermx |
---|
199 | ! if (ztla(i,k) .lt. 1.e-10) fraca(i,k) =0. |
---|
200 | ! print*,'youpi je sers a quelque chose !' |
---|
201 | ! enddo |
---|
202 | ! enddo |
---|
203 | |
---|
204 | DO i=1,ngridmx |
---|
205 | hfmax(i)=MAXVAL(heatFlux(i,:)+heatFlux_down(i,:)) |
---|
206 | wmax(i)=MAXVAL(zw2(i,:)) |
---|
207 | ENDDO |
---|
208 | |
---|
209 | return |
---|
210 | |
---|
211 | end |
---|