Changeset 541
- Timestamp:
- Feb 23, 2012, 2:20:06 AM (13 years ago)
- Location:
- trunk/LMDZ.MARS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/README
r530 r541 1407 1407 >> Code 35% faster with a Valles Marineris mesoscale run in springtime (set imicro=25) 1408 1408 ... probably even better at cloudier seasons 1409 1410 == 23/02/12 == AS 1411 >> In improvedclouds and waterclouds, added optimizations 1412 ... moved calculations to firstcall 1413 ... moved 'if' statement so that only useful calculations are performed 1414 >> Code about 10% faster [tests carried out with mesoscale summer Tharsis run] 1415 >> Check with a GCM run that results similar -
trunk/LMDZ.MARS/libf/phymars/improvedclouds.F
r531 r541 192 192 write(*,'(i2,3x,e12.6)') nbin_cld+1,rb_cld(nbin_cld+1) 193 193 print*,'-----------------------------------' 194 195 do i=1,nbin_cld+1 196 rb_cld(i) = dlog(rb_cld(i)) !! we save that so that it is not computed 197 !! at each timestep and gridpoint 198 enddo 194 199 195 200 c Contact parameter of water ice on dust ( m=cos(theta) ) … … 265 270 266 271 Cste = ptimestep * 4. * pi * rho_ice 272 dev2 = 1. / ( sqrt(2.) * sigma_ice ) 267 273 268 274 call watersat(ngridmx*nlayermx,zt,pplay,zqsat) … … 286 292 Mo = zq(ig,l,igcm_dust_mass)* tauscaling(ig) 287 293 No = zq(ig,l,igcm_dust_number)* tauscaling(ig)+ 1.e-30 288 dev2 = 1. / ( sqrt(2.) * sigma_ice )289 294 Rn = rdust(ig,l) 290 295 Rn = -dlog(Rn) 291 296 Rm = Rn - 3. * sigma_ice*sigma_ice 292 yeah = dlog(rb_cld(1)) 293 yeahn = derf( (yeah+Rn) *dev2) 294 yeahm = derf( (yeah+Rm) *dev2) 297 yeahn = derf( (rb_cld(1)+Rn) *dev2) 298 yeahm = derf( (rb_cld(1)+Rm) *dev2) 295 299 do i = 1, nbin_cld 296 300 n_aer(i) = -0.5 * No * yeahn !! this ith previously computed 297 301 m_aer(i) = -0.5 * Mo * yeahm !! this ith previously computed 298 yeah = dlog(rb_cld(i+1)) !! this (i+1)th now computed 299 yeahn = derf( (yeah+Rn) *dev2) 300 yeahm = derf( (yeah+Rm) *dev2) 302 yeahn = derf( (rb_cld(i+1)+Rn) *dev2) 303 yeahm = derf( (rb_cld(i+1)+Rm) *dev2) 301 304 n_aer(i) = n_aer(i) + 0.5 * No * yeahn 302 305 m_aer(i) = m_aer(i) + 0.5 * Mo * yeahm … … 363 366 & / Mo * rho_dust 364 367 rhocloud(ig,l) = min(max(rhocloud(ig,l),rho_ice),rho_dust) 365 rice(ig,l) = 366 & CBRT( real(Mo)/real(No) * 0.75 / pi / rhocloud(ig,l) ) !**(1./3.) 368 if ((Mo.lt.1.e-20) .or. (No.le.1)) then 369 rice(ig,l) = 1.e-8 370 else 371 rice(ig,l) = 372 & CBRT( real(Mo)/real(No) * 0.75 / pi / rhocloud(ig,l) ) !**(1./3.) 373 endif 367 374 c nuice(ig,l)=nuice_ref ! used for rad. transfer calculations 368 if ((Mo.lt.1.e-20) .or. (No.le.1)) rice(ig,l) = 1.e-8369 375 seq = exp( 2.*sig(zt(ig,l))*mh2o / 370 376 & (rho_ice*rgp*zt(ig,l)*rice(ig,l)) ) … … 483 489 484 490 rice_out(ig,l)=rice(ig,l) 485 rice(ig,l) = 486 & CBRT( real(Mo)/real(No) * 0.75 / pi / rhocloud(ig,l) ) !**(1./3.) 487 if ((Mo.lt.1.e-20) .or. (No.le.1)) rice(ig,l) = 1.e-8 491 if ((Mo.lt.1.e-20) .or. (No.le.1)) then 492 rice(ig,l) = 1.e-8 493 else 494 rice(ig,l) = 495 & CBRT( real(Mo)/real(No) * 0.75 / pi / rhocloud(ig,l) ) !**(1./3.) 496 endif 488 497 rice_out(ig,l)=rice(ig,l)-rice_out(ig,l) 489 498 -
trunk/LMDZ.MARS/libf/phymars/watercloud.F
r522 r541 402 402 & *tauscaling(ig)/ Mo * rho_dust 403 403 rhocloud(ig,l) = min(max(rhocloud(ig,l),rho_ice),rho_dust) 404 rice(ig,l)=(Mo / No * 0.75 / pi / rhocloud(ig,l))**(1./3.) 405 if ((Mo.lt.1.e-15) .or. (No.le.50)) rice(ig,l) = 1.e-8 404 if ((Mo.lt.1.e-15) .or. (No.le.50)) then 405 rice(ig,l) = 1.e-8 406 else 407 !! AS: only perform computations if conditions not met 408 rice(ig,l)=(Mo / No * 0.75 / pi / rhocloud(ig,l))**(1./3.) 409 endif 406 410 ENDDO 407 411 ENDDO … … 414 418 rice(ig,l)=max( CBRT ( ((pq(ig,l,igcm_h2o_ice) 415 419 & + pdqcloud(ig,l,igcm_h2o_ice)*ptimestep)/rho_ice 416 & +ccntyp*(4./3.)*pi*rdust(ig,l)* *3.)420 & +ccntyp*(4./3.)*pi*rdust(ig,l)*rdust(ig,l)*rdust(ig,l)) 417 421 & /(ccntyp*4./3.*pi) ), rdust(ig,l)) 418 422 ENDDO
Note: See TracChangeset
for help on using the changeset viewer.