Changeset 5082 for LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer
- Timestamp:
- Jul 19, 2024, 5:41:58 PM (4 months ago)
- Location:
- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/aer_sedimnt.F90
r4950 r5082 52 52 53 53 ! dynamic viscosity of air (Pruppacher and Klett, 1978) [kg/(m*s)] 54 WHERE (t_seri .GE.273.15)54 WHERE (t_seri>=273.15) 55 55 zvis=(1.718 + 0.0049*(t_seri-273.15))*1.E-5 56 56 ELSEWHERE -
LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/calcaerosolstrato_rrtm.F90
r4293 r5082 96 96 ENDDO 97 97 98 WHERE (tau_aero_sw_rrtm .LT.1.e-14) piz_aero_sw_rrtm=1.099 WHERE (tau_aero_sw_rrtm .LT.1.e-14) tau_aero_sw_rrtm=1.e-15100 WHERE (tau_aero_lw_rrtm .LT.1.e-14) tau_aero_lw_rrtm=1.e-1598 WHERE (tau_aero_sw_rrtm < 1.e-14) piz_aero_sw_rrtm=1.0 99 WHERE (tau_aero_sw_rrtm < 1.e-14) tau_aero_sw_rrtm=1.e-15 100 WHERE (tau_aero_lw_rrtm < 1.e-14) tau_aero_lw_rrtm=1.e-15 101 101 102 102 tausum_strat(:,:)=0.0 103 103 DO i=1,klon 104 104 DO k=1,klev 105 IF (stratomask(i,k) .GT.0.5) THEN105 IF (stratomask(i,k)>0.5) THEN 106 106 tausum_strat(i,1)=tausum_strat(i,1)+tau_strat_wave(i,k,2) !--550 nm 107 107 tausum_strat(i,2)=tausum_strat(i,2)+tau_strat_wave(i,k,5) !--1020 nm -
LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/coagulate.F90
r4950 r5082 106 106 DO j=1, nbtr_bin 107 107 DO i=1, nbtr_bin 108 IF (k .EQ.1) THEN108 IF (k==1) THEN 109 109 ff(i,j,k)= 0.0 110 ELSEIF (k .GT.1.AND.Vdry(k-1).LT.Vij(i,j).AND.Vij(i,j).LT.Vdry(k)) THEN110 ELSEIF (k>1.AND.Vdry(k-1)<Vij(i,j).AND.Vij(i,j)<Vdry(k)) THEN 111 111 ff(i,j,k)= 1.-ff(i,j,k-1) 112 ELSEIF (k .EQ.nbtr_bin) THEN113 IF (Vij(i,j) .GE.Vdry(k)) THEN112 ELSEIF (k==nbtr_bin) THEN 113 IF (Vij(i,j)>=Vdry(k)) THEN 114 114 ff(i,j,k)= 1. 115 115 ELSE 116 116 ff(i,j,k)= 0.0 117 117 ENDIF 118 ELSEIF (k .LE.(nbtr_bin-1).AND.Vdry(k).LE.Vij(i,j).AND.Vij(i,j).LT.Vdry(k+1)) THEN118 ELSEIF (k<=(nbtr_bin-1).AND.Vdry(k)<=Vij(i,j).AND.Vij(i,j)<Vdry(k+1)) THEN 119 119 ff(i,j,k)= Vdry(k)/Vij(i,j)*(Vdry(k+1)-Vij(i,j))/(Vdry(k+1)-Vdry(k)) 120 120 ENDIF … … 159 159 160 160 ! dynamic viscosity of air (Pruppacher and Klett, 2010, p.417) [kg/(m*s)] 161 IF (t_seri(ilon,ilev) .GE.273.15) THEN161 IF (t_seri(ilon,ilev)>=273.15) THEN 162 162 eta=(1.718+0.0049*(t_seri(ilon,ilev)-273.15))*1.E-5 163 163 ELSE … … 212 212 ! 213 213 !--compute enhancement factor due to van der Waals forces 214 IF (ok_vdw .EQ.0) THEN !--no enhancement factor214 IF (ok_vdw == 0) THEN !--no enhancement factor 215 215 Evdw=1.0 216 ELSEIF (ok_vdw .EQ.1) THEN !--E(0) case216 ELSEIF (ok_vdw == 1) THEN !--E(0) case 217 217 AvdWi = AvdW/(RKBOL*t_seri(ilon,ilev))*(4.*radiuswet(i)*radiuswet(j))/(radiuswet(i)+radiuswet(j))**2. 218 218 xvdW = LOG(1.+AvdWi) 219 219 EvdW = 1. + avdW1*xvdW + avdW3*xvdW**3 220 ELSEIF (ok_vdw .EQ.2) THEN !--E(infinity) case220 ELSEIF (ok_vdw == 2) THEN !--E(infinity) case 221 221 AvdWi = AvdW/(RKBOL*t_seri(ilon,ilev))*(4.*radiuswet(i)*radiuswet(j))/(radiuswet(i)+radiuswet(j))**2. 222 222 xvdW = LOG(1.+AvdWi) … … 239 239 ENDDO 240 240 241 IF (k .EQ.1) THEN241 IF (k==1) THEN 242 242 !--calculate new concentration of smallest bin 243 243 tr_tp1(ilon,ilev,k)=tr_t(ilon,ilev,k)/(1.+pdtcoag*denom) -
LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/interp_sulf_input.F90
r5075 r5082 112 112 IF (.NOT.ALLOCATED(SO2_clim)) ALLOCATE(SO2_clim(klon,klev)) 113 113 114 IF (debutphy.OR.mth_cur .NE.mth_pre) THEN114 IF (debutphy.OR.mth_cur/=mth_pre) THEN 115 115 116 116 !--preparation of global fields … … 233 233 DO kk=1, n_lev 234 234 !--added tests on VMR of species for realism 235 IF (OCS_clim_tmp(i,kk) .LT.1.e-20) THEN235 IF (OCS_clim_tmp(i,kk)<1.e-20) THEN 236 236 OCS_clim_tmp(i,kk)=1.0e-20 237 237 ENDIF 238 IF (SO2_clim_tmp(i,kk) .LT.1.e-20) THEN238 IF (SO2_clim_tmp(i,kk)<1.e-20) THEN 239 239 SO2_clim_tmp(i,kk)=1.0e-20 240 240 ENDIF 241 241 ! 50 ppbv min for O3 242 IF (O3_clim_tmp(i,kk) .LT.50.0e-9) THEN242 IF (O3_clim_tmp(i,kk)<50.0e-9) THEN 243 243 O3_clim_tmp(i,kk)=50.0e-9 244 244 ENDIF … … 325 325 !--set to background value everywhere in the very beginning, later only in the troposphere 326 326 !--a little dangerous as the MAXVAL is not computed on the global field 327 IF (debutphy.AND.MAXVAL(tr_seri) .LT.1.e-30) THEN327 IF (debutphy.AND.MAXVAL(tr_seri)<1.e-30) THEN 328 328 p_bound=0.0 329 329 ELSE … … 336 336 ! 337 337 !--OCS and SO2 prescribed back to their clim values below p_bound 338 IF (paprs(i,k) .GT.p_bound) THEN338 IF (paprs(i,k)>p_bound) THEN 339 339 budg_3D_backgr_ocs(i,k)=OCS_clim(i,k)-tr_seri(i,k,id_OCS_strat) 340 340 budg_3D_backgr_so2(i,k)=SO2_clim(i,k)-tr_seri(i,k,id_SO2_strat) -
LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/micphy_tstep.F90
r4950 r5082 82 82 DO WHILE (PDT>0.0) 83 83 count_tstep=count_tstep+1 84 IF (count_tstep .GT.nbtstep) EXIT84 IF (count_tstep > nbtstep) EXIT 85 85 ! convert tr_seri(GASH2SO4) (in kg/kgA) to H2SO4 number density (in molecules/cm3) 86 86 rhoa=tr_seri(ilon,ilev,id_H2SO4_strat) & … … 91 91 !NL - add nucleation box (if flag on) 92 92 IF (flag_nuc_rate_box) THEN 93 IF (latitude_deg(ilon) .LE.nuclat_min .OR. latitude_deg(ilon).GE.nuclat_max &94 .OR. pplay(ilon,ilev) .GE.nucpres_max .AND. pplay(ilon,ilev).LE.nucpres_min) THEN93 IF (latitude_deg(ilon)<=nuclat_min .OR. latitude_deg(ilon)>=nuclat_max & 94 .OR. pplay(ilon,ilev)>=nucpres_max .AND. pplay(ilon,ilev)<=nucpres_min) THEN 95 95 nucl_rate=0.0 96 96 ENDIF … … 122 122 ! determine appropriate time step 123 123 dt=(H2SO4_init-H2SO4_sat)/float(nbtstep)/MAX(1.e-30, nucl_rate+cond_evap_rate) !cond_evap_rate pos. for cond. and neg. for evap. 124 IF (dt .LT.0.0) THEN124 IF (dt<0.0) THEN 125 125 dt=PDT 126 126 ENDIF … … 178 178 ENDDO 179 179 180 IF (MINVAL(tr_seri) .LT.0.0) THEN180 IF (MINVAL(tr_seri)<0.0) THEN 181 181 DO ilon=1, klon 182 182 DO ilev=1, klev 183 183 DO it=1, nbtr 184 IF (tr_seri(ilon,ilev,it) .LT.0.0) THEN184 IF (tr_seri(ilon,ilev,it)<0.0) THEN 185 185 WRITE(lunout,*) 'micphy_tstep: negative concentration', tr_seri(ilon,ilev,it), ilon, ilev, it 186 186 ENDIF -
LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/miecalc_aer.F90
r4950 r5082 275 275 ilambda_min=ref_ind(nb_lambda_h2so4,2)/1.e6 !--in m 276 276 DO Nwv=1, NwvmaxSW+nwave_sw+nwave_lw+NwvmaxLW 277 IF (lambda_int(Nwv) .GT.ilambda_max) THEN277 IF (lambda_int(Nwv)>ilambda_max) THEN 278 278 !for lambda out of data range, take boundary values 279 279 n_r(Nwv)=ref_ind(1,3) 280 280 n_i(Nwv)=ref_ind(1,4) 281 ELSEIF (lambda_int(Nwv) .LE.ilambda_min) THEN281 ELSEIF (lambda_int(Nwv)<=ilambda_min) THEN 282 282 n_r(Nwv)=ref_ind(nb_lambda_h2so4,3) 283 283 n_i(Nwv)=ref_ind(nb_lambda_h2so4,4) … … 290 290 n_i_h2so4=ref_ind(nb,4) 291 291 n_i_h2so4_prev=ref_ind(nb-1,4) 292 IF (lambda_int(Nwv) .GT.ilambda.AND. &293 lambda_int(Nwv) .LE.ilambda_prev) THEN !--- linear interpolation292 IF (lambda_int(Nwv)>ilambda.AND. & 293 lambda_int(Nwv)<=ilambda_prev) THEN !--- linear interpolation 294 294 n_r(Nwv)=n_r_h2so4+(lambda_int(Nwv)-ilambda)/ & 295 295 (ilambda_prev-ilambda)*(n_r_h2so4_prev-n_r_h2so4) … … 307 307 n_i(Nwv)=ref_ind(1,4) 308 308 DO nb=2,nb_lambda_h2so4 309 IF (ref_ind(nb,2)/1.e6 .GT.lambda_int(Nwv)) THEN !--- step function309 IF (ref_ind(nb,2)/1.e6>lambda_int(Nwv)) THEN !--- step function 310 310 n_r(Nwv)=ref_ind(nb,3) 311 311 n_i(Nwv)=ref_ind(nb,4) … … 342 342 !we impose a minimum value for x and extrapolate quantities for small x values 343 343 smallx = .FALSE. 344 IF (x .LT.0.001) THEN344 IF (x<0.001) THEN 345 345 smallx = .TRUE. 346 346 x_old = x … … 359 359 z1=m*z2 360 360 361 IF (0.0 .LE.x.AND.x.LE.8.) THEN361 IF (0.0<=x.AND.x<=8.) THEN 362 362 Nmax=INT(x+4*x**(1./3.)+1.)+2 363 ELSEIF (8. .LT.x.AND.x.LT.4200.) THEN363 ELSEIF (8.<x.AND.x<4200.) THEN 364 364 Nmax=INT(x+4.05*x**(1./3.)+2.)+1 365 ELSEIF (4200. .LE.x.AND.x.LE.20000.) THEN365 ELSEIF (4200.<=x.AND.x<=20000.) THEN 366 366 Nmax=INT(x+4*x**(1./3.)+2.)+1 367 367 ELSE … … 435 435 Q_abs=Q_ext-Q_sca 436 436 437 IF (AIMAG(m) .EQ.0.0) Q_abs=0.0437 IF (AIMAG(m)==0.0) Q_abs=0.0 438 438 omega=Q_sca/Q_ext 439 439 … … 488 488 DO Nwv=1,NwvmaxSW 489 489 490 IF (lambda_int(Nwv) .LE.wv_rrtm_SW(3)) THEN !--RRTM spectral interval 2490 IF (lambda_int(Nwv)<=wv_rrtm_SW(3)) THEN !--RRTM spectral interval 2 491 491 bandSW=2 492 ELSEIF (lambda_int(Nwv) .LE.wv_rrtm_SW(4)) THEN !--RRTM spectral interval 3492 ELSEIF (lambda_int(Nwv)<=wv_rrtm_SW(4)) THEN !--RRTM spectral interval 3 493 493 bandSW=3 494 ELSEIF (lambda_int(Nwv) .LE.wv_rrtm_SW(5)) THEN !--RRTM spectral interval 4494 ELSEIF (lambda_int(Nwv)<=wv_rrtm_SW(5)) THEN !--RRTM spectral interval 4 495 495 bandSW=4 496 ELSEIF (lambda_int(Nwv) .LE.wv_rrtm_SW(6)) THEN !--RRTM spectral interval 5496 ELSEIF (lambda_int(Nwv)<=wv_rrtm_SW(6)) THEN !--RRTM spectral interval 5 497 497 bandSW=5 498 498 ELSE !--RRTM spectral interval 6 … … 515 515 bandLW=1 !--default value starting from the highest lambda 516 516 DO band=2, nbands_lw_rrtm 517 IF (ll .LT.wv_rrtm(band)) THEN !--as long as517 IF (ll<wv_rrtm(band)) THEN !--as long as 518 518 bandLW=band 519 519 ENDIF -
LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/nucleation_tstep_mod.F90
r4950 r5082 102 102 DO k=1, nbtr_bin 103 103 ! CK 20160531: bug fix for first bin 104 IF (k .LE.nbtr_bin-1) THEN105 IF (Vbin(k) .LE.Vnew.AND.Vnew.LT.Vbin(k+1)) THEN104 IF (k<=nbtr_bin-1) THEN 105 IF (Vbin(k)<=Vnew.AND.Vnew<Vbin(k+1)) THEN 106 106 ff(k)= Vbin(k)/Vnew*(Vbin(k+1)-Vnew)/(Vbin(k+1)-Vbin(k)) 107 107 ENDIF 108 108 ENDIF 109 IF (k .EQ.1.AND.Vnew.LE.Vbin(k)) THEN109 IF (k==1.AND.Vnew<=Vbin(k)) THEN 110 110 ff(k)= 1. 111 111 ENDIF 112 IF (k .GT.1) THEN113 IF (Vbin(k-1) .LT.Vnew.AND.Vnew.LT.Vbin(k)) THEN112 IF (k>1) THEN 113 IF (Vbin(k-1)<Vnew.AND.Vnew<Vbin(k)) THEN 114 114 ff(k)= 1.-ff(k-1) 115 115 ENDIF 116 116 ENDIF 117 IF (k .EQ.nbtr_bin.AND.Vnew.GE.Vbin(k)) THEN117 IF (k==nbtr_bin.AND.Vnew>=Vbin(k)) THEN 118 118 ff(k)= 1. 119 119 ENDIF … … 416 416 417 417 !Temperature bounds 418 IF (t .LE.165.) THEN418 IF (t<=165.) THEN 419 419 tln=165.0 420 420 ENDIF 421 IF (t .LE.195.) THEN421 IF (t<=195.) THEN 422 422 tli=195.0 423 423 ENDIF 424 IF (t .GE.400.) THEN424 IF (t>=400.) THEN 425 425 tln=400. 426 426 tli=400. … … 428 428 429 429 ! Saturation ratio bounds 430 IF (satrat .LT.1.E-7) THEN430 IF (satrat<1.E-7) THEN 431 431 satratli=1.E-7 432 432 ENDIF 433 IF (satrat .LT.1.E-5) THEN433 IF (satrat<1.E-5) THEN 434 434 satratln=1.E-5 435 435 ENDIF 436 IF (satrat .GT.0.95) THEN436 IF (satrat>0.95) THEN 437 437 satratli=0.95 438 438 ENDIF 439 IF (satrat .GT.1.0) THEN439 IF (satrat>1.0) THEN 440 440 satratln=1.0 441 441 ENDIF 442 442 443 443 ! Sulfuric acid concentration bounds 444 IF (rhoa .LE.1.E4) THEN444 IF (rhoa<=1.E4) THEN 445 445 rhoaln=1.E4 446 446 rhoali=1.E4 447 447 ENDIF 448 IF (rhoa .GT.1.E13) THEN448 IF (rhoa>1.E13) THEN 449 449 rhoaln=1.E13 450 450 ENDIF 451 IF (rhoa .GT.1.E16) THEN451 IF (rhoa>1.E16) THEN 452 452 rhoali=1.E16 453 453 ENDIF … … 473 473 474 474 !Kinetic limit check 475 IF (satratln .GE. 1.E-2 .AND. satratln .LE.1.) THEN475 IF (satratln >= 1.E-2 .AND. satratln <= 1.) THEN 476 476 kinrhotresn=EXP(7.8920778706888086E+1 + 7.3665492897447082*satratln - 1.2420166571163805E+4/tln & 477 477 & + (-6.1831234251470971E+2*satratln)/tln - 2.4501159970109945E-2*tln & … … 479 479 & -1.4673887785408892*LOG(satratln) + (-3.2141890006517094E+1*LOG(satratln))/tln & 480 480 & + 2.7137429081917556E-3*tln*LOG(satratln)) !1/cm3 481 IF (kinrhotresn .LT.rhoaln) kinetic_n=.TRUE.482 ENDIF 483 484 IF (satratln .GE. 1.E-4 .AND. satratln .LT. 1.E-2) THEN481 IF (kinrhotresn<rhoaln) kinetic_n=.TRUE. 482 ENDIF 483 484 IF (satratln >= 1.E-4 .AND. satratln < 1.E-2) THEN 485 485 kinrhotresn=EXP(7.9074383049843647E+1 - 2.8746005462158347E+1*satratln - 1.2070272068458380E+4/tln & 486 486 & + (-5.9205040320056632E+3*satratln)/tln - 2.4800372593452726E-2*tln & … … 488 488 & -2.3141363245211317*LOG(satratln) + (9.9186787997857735E+1*LOG(satratln))/tln & 489 489 & + 5.6819382556144681E-3*tln*LOG(satratln)) !1/cm3 490 IF (kinrhotresn .LT.rhoaln) kinetic_n=.TRUE.491 ENDIF 492 493 IF (satratln .GE. 5.E-6 .AND. satratln .LT.1.E-4) THEN490 IF (kinrhotresn<rhoaln) kinetic_n=.TRUE. 491 ENDIF 492 493 IF (satratln >= 5.E-6 .AND. satratln < 1.E-4) THEN 494 494 kinrhotresn=EXP(8.5599712000361677E+1 + 2.7335119660796581E+3*satratln - 1.1842350246291651E+4/tln & 495 495 & + (-1.2439843468881438E+6*satratln)/tln - 5.4536964974944230E-2*tln & … … 497 497 & -2.4472627526306372*LOG(satratln) + (1.7561478001423779E+2*LOG(satratln))/tln & 498 498 & + 6.2640132818141811E-3*tln*LOG(satratln)) !1/cm3 499 IF (kinrhotresn .LT.rhoaln) kinetic_n=.TRUE.499 IF (kinrhotresn<rhoaln) kinetic_n=.TRUE. 500 500 ENDIF 501 501 … … 584 584 585 585 na_n=x_n*ntot_n 586 IF (na_n .LT.1.) THEN586 IF (na_n < 1.) THEN 587 587 na_n=1.0 588 588 ENDIF … … 590 590 591 591 ! Set the neutral nucleation rate to 0.0 if less than 1.0E-7 592 IF (jnuc_n .LT.1.E-7) THEN592 IF (jnuc_n<1.E-7) THEN 593 593 jnuc_n=0.0 594 594 ENDIF … … 598 598 ! Ion-induced nucleation parameterization 599 599 600 IF (ipr .GT.0.0) THEN ! if the ion production rate is above zero600 IF (ipr>0.0) THEN ! if the ion production rate is above zero 601 601 602 602 ! Calculate the ion induced nucleation rate wrt. concentration of 1 ion/cm3 … … 617 617 kinrhotresi=EXP(kinrhotresi) !1/cm3 618 618 619 IF (kinrhotresi .LT.rhoali) kinetic_i=.true.619 IF (kinrhotresi<rhoali) kinetic_i=.true. 620 620 621 621 IF (kinetic_i) THEN … … 770 770 771 771 na_i=x_i*ntot_i 772 IF (na_i .LT.1.) THEN772 IF (na_i < 1.) THEN 773 773 na_n=1.0 774 774 ENDIF … … 790 790 jnuc_i=MIN(ipr,n_i*jnuc_i1) 791 791 ! Set the ion-induced nucleation rate to 0.0 if less than 1.0E-7 792 IF (jnuc_i .LT.1.E-7) THEN792 IF (jnuc_i<1.E-7) THEN 793 793 jnuc_i=0.0 794 794 ENDIF -
LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/ocs_to_so2.F90
r4601 r5082 34 34 !only in the stratosphere 35 35 IF (is_strato(ilon,ilev)) THEN 36 IF (OCS_lifetime(ilon,ilev) .GT.0.0.AND.OCS_lifetime(ilon,ilev).LT.1.E10) THEN36 IF (OCS_lifetime(ilon,ilev)>0.0.AND.OCS_lifetime(ilon,ilev)<1.E10) THEN 37 37 rreduce = OCS_lifetime(ilon,ilev) 38 38 ! Check lifetime rreduce < timestep*3 (such as H2SO4 loss > 0.28*H2SO4) with exp(-1/3)=0.72 39 39 IF(flag_min_rreduce) THEN 40 IF (rreduce .LT.(3.*pdtphys)) rreduce = 3.*pdtphys40 IF (rreduce < (3.*pdtphys)) rreduce = 3.*pdtphys 41 41 ENDIF 42 42 budg_3D_ocs_to_so2(ilon,ilev)=tr_seri(ilon,ilev,id_OCS_strat)*(1.0-exp(-pdtphys/rreduce)) -
LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/so2_to_h2so4.F90
r4601 r5082 37 37 !only in the stratosphere 38 38 IF (is_strato(ilon,ilev)) THEN 39 IF (SO2_lifetime(ilon,ilev) .GT.0.0 .AND. SO2_lifetime(ilon,ilev).LT.1.E10) THEN39 IF (SO2_lifetime(ilon,ilev)>0.0 .AND. SO2_lifetime(ilon,ilev)<1.E10) THEN 40 40 IF (flag_OH_reduced) THEN 41 41 !--convert SO2 to H2SO4 (slimane) … … 83 83 & *pplay(ilon,ilev)/t_seri(ilon,ilev)/RD/1.E6/mSO2mol 84 84 85 IF (rrak1 .GE.0.0) THEN85 IF (rrak1 >= 0.0) THEN 86 86 rreduce =( (rkho2o3+rkoho3)*rrak0 + rkso2oh*rrak1 ) / & 87 87 ( (rkho2o3+rkoho3)*rrak0 ) … … 100 100 ! Check lifetime rreduce < timestep*3 (such as SO2 loss > 0.28*SO2) with exp(-1/3)=0.72 101 101 IF(flag_min_rreduce) THEN 102 IF (rreduce .LT.(3.*pdtphys)) rreduce = 3.*pdtphys102 IF (rreduce < (3.*pdtphys)) rreduce = 3.*pdtphys 103 103 ENDIF 104 104 budg_3D_so2_to_h2so4(ilon,ilev)=tr_seri(ilon,ilev,id_SO2_strat)*(1.0-exp(-pdtphys/rreduce)) … … 122 122 ! test: quick sequential integration for SO2 to H2SO4 and reverse 123 123 124 IF (H2SO4_lifetime(ilon,ilev) .GT.0.0 .AND. H2SO4_lifetime(ilon,ilev).LT.1.E10) THEN124 IF (H2SO4_lifetime(ilon,ilev)>0.0 .AND. H2SO4_lifetime(ilon,ilev)<1.E10) THEN 125 125 126 126 rreduce = H2SO4_lifetime(ilon,ilev) … … 130 130 ! Check lifetime rreduce < timestep*3 (such as H2SO4 loss > 0.28*H2SO4) with exp(-1/3)=0.72 131 131 IF(flag_min_rreduce) THEN 132 IF (rreduce .LT.(3.*pdtphys)) rreduce = 3.*pdtphys132 IF (rreduce < (3.*pdtphys)) rreduce = 3.*pdtphys 133 133 ENDIF 134 134 dummyso4toso2 = (mSO2mol/mH2SO4mol)*tr_seri(ilon,ilev,id_H2SO4_strat)*(1.0-exp(-pdtphys/rreduce)) -
LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/strataer_emiss_mod.F90
r4768 r5082 16 16 WRITE(lunout,*) 'IN STRATAER_EMISS INIT WELCOME!' 17 17 18 IF (flag_emit .EQ.1 .OR. flag_emit.EQ.4) THEN ! Volcano18 IF (flag_emit==1 .OR. flag_emit==4) THEN ! Volcano 19 19 CALL getin_p('nErupt',nErupt) !eruption nb 20 20 CALL getin_p('injdur',injdur) !injection duration … … 26 26 ENDIF 27 27 28 IF (nErupt .GT.0) THEN28 IF (nErupt>0) THEN 29 29 ALLOCATE(year_emit_vol(nErupt),mth_emit_vol(nErupt),day_emit_vol(nErupt)) 30 30 year_emit_vol=0 ; mth_emit_vol=0 ; day_emit_vol=0 … … 242 242 DO j=1,nbp_lat 243 243 lat_reg_deg = lat_reg(j)*180./RPI 244 IF ( lat_reg_deg .GE.xlat_min_vol(ieru)-dlat .AND. lat_reg_deg.LT.xlat_max_vol(ieru)+dlat .AND. &245 lon_reg_deg .GE.xlon_min_vol(ieru)-dlon .AND. lon_reg_deg.LT.xlon_max_vol(ieru)+dlon ) THEN244 IF ( lat_reg_deg>=xlat_min_vol(ieru)-dlat .AND. lat_reg_deg<xlat_max_vol(ieru)+dlat .AND. & 245 lon_reg_deg>=xlon_min_vol(ieru)-dlon .AND. lon_reg_deg<xlon_max_vol(ieru)+dlon ) THEN 246 246 ponde_lonlat_vol(ieru) = ponde_lonlat_vol(ieru) + 1 247 247 ENDIF -
LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/strataer_local_var_mod.F90
r4950 r5082 251 251 !--initialising dry diameters to geometrically spaced mass/volume (see Jacobson 1994) 252 252 mdw(1)=mdwmin 253 IF (V_rat .LT.1.62) THEN ! compensate for dip in second bin for lower volume ratio253 IF (V_rat<1.62) THEN ! compensate for dip in second bin for lower volume ratio 254 254 mdw(2)=mdw(1)*2.**(1./3.) 255 255 DO it=3, nbtr_bin -
LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/stratemit.F90
r4601 r5082 74 74 theta_max = min(xlat(i)+dlat_loc,latmax) 75 75 76 IF ( xlat(i) .GE.latmin-dlat_loc .AND. &77 & xlat(i) .LT.latmax+dlat_loc .AND. &78 & xlon(i) .GE.lonmin-dlon .AND. &79 & xlon(i) .LT.lonmax+dlon ) THEN76 IF ( xlat(i)>=latmin-dlat_loc .AND. & 77 & xlat(i)<latmax+dlat_loc .AND. & 78 & xlon(i)>=lonmin-dlon .AND. & 79 & xlon(i)<lonmax+dlon ) THEN 80 80 ! 81 81 WRITE(*,*) 'coordinates of volcanic injection point=',& … … 95 95 CALL STRATDISTRIB(altLMDz,altemiss,sigma_alt,f_lay_emiss) 96 96 97 IF (flag_emit .EQ.3) then97 IF (flag_emit==3) then 98 98 theta=(sin(theta_max/180.*RPI)-sin(theta_min/180.*RPI))/ & 99 99 & (sin(xlat_max_sai/180.*RPI)-sin(xlat_min_sai/180.*RPI)) … … 122 122 IF(emission < 1.E-34) emission = 0.0 123 123 124 IF (flh2o .EQ.0) THEN124 IF (flh2o==0) THEN 125 125 IF(flag_verbose_strataer) WRITE(*,*) 'IN STRATEMIT: tr_ser avant/apres',& 126 126 & 'i= ',i,'k= ',k, 'flh2o= ',flh2o, & … … 129 129 130 130 tr_seri(i,k,id_spec)=tr_seri(i,k,id_spec)+emission*pdtphys 131 IF (id_species_total .NE.0) THEN131 IF (id_species_total/=0) THEN 132 132 tr_seri(i,k,id_species_total)=tr_seri(i,k,id_species_total)+emission*pdtphys 133 133 ENDIF 134 ELSE IF(flh2o .EQ.1) THEN134 ELSE IF(flh2o==1) THEN 135 135 d_q_emiss(i,k)=emission*pdtphys 136 136 IF(d_q_emiss(i,k) > 1.E34) THEN -
LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/sulfate_aer_mod.F90
r4950 r5082 93 93 ! *** H2SO4-H2O curved surface - Kelvin effect factor *** 94 94 ! wet radius (m) (RRSI(IK) in [cm]) 95 if (f_r_wetB(ilon,ilev,IK) .gt. 1.0) then95 if (f_r_wetB(ilon,ilev,IK) > 1.0) then 96 96 radwet = 1.e-2*RRSI(IK)*f_r_wetB(ilon,ilev,IK) 97 97 else … … 197 197 H2O(:,:)=sh(:,:)*mAIRmol/mH2Omol 198 198 199 IF(INSTEP .EQ.0) THEN199 IF(INSTEP==0) THEN 200 200 201 201 INSTEP=1 … … 508 508 DO I=1,16 509 509 DO J=1,28 510 IF (F(I,J) .LT.9.0) F(I,J)=30.0511 IF (F(I,J) .GT.99.99) F(I,J)=99.99510 IF (F(I,J)<9.0) F(I,J)=30.0 511 IF (F(I,J)>99.99) F(I,J)=99.99 512 512 ENDDO 513 513 ENDDO … … 518 518 DO J=1,klev 519 519 TP=t_seri(I,J) 520 IF (TP .LT.175.1) TP=175.1520 IF (TP<175.1) TP=175.1 521 521 ! Partial pressure of H2O (mb) 522 522 PH2O =PMB(I,J)*H2O(I,J) 523 IF (PH2O .LT.XC1) THEN523 IF (PH2O<XC1) THEN 524 524 R2SO4(I,J)=99.99 525 525 ! PH2O=XC(1)+1.0E-10 526 526 ELSE 527 IF (PH2O .GT.XC16) PH2O=XC16527 IF (PH2O>XC16) PH2O=XC16 528 528 ! SIMPLE LINEAR INTERPOLATIONS 529 529 CALL FIND(PH2O,TP,XC,YC,F,VAL,N,M) 530 IF (PMB(I,J) .GE.10.0.AND.VAL.LT.60.0) VAL=60.0530 IF (PMB(I,J)>=10.0.AND.VAL<60.0) VAL=60.0 531 531 R2SO4(I,J)=VAL 532 532 ENDIF … … 601 601 CALL POSACT(XT,XC,NN,JX) 602 602 JX1=JX+1 603 IF(JX .EQ.0) THEN603 IF(JX==0) THEN 604 604 ACTSO4(I,J)=0.0 605 ELSE IF(JX .GE.NN) THEN605 ELSE IF(JX>=NN) THEN 606 606 ACTSO4(I,J)=15811.0 607 607 ELSE … … 684 684 CALL POSITION(YC,Y,M,JY,IERY) 685 685 686 IF(JX .EQ.0.OR.IERY.EQ.1) THEN686 IF(JX==0.OR.IERY==1) THEN 687 687 VAL=99.99 688 688 RETURN 689 689 ENDIF 690 690 691 IF(JY .EQ.0.OR.IERX.EQ.1) THEN691 IF(JY==0.OR.IERX==1) THEN 692 692 VAL=9.0 693 693 RETURN … … 714 714 VAL=(1.-T)*(1.-U)*SXY + T*(1.0-U)*SX1Y + T*U*SX1Y1 + (1.0-T)*U*SXY1 715 715 716 IF(VAL .LT.9.0) VAL=9.0717 IF(VAL .GT.99.99) VAL=99.99716 IF(VAL<9.0) VAL=9.0 717 IF(VAL>99.99) VAL=99.99 718 718 719 719 RETURN … … 728 728 729 729 IER=0 730 IF(X .LT.XC(1)) THEN730 IF(X<XC(1)) THEN 731 731 JX=0 732 732 ELSE 733 733 DO 10 I=1,N 734 IF (X .LT.XC(I)) GO TO 20734 IF (X<XC(I)) GO TO 20 735 735 10 CONTINUE 736 736 IER=1 … … 753 753 INTEGER JX,I 754 754 755 IF(XT .GT.X(1)) THEN755 IF(XT>X(1)) THEN 756 756 JX=0 757 757 ELSE 758 758 DO 10 I=1,N 759 IF (XT .GT.X(I)) GO TO 20759 IF (XT>X(I)) GO TO 20 760 760 10 CONTINUE 761 761 20 JX=I … … 814 814 real, intent(in) :: T 815 815 816 if(T .gt.229.) then816 if(T>229.) then 817 817 ! Preining et al., 1981 (from Kulmala et al., 1998) 818 818 ! saturation vapor pressure (N/m2 = 1 Pa = 1 kg/(m·s2)) … … 955 955 ! composition 956 956 ! calculation of h2so4 molality 957 if(aw .le. 0.05 .and. aw .gt.0.) then957 if(aw <= 0.05 .and. aw > 0.) then 958 958 y1=12.372089320*aw**(-0.16125516114) & 959 959 & -30.490657554*aw -2.1133114241 960 960 y2=13.455394705*aw**(-0.19213122550) & 961 961 & -34.285174607*aw -1.7620073078 962 else if(aw .le. 0.85 .and. aw .gt.0.05) then962 else if(aw <= 0.85 .and. aw > 0.05) then 963 963 y1=11.820654354*aw**(-0.20786404244) & 964 964 & -4.8073063730*aw -5.1727540348 -
LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/traccoag_mod.F90
r4998 r5082 96 96 !--set boundaries of size bins 97 97 DO it=1, nbtr_bin 98 IF (it .EQ.1) THEN98 IF (it==1) THEN 99 99 r_upper(it)=sqrt(r_bin(it+1)*r_bin(it)) 100 100 r_lower(it)=r_bin(it)**2./r_upper(it) 101 ELSEIF (it .EQ.nbtr_bin) THEN101 ELSEIF (it==nbtr_bin) THEN 102 102 r_lower(it)=sqrt(r_bin(it)*r_bin(it-1)) 103 103 r_upper(it)=r_bin(it)**2./r_lower(it) … … 116 116 !--initialising logical is_strato from stratomask 117 117 is_strato(:,:)=.FALSE. 118 WHERE (stratomask .GT.0.5) is_strato=.TRUE.118 WHERE (stratomask>0.5) is_strato=.TRUE. 119 119 120 120 IF(flag_new_strat_compo) THEN … … 335 335 DO i=1,klon 336 336 DO it=1, nbtr_bin 337 IF (mdw(it) .LT.2.5e-6) THEN337 IF (mdw(it) < 2.5e-6) THEN 338 338 !surf_PM25_sulf(i)=surf_PM25_sulf(i)+tr_seri(i,1,it+nbtr_sulgas)*m_part(i,1,it) & 339 339 !assume that particles consist of ammonium sulfate at the surface (132g/mol)
Note: See TracChangeset
for help on using the changeset viewer.