Changeset 737
- Timestamp:
- Jul 24, 2012, 6:55:41 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/phymars/aeroptproperties.F
r690 r737 37 37 38 38 c Min. and max radius of the interpolation grid (in METERS) 39 REAL, PARAMETER :: refftabmin = 1e-8 !5e-840 REAL, PARAMETER :: refftabmax = 35e-639 REAL, SAVE :: refftabmin(naerkind,2) 40 REAL, SAVE :: refftabmax(naerkind,2) 41 41 c Log of the min and max variance of the interpolation grid 42 42 REAL, PARAMETER :: nuefftabmin = -4.6 … … 87 87 88 88 c Radius axis of the interpolation grid 89 REAL,SAVE :: refftab(refftabsize )89 REAL,SAVE :: refftab(refftabsize,naerkind,2) 90 90 c Variance axis of the interpolation grid 91 REAL,SAVE :: nuefftab(nuefftabsize )91 REAL,SAVE :: nuefftab(nuefftabsize,naerkind,2) 92 92 c Volume ratio of the grid 93 REAL,SAVE :: logvratgrid ,vratgrid93 REAL,SAVE :: logvratgrid(naerkind,2) 94 94 c Grid used to remember which calculation is done 95 95 LOGICAL,SAVE :: checkgrid(refftabsize,nuefftabsize,naerkind,2) … … 186 186 CHARACTER*1 :: out_str 187 187 188 c Creating the effective radius and variance grid 189 c ----------------------------------------------- 190 IF (firstcall) THEN 191 c 0.1 Pi! 192 pi = 2. * asin(1.e0) 193 194 WRITE(*,*) "aeroptproperties: interpolation grid" 195 DO iaer = 1, naerkind ! Loop on aerosol kind 196 DO idomain = 1, 2 ! Loop on visible or infrared channel 197 198 c 0.2 Effective radius 199 radiusm= 200 & 0.5*(radiustab(iaer,idomain,nsize(iaer,idomain))+ 201 & radiustab(iaer,idomain,1)) 202 radiusr= 203 & 0.5*(radiustab(iaer,idomain,nsize(iaer,idomain))- 204 & radiustab(iaer,idomain,1)) 205 refftabmin(iaer,idomain) = 206 & radiusm-radiusr*radgaus(ngau) 207 refftabmax(iaer,idomain) = 208 & radiustab(iaer,idomain,nsize(iaer,idomain)) 209 210 WRITE(*,*) "Scatterer: ",iaer 211 WRITE(*,*) "Domain: ",idomain 212 WRITE(*,*) "Min radius (m): ", refftabmin(iaer,idomain) 213 WRITE(*,*) "Max radius (m): ", refftabmax(iaer,idomain) 214 215 refftab(1,iaer,idomain) = 216 & refftabmin(iaer,idomain) 217 refftab(refftabsize,iaer,idomain) = 218 & refftabmax(iaer,idomain) 219 220 logvratgrid(iaer,idomain) = 221 & log(refftabmax(iaer,idomain)/ 222 & refftabmin(iaer,idomain)) / 223 & float(refftabsize-1)*3. 224 do i = 2, refftabsize-1 225 refftab(i,iaer,idomain) = refftab(i-1,iaer,idomain)* 226 & exp(1./3.*logvratgrid(iaer,idomain)) 227 enddo 228 229 c 0.3 Effective variance 230 do i = 0, nuefftabsize-1 231 nuefftab(i+1,iaer,idomain) = exp( nuefftabmin + 232 & i*(nuefftabmax-nuefftabmin)/(nuefftabsize-1) ) 233 enddo 234 235 ENDDO 236 ENDDO 237 firstcall = .false. 238 ENDIF 239 188 240 DO iaer = 1, naerkind ! Loop on aerosol kind 189 241 IF ( (nsize(iaer,1).EQ.1).AND.(nsize(iaer,2).EQ.1) ) THEN … … 212 264 DO idomain = 1, 2 ! Loop on visible or infrared channel 213 265 c================================================================== 214 c 1. Creating the effective radius and variance grid 215 c -------------------------------------------------- 216 IF (firstcall) THEN 217 218 c 1.1 Pi! 219 pi = 2. * asin(1.e0) 220 221 c 1.2 Effective radius 222 refftab(1) = refftabmin 223 refftab(refftabsize) = refftabmax 224 225 logvratgrid = log(refftabmax/refftabmin) / 226 & float(refftabsize-1)*3. 227 vratgrid = exp(logvratgrid) 228 229 do i = 2, refftabsize-1 230 refftab(i) = refftab(i-1)*vratgrid**(1./3.) 231 enddo 232 233 c 1.3 Effective variance 234 do i = 0, nuefftabsize-1 235 nuefftab(i+1) = exp( nuefftabmin + 236 & i*(nuefftabmax-nuefftabmin)/(nuefftabsize-1) ) 237 enddo 238 firstcall = .false. 239 ENDIF 240 241 c 1.4 Radius middle point and range for Gauss integration 266 267 c 1.1 Radius middle point and range for Gauss integration 242 268 radiusm= 243 269 & 0.5*(radiustab(iaer,idomain,nsize(iaer,idomain)) + … … 247 273 & radiustab(iaer,idomain,1)) 248 274 249 c 1. 5Interpolating data at the Gauss quadrature points:275 c 1.2 Interpolating data at the Gauss quadrature points: 250 276 DO gausind=1,ngau 251 277 drad=radiusr*radgaus(gausind) … … 379 405 DO ig = 1,ngrid 380 406 c 2.1 Effective radius index and kx calculation 381 var_tmp=reffrad(ig,lg,iaer)/refftabmin 407 var_tmp=reffrad(ig,lg,iaer)/refftabmin(iaer,idomain) 382 408 var_tmp=log(var_tmp)*3. 383 var_tmp=var_tmp/logvratgrid +1.409 var_tmp=var_tmp/logvratgrid(iaer,idomain)+1. 384 410 grid_i=floor(var_tmp) 385 411 IF (grid_i.GE.refftabsize) THEN … … 398 424 kx = 0. 399 425 ELSE 400 kx = ( reffrad(ig,lg,iaer)-refftab(grid_i) ) / 401 & ( refftab(grid_i+1)-refftab(grid_i) ) 426 kx = ( reffrad(ig,lg,iaer)- 427 & refftab(grid_i,iaer,idomain) ) / 428 & ( refftab(grid_i+1,iaer,idomain)- 429 & refftab(grid_i,iaer,idomain) ) 402 430 ENDIF 403 431 c 2.3 Integration … … 411 439 sizedistk2 = log(1.+nueffrad(1,1,iaer)) 412 440 sizedistk1 = exp(2.5*sizedistk2) 413 sizedistk1 = refftab(j ) / sizedistk1441 sizedistk1 = refftab(j,iaer,idomain) / sizedistk1 414 442 415 443 normd(j,1,iaer,idomain) = 1e-30 … … 447 475 & ) 448 476 ENDDO 477 IF (normd(j,1,iaer,idomain).EQ.1e-30) THEN 478 WRITE(*,*)"normd:", normd(j,1,iaer,idomain) 479 WRITE(*,*)"Risk of division by 0 (aeroptproperties.F)" 480 WRITE(*,*)"Check the size of the interpolation grid." 481 CALL ABORT 482 ENDIF 449 483 IF (idomain.EQ.1) THEN ! VISIBLE DOMAIN ----------- 450 484 c 2.3.3.vis Initialization … … 754 788 ky = 0. 755 789 ELSE 756 ky = ( nueffrad(ig,lg,iaer)-nuefftab(grid_j) ) / 757 & ( nuefftab(grid_j+1)-nuefftab(grid_j) ) 790 ky = ( nueffrad(ig,lg,iaer)- 791 & nuefftab(grid_j,iaer,idomain) ) / 792 & ( nuefftab(grid_j+1,iaer,idomain)- 793 & nuefftab(grid_j,iaer,idomain) ) 758 794 ENDIF 759 795 c 3.2 Effective radius index and kx calculation 760 var_tmp=reffrad(ig,lg,iaer)/refftabmin 796 var_tmp=reffrad(ig,lg,iaer)/refftabmin(iaer,idomain) 761 797 var_tmp=log(var_tmp)*3. 762 var_tmp=var_tmp/logvratgrid +1.798 var_tmp=var_tmp/logvratgrid(iaer,idomain)+1. 763 799 grid_i=floor(var_tmp) 764 800 IF (grid_i.GE.refftabsize) THEN … … 777 813 kx = 0. 778 814 ELSE 779 kx = ( reffrad(ig,lg,iaer)-refftab(grid_i) ) / 780 & ( refftab(grid_i+1)-refftab(grid_i) ) 815 kx = ( reffrad(ig,lg,iaer)- 816 & refftab(grid_i,iaer,idomain) ) / 817 & ( refftab(grid_i+1,iaer,idomain)- 818 & refftab(grid_i,iaer,idomain) ) 781 819 ENDIF 782 820 c 3.3 Integration … … 790 828 c atmospheres", Space Science Reviews 16 527-610. 791 829 c Here, sizedistk1=r_g and sizedistk2=sigma_g^2 792 sizedistk2 = log(1.+nuefftab(k ))830 sizedistk2 = log(1.+nuefftab(k,iaer,idomain)) 793 831 sizedistk1 = exp(2.5*sizedistk2) 794 sizedistk1 = refftab(j ) / sizedistk1832 sizedistk1 = refftab(j,iaer,idomain) / sizedistk1 795 833 796 834 normd(j,k,iaer,idomain) = 1e-30 … … 829 867 & ) 830 868 ENDDO 869 IF (normd(j,k,iaer,idomain).EQ.1e-30) THEN 870 WRITE(*,*)"normd:", normd(j,k,iaer,idomain) 871 WRITE(*,*)"Risk of division by 0 (aeroptproperties.F)" 872 WRITE(*,*)"Check the size of the interpolation grid." 873 CALL ABORT 874 ENDIF 831 875 IF (idomain.EQ.1) THEN ! VISIBLE DOMAIN ----------- 832 876 c 2.3.3.vis Initialization
Note: See TracChangeset
for help on using the changeset viewer.