Changeset 313
- Timestamp:
- Oct 10, 2011, 12:03:17 PM (13 years ago)
- Location:
- trunk/LMDZ.MARS
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/README
r311 r313 1034 1034 >> Bug correction in lect_start_archive.F ; in some cases layer(:) was not 1035 1035 initialized. 1036 1037 1038 == 10/10/2011 == AC 1039 1040 *********** 1041 This commit aims at increasing the thermals speed. Using these corrections, gcm performances in 64x48x32 using 1 tracer goes from 27.9% elapsed time in thermals to 18.76%. 1042 1043 *********** 1044 Additional work needs to be done in tracer advection to gain speed in high tracer number configuration. (tracer advection (but not momentum nor temperature) could be decoupled from sub-timestep, as they do not act on the thermals scheme (water vapor is neglected as we use theta and not theta_v, and radiative effect of dust is not computed in the thermals.)) 1045 1046 *********** 1047 => TOP 5 of routine contributions to gcm runtime : 1048 1049 Each sample counts as 0.01 seconds. 1050 % cumulative self self total 1051 time seconds seconds calls s/call s/call name 1052 18.76 6.33 6.33 960 0.01 0.01 thermcell_main_mars_ 1053 17.19 12.13 5.80 __svml_powf4.A 1054 13.72 16.76 4.63 10369 0.00 0.00 filtreg_ 1055 3.94 18.09 1.33 __intel_new_memset 1056 3.73 19.35 1.26 2880 0.00 0.00 thermcell_dqupdown_ 1057 1058 note: thermcell_main_mars_ does call quite a lot power computations (see __svml_powf4.A), but this number will not increase with tracer numbers. 1059 1060 *********** 1061 => LOG: 1062 1063 M 312 libf/phymars/thermcell_main_mars.F90 1064 ^------------------- removed (commented) computations on buoyancy which is purely diagnostic 1065 tuned internal convergence loop and added convergence criterion 1066 1067 M 312 libf/phymars/thermcell_dqupdown.F90 1068 ^------------------- removed (commented) downdraft-related if-loops (as we do not advect tracers and momentum in downdrafts for now) 1069 1070 M 312 libf/phymars/calltherm_mars.F90 1071 ^------------------- removed (commented) diagnostic-related computations 1072 changed default thermals spliting and aspect ratio 1073 corrected a bug where maximum height was not correctly computed and could result in convective adjustment used in place of thermals 1074 when using certains sets of nsplit and r_aspect (was not happening with the baseline version, so that this correction is transparent to 1075 users) 1076 ******************** 1077 -
trunk/LMDZ.MARS/libf/phymars/calltherm_mars.F90
r300 r313 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 & 8 & ,fm_therm,entr_therm,detr_therm,lmax,zmax ,&8 & ,fm_therm,entr_therm,detr_therm,lmax,zmaxth,& 9 9 & zw2,fraca,zpopsk,ztla,heatFlux,heatFlux_down,& 10 10 & buoyancyOut,buoyancyEst,hfmax,wmax) … … 49 49 real hfmax(ngridmx) 50 50 integer lmax(ngridmx) 51 real zmax(ngridmx) 51 real lmax_real(ngridmx) 52 real zmax(ngridmx),zmaxth(ngridmx) 52 53 53 54 !nouvelles variables pour la convection … … 99 100 r_aspect_thermals=0.7 100 101 #else 101 nsplit_thermals= 50102 r_aspect_thermals= 1.5102 nsplit_thermals=20 103 r_aspect_thermals=2. 103 104 #endif 104 105 105 106 call getin("nsplit_thermals",nsplit_thermals) 106 107 fm_therm(:,:)=0. 108 detr_therm(:,:)=0. 109 entr_therm(:,:)=0. 107 call getin("r_aspect_thermals",r_aspect_thermals) 108 109 ! fm_therm(:,:)=0. 110 ! detr_therm(:,:)=0. 111 ! entr_therm(:,:)=0. 110 112 111 113 heatFlux(:,:)=0. 112 114 heatFlux_down(:,:)=0. 113 buoyancyOut(:,:)=0.114 buoyancyEst(:,:)=0.115 ! buoyancyOut(:,:)=0. 116 ! buoyancyEst(:,:)=0. 115 117 116 118 zw2(:,:)=0. 119 zmaxth(:)=0. 120 lmax_real(:)=0. 117 121 118 122 zdt=dtime/REAL(nsplit_thermals) … … 126 130 ! cas de splitting 127 131 128 zfm_therm(:,:)=0.129 zentr_therm(:,:)=0.130 zdetr_therm(:,:)=0.131 132 ! zfm_therm(:,:)=0. 133 ! zentr_therm(:,:)=0. 134 ! zdetr_therm(:,:)=0. 135 ! 132 136 zheatFlux(:,:)=0. 133 137 zheatFlux_down(:,:)=0. 134 zbuoyancyOut(:,:)=0.135 zbuoyancyEst(:,:)=0.138 ! zbuoyancyOut(:,:)=0. 139 ! zbuoyancyEst(:,:)=0. 136 140 137 141 zzw2(:,:)=0. 142 zmax(:)=0. 143 lmax(:)=0. 138 144 139 145 d_t_the(:,:)=0. 140 146 d_u_the(:,:)=0. 141 147 d_v_the(:,:)=0. 142 dq2_the(:,:)=0.148 ! dq2_the(:,:)=0. 143 149 if (nqmx .ne. 0) then 144 150 d_q_the(:,:,:)=0. … … 146 152 147 153 CALL thermcell_main_mars(zdt & 154 ! CALL thermcell_main_mars_coupled_v2(zdt & 148 155 & ,pplay,paprs,pphi,zzlev,zzlay & 149 156 & ,u_seri,v_seri,t_seri,pq_therm,q2_therm & … … 161 168 d_u_the(:,:)=d_u_the(:,:)*fact 162 169 d_v_the(:,:)=d_v_the(:,:)*fact 163 dq2_the(:,:)=dq2_the(:,:)*fact170 ! dq2_the(:,:)=dq2_the(:,:)*fact 164 171 165 172 if (nqmx .ne. 0) then … … 167 174 endif 168 175 169 fm_therm(:,:)=fm_therm(:,:) & 170 & +zfm_therm(:,:)*fact 171 entr_therm(:,:)=entr_therm(:,:) & 172 & +zentr_therm(:,:)*fact 173 detr_therm(:,:)=detr_therm(:,:) & 174 & +zdetr_therm(:,:)*fact 176 zmaxth(:)=zmaxth(:)+zmax(:)*fact 177 lmax_real(:)=lmax_real(:)+float(lmax(:))*fact 178 ! fm_therm(:,:)=fm_therm(:,:) & 179 ! & +zfm_therm(:,:)*fact 180 ! entr_therm(:,:)=entr_therm(:,:) & 181 ! & +zentr_therm(:,:)*fact 182 ! detr_therm(:,:)=detr_therm(:,:) & 183 ! & +zdetr_therm(:,:)*fact 175 184 176 185 heatFlux(:,:)=heatFlux(:,:) & … … 178 187 heatFlux_down(:,:)=heatFlux_down(:,:) & 179 188 & +zheatFlux_down(:,:)*fact 180 buoyancyOut(:,:)=buoyancyOut(:,:) &181 & +zbuoyancyOut(:,:)*fact182 buoyancyEst(:,:)=buoyancyEst(:,:) &183 & +zbuoyancyEst(:,:)*fact189 ! buoyancyOut(:,:)=buoyancyOut(:,:) & 190 ! & +zbuoyancyOut(:,:)*fact 191 ! buoyancyEst(:,:)=buoyancyEst(:,:) & 192 ! & +zbuoyancyEst(:,:)*fact 184 193 185 194 zw2(:,:)=zw2(:,:) + zzw2(:,:)*fact … … 191 200 d_v_ajs(:,:)=d_v_ajs(:,:)+d_v_the(:,:) 192 201 d_q_ajs(:,:,:)=d_q_ajs(:,:,:)+d_q_the(:,:,:) 193 dq2_therm(:,:)=dq2_therm(:,:)+dq2_the(:,:)202 ! dq2_therm(:,:)=dq2_therm(:,:)+dq2_the(:,:) 194 203 ! incrementation des variables meteo 195 204 … … 198 207 v_seri(:,:) = v_seri(:,:) + d_v_the(:,:) 199 208 pq_therm(:,:,:) = pq_therm(:,:,:) + d_q_the(:,:,:) 200 q2_therm(:,:) = q2_therm(:,:) + dq2_therm(:,:)209 ! q2_therm(:,:) = q2_therm(:,:) + dq2_therm(:,:) 201 210 202 211 … … 220 229 wmax(i)=MAXVAL(zw2(i,:)) 221 230 ENDDO 222 231 232 lmax(:)=nint(lmax_real(:)) 233 223 234 return 224 235 -
trunk/LMDZ.MARS/libf/phymars/thermcell_dqupdown.F90
r278 r313 54 54 qa(:,:)=q_therm(:,:) 55 55 q(:,:)=q_therm(:,:) 56 qd(:,:)=q_therm(:,:)57 active(:,:)=.false.56 ! qd(:,:)=q_therm(:,:) 57 ! active(:,:)=.false. 58 58 59 59 ! previous calculation of zdthl_down uses the divergence of fmd … … 61 61 ! of fmd in the equations, so it has to be positive 62 62 ! 63 fmd(:,:)=-fm_down(:,:)63 ! fmd(:,:)=-fm_down(:,:) 64 64 ! 65 65 !! ========== Entrainment, Detrainement and Mass ================= … … 248 248 249 249 do ig=1,ngridmx 250 if(active(ig,1)) then251 252 dq_therm(ig,1)=(detr0(ig,1)*qa(ig,1)+detrd(ig,1)*qd(ig,1) &253 & +fm0(ig,2)*q(ig,2) &254 & -entr0(ig,1)*q(ig,1)-entrd(ig,1)*q(ig,1) &255 & -fmd(ig,2)*q(ig,1)) &256 & *ptimestep/masse0(ig,1)257 258 else250 ! if(active(ig,1)) then 251 ! 252 ! dq_therm(ig,1)=(detr0(ig,1)*qa(ig,1)+detrd(ig,1)*qd(ig,1) & 253 ! & +fm0(ig,2)*q(ig,2) & 254 ! & -entr0(ig,1)*q(ig,1)-entrd(ig,1)*q(ig,1) & 255 ! & -fmd(ig,2)*q(ig,1)) & 256 ! & *ptimestep/masse0(ig,1) 257 ! 258 ! else 259 259 dq_therm(ig,1)=(detr0(ig,1)*qa(ig,1)+fm0(ig,2)*q(ig,2) & 260 260 & -entr0(ig,1)*q(ig,1)) & 261 261 & *ptimestep/masse0(ig,1) 262 262 263 endif263 ! endif 264 264 enddo 265 265 … … 267 267 do ig=1, ngridmx 268 268 269 if(active(ig,k)) then270 271 dq_therm(ig,k)=(detr0(ig,k)*qa(ig,k)+detrd(ig,k)*qd(ig,k) &272 & +fm0(ig,k+1)*q(ig,k+1)+fmd(ig,k)*q(ig,k-1) &273 & -entr0(ig,k)*q(ig,k)-entrd(ig,k)*q(ig,k) &274 & -fm0(ig,k)*q(ig,k)-fmd(ig,k+1)*q(ig,k)) &275 276 277 278 else269 ! if(active(ig,k)) then 270 ! 271 ! dq_therm(ig,k)=(detr0(ig,k)*qa(ig,k)+detrd(ig,k)*qd(ig,k) & 272 ! & +fm0(ig,k+1)*q(ig,k+1)+fmd(ig,k)*q(ig,k-1) & 273 ! & -entr0(ig,k)*q(ig,k)-entrd(ig,k)*q(ig,k) & 274 ! & -fm0(ig,k)*q(ig,k)-fmd(ig,k+1)*q(ig,k)) & 275 ! & *ptimestep/masse0(ig,k) 276 277 278 ! else 279 279 dq_therm(ig,k)=(detr0(ig,k)*qa(ig,k)+fm0(ig,k+1)*q(ig,k+1) & 280 280 & -entr0(ig,k)*q(ig,k)-fm0(ig,k)*q(ig,k)) & … … 282 282 283 283 284 endif284 ! endif 285 285 286 286 enddo … … 289 289 do ig=1, ngridmx 290 290 291 if(active(ig,nlayermx)) then292 293 dq_therm(ig,nlayermx)=(detr0(ig,nlayermx)*qa(ig,nlayermx)+detrd(ig,nlayermx)*qd(ig,nlayermx) &294 & +fmd(ig,nlayermx)*q(ig,nlayermx-1) &295 & -entr0(ig,nlayermx)*q(ig,nlayermx)-entrd(ig,nlayermx)*q(ig,nlayermx) &296 & -fm0(ig,nlayermx)*q(ig,nlayermx)) &297 & *ptimestep/masse0(ig,nlayermx)298 299 else291 ! if(active(ig,nlayermx)) then 292 ! 293 ! dq_therm(ig,nlayermx)=(detr0(ig,nlayermx)*qa(ig,nlayermx)+detrd(ig,nlayermx)*qd(ig,nlayermx) & 294 ! & +fmd(ig,nlayermx)*q(ig,nlayermx-1) & 295 ! & -entr0(ig,nlayermx)*q(ig,nlayermx)-entrd(ig,nlayermx)*q(ig,nlayermx) & 296 ! & -fm0(ig,nlayermx)*q(ig,nlayermx)) & 297 ! & *ptimestep/masse0(ig,nlayermx) 298 299 ! else 300 300 dq_therm(ig,nlayermx)=(detr0(ig,nlayermx)*qa(ig,nlayermx) & 301 301 & -entr0(ig,nlayermx)*q(ig,nlayermx)-fm0(ig,nlayermx)*q(ig,nlayermx)) & 302 302 & *ptimestep/masse0(ig,nlayermx) 303 endif303 ! endif 304 304 305 305 enddo -
trunk/LMDZ.MARS/libf/phymars/thermcell_main_mars.F90
r300 r313 41 41 REAL, INTENT(OUT) :: pdvadj(ngridmx,nlayermx) 42 42 REAL, INTENT(OUT) :: pdqadj(ngridmx,nlayermx,nqmx) 43 REAL, INTENT(OUT) :: pdq2adj(ngridmx,nlayermx) 43 ! REAL, INTENT(OUT) :: pdq2adj(ngridmx,nlayermx) 44 REAL :: pdq2adj(ngridmx,nlayermx) 44 45 REAL, INTENT(OUT) :: zw2(ngridmx,nlayermx+1) 45 46 46 47 ! Diagnostics 47 48 REAL, INTENT(OUT) :: heatFlux(ngridmx,nlayermx) ! interface heatflux 48 49 REAL, INTENT(OUT) :: buoyancyOut(ngridmx,nlayermx) ! interlayer buoyancy term50 REAL, INTENT(OUT) :: buoyancyEst(ngridmx,nlayermx) ! interlayer estimated buoyancy term49 REAL, INTENT(OUT) :: heatFlux_down(ngridmx,nlayermx) ! interface heat flux from downdraft 50 ! REAL, INTENT(OUT) :: buoyancyOut(ngridmx,nlayermx) ! interlayer buoyancy term 51 ! REAL, INTENT(OUT) :: buoyancyEst(ngridmx,nlayermx) ! interlayer estimated buoyancy term 51 52 52 53 ! dummy variables when output not needed : … … 54 55 ! REAL :: heatFlux(ngridmx,nlayermx) ! interface heatflux 55 56 ! REAL :: heatFlux_down(ngridmx,nlayermx) ! interface heat flux from downdraft 56 !REAL :: buoyancyOut(ngridmx,nlayermx) ! interlayer buoyancy term57 !REAL :: buoyancyEst(ngridmx,nlayermx) ! interlayer estimated buoyancy term57 REAL :: buoyancyOut(ngridmx,nlayermx) ! interlayer buoyancy term 58 REAL :: buoyancyEst(ngridmx,nlayermx) ! interlayer estimated buoyancy term 58 59 59 60 … … 526 527 !--------------------------------------------------------------------------- 527 528 528 DO tic=0,3 529 529 DO tic=0,6 ! internal convergence loop 530 530 activetmp(:)=active(:) .and. f_star(:,l+1)>1.e-10 531 531 do ig=1,ngridmx … … 538 538 endif 539 539 enddo 540 541 activetmp(:)=activetmp(:).and.(abs(ztla(:,l)-ztva(:,l)).gt.0.01) 540 542 541 543 do ig=1,ngridmx … … 600 602 enddo 601 603 602 ENDDO 604 ENDDO ! of tic 605 603 606 !--------------------------------------------------------------------------- 604 607 !initialisations pour le calcul de la hauteur du thermique, de l'inversion et de la vitesse verticale max … … 1402 1405 !------------------------------------------------------------------ 1403 1406 1404 modname='tke'1405 call thermcell_dqupdown(ngridmx,nlayermx,ptimestep,fm,entr,detr, &1406 & masse,pq2,pdq2adj,ztvd,fm_down,ztv,modname,lmax)1407 ! modname='tke' 1408 ! call thermcell_dqupdown(ngridmx,nlayermx,ptimestep,fm,entr,detr, & 1409 ! & masse,pq2,pdq2adj,ztvd,fm_down,ztv,modname,lmax) 1407 1410 1408 1411 ! =========================================================================== … … 1434 1437 do ig=1,ngridmx 1435 1438 heatFlux(ig,l)=fm(ig,l)*(teta_th_int(ig,l)-teta_env_int(ig,l))/(rhobarz(ig,l)) 1436 buoyancyOut(ig,l)=g*(ztva(ig,l)-ztv(ig,l))/ztv(ig,l)1437 buoyancyEst(ig,l)=g*(ztva_est(ig,l)-ztv(ig,l))/ztv(ig,l)1439 ! buoyancyOut(ig,l)=g*(ztva(ig,l)-ztv(ig,l))/ztv(ig,l) 1440 ! buoyancyEst(ig,l)=g*(ztva_est(ig,l)-ztv(ig,l))/ztv(ig,l) 1438 1441 heatFlux_down(ig,l)=fm_down(ig,l)*(teta_down_int(ig,l)-teta_env_int(ig,l))/rhobarz(ig,l) 1439 1442 enddo
Note: See TracChangeset
for help on using the changeset viewer.