Changeset 337 for trunk/LMDZ.MARS/libf/phymars
- Timestamp:
- Nov 2, 2011, 5:32:28 PM (13 years ago)
- Location:
- trunk/LMDZ.MARS/libf/phymars
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/phymars/calltherm_mars.F90
r336 r337 2 2 ! $Id: calltherm.F90 1428 2010-09-13 08:43:37Z fairhead $ 3 3 ! 4 subroutine calltherm_mars( dtime,zzlev,zzlay &5 & ,pplay,p aprs,pphi &4 subroutine calltherm_mars(ptimestep,zzlev,zzlay & 5 & ,pplay,pplev,pphi & 6 6 & ,u_seri,v_seri,t_seri,pq_therm,q2_therm & 7 7 & ,d_u_ajs,d_v_ajs,d_t_ajs,d_q_ajs,dq2_therm & … … 15 15 #include "dimensions.h" 16 16 #include "dimphys.h" 17 18 REAL dtime 17 #include "comcstfi.h" 18 19 REAL ptimestep 19 20 LOGICAL logexpr0, logexpr2(ngridmx,nlayermx), logexpr1(ngridmx) 20 21 REAL fact 21 INTEGER nbptspb 22 INTEGER nbptspb,iq,l 22 23 23 24 REAL, INTENT(IN) :: zzlay(ngridmx,nlayermx) … … 27 28 REAL t_seri(ngridmx,nlayermx),pq_therm(ngridmx,nlayermx,nqmx) 28 29 REAL q2_therm(ngridmx,nlayermx) 29 REAL p aprs(ngridmx,nlayermx+1)30 REAL pplev(ngridmx,nlayermx+1) 30 31 REAL pplay(ngridmx,nlayermx) 31 32 REAL pphi(ngridmx,nlayermx) … … 41 42 real fm_therm(ngridmx,nlayermx+1) 42 43 real entr_therm(ngridmx,nlayermx),detr_therm(ngridmx,nlayermx) 44 REAL masse(ngridmx,nlayermx) 43 45 44 46 !******************************************************** … … 51 53 real lmax_real(ngridmx) 52 54 real zmax(ngridmx),zmaxth(ngridmx) 55 REAL zdz(ngridmx,nlayermx) 56 53 57 54 58 !nouvelles variables pour la convection … … 76 80 real zbuoyancyEst(ngridmx,nlayermx) 77 81 78 character (len=20) :: modname ='calltherm'82 character (len=20) :: modname 79 83 character (len=80) :: abort_message 80 84 … … 107 111 call getin("r_aspect_thermals",r_aspect_thermals) 108 112 109 !fm_therm(:,:)=0.110 !detr_therm(:,:)=0.111 !entr_therm(:,:)=0.113 fm_therm(:,:)=0. 114 detr_therm(:,:)=0. 115 entr_therm(:,:)=0. 112 116 113 117 heatFlux(:,:)=0. … … 120 124 lmax_real(:)=0. 121 125 122 zdt= dtime/REAL(nsplit_thermals)126 zdt=ptimestep/REAL(nsplit_thermals) 123 127 124 128 do isplit=1,nsplit_thermals … … 130 134 ! cas de splitting 131 135 132 !zfm_therm(:,:)=0.133 !zentr_therm(:,:)=0.134 !zdetr_therm(:,:)=0.136 zfm_therm(:,:)=0. 137 zentr_therm(:,:)=0. 138 zdetr_therm(:,:)=0. 135 139 ! 136 140 zheatFlux(:,:)=0. … … 153 157 CALL thermcell_main_mars(zdt & 154 158 ! CALL thermcell_main_mars_coupled_v2(zdt & 155 & ,pplay,p aprs,pphi,zzlev,zzlay &159 & ,pplay,pplev,pphi,zzlev,zzlay & 156 160 & ,u_seri,v_seri,t_seri,pq_therm,q2_therm & 157 161 & ,d_u_the,d_v_the,d_t_the,d_q_the,dq2_the & … … 165 169 ! transformation de la derivee en tendance 166 170 167 d_t_the(:,:)=d_t_the(:,:)* dtime*fact168 d_u_the(:,:)=d_u_the(:,:)*fact169 d_v_the(:,:)=d_v_the(:,:)*fact171 d_t_the(:,:)=d_t_the(:,:)*ptimestep*fact 172 ! d_u_the(:,:)=d_u_the(:,:)*fact 173 ! d_v_the(:,:)=d_v_the(:,:)*fact 170 174 ! dq2_the(:,:)=dq2_the(:,:)*fact 171 175 172 if (nqmx .ne. 0) then173 d_q_the(:,:,:)=d_q_the(:,:,:)*fact174 endif176 ! if (nqmx .ne. 0) then 177 ! d_q_the(:,:,:)=d_q_the(:,:,:)*fact 178 ! endif 175 179 176 180 zmaxth(:)=zmaxth(:)+zmax(:)*fact 177 181 lmax_real(:)=lmax_real(:)+float(lmax(:))*fact 178 !fm_therm(:,:)=fm_therm(:,:) &179 !& +zfm_therm(:,:)*fact180 !entr_therm(:,:)=entr_therm(:,:) &181 !& +zentr_therm(:,:)*fact182 !detr_therm(:,:)=detr_therm(:,:) &183 !& +zdetr_therm(:,:)*fact182 fm_therm(:,:)=fm_therm(:,:) & 183 & +zfm_therm(:,:)*fact 184 entr_therm(:,:)=entr_therm(:,:) & 185 & +zentr_therm(:,:)*fact 186 detr_therm(:,:)=detr_therm(:,:) & 187 & +zdetr_therm(:,:)*fact 184 188 185 189 heatFlux(:,:)=heatFlux(:,:) & … … 197 201 198 202 d_t_ajs(:,:)=d_t_ajs(:,:)+d_t_the(:,:) 199 200 201 d_q_ajs(:,:,:)=d_q_ajs(:,:,:)+d_q_the(:,:,:)203 ! d_u_ajs(:,:)=d_u_ajs(:,:)+d_u_the(:,:) 204 ! d_v_ajs(:,:)=d_v_ajs(:,:)+d_v_the(:,:) 205 ! d_q_ajs(:,:,:)=d_q_ajs(:,:,:)+d_q_the(:,:,:) 202 206 ! dq2_therm(:,:)=dq2_therm(:,:)+dq2_the(:,:) 203 207 ! incrementation des variables meteo 204 208 205 209 t_seri(:,:) = t_seri(:,:) + d_t_the(:,:) 206 u_seri(:,:) = u_seri(:,:) + d_u_the(:,:)207 v_seri(:,:) = v_seri(:,:) + d_v_the(:,:)208 pq_therm(:,:,:) = pq_therm(:,:,:) + d_q_the(:,:,:)210 ! u_seri(:,:) = u_seri(:,:) + d_u_the(:,:) 211 ! v_seri(:,:) = v_seri(:,:) + d_v_the(:,:) 212 ! pq_therm(:,:,:) = pq_therm(:,:,:) + d_q_the(:,:,:) 209 213 ! q2_therm(:,:) = q2_therm(:,:) + dq2_therm(:,:) 210 214 … … 218 222 !**************************************************************** 219 223 220 ! do i=1,ngridmx 221 ! do k=1,nlayermx 222 ! if (ztla(i,k) .lt. 1.e-10) fraca(i,k) =0. 223 ! print*,'youpi je sers a quelque chose !' 224 ! enddo 225 ! enddo 226 227 DO i=1,ngridmx 228 hfmax(i)=MAXVAL(heatFlux(i,:)+heatFlux_down(i,:)) 229 wmax(i)=MAXVAL(zw2(i,:)) 230 ENDDO 231 232 lmax(:)=nint(lmax_real(:)) 224 ! Now that we have computed total entrainment and detrainment, we can 225 ! advect u, v, and q in thermals. (theta already advected). We can do 226 ! that separatly because u,v,and q are not used in thermcell_main for 227 ! any thermals-related computation : they are purely passive. 228 229 !calcul de la masse 230 do l=1,nlayermx 231 masse(:,l)=(pplev(:,l)-pplev(:,l+1))/g 232 enddo 233 234 !calcul de l'epaisseur des couches 235 do l=1,nlayermx 236 zdz(:,l)=zzlev(:,l+1)-zzlev(:,l) 237 enddo 238 239 240 modname='momentum' 241 call thermcell_dqup(ngridmx,nlayermx,ptimestep & 242 & ,fm_therm,entr_therm,detr_therm, & 243 & masse,u_seri,d_u_ajs,modname,zdz) 244 245 call thermcell_dqup(ngridmx,nlayermx,ptimestep & 246 & ,fm_therm,entr_therm,detr_therm, & 247 & masse,v_seri,d_v_ajs,modname,zdz) 248 249 if (nqmx .ne. 0.) then 250 modname='tracer' 251 DO iq=1,nqmx 252 call thermcell_dqup(ngridmx,nlayermx,ptimestep & 253 & ,fm_therm,entr_therm,detr_therm, & 254 & masse,pq_therm(:,:,iq),d_q_ajs(:,:,iq),modname,zdz) 255 256 ENDDO 257 endif 258 259 DO i=1,ngridmx 260 hfmax(i)=MAXVAL(heatFlux(i,:)+heatFlux_down(i,:)) 261 wmax(i)=MAXVAL(zw2(i,:)) 262 ENDDO 263 264 lmax(:)=nint(lmax_real(:)) 233 265 234 266 return -
trunk/LMDZ.MARS/libf/phymars/thermcell_main_mars.F90
r336 r337 38 38 39 39 REAL, INTENT(OUT) :: pdtadj(ngridmx,nlayermx) 40 REAL , INTENT(OUT):: pduadj(ngridmx,nlayermx)41 REAL , INTENT(OUT):: pdvadj(ngridmx,nlayermx)42 REAL , INTENT(OUT):: pdqadj(ngridmx,nlayermx,nqmx)40 REAL :: pduadj(ngridmx,nlayermx) 41 REAL :: pdvadj(ngridmx,nlayermx) 42 REAL :: pdqadj(ngridmx,nlayermx,nqmx) 43 43 ! REAL, INTENT(OUT) :: pdq2adj(ngridmx,nlayermx) 44 44 REAL :: pdq2adj(ngridmx,nlayermx) … … 185 185 detr(:,:)=0. 186 186 fm(:,:)=0. 187 zu(:,:)=pu(:,:)188 zv(:,:)=pv(:,:)187 ! zu(:,:)=pu(:,:) 188 ! zv(:,:)=pv(:,:) 189 189 ztv(:,:)=pt(:,:)/zpopsk(:,:) 190 190 … … 1308 1308 ! gamma(ig,k)=gamma0(ig,k) 1309 1309 ! On choisit une relaxation quadratique. 1310 1310 gamma(ig,k)=gamma0(ig,k)*sqrt(dua(ig,k)**2+dva(ig,k)**2) 1311 1311 zua(ig,k)=(fm(ig,k)*zua(ig,k-1) & 1312 1312 & +(zf2*entr(ig,k)+gamma(ig,k))*zu(ig,k)) & … … 1377 1377 else 1378 1378 1379 modname='momentum'1380 call thermcell_dqupdown(ngridmx,nlayermx,ptimestep,fm,entr,detr, &1381 & masse,zu,pduadj,ztvd,fm_down,ztv,modname,lmax)1382 1383 call thermcell_dqupdown(ngridmx,nlayermx,ptimestep,fm,entr,detr, &1384 & masse,zv,pdvadj,ztvd,fm_down,ztv,modname,lmax)1379 ! modname='momentum' 1380 ! call thermcell_dqupdown(ngridmx,nlayermx,ptimestep,fm,entr,detr, & 1381 ! & masse,zu,pduadj,ztvd,fm_down,ztv,modname,lmax) 1382 ! 1383 ! call thermcell_dqupdown(ngridmx,nlayermx,ptimestep,fm,entr,detr, & 1384 ! & masse,zv,pdvadj,ztvd,fm_down,ztv,modname,lmax) 1385 1385 1386 1386 endif … … 1400 1400 !------------------------------------------------------------------ 1401 1401 1402 if (nqmx .ne. 0.) then1403 modname='tracer'1404 DO iq=1,nqmx1405 call thermcell_dqupdown(ngridmx,nlayermx,ptimestep,fm,entr,detr, &1406 & masse,pq(:,:,iq),pdqadj(:,:,iq),ztvd,fm_down,ztv,modname,lmax)1407 1408 ENDDO1409 endif1402 ! if (nqmx .ne. 0.) then 1403 ! modname='tracer' 1404 ! DO iq=1,nqmx 1405 ! call thermcell_dqupdown(ngridmx,nlayermx,ptimestep,fm,entr,detr, & 1406 ! & masse,pq(:,:,iq),pdqadj(:,:,iq),ztvd,fm_down,ztv,modname,lmax) 1407 ! 1408 ! ENDDO 1409 ! endif 1410 1410 1411 1411 !------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.