Changeset 1647 for trunk/LMDZ.TITAN/libf/phytitan/aeropacity.F90
- Timestamp:
- Jan 11, 2017, 3:33:51 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.TITAN/libf/phytitan/aeropacity.F90
r1542 r1647 1 1 Subroutine aeropacity(ngrid,nlayer,nq,pplay,pplev,pq, & 2 aerosol,reffrad,QREFvis3d,QREFir3d,tau_col ,cloudfrac,totcloudfrac,clearsky)2 aerosol,reffrad,QREFvis3d,QREFir3d,tau_col) 3 3 4 4 use radinc_h, only : L_TAUMAX,naerkind 5 5 use aerosol_mod 6 USE tracer_h, only: noms ,rho_co2,rho_ice6 USE tracer_h, only: noms 7 7 use comcstfi_mod, only: g 8 use callkeys_mod, only: aerofixco2,aerofixh2o,kastprof,cloudlvl, & 9 CLFvarying,CLFfixval,dusttau, & 10 pres_bottom_tropo,pres_top_tropo,obs_tau_col_tropo, & 8 use callkeys_mod, only: pres_bottom_tropo,pres_top_tropo,obs_tau_col_tropo, & 11 9 pres_bottom_strato,pres_top_strato,obs_tau_col_strato 12 10 … … 55 53 REAL,INTENT(IN) :: QREFir3d(ngrid,nlayer,naerkind) 56 54 REAL,INTENT(OUT):: tau_col(ngrid) !column integrated visible optical depth 57 ! BENJAMIN MODIFS58 real,intent(in) :: cloudfrac(ngrid,nlayer) ! cloud fraction59 real,intent(out) :: totcloudfrac(ngrid) ! total cloud fraction60 logical,intent(in) :: clearsky61 55 62 56 real aerosol0 … … 69 63 EXTERNAL CBRT 70 64 71 INTEGER,SAVE :: i_co2ice=0 ! co2 ice72 INTEGER,SAVE :: i_h2oice=0 ! water ice73 !$OMP THREADPRIVATE(i_co2ice,i_h2oice)74 CHARACTER(LEN=20) :: tracername ! to temporarily store text75 76 65 ! for fixed dust profiles 77 real topdust, expfactor, zp 78 REAL taudusttmp(ngrid) ! Temporary dust opacity used before scaling 79 REAL tauh2so4tmp(ngrid) ! Temporary h2so4 opacity used before scaling 80 81 real CLFtot 66 real expfactor, zp 82 67 83 68 ! identify tracers … … 85 70 86 71 write(*,*) "Tracers found in aeropacity:" 87 do iq=1,nq88 tracername=noms(iq)89 if (tracername.eq."co2_ice") then90 i_co2ice=iq91 write(*,*) "i_co2ice=",i_co2ice92 93 endif94 if (tracername.eq."h2o_ice") then95 i_h2oice=iq96 write(*,*) "i_h2oice=",i_h2oice97 endif98 enddo99 72 100 73 if (noaero) then … … 107 80 endif 108 81 109 if ((iaero_co2.ne.0).and.(.not.noaero)) then110 print*, 'iaero_co2= ',iaero_co2111 endif112 if (iaero_h2o.ne.0) then113 print*,'iaero_h2o= ',iaero_h2o114 endif115 if (iaero_dust.ne.0) then116 print*,'iaero_dust= ',iaero_dust117 endif118 if (iaero_h2so4.ne.0) then119 print*,'iaero_h2so4= ',iaero_h2so4120 endif121 82 if (iaero_back2lay.ne.0) then 122 83 print*,'iaero_back2lay= ',iaero_back2lay … … 127 88 128 89 129 ! --------------------------------------------------------- 130 !================================================================== 131 ! CO2 ice aerosols 132 !================================================================== 90 ! --------------------------------------------------------- 133 91 134 if (iaero_co2.ne.0) then135 iaer=iaero_co2136 ! 1. Initialization137 aerosol(1:ngrid,1:nlayer,iaer)=0.0138 ! 2. Opacity calculation139 if (noaero) then ! aerosol set to zero140 aerosol(1:ngrid,1:nlayer,iaer)=0.0141 elseif (aerofixco2.or.(i_co2ice.eq.0)) then ! CO2 ice cloud prescribed142 aerosol(1:ngrid,1:nlayer,iaer)=1.e-9143 !aerosol(1:ngrid,12,iaer)=4.0 ! single cloud layer option144 else145 DO ig=1, ngrid146 DO l=1,nlayer-1 ! to stop the rad tran bug147 148 aerosol0 = &149 ( 0.75 * QREFvis3d(ig,l,iaer) / &150 ( rho_co2 * reffrad(ig,l,iaer) ) ) * &151 ( pq(ig,l,i_co2ice) + 1.E-9 ) * &152 ( pplev(ig,l) - pplev(ig,l+1) ) / g153 aerosol0 = max(aerosol0,1.e-9)154 aerosol0 = min(aerosol0,L_TAUMAX)155 aerosol(ig,l,iaer) = aerosol0156 ! aerosol(ig,l,iaer) = 0.0157 ! print*, aerosol(ig,l,iaer)158 ! using cloud fraction159 ! aerosol(ig,l,iaer) = -log(1 - CLF + CLF*exp(-aerosol0/CLF))160 ! aerosol(ig,l,iaer) = min(aerosol(ig,l,iaer),L_TAUMAX)161 162 163 ENDDO164 ENDDO165 end if ! if fixed or varying166 end if ! if CO2 aerosols167 !==================================================================168 ! Water ice / liquid169 !==================================================================170 171 if (iaero_h2o.ne.0) then172 iaer=iaero_h2o173 ! 1. Initialization174 aerosol(1:ngrid,1:nlayer,iaer)=0.0175 ! 2. Opacity calculation176 if (aerofixh2o.or.(i_h2oice.eq.0).or.clearsky) then177 aerosol(1:ngrid,1:nlayer,iaer) =1.e-9178 179 ! put cloud at cloudlvl180 if(kastprof.and.(cloudlvl.ne.0.0))then181 ig=1182 do l=1,nlayer183 if(int(cloudlvl).eq.l)then184 !if(cloudlvl.gt.(pplay(ig,l)/pplev(ig,1)))then185 print*,'Inserting cloud at level ',l186 !aerosol(ig,l,iaer)=10.0187 188 rho_ice=920.0189 190 ! the Kasting approximation191 aerosol(ig,l,iaer) = &192 ( 0.75 * QREFvis3d(ig,l,iaer) / &193 ( rho_ice * reffrad(ig,l,iaer) ) ) * &194 !( pq(ig,l,i_h2oice) + 1.E-9 ) * &195 ( 4.0e-4 + 1.E-9 ) * &196 ( pplev(ig,l) - pplev(ig,l+1) ) / g197 198 199 open(115,file='clouds.out',form='formatted')200 write(115,*) l,aerosol(ig,l,iaer)201 close(115)202 203 return204 endif205 end do206 207 call abort208 endif209 210 else211 212 do ig=1, ngrid213 do l=1,nlayer-1 ! to stop the rad tran bug214 215 aerosol(ig,l,iaer) = & !modification by BC216 ( 0.75 * QREFvis3d(ig,l,iaer) / &217 ( rho_ice * reffrad(ig,l,iaer) ) ) * &218 ! pq(ig,l,i_h2oice) * & !JL I dropped the +1e-9 here to have the same219 !( pplev(ig,l) - pplev(ig,l+1) ) / g ! opacity in the clearsky=true and the220 ! clear=false/pq=0 case221 ( pq(ig,l,i_h2oice) + 1.E-9 ) * & ! Doing this makes the code unstable, so I have restored it (RW)222 ( pplev(ig,l) - pplev(ig,l+1) ) / g223 224 enddo225 enddo226 227 if(CLFvarying)then228 call totalcloudfrac(ngrid,nlayer,nq,cloudfrac,totcloudfrac,pplev,pq,aerosol(1,1,iaer))229 do ig=1, ngrid230 do l=1,nlayer-1 ! to stop the rad tran bug231 CLFtot = max(totcloudfrac(ig),0.01)232 aerosol(ig,l,iaer)=aerosol(ig,l,iaer)/CLFtot233 aerosol(ig,l,iaer) = max(aerosol(ig,l,iaer),1.e-9)234 enddo235 enddo236 else237 do ig=1, ngrid238 do l=1,nlayer-1 ! to stop the rad tran bug239 CLFtot = CLFfixval240 aerosol(ig,l,iaer)=aerosol(ig,l,iaer)/CLFtot241 aerosol(ig,l,iaer) = max(aerosol(ig,l,iaer),1.e-9)242 enddo243 enddo244 end if!(CLFvarying)245 endif !(aerofixed.or.(i_h2oice.eq.0).or.clearsky)246 247 end if ! End if h2o aerosol248 249 !==================================================================250 ! Dust251 !==================================================================252 if (iaero_dust.ne.0) then253 iaer=iaero_dust254 ! 1. Initialization255 aerosol(1:ngrid,1:nlayer,iaer)=0.0256 257 topdust=30.0 ! km (used to be 10.0 km) LK258 259 ! 2. Opacity calculation260 261 ! expfactor=0.262 DO l=1,nlayer-1263 DO ig=1,ngrid264 ! Typical mixing ratio profile265 266 zp=(pplev(ig,1)/pplay(ig,l))**(70./topdust)267 expfactor=max(exp(0.007*(1.-max(zp,1.))),1.e-3)268 269 ! Vertical scaling function270 aerosol(ig,l,iaer)= (pplev(ig,l)-pplev(ig,l+1)) &271 *expfactor272 273 274 ENDDO275 ENDDO276 277 ! Rescaling each layer to reproduce the choosen (or assimilated)278 ! dust extinction opacity at visible reference wavelength, which279 ! is scaled to the surface pressure pplev(ig,1)280 281 taudusttmp(1:ngrid)=0.282 DO l=1,nlayer283 DO ig=1,ngrid284 taudusttmp(ig) = taudusttmp(ig) &285 + aerosol(ig,l,iaer)286 ENDDO287 ENDDO288 DO l=1,nlayer-1289 DO ig=1,ngrid290 aerosol(ig,l,iaer) = max(1E-20, &291 dusttau &292 * pplev(ig,1) / pplev(ig,1) &293 * aerosol(ig,l,iaer) &294 / taudusttmp(ig))295 296 ENDDO297 ENDDO298 end if ! If dust aerosol299 300 !==================================================================301 ! H2SO4302 !==================================================================303 ! added by LK304 if (iaero_h2so4.ne.0) then305 iaer=iaero_h2so4306 307 ! 1. Initialization308 aerosol(1:ngrid,1:nlayer,iaer)=0.0309 310 311 ! 2. Opacity calculation312 313 ! expfactor=0.314 DO l=1,nlayer-1315 DO ig=1,ngrid316 ! Typical mixing ratio profile317 318 zp=(pplev(ig,1)/pplay(ig,l))**(70./30) !emulating topdust319 expfactor=max(exp(0.007*(1.-max(zp,1.))),1.e-3)320 321 ! Vertical scaling function322 aerosol(ig,l,iaer)= (pplev(ig,l)-pplev(ig,l+1))*expfactor323 324 ENDDO325 ENDDO326 tauh2so4tmp(1:ngrid)=0.327 DO l=1,nlayer328 DO ig=1,ngrid329 tauh2so4tmp(ig) = tauh2so4tmp(ig) + aerosol(ig,l,iaer)330 ENDDO331 ENDDO332 DO l=1,nlayer-1333 DO ig=1,ngrid334 aerosol(ig,l,iaer) = max(1E-20, &335 1 &336 * pplev(ig,1) / pplev(ig,1) &337 * aerosol(ig,l,iaer) &338 / tauh2so4tmp(ig))339 340 ENDDO341 ENDDO342 343 ! 1/700. is assuming a "sulfurtau" of 1344 ! Sulfur aerosol routine to be improved.345 ! aerosol0 = &346 ! ( 0.75 * QREFvis3d(ig,l,iaer) / &347 ! ( rho_h2so4 * reffrad(ig,l,iaer) ) ) * &348 ! ( pq(ig,l,i_h2so4) + 1.E-9 ) * &349 ! ( pplev(ig,l) - pplev(ig,l+1) ) / g350 ! aerosol0 = max(aerosol0,1.e-9)351 ! aerosol0 = min(aerosol0,L_TAUMAX)352 ! aerosol(ig,l,iaer) = aerosol0353 354 ! ENDDO355 ! ENDDO356 end if357 358 359 ! ---------------------------------------------------------360 92 !================================================================== 361 93 ! Two-layer aerosols (unknown composition)
Note: See TracChangeset
for help on using the changeset viewer.