Changeset 337 for trunk/LMDZ.MARS
- Timestamp:
- Nov 2, 2011, 5:32:28 PM (13 years ago)
- Location:
- trunk/LMDZ.MARS
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/README
r334 r337 1120 1120 --> Added settings which works for 35 levels in inidissip.F according to FL. Commented for the moment. 1121 1121 --> Checked compilation and run, looks fine. Note that 'jmars.20101220' is needed. 1122 1123 == 10/10/2011 == AC 1124 1125 *********** 1126 This commit aims at increasing the thermals speed, especially for large tracer number configurations. The idea behind this commit is to advect non-active conserved variables outside of the sub-timestep of the thermals. Because these variables are not used in thermals computation, we can decouple them: 1127 1128 momentum: can be decoupled because we assume a constant ratio between horizontal velocity in alimentation layer and maximum vertical velocity in the thermal 1129 s. 1130 1131 tracer: can be decoupled because we do not take condensation of any tracer into account and hence do not liberate latent heat nor form clouds in the thermal 1132 s. 1133 1134 temperature: cannot be decoupled (of course) 1135 *********** 1136 1137 D 336 libf/phymars/thermcell_dqupdown.F90 1138 ^---------------- Deleted and replaced by a simpler version. Notes about downdraft advection are still available from revision 336 of SVN in thermcell_dqu 1139 pdown. 1140 1141 A 0 libf/phymars/thermcell_dqup.F90 1142 ^---------------- New upward advection for tracers and momentum in thermals. Several changes are done compared to the old approach: 1143 - Updraft quantities are not longer computed by making hypothesis on the amount of advected air. 1144 - In general, the formalism for updraft computation is much simpler and clearer. 1145 - Tracer tendancies are no longer computed using the conservation equation. Instead, we use the divergence 1146 of an approximated turbulent flux of the concerned quantity, where downdraft are also neglected. 1147 1148 M 336 libf/phymars/thermcell_main_mars.F90 1149 ^---------------- The Main does not call anymore thermcell_dqupdown, which it was doing 2+tracer_number times per subtimestep (140 times per physical step for a 2 tracer config) 1150 1151 M 336 libf/phymars/calltherm_mars.F90 1152 ^---------------- Entrainment, detrainment and mass-fluxes are recomputed in the sub-timestep loop. Their final value after iterations is used by the new 1153 advection routine to compute tracer and momentum fluxes. 1154 1155 *********** Results 1156 1157 - Conservation of tracers has been assessed over 1 yr in 1D and found to be comparable to that obtained with the simple convective adjustment. (it actually 1158 seems to be better by a factor of 10%!) 1159 - GCM speed-up is of about 20% compared to the old thermal configuration, for a 2 tracer case. 1160 - Advection of sharp tracer profiles has been successfully observed, similar to the old method. 1161 -
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.