MODULE module_radm USE module_data_radm2 USE module_data_sorgam integer numchem parameter (numchem=numchem_radm) ! .. CONTAINS subroutine radm_driver(id,curr_secs,dtstep,config_flags, & gmt,julday,t_phy,moist,p8w,t8w, & p_phy,chem,rho_phy,dz8w,z,z_at_w,vdrog3, & ph_o31d,ph_o33p,ph_no2,ph_no3o2,ph_no3o,ph_hno2, & ph_hno3,ph_hno4,ph_h2o2,ph_ch2or,ph_ch2om,ph_ch3cho, & ph_ch3coch3,ph_ch3coc2h5,ph_hcocho,ph_ch3cocho, & ph_hcochest,ph_ch3o2h,ph_ch3coo2h,ph_ch3ono2,ph_hcochob,& ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte ) USE module_configure USE module_state_description USE module_model_constants IMPLICIT NONE INTEGER, INTENT(IN ) :: id,julday, & ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte REAL(KIND=8), INTENT(IN ) :: curr_secs REAL, INTENT(IN ) :: dtstep,gmt ! ! advected moisture variables ! REAL, DIMENSION( ims:ime, kms:kme, jms:jme, num_moist ), & INTENT(IN ) :: moist ! ! advected chemical tracers ! REAL, DIMENSION( ims:ime, kms:kme, jms:jme, num_chem ), & INTENT(INOUT ) :: chem ! ! arrays that hold photolysis rates ! REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), & INTENT(INOUT ) :: & ph_o31d,ph_o33p,ph_no2,ph_no3o2,ph_no3o,ph_hno2, & ph_hno3,ph_hno4,ph_h2o2,ph_ch2or,ph_ch2om,ph_ch3cho, & ph_ch3coch3,ph_ch3coc2h5,ph_hcocho,ph_ch3cocho, & ph_hcochest,ph_ch3o2h,ph_ch3coo2h,ph_ch3ono2,ph_hcochob ! ! on input from met model ! REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , & INTENT(IN ) :: & t_phy, & p_phy, & dz8w, & z , & t8w,p8w,z_at_w , & rho_phy ! ! for interaction with aerosols (really is output) ! real , INTENT(INOUT) :: & vdrog3(ims:ime,kms:kme-0,jms:jme,ldrog) TYPE(grid_config_rec_type), INTENT(IN ) :: config_flags ! .. ! .. Local Scalars .. REAL :: clwchem, dt60, dtcmax, dtcmin INTEGER :: i,j,k,iprt, jce, jcs, n, nr, ipr,jpr,nvr ! .. ! .. Local Arrays .. REAL :: p(kts:kte), rh(kts:kte), rj(kts:kte,nreacj), & t(kts:kte), vcinp(kts:kte,numchem),wlc(kts:kte) real :: vdrog1(kts:kte,ldrog) ! integer(kind=8) :: ixhour INTEGER :: iaerosol_sorgam real(kind=8) :: xhour, xtime, xtimin real :: xmin xtime=curr_secs/60._8 ixhour=int(gmt+.01,8)+int(xtime/60._8,8) xhour=real(ixhour,8) xmin=60.*gmt+real(xtime-xhour*60._8,8) ipr=-10 jpr=-10 nvr=5 ! ! following is for combination radm/sorgam only, p_nu0 must be defined ! in that case ! iaerosol_sorgam=0 if(p_nu0.gt.1)iaerosol_sorgam=1 ! chem=max(chem,epsilc) do 100 j=jts,jte do 100 i=its,ite vcinp=epsilc vdrog1=0. iprt=0 ! if(xtime/60.ge.2.)then ! if((i.eq.12.and.j.eq.17).or. & ! (i.eq.12.and.j.eq.7).or. & ! (i.eq.1.and.j.eq.17))iprt=2 ! endif ! reorder ! ! if(iprt.eq.2)print *,'k,chem(i,k,j,p_sulf),vcinp(k,lsulf)' do k=kts,kte vcinp(k,lso2) = max(chem(i,k,j,p_so2),epsilc) vcinp(k,Lsulf) = max(chem(i,k,j,p_sulf),epsilc) vcinp(k,Lno2) = max(chem(i,k,j,p_no2),epsilc) vcinp(k,Lno) = max(chem(i,k,j,p_no),1.e-6) ! vcinp(k,Lno) = max(chem(i,k,j,p_no),epsilc) vcinp(k,Lo3) = max(chem(i,k,j,p_o3),epsilc) vcinp(k,Lhno3) = max(chem(i,k,j,p_hno3),epsilc) vcinp(k,Lh2o2) = max(chem(i,k,j,p_h2o2),epsilc) vcinp(k,Lald) = max(chem(i,k,j,p_ald),epsilc) vcinp(k,Lhcho) = max(chem(i,k,j,p_hcho),epsilc) vcinp(k,Lop1) = max(chem(i,k,j,p_op1),epsilc) vcinp(k,Lop2) = max(chem(i,k,j,p_op2),epsilc) vcinp(k,Lpaa) = max(chem(i,k,j,p_paa),epsilc) vcinp(k,Lora1) = max(chem(i,k,j,p_ora1),epsilc) vcinp(k,Lora2) = max(chem(i,k,j,p_ora2),epsilc) vcinp(k,Lnh3) = max(chem(i,k,j,p_nh3),epsilc) vcinp(k,Ln2o5) = max(chem(i,k,j,p_n2o5),epsilc) vcinp(k,Lno3) = max(chem(i,k,j,p_no3),epsilc) vcinp(k,Lpan) = max(chem(i,k,j,p_pan),epsilc) vcinp(k,Lhc3) = max(chem(i,k,j,p_hc3),epsilc) vcinp(k,Lhc5) = max(chem(i,k,j,p_hc5),epsilc) vcinp(k,Lhc8) = max(chem(i,k,j,p_hc8),epsilc) vcinp(k,Leth) = max(chem(i,k,j,p_eth),epsilc) vcinp(k,Lco) = max(chem(i,k,j,p_co),epsilc) vcinp(k,Lol2) = max(chem(i,k,j,p_ol2),epsilc) vcinp(k,Lolt) = max(chem(i,k,j,p_olt),epsilc) vcinp(k,Loli) = max(chem(i,k,j,p_oli),epsilc) vcinp(k,Ltol) = max(chem(i,k,j,p_tol),epsilc) vcinp(k,Lxyl) = max(chem(i,k,j,p_xyl),epsilc) vcinp(k,Laco3) = max(chem(i,k,j,p_aco3),epsilc) vcinp(k,Ltpan) = max(chem(i,k,j,p_tpan),epsilc) vcinp(k,Lhono) = max(chem(i,k,j,p_hono),epsilc) vcinp(k,Lhno4) = max(chem(i,k,j,p_hno4),epsilc) vcinp(k,Lket) = max(chem(i,k,j,p_ket),epsilc) vcinp(k,Lgly) = max(chem(i,k,j,p_gly),epsilc) vcinp(k,Lmgly) = max(chem(i,k,j,p_mgly),epsilc) vcinp(k,Ldcb) = max(chem(i,k,j,p_dcb),epsilc) vcinp(k,Lonit) = max(chem(i,k,j,p_onit),epsilc) vcinp(k,Lcsl) = max(chem(i,k,j,p_csl),epsilc) vcinp(k,Lxyl) = max(chem(i,k,j,p_xyl),epsilc) vcinp(k,Liso) = max(chem(i,k,j,p_iso),epsilc) vcinp(k,Lho) = max(chem(i,k,j,p_ho),epsilc) vcinp(k,Lho2) = max(chem(i,k,j,p_ho2),epsilc) ! if(iprt.eq.2)then ! print *,k,chem(i,k,j,p_sulf),vcinp(k,lsulf) ! endif enddo !--- now do chemistry, need some input here do k=kts,kte t(k) = t_phy(i,k,j) p(k) = .001*p_phy(i,k,j) rh(k) = .95 rh(k) = MIN( .95, moist(i,k,j,p_qv) / & (3.80*exp(17.27*(t_phy(i,k,j)-273.)/ & (t_phy(i,k,j)-36.))/(.01*p_phy(i,k,j)))) rh(k)=max(.1,rh(k)) ! wlc(k) = moist(i,k,j,p_qc) wlc(k) = 0. END DO dt60 = dtstep/60. xtimin = max(0._8,xtime-real(dt60,8)) dtcmin = min(.05_8,xtime-xtimin) dtcmin = max(dtcmin,0.5/60.) dtcmax = min(5.,dt60) dtcmax = min(real(dtcmax,8),xtime-xtimin) ! ! radm here is called with a vertical stack ! jcs = kts jce = kte ! ! fill photolysis rates for use in radm module ! do k=kts,kte rj(k,1) = ph_no2(i,k,j) rj(k,2) = ph_o31d(i,k,j) rj(k,3) = ph_o33p(i,k,j) rj(k,4) = ph_hno2(i,k,j) rj(k,5) = ph_hno3(i,k,j) rj(k,6) = ph_hno4(i,k,j) rj(k,7) = ph_no3o2(i,k,j) rj(k,8) = ph_no3o(i,k,j) rj(k,9) = ph_h2o2(i,k,j) rj(k,10) = ph_ch2om(i,k,j) rj(k,11) = ph_ch2or(i,k,j) rj(k,12) = ph_ch3cho(i,k,j) rj(k,13) = ph_ch3o2h(i,k,j) rj(k,14) = ph_ch3coch3(i,k,j) rj(k,15) = ph_ch3coo2h(i,k,j) rj(k,16) = ph_ch3coc2h5(i,k,j) rj(k,17) = ph_hcocho(i,k,j) rj(k,18) = ph_hcochob(i,k,j) rj(k,19) = ph_ch3cocho(i,k,j) rj(k,20) = ph_hcochest(i,k,j) rj(k,21) = ph_ch3ono2(i,k,j) END DO ! print *,'before radm, i,j = ',i,j ! iprt=0 ! if((i.eq.87.and.j.eq.15).or.(i.eq.87.and.j.eq.4))then ! iprt=1 ! endif CALL radm(rj,wlc,vcinp,t,p,rh,xtime,xtimin,kts,kte, & iprt,dt60,dtcmax,dtcmin,vdrog1,iaerosol_sorgam) ! print *,'after radm, i,j = ',i,j do k=kts,kte chem(i,k,j,p_so2) = max(vcinp(k,lso2),epsilc) chem(i,k,j,p_sulf) = max(vcinp(k,Lsulf),epsilc) chem(i,k,j,p_no2) = max(vcinp(k,Lno2),epsilc) chem(i,k,j,p_no) = max(vcinp(k,Lno),1.e-6) chem(i,k,j,p_o3) = max(vcinp(k,Lo3),epsilc) chem(i,k,j,p_hno3) = max(vcinp(k,Lhno3),epsilc) chem(i,k,j,p_h2o2) = max(vcinp(k,Lh2o2),epsilc) chem(i,k,j,p_ald) = max(vcinp(k,Lald),epsilc) chem(i,k,j,p_hcho) = max(vcinp(k,Lhcho),epsilc) chem(i,k,j,p_op1) = max(vcinp(k,Lop1),epsilc) chem(i,k,j,p_op2) = max(vcinp(k,Lop2),epsilc) chem(i,k,j,p_paa) = max(vcinp(k,Lpaa),epsilc) chem(i,k,j,p_ora1) = max(vcinp(k,Lora1),epsilc) chem(i,k,j,p_ora2) = max(vcinp(k,Lora2),epsilc) chem(i,k,j,p_nh3) = max(vcinp(k,Lnh3),epsilc) chem(i,k,j,p_n2o5) = max(vcinp(k,Ln2o5),epsilc) chem(i,k,j,p_no3) = max(vcinp(k,Lno3),epsilc) chem(i,k,j,p_pan) = max(vcinp(k,Lpan),epsilc) chem(i,k,j,p_hc3) = max(vcinp(k,Lhc3),epsilc) chem(i,k,j,p_hc5) = max(vcinp(k,Lhc5),epsilc) chem(i,k,j,p_hc8) = max(vcinp(k,Lhc8),epsilc) chem(i,k,j,p_eth) = max(vcinp(k,Leth),epsilc) chem(i,k,j,p_co) = max(vcinp(k,Lco),epsilc) chem(i,k,j,p_ol2) = max(vcinp(k,Lol2),epsilc) chem(i,k,j,p_olt) = max(vcinp(k,Lolt),epsilc) chem(i,k,j,p_oli) = max(vcinp(k,Loli),epsilc) chem(i,k,j,p_tol) = max(vcinp(k,Ltol),epsilc) chem(i,k,j,p_xyl) = max(vcinp(k,Lxyl),epsilc) chem(i,k,j,p_aco3) = max(vcinp(k,Laco3),epsilc) chem(i,k,j,p_tpan) = max(vcinp(k,Ltpan),epsilc) chem(i,k,j,p_hono) = max(vcinp(k,Lhono),epsilc) chem(i,k,j,p_hno4) = max(vcinp(k,Lhno4),epsilc) chem(i,k,j,p_ket) = max(vcinp(k,Lket),epsilc) chem(i,k,j,p_gly) = max(vcinp(k,Lgly),epsilc) chem(i,k,j,p_mgly) = max(vcinp(k,Lmgly),epsilc) chem(i,k,j,p_dcb) = max(vcinp(k,Ldcb),epsilc) chem(i,k,j,p_onit) = max(vcinp(k,Lonit),epsilc) chem(i,k,j,p_csl) = max(vcinp(k,Lcsl),epsilc) chem(i,k,j,p_iso) = max(vcinp(k,Liso),epsilc) chem(i,k,j,p_ho) = max(vcinp(k,Lho),epsilc) chem(i,k,j,p_ho2) = max(vcinp(k,Lho2),epsilc) if(p_nu0.gt.1)then VDROG3(i,k,j,PXYL ) = VDROG1(k,PXYL ) VDROG3(i,k,j,PTOL ) = VDROG1(k,PTOL ) VDROG3(i,k,j,PCSL1) = VDROG1(k,PCSL1) VDROG3(i,k,j,PCSL2) = VDROG1(k,PCSL2) VDROG3(i,k,j,PHC8 ) = VDROG1(k,PHC8 ) VDROG3(i,k,j,POLI1) = VDROG1(k,POLI1) VDROG3(i,k,j,POLI2) = VDROG1(k,POLI2) VDROG3(i,k,j,POLI3) = VDROG1(k,POLI3) VDROG3(i,k,j,POLT1) = VDROG1(k,POLT1) VDROG3(i,k,j,POLT2) = VDROG1(k,POLT2) VDROG3(i,k,j,POLT3) = VDROG1(k,POLT3) endif END DO ! if(iprt.eq.2)then ! print *,'after radm, k,chem(i,k,j,p_sulf),vcinp(k,lsulf)' ! do k=kts,kte ! print *,k,chem(i,k,j,p_sulf),vcinp(k,lsulf) ! enddo ! endif 100 continue END SUBROUTINE radm_driver SUBROUTINE radm(rjj,wlcc,vcinp,tinp,pinp,rhinp,tstart,timemx, & jcs,jce,iprt,dt60,dtcmax,dtcmin,vdrog,iaerosol_sorgam) implicit none ! .. Parameters .. REAL, PARAMETER :: c302 = 5417.4, c303 = 19.83 ! .. ! .. Scalar Arguments .. REAL(KIND=8),INTENT(IN) :: timemx, tstart REAL,INTENT(IN) :: dt60, dtcmax, dtcmin INTEGER, INTENT(IN) :: iprt, jce, jcs ! ! integer, intent (in) :: iaerosol_sorgam REAL,INTENT(IN) :: rjj(jcs:jce,nreacj), & wlcc(jcs:jce), tinp(jcs:jce),pinp(jcs:jce),rhinp(jcs:jce) ! .. real,intent (INOUT) :: vdrog(jcs:jce,ldrog),vcinp(jcs:jce,lspec) ! .. ! .. Local Scalars .. REAL :: dtc, r, timenow, tsqrd, xk0, xk2, xk3 INTEGER :: i, ir, irdum, j, k, kdum, l, nr ! .. ! .. Local Arrays .. REAL :: prdrog(jcs:jce,ldrog) REAL :: aquad(jcs:jce), bquad(jcs:jce), & crj(jcs:jce,nreacj), crk(jcs:jce,nreack), & dum(jcs:jce), dvc(jcs:jce,ldiag), dvca(jcs:jce,ldiag), & dvcg(jcs:jce,ldiag), h2o(jcs:jce,1), & loss(jcs:jce,lpred), lossl(jcs:jce,lump), & p(jcs:jce,1), patmot1(jcs:jce), & patmot2(jcs:jce), patmot3(jcs:jce), & pot(jcs:jce), prod(jcs:jce,lpred), & prodl(jcs:jce,lump), rh(jcs:jce), & rj(jcs:jce,nreacj), rk(jcs:jce,nreack), & t(jcs:jce,1), tin(jcs:jce), to300(jcs:jce), & vc(jcs:jce,1,lspec), vca(jcs:jce,1,lspec), & vcg(jcs:jce,1,lspec), vcl(jcs:jce,lump), wlc(jcs:jce) ! .. ! .. Intrinsic Functions .. INTRINSIC amax1, amin1, exp, log10 ! .. IF (iprt==1) PRINT *, 'in radm ', jcs, jce, vcinp(jcs:jce,3), & vcinp(jcs:jce,lho2) IF (iprt==1) PRINT *, 'in radm ', lspec, lho2 IF (iprt==2) PRINT *, 'in radm ', lsulf,vcinp(jcs:jcs+5,lsulf) r = 0.0820578 do nr=1,ldrog do j=jcs,jce VDROG(j,nr)=0. enddo enddo DO nr = 1, nreacj DO j = jcs, jce rj(j,nr) = rjj(j,nr) END DO END DO DO j = jcs, jce wlc(j) = wlcc(j) t(j,1) = tinp(j) p(j,1) = pinp(j) rh(j) = rhinp(j) END DO DO l = 1, lspec DO j = jcs, jce vca(j,1,l) = epsilc vcg(j,1,l) = amax1(epsilc,vcinp(j,l)) vc(j,1,l) = amax1(epsilc,vcinp(j,l)) END DO END DO IF (iprt==1) PRINT *, ' radm', lho2, vc(jcs:jce,1,3), vc(jcs:jce,1,7), & vc(jcs:jce,1,lho2) DO l = 1, lpred DO j = jcs, jce prod(j,l) = 0. loss(j,l) = epsilc END DO END DO DO l = 1, nreacj DO j = jcs, jce crj(j,l) = 0. END DO END DO DO l = 1, ldiag DO j = jcs, jce dvca(j,l) = epsilc dvcg(j,l) = epsilc dvc(j,l) = epsilc END DO END DO DO l = 1, nreack DO j = jcs, jce rk(j,l) = 0. crk(j,l) = epsilc END DO END DO DO l = 1, lump DO j = jcs, jce vcl(j,l) = 1.e-9 lossl(j,l) = epsilc prodl(j,l) = 0. END DO END DO dtc = dtcmin DO j = jcs, jce h2o(j,1) = .611E6*rh(j)*exp(c303-c302/t(j,1))/p(j,1) END DO k = 1 i = 1 kdum = k DO j = jcs, jce tin(j) = 1./t(j,1) !RADM2.0 I --> IMRCHEM !RADM2.0 I --> IMRCHEM pot(j) = p(j,1)*tin(j)/101.3 !RADM2.0 I --> IMRCHEM to300(j) = t(j,1)/300. patmot1(j) = const(1)*pot(j) patmot2(j) = const(2)*pot(j) patmot3(j) = const(3)*pot(j)*pot(j) END DO DO ir = 1, nreack DO j = jcs, jce rk(j,ir) = thafac(ir)*exp(-eor(ir)*tin(j))*patmot2(j) END DO END DO DO j = jcs, jce !3RD ORDER rk(j,16) = rk(j,16)*patmot3(j)/patmot2(j)*1.E-20 !1ST ORDER rk(j,54) = rk(j,54)/patmot2(j)*60. !1ST ORDER rk(j,56) = rk(j,56)/patmot2(j)*60. END DO DO ir = 1, ntroe irdum = itroe(ir) DO j = jcs, jce aquad(j) = xk0300(ir)*to300(j)**(-xntroe(ir)) aquad(j) = aquad(j)*patmot1(j) bquad(j) = xkf300(ir)*to300(j)**(-xmtroe(ir)) bquad(j) = aquad(j)/bquad(j) END DO DO j = jcs, jce rk(j,irdum) = aquad(j)/(1.+bquad(j))*0.6**(1./(1.+(log10(bquad(j)) & )**2)) END DO IF (ir>2) THEN DO j = jcs, jce rk(j,irdum) = rk(j,irdum)*patmot2(j) END DO ELSE DO j = jcs, jce !changed RADM2.0 IMRCHEM rk(j,irdum) = rk(j,irdum)/(afac(ir)*exp(bfac(ir)/t(j,1)))*60. END DO END IF !END DO 90 LOOP END DO DO j = jcs, jce tsqrd = t(j,1)*t(j,1) !was Imrchem 3d I --> IMRCHEM rk(j,30) = rk(j,30)*tsqrd rk(j,31) = rk(j,31)*tsqrd rk(j,50) = rk(j,50)*tsqrd END DO DO j = jcs, jce rk(j,1) = patmot1(j)*6.E-34*to300(j)**(-2.3)*patmot2(j) rk(j,12) = (2.2E-13*exp(620.*tin(j))+1.9E-33*patmot1(j)*exp(980.*tin & (j)))*patmot2(j) ! IF (iprt==1 .AND. j==jce) THEN ! PRINT *, j, tin(j), patmot1(j), patmot2(j), & ! 1.9E-33*patmot1(j)*exp(980.*tin(j)) ! PRINT *, rk(j,12), 2.2E-13*exp(620.*tin(j)), const(3), p(j,1) ! END IF xk0 = 7.2E-15*exp(785.*tin(j)) xk2 = 4.1E-16*exp(1440.*tin(j)) xk3 = 1.9E-33*exp(725.*tin(j))*patmot1(j) rk(j,25) = (xk0+xk3/(1.+xk3/xk2))*patmot2(j) rk(j,29) = (1.5E-13*(1.+2.439E-20*patmot1(j)))*patmot2(j) rk(j,13) = (3.08E-34*exp(2820.*tin(j))+2.66E-34*patmot1(j)*1.E-20* & exp(3180.*tin(j)))*patmot3(j) END DO DO j = jcs, jce dum(j) = amin1(rh(j),1.) dum(j) = amax1(dum(j),0.) ! RK(J,137) = 1./(600.*EXP(-(DUM(J)/.28)**2.8)+5.) ! RK(J,137)= CVMGP(0.2,0.0,DUM(J) - .70) ! HETEROGENOUS N2O5 rk(j,23) = 0.0 ! HOMOGENEOUS N2O5 IF (dum(j)-.7>=0.) THEN rk(j,137) = 0.2 ELSE rk(j,137) = 0. END IF END DO !** DO j = jcs, jce vcl(j,lnox) = vc(j,1,lno) + vc(j,1,lno2) vcl(j,lhox) = max(1.e-9,vc(j,1,lho) + vc(j,1,lho2)) vcl(j,lpao3) = vc(j,1,lpan) + vc(j,1,laco3) vcl(j,ln2n3) = vc(j,1,lno3) + vc(j,1,ln2o5) END DO !********************************************************************** ! C H E M I C A L S O L V E R !********************************************************************** timenow = 0. 10 CONTINUE ! Chemical solver CALL predraten(jcs,jce,iprt,crj,crk,rj,rk,vc,dvc,vca, & wlc,dvca,p,h2o,dvcg,t,r) CALL producn(jcs,jce,iprt,crj,crk,loss,prod,prodl,lossl, & prdrog,iaerosol_sorgam) CALL setdtc(jcs,jce,dtc,dtcmax,dtcmin,dt60,prod,loss,vc,timenow) CALL integ1n(jcs,jce,iprt,dtc,vc,loss,prod,vcl,lossl,prodl, & rk,dvc,h2o,rj,vdrog,prdrog,iaerosol_sorgam) timenow = timenow + dtc IF (iprt==2) PRINT *, 'end radm', timenow,vc(jcs:jce,1,lsulf) IF ((timenow+0.001) TAKE THE COMMENTED STUFF !........ UNCOMMENTED IS: NTOTAL=NOX+HNO3+NO3+2*N2O5+HONO+HNO4 !-------> DON'T FORGET TO CHANGE INTEG AND CHEM ! LOSSL(J,LNTOTAL)= CRK(J,80)+CRK(J,81)+ ! 1 CRK(J,82)+CRK(J,83) ! LOSSL(J,LNTOTAL)= CRK(J,53)+CRK(J,55)+ ! 1 CRK(J,132)+ ! 1 CRK(J,80)+CRK(J,81)+ ! 1 CRK(J,82)+CRK(J,83) ! PRODL(J,LNTOTAL)= ! 1 CRK(J,20)+ ! 1 CRK(J,50)+CRK(J,54)+CRK(J,56)+CRK(J,73)+ ! 1 CRK(J,51) ! PRODL(J,LNTOTAL)= CRK(J,101) + CRK(J,73) DO j = jcs, jce prodl(j,ln2n3) = crk(j,17) + crk(j,25) + crk(j,50) END DO DO j = jcs, jce lossl(j,ln2n3) = crk(j,23) + crj(j,7) + crj(j,8) + crk(j,18) + & crk(j,19) + crk(j,20) + crk(j,74) + crk(j,75) + crk(j,76) + & crk(j,77) + crk(j,78) + crk(j,79) + crk(j,80) + crk(j,81) + & crk(j,82) + crk(j,83) + crk(j,137) END DO DO j = jcs, jce loss(j,lpan) = crk(j,50) + crk(j,54) END DO DO j = jcs, jce prod(j,lpan) = crk(j,53) END DO DO j = jcs, jce loss(j,lhno3) = crj(j,5) + crk(j,25) END DO DO j = jcs, jce prod(j,lhno3) = crk(j,20) + 2.D0*crk(j,23) + crk(j,24) + crk(j,74) + & crk(j,75) + crk(j,76) + crk(j,77) + crk(j,78) + crk(j,79) + & 2.*crk(j,137) END DO DO j = jcs, jce loss(j,lh2o2) = max(alow,crj(j,9) + crk(j,14) ) ! if(iprt.eq.1.and.j.eq.jce)then ! print *,LH2O2,LOSS(J,LH2O2),CRJ(J, 9),CRK(J, 14) ! endif END DO DO j = jcs, jce prod(j,lh2o2) = crk(j,12) + crk(j,13) ! if(iprt.eq.1.and.j.eq.jce)then ! print *,LH2O2,prod(J,LH2O2),CRK(J, 12),CRK(J, 13) ! endif END DO DO j = jcs, jce loss(j,lhcho) = crj(j,10) + crj(j,11) + crk(j,41) + crk(j,74) END DO DO j = jcs, jce prod(j,lhcho) = crj(j,13) + .13*crj(j,17) + .45*crj(j,18) + & .009*crk(j,32) + .5*crk(j,47) + crk(j,50) + crk(j,57) + & .09*crk(j,58) + .04*crk(j,62) + 1.6*crk(j,64) + crk(j,65) + & .28*crk(j,66) + crk(j,73) + crk(j,84) + .53*crk(j,85) + & .18*crk(j,86) + .53*crk(j,87) + 1.5*crk(j,102) + .75*crk(j,103) + & .75*crk(j,104) + .77*crk(j,105) + .80*crk(j,106) + & 1.55*crk(j,107) + 1.25*crk(j,108) + .89*crk(j,109) + & .75*crk(j,110) + crk(j,111) + crk(j,112) + crk(j,113) + & .5*crk(j,114) + .8*crk(j,119) + .5*crk(j,120) + .14*crk(j,121) + & crk(j,128) + crk(j,134) + 1.75*crk(j,138) + crk(j,139) + & 2.0*crk(j,140) END DO DO j = jcs, jce prod(j,lhono) = crk(j,15) END DO DO j = jcs, jce loss(j,lhono) = crj(j,4) END DO DO j = jcs, jce prod(j,lhno4) = crk(j,10) END DO DO j = jcs, jce loss(j,lhno4) = crj(j,6) + crk(j,11) + crk(j,26) END DO DO j = jcs, jce prod(j,ln2o5) = crk(j,21) END DO DO j = jcs, jce loss(j,ln2o5) = crk(j,22) + crk(j,23) + crk(j,137) END DO DO j = jcs, jce prod(j,lno3) = crk(j,17) + crk(j,22) + crk(j,25) + crk(j,50) END DO DO j = jcs, jce loss(j,lno3) = crj(j,7) + crj(j,8) + crk(j,18) + crk(j,19) + & crk(j,20) + crk(j,21) + crk(j,74) + crk(j,75) + crk(j,76) + & crk(j,77) + crk(j,78) + crk(j,79) + crk(j,80) + crk(j,81) + & crk(j,82) + crk(j,83) END DO DO j = jcs, jce loss(j,lco) = crk(j,29) END DO DO j = jcs, jce prod(j,lco) = crj(j,10) + crj(j,11) + crj(j,12) + 1.87*crj(j,17) + & 1.55*crj(j,18) + crj(j,19) + crk(j,41) + 2.*crk(j,44) + & crk(j,45) + .95*crk(j,68) + crk(j,74) + 2.*crk(j,76) + crk(j,77) + & .42*crk(j,84) + .33*crk(j,85) + .23*crk(j,86) + .33*crk(j,87) + & .475*crk(j,114) + .95*crk(j,126) END DO DO j = jcs, jce loss(j,lald) = crj(j,12) + crk(j,42) + crk(j,75) END DO DO j = jcs, jce prod(j,lald) = crj(j,14) + .075*crk(j,32) + .2*crj(j,21) + & .5*crk(j,48) + .75*crk(j,58) + .38*crk(j,60) + .35*crk(j,62) + & .2*crk(j,64) + crk(j,65) + 1.45*crk(j,66) + crk(j,73) + & crk(j,71) + .5*crk(j,85) + .72*crk(j,86) + .5*crk(j,87) + & .75*crk(j,103) + .15*crk(j,104) + .41*crk(j,105) + & .46*crk(j,106) + .35*crk(j,107) + .75*crk(j,108) + & .725*crk(j,109) + crk(j,115) + .2*crk(j,116) + .14*crk(j,117) + & .1*crk(j,118) + .6*crk(j,119) + crk(j,120) + .725*crk(j,121) + & crk(j,138) + crk(j,139) + 2.0*crk(j,140) END DO DO j = jcs, jce loss(j,lop1) = crj(j,13) + crk(j,47) END DO DO j = jcs, jce prod(j,lop1) = crk(j,88) END DO DO j = jcs, jce loss(j,lop2) = crj(j,14) + crk(j,48) END DO DO j = jcs, jce prod(j,lop2) = crk(j,89) + crk(j,90) + crk(j,91) + crk(j,92) + & crk(j,93) + crk(j,94) + crk(j,95) + crk(j,96) + crk(j,98) + & crk(j,99) + crk(j,100) + crk(j,127) + crk(j,133) END DO DO j = jcs, jce loss(j,lpaa) = crj(j,15) + crk(j,49) END DO DO j = jcs, jce prod(j,lpaa) = crk(j,97) END DO DO j = jcs, jce loss(j,lket) = crj(j,16) + crk(j,43) END DO DO j = jcs, jce prod(j,lket) = .8*crj(j,21) + .025*crk(j,32) + .25*crk(j,58) + & .69*crk(j,60) + 1.06*crk(j,62) + .10*crk(j,66) + .10*crk(j,86) + & .6*crk(j,104) + .75*crk(j,105) + 1.39*crk(j,106) + & .55*crk(j,109) + .8*crk(j,116) + .86*crk(j,117) + .9*crk(j,118) + & .55*crk(j,121) END DO DO j = jcs, jce loss(j,lgly) = crj(j,17) + crj(j,18) + crk(j,44) + crk(j,76) END DO DO j = jcs, jce prod(j,lgly) = .89*crk(j,68) + .16*crk(j,69) + .16*crk(j,112) + & .44*crk(j,114) + .2*crk(j,124) + .89*crk(j,126) END DO DO j = jcs, jce loss(j,lmgly) = crj(j,19) + crk(j,45) + crk(j,77) END DO DO j = jcs, jce prod(j,lmgly) = .11*crk(j,68) + .17*crk(j,69) + .450*crk(j,70) + & crk(j,72) + .75*crk(j,110) + .17*crk(j,112) + .45*crk(j,113) + & .05*crk(j,114) + crk(j,122) + .8*crk(j,124) + crk(j,125) + & .11*crk(j,126) END DO DO j = jcs, jce loss(j,ldcb) = crj(j,20) + crk(j,46) + crk(j,78) END DO DO j = jcs, jce loss(j,ldcb) = max(alow,loss(j,ldcb)) END DO DO j = jcs, jce prod(j,ldcb) = .70*crk(j,69) + .806*crk(j,70) + .7*crk(j,112) + & .806*crk(j,113) + crk(j,124) + crk(j,125) END DO DO j = jcs, jce loss(j,lonit) = crj(j,21) + crk(j,51) END DO DO j = jcs, jce prod(j,lonit) = .036*crk(j,58) + .08*crk(j,60) + .24*crk(j,62) + & crk(j,101) + crk(j,132) END DO DO j = jcs, jce loss(j,lso2) = crk(j,28) END DO DO j = jcs, jce loss(j,lsulf) = 0. END DO DO j = jcs, jce prod(j,lsulf) = crk(j,28) ! if(iprt==2)print *,' j,prod = ',j,prod(j,lsulf) END DO DO j = jcs, jce loss(j,leth) = crk(j,31) END DO DO j = jcs, jce loss(j,lhc3) = crk(j,32) END DO DO j = jcs, jce loss(j,lhc5) = crk(j,33) END DO DO j = jcs, jce loss(j,lhc8) = crk(j,34) END DO DO j = jcs, jce loss(j,lol2) = crk(j,35) + crk(j,80) + crk(j,84) END DO DO j = jcs, jce loss(j,lolt) = crk(j,36) + crk(j,81) + crk(j,85) END DO DO j = jcs, jce loss(j,loli) = crk(j,37) + crk(j,82) + crk(j,86) END DO DO j = jcs, jce loss(j,ltol) = crk(j,38) END DO DO j = jcs, jce loss(j,lcsl) = crk(j,40) + .5*crk(j,79) END DO DO j = jcs, jce prod(j,lcsl) = .25*crk(j,38) + .17*crk(j,39) END DO DO j = jcs, jce loss(j,lxyl) = crk(j,39) END DO DO j = jcs, jce loss(j,laco3) = crk(j,53) + crk(j,67) + crk(j,97) + crk(j,111) + & crk(j,115) + crk(j,116) + crk(j,117) + crk(j,118) + crk(j,119) + & crk(j,120) + crk(j,121) + crk(j,122) + 2.*crk(j,123) + & crk(j,124) + crk(j,125) + .95*crk(j,126) + crk(j,129) + & crk(j,135) + crk(j,139) END DO DO j = jcs, jce prod(j,laco3) = crj(j,16) + crj(j,19) + .02*crj(j,20) + crk(j,42) + & crk(j,45) + crk(j,49) + crk(j,54) + .05*crk(j,68) + crk(j,75) + & crk(j,77) + .03*crk(j,114) END DO DO j = jcs, jce loss(j,liso) = crk(j,52) + crk(j,83) + crk(j,87) END DO DO j = jcs, jce loss(j,ltpan) = crk(j,56) END DO DO j = jcs, jce prod(j,ltpan) = crk(j,55) END DO DO j = jcs, jce loss(j,lora1) = 1.E-27 END DO DO j = jcs, jce prod(j,lora1) = .4*crk(j,84) + .06*crk(j,86) + .2*crk(j,85) + & .2*crk(j,87) END DO DO j = jcs, jce loss(j,lora2) = 1.E-27 END DO DO j = jcs, jce prod(j,lora2) = .2*crk(j,85) + .29*crk(j,86) + .2*crk(j,87) + & .5*crk(j,111) + .5*crk(j,114) + .5*crk(j,115) + .5*crk(j,116) + & .5*crk(j,117) + .5*crk(j,118) + .5*crk(j,119) + .5*crk(j,120) + & .5*crk(j,121) + .5*crk(j,122) + .5*crk(j,139) END DO DO j = jcs, jce lossl(j,lhox) = crk(j,15) + crk(j,24) + crk(j,25) + crk(j,26) + & crk(j,27) + crk(j,30) + crk(j,31) + .83*crk(j,32) + crk(j,33) + & crk(j,34) + crk(j,35) + crk(j,36) + crk(j,37) + .75*crk(j,38) + & .83*crk(j,39) + 1.8*crk(j,40) + crk(j,42) + crk(j,43) + & crk(j,45) + crk(j,46) + crk(j,49) + crk(j,50) + crk(j,51) + & crk(j,52) + crk(j,10) + 2.*crk(j,12) + 2.*crk(j,13) + crk(j,20) + & crk(j,27) + crk(j,88) + crk(j,89) + crk(j,90) + crk(j,91) + & .5*crk(j,47) + .5*crk(j,48) + crk(j,92) + crk(j,93) + crk(j,94) + & crk(j,95) + crk(j,96) + crk(j,97) + crk(j,98) + crk(j,99) + & crk(j,100) + crk(j,101) + crk(j,127) + crk(j,133) lossl(j,lhox) = max(alow,lossl(j,lhox)) END DO DO j = jcs, jce prodl(j,lhox) = crj(j,4) + crj(j,5) + crj(j,6) + 2.*crj(j,9) + & crj(j,13) + crj(j,14) + crj(j,15) + 2.*crk(j,5) + 2.*crj(j,11) + & crj(j,12) + crj(j,13) + crj(j,14) + .8*crj(j,18) + crj(j,19) + & .98*crj(j,20) + crj(j,21) + crk(j,11) + crk(j,57) + & .964*crk(j,58) + .92*crk(j,60) + .76*crk(j,62) + crk(j,64) + & crk(j,65) + crk(j,66) + .92*crk(j,68) + crk(j,69) + crk(j,70) + & crk(j,71) + crk(j,72) + crk(j,74) + crk(j,76) + .12*crk(j,84) + & .33*crk(j,85) + .40*crk(j,86) + .33*crk(j,87) + crk(j,102) + & crk(j,103) + crk(j,104) + crk(j,105) + crk(j,106) + crk(j,107) + & crk(j,108) + crk(j,109) + crk(j,110) + .5*crk(j,111) + & 2.0*crk(j,112) + 2.*crk(j,113) + .46*crk(j,114) + .5*crk(j,115) + & .5*crk(j,116) + .5*crk(j,117) + .5*crk(j,118) + .5*crk(j,119) + & .5*crk(j,120) + .5*crk(j,121) + .5*crk(j,122) + crk(j,124) + & crk(j,125) + .92*crk(j,126) + crk(j,128) + crk(j,134) + & .5*crk(j,138) END DO ! DO 850 L=1 ,LPRED ! DO 850 J=JCS,JCE ! PROD(J,L)= PROD(J,L) + PRODS(J,L) !850 CONTINUE ! DO 900 J=JCS,JCE ! PRODL(J,LNOX) = PRODL(J,LNOX)+ PRODS(J,LNO) + PRODS(J,LNO2) ! PRODL(J,LNTOTAL)= PRODL(J,LNTOTAL)+PRODS(J,LNO)+PRODS(J,LNO2) !900 CONTINUE DO J = JCS, JCE PRDROG(J,PXYL) = CRK(J, 39) PRDROG(J,PTOL) = CRK(J, 38) PRDROG(J,PCSL1) = CRK(J, 40) PRDROG(J,PCSL2) = 0.50 * CRK(J, 79) PRDROG(J,PHC8) = CRK(J, 34) PRDROG(J,POLI1) = CRK(J, 37) PRDROG(J,POLI2) = CRK(J, 82) PRDROG(J,POLI3) = CRK(J, 86) PRDROG(J,POLT1) = CRK(J, 36) PRDROG(J,POLT2) = CRK(J, 81) PRDROG(J,POLT3) = CRK(J, 85) ! ! next lines for radm only, RACM would be different ! PRDROG(J,PAPI1) = 0. PRDROG(J,PAPI2) = 0. PRDROG(J,PAPI3) = 0. PRDROG(J,PLIM1) = 0. PRDROG(J,PLIM2) = 0. PRDROG(J,PLIM3) = 0. ENDDO RETURN END SUBROUTINE producn SUBROUTINE setdtc(jcs,jce,dtc,dtcmax,dtcmin,dt60,prod,loss,vc, & timenow ) implicit none REAL, PARAMETER :: huge=1.e10 ! .. Scalar Arguments .. REAL, intent(in) :: dt60, dtcmax, dtcmin, timenow INTEGER, intent(in) :: jce, jcs REAL, intent(in) :: loss(jcs:jce,lpred), & prod(jcs:jce,lpred), vc(jcs:jce,1,lspec) real, intent(inout) :: dtc ! .. ! .. ! .. Local Scalars .. INTEGER :: j, k, l ! .. ! .. Local Arrays .. REAL :: dtlsp(lspec), dum(jcs:jce) ! .. ! .. Intrinsic Functions .. INTRINSIC abs, max, min ! .. ! .. k = 1 DO l = 1, lspec dtlsp(l) = huge END DO DO l = 1, lpred IF (qdtc(l)==1) THEN DO j = jcs, jce dum(j) = prod(j,l) - loss(j,l) ! dum(j) = max(abs(dum(j)),epsilc) dum(j) = max(abs(dum(j)),1.e-30) dum(j) = .02*vc(j,1,l)/dum(j) ! DUM(J) = CVMGP(DUM(J),HUGE,VC(J,1,L)-epsilc*100.) IF (vc(j,1,l)-1.e-10>=0.) THEN dum(j) = dum(j) ELSE dum(j) = huge END IF END DO DO j = jcs, jce dtlsp(l) = min(dtlsp(l),dum(j)) END DO END IF END DO ! IF (dtc<=dtcmax*.9) THEN ! dtc = dtc*1.1 ! ELSE ! dtc = dtcmax ! END IF dtc = dtcmax DO l = 1, lpred IF (qdtc(l)==1) THEN IF (dtlsp(l)dt60) dtc = dt60 - timenow RETURN END SUBROUTINE setdtc SUBROUTINE chemin implicit none ! .. Scalar Arguments .. RETURN END SUBROUTINE chemin END MODULE module_radm