13 1 ozone_lut,atm_lut,coeff_lut,nsd,iair,iprin,ipsudo,ioptn,idust,
14 2 iaprof,iblyr,icld,nch,nt55,nrh,kset,ilam1,ilam2,isd1,isd2,
15 3 itau1,itau2,kznum,krhum,deltau,psrfc,ht_dust,sigma_dust,
16 4 pcldtop,pcldbtm,taum55,xlamb,c0,c1,c2,beta,rho,ppo,x101,
17 5 temp101,htdd,ppodd,dxdd,znpdd,nortau,ioznab,nrmww,
18 6 oqst,oqtt,oqst5,oqtt5)
20 include
'afrt_rt1.cmn'
25 integer*4 iair(3),krhum(ksd),iprin,ipsudo,ioptn,
26 1 idust,iaprof,iblyr,icld,nch,nt55,nrh,kset,ilam1,ilam2,
27 2 itau1,itau2,kznum,nortau,ioznab,nrmww,nsd
28 real*8 wvlth2,deltau,psrfc,ht_dust,sigma_dust,pcldtop,pcldbtm,nmnum
29 real*8 taum55(ktau),beta(klam),xlamb(klam),c0(klam),c1(klam),c2(klam
30 1 rho(klam),ppo(koznp),x101(koznp),temp101(koznp),
31 2 htdd(kmac),ppodd(kmac),dxdd(kmac),znpdd(kmac),watrdd(kmac)
32 real*8 oqst(ktau,ksd,klam),oqtt(ktau,ksd,klam),
33 1 oqst5(ktau,ksd,klam),oqtt5(ktau,ksd,klam)
34 character*255 infile,ozone_lut,atm_lut,coeff_lut,phsdir,outdir,tmat
36 character*90 tmata,tmat55a
38 character*2 dndex,endex,wwcc,krhc,ksetc
58 len1=
index(infile,
' ')-1
59 len2=
index(outdir,
' ')-1
60 len3=
index(phsdir,
' ')-1
61 len4=
index(ozone_lut,
' ')-1
62 len5=
index(atm_lut,
' ')-1
63 len6=
index(coeff_lut,
' ')-1
65 call getenv(
'RTDATA',root)
69 open(unit=4,file=infile(1:len1),status=
'old')
70 open(unit=7,file=ozone_lut(1:len4),status=
'old')
71 open(unit=8,file=atm_lut(1:len5),status=
'old')
72 open(unit=15,file=coeff_lut(1:len6),status=
'old')
80 read(4,1000)(iair(i),i=1,3)
93 if(idust.eq.0 .and. iaprof.eq.0 .and. iblyr.eq.0)
then
98 if(idust.ge.1 .and. iaprof.eq.1 .and. iblyr.eq.1)
then
104 if(idust.ge.1 .and. iblyr.eq.1)
then
114 read(4,1003)nch,nt55,nrh,kset
124 read(4,1065)ilam1,ilam2
125 read(4,1065)isd1,isd2
126 read(4,1065)itau1,itau2
131 read(4,1015)deltau,psrfc
136 read(4,1005)(taum55(i),i=1,nt55)
140 read(4,1018)(krhum(i),i=1,nrh)
149 read(4,1015)pcldtop,pcldbtm
168 read(15,*)kznum,xlamb(kz),c0(kz),c1(kz),c2(kz),
172 111
format(i5,1p6e11.3)
178 read(7,*)ppo(i),x101(i),temp101(i)
190 read (8,*) htdd(i),ppodd(i),dxdd(i),znpdd(i)
199 do 380 il=ilam1,ilam2,1
201 lambz=xlamb(il)*1.0d3+0.01
206 do 390 isd=isd1,isd2,1
207 ih = (isd-1)*nrh/nsd + 1
208 do 400 itau=itau1,itau2,1
211 call convtc(idnint(xlamb(il)*1.0d3+0.01),4,cndex)
214 call convtc(krhum(isd),2,krhc)
217 if( kset.eq.0)krhc=
'00'
219 tmata=
'phs_twl'//cndex//
'sd'//dndex//
'rh'//krhc
220 k04=
index(tmata,
' ')-1
221 tmat=tmata(1:k04)//
'_set'//ksetc//
'.dat'
223 tmat55a=
'phs_twl'//wwcc//
'sd'//dndex//
'rh'//krhc
224 k05=
index(tmat55a,
' ')-1
225 tmat55=tmat55a(1:k05)//
'_set'//ksetc//
'.dat'
227 ntm=
index(tmat,
' ')-1
228 n55=
index(tmat55,
' ')-1
230 oqst(itau,isd,il) = 1.0e-15
231 oqtt(itau,isd,il) = 1.0e-15
250 1005
format(1p10e11.4)
251 1015
format(1p4e15.5)
255 1095
format(i5,11x,i5)
256 1105
format(1x,
'input wavelength and phase matrix wavelength'
257 1
' do not match.'/1x,
'input wavelength=',1pe12.4,
258 2
'phase matrix wavelength=',1pe12.4)
259 1100
format(1p4e11.3,1p2e12.4)
266 1 iair,iprin,ipsudo,ioptn,idust,iaprof,iblyr,icld,nch,nt55,nsd,
267 2 nrh,kset,kznum,krhum,adeltau,psrfc,ht_dust,sigma_dust,
268 3 pcldtop,pcldbtm,taum55,xlamb,c0,c1,c2,beta,rho,ppo,x101,
269 4 temp101,htdd,ppodd,dxdd,znpdd,nortau,ioznab,nrmww,aqst,
270 5 aqtt,aqst5,aqtt5,ohtlvl,opplvl,ofr,ofn,ofa,oftot,odtrr,
271 6 odtmm,odtaa,odtot,otrp,otmp,otap,osalb,oturbhl,odx,ox,
272 7 otozn101,ohtdv,opdv,otaur,otaum,otaua,otau,owvlth,opsrfc,
273 8 orho,oozamtp,otautot,odtau1,onolyr,otcar,otwat,
274 9 otoznp,oifc,onmodl )
276 implicit real*8 (a-h,o-z)
277 include
'afrt_rt1.cmn'
279 integer*4 ailam,aitau,aisd,airh,iair(3),krhum(ksd),iprin,
280 1 ipsudo,ioptn,idust,iaprof,iblyr,icld,nch,nt55,nsd,nrh,kset,
281 2 kznum,nortau,ioznab,nrmww,nmsz,asd
282 real*8 adeltau,psrfc,ht_dust,sigma_dust,pcldtop,pcldbtm
283 real*8 taum55(ktau),beta(klam),xlamb(klam),c0(klam),c1(klam),c2(klam
284 1 rho(klam),ppo(koznp),x101(koznp),temp101(koznp),
285 2 htdd(kmac),ppodd(kmac),dxdd(kmac),znpdd(kmac),watrdd(kmac)
286 real*8 aqst,aqtt,aqst5,aqtt5,ohtlvl(klyr),opplvl(klyr),ofr(klyr),
287 1 ofn(klyr),ofa(klyr),oftot(klyr)
288 real*8 odtrr(klyr),odtmm(klyr),odtaa(klyr),odtot(klyr),
289 1 osalb(klyr),oturbhl(klyr),otrp,otmp,otap,
290 2 odx(koznp),ox(koznp),otozn101(koznp)
291 real*8 ohtdv(kdlvl),opdv(kdlvl),otaur(klyr),otaum(klyr),
292 1 otaua(klyr),otau(klyr),owvlth,opsrfc
293 real*8 orho,oozamtp,otautot,odtau1,otcar,otwat,otoznp
294 integer*4 onolyr,oifc,onmodl
296 real*8 ttozn(klam),th2o(klam),tco2(klam),ppod(kmac),htd(kmac),znp(kmac)
298 2 dtrr(klyr),dtmm(klyr),abozn(klam), dtaa(klyr),dtot(klyr),
299 3 temp1(klyr),temp2(klyr),xxd(kmacp),tozn101(koznp),xd(kmac)
300 real*8 wvlth,tr,tmt,ta,twat,tcar,rrho,oznabs,qst,qtt,
301 1 xozn,tautot,dtau1,tozn,p2km,h2km,cc0,cc1,cc2
302 real*8 fr(klyr),fn(klyr),fa(klyr),ftot(klyr),taur(klyr),
303 1 taum(klyr),taua(klyr),tauw(klyr),tauc(klyr),
304 2 tauozn(klyr),tau(klyr),lgppod(kmac),lgpdv(kdlvl),
305 3 htlvl(klyr),pplvl(klyr)
306 real*8 ht(kdlvl),hho(kdlvl),zpp(kdlvl),zppt(kdlvl),dnm(kdlvl)
307 integer*4 n,nm,ifc,nolyr,kndx,ndvsrf
309 character*255 outdir,out2,out3,out23,txt
310 character*90 out2a,out3a,out23a
312 character*2 dndex,endex,wwcc,krhc,ksetc
314 data root /
'$RTDATA'/
337 dx(i)=(x101(i+1)-x101(i))*1.0d-3
346 pdv(i)=1.0d0*dexp(a1*(nd-i)*(1.0d0+a2*(nd-i)))
354 if(pdv(i).ge.psrfc)
then
363 call cloud_prof(pcldtop,pcldbtm,ppodd,htdd,znpdd)
373 temp1(i)=dlog(ppodd(i))
375 call linear(h2km,htdd,temp1,nm,xlp2km)
376 p2km=dexp(xlp2km)/ppodd(1)
378 181
format(
'h2km,xlp2km,p2km',1p3e11.3)
379 diff=dabs(pdv(1)-p2km)
381 diffx=dabs(pdv(i)-p2km)
382 if(diffx.le.
diff)
then
395 ppod(i) = ppodd(k) / ppodd(1)
410 asd = mod(isd-1,nmsz) + 1
411 lambz=xlamb(il)*1.0d3+0.01
412 call convtc(lambz,4,cndex)
413 call convtc(idnint(xlamb(il)*1.0d3+0.01),4,cndex)
416 call convtc(krhum(isd),2,krhc)
421 if( kset.eq.0)krhc=
'00'
423 out2a=
'rt1_wl'//cndex//
'sd'//dndex//
'rh'//krhc
424 k01=
index(out2a,
' ')-1
425 out2=out2a(1:k01)//
'ta'//endex//
'_set'//ksetc//
'.out'
427 out3a=
'rt1_spwl'//cndex//
'sd'//dndex//
'rh'//krhc
428 k02=
index(out3a,
' ')-1
429 out3=out3a(1:k02)//
'ta'//endex//
'_set'//ksetc//
'.dat'
431 out23a=
'rt1_wl'//cndex//
'sd'//dndex//
'rh'//krhc
432 k03=
index(out23a,
' ')-1
433 out23=out23a(1:k03)//
'ta'//endex//
'_set'//ksetc//
'.dat'
435 n02=
index(out2,
' ')-1
436 n03=
index(out3,
' ')-1
437 n23=
index(out23,
' ')-1
439 len2=
index(outdir,
' ')-1
440 open(2,file=outdir(1:len2)//
'/'//out2(1:n02),status=
'unknown')
442 open(3,file=outdir(1:len2)//
'/'//out3(1:n03),status=
'unknown')
445 open(unit=23,file=outdir(1:len2)//
'/'//out23(1:n23),
450 wvlth=xlamb(il)/10000.0d0
461 if (iair(2) .eq. 1) ifc=1
462 if(taum55(itau).lt. 1.0d-6)ifc=0
474 if (iair(2) .ne. 1)
go to 90
478 dwv=dabs(wvlth2-wvlth)
479 if(dwv .ge.1.0e-8)
then
480 write(2,1105)wvlth,wvlth2
481 write(*,1105)wvlth,wvlth2
485 tmt=(qtt/qtt5)*taum55(itau)
486 write (2,1165) qtt5,qst5
487 write (2,1170) qtt,qst
488 write(2,1175)taum55(itau),tmt
489 write(2,1177)wvlth*1.0d4
494 write(2,1177)wvlth*1.0d4
504 call tauint( itau,isd,ih,il,ifc,iair,iprin,ipsudo,ioptn,idust,iaprof
505 1 iblyr,icld,nd,nm,ndvsrf,psrfc,deltau,qst,qtt,tmt,znp,zpp,
506 2 pdv,fr,fn,fa,ftot,tau,taum,taua,taur,tauw,tauc,tauozn,ppod,lgppod
507 3 x,dx,xd,dxd,htlvl,pplvl,htd,dtrr,dtmm,dtaa,dtot,htdv,tr,tcar,wvlth
508 4 ohtlvl,opplvl,ofr,ofn,ofa,oftot,odtrr,odtmm,odtaa,odtot,osalb,
509 5 oturbhl,otrp,otmp,otap,odx,ox,temp101,x101,ppo,otozn101,ohtdv,
510 6 opdv,otaur,otaum,otaua,otau,owvlth,opsrfc,orho,oozamtp,otautot,odtau1
511 7 onolyr,otcar,otwat,otoznp,oifc,onmodl,aqst,aqtt,aqst5,aqtt5 )
523 1022
format(t5,
'wvlth',t17,
'psrfc',t29,
'rho',t41,
'xozn',t53,
'tautot',
524 1 t65,
'deltau',t74,
'nolyr')
525 1023
format(1p6e12.4,i4)
526 1024
format(t5,
'tr',t17,
'tmt',t29,
'ta',t41,
'tcar',t53,
'twat',
527 1 t65,
'tozn',t75,
'ifc')
528 1025
format(1p6e12.4,i4)
529 1026
format(t3,
'no',t9,
'dtrr',t21,
'dtmm',t33,
'dtaa',t45,
'dtot')
530 1027
format(i4,1p4e12.4)
533 1040
format (/t5,
'radiative transfer calculations based on',
534 1
' the clear atmosphere model')
535 1050
format (/t5,
'radiative transfer calculations based on',
536 1
' the thin cloud model')
537 1060
format(4e15.5,2i5)
540 1095
format(i5,11x,i5)
541 1105
format(1x,
'input wavelength and phase matrix wavelength'
542 1
' do not match.'/1x,
'input wavelength=',1pe12.4,
543 2
'phase matrix wavelength=',1pe12.4)
544 1100
format(1p4e11.3,1p2e12.4)
545 1120
format(1p2d18.12,1p2d19.12,0pf6.2)
546 1130
format(i4,25f4.1)
547 1140
format(i4,10f4.2)
548 1165
format(
'volume extinction coefficient (550 nm)',t40,
'=',1pe15.5,
549 1
'(cm-1)'/
'volume scattering coefficient (550 nm)', t40,
'=',
550 2 1pe15.5,
'(cm-1)' / )
551 1170
format(
'volume extinction coefficient',t40,
'=',1pe15.5,
552 1
'(cm-1)' /
'volume scattering coefficient', t40,
'=',
553 2 1pe15.5,
'(cm-1)' / )
554 1175
format(
'aerosol opt. thickness (550 nm)=',1pe15.5/
555 1
'aerosol opt. thickness =',1pe15.5)
556 1176
format(
'aerosol opt. thickness =',1pe15.5)
557 1177
format(
'wavelength (um) =',1pe15.5)
558 1180
format(4d18.10,5x,i3)
559 1220
format(f5.0,4d12.4)
560 1230
format(5x,f5.1,3f10.3)
564 subroutine tauint(itau,isd,ih,il,ifc,iair,iprin,ipsudo,ioptn,idust,iaprof,
565 1 iblyr,icld,nd,nm,ndvsrf,psrfc,deltau,qst,qtt,tmt,znp,zpp,
566 2 pdv,fr,fn,fa,ftot,tau,taum,taua,taur,tauw,tauc,tauozn,ppod,
567 3 lgppod,lgpdv,x,dx,xd,dxd,htlvl,pplvl,htd,dtrr,dtmm,dtaa,
568 4 dtot,htdv,tr,tcar,wvlth,rrho, ohtlvl,opplvl,ofr,ofn,ofa,
569 5 oftot,odtrr,odtmm,odtaa,odtot,osalb,oturbhl,otrp,otmp,otap,odx,ox,
570 6 temp101,x101,ppo,otozn101,ohtdv,opdv,otaur,otaum,otaua,otau,owvlth,
571 7 opsrfc,orho,oozamtp,otautot,odtau1,onolyr,otcar,otwat,
572 8 otoznp,oifc,onmodl,aqst,aqtt,aqst5,aqtt5 )
580 include
'afrt_rt1.cmn'
582 integer*4 itau,isd,ih,il,nd,ndvsrf,n,nm,ifc,nolyr,kndx,
583 1 iair(3),krhum(ksd),iprin,ipsudo,ioptn,idust,iaprof,iblyr,icld
584 real*8 temp101(koznp),x101(koznp),ppo(koznp),aqst,aqtt,aqst5,tmt,
585 1 aqtt5,ohtlvl(klyr),opplvl(klyr),ofr(klyr),ofn(klyr),ofa(klyr
586 2 oftot(klyr),psrfc,deltau,qst,qtt,tr,wvlth,rrho
587 real*8 odtrr(klyr),odtmm(klyr),odtaa(klyr),odtot(klyr),znp(kmac),
588 1 zpp(kdlvl),osalb(klyr),oturbhl(klyr),otrp,otmp,otap,
589 2 odx(koznp),ox(koznp),otozn101(koznp)
590 real*8 ohtdv(kdlvl),opdv(kdlvl),otaur(klyr),otaum(klyr),
591 1 otaua(klyr),otau(klyr),owvlth,opsrfc
592 real*8 orho,oozamtp,otautot,odtau1,otcar,otwat,otoznp,pp,pplg,argi
593 integer*4 onolyr,oifc,onmodl
594 real*8 pdv(kdlvl),fr(klyr),fn(klyr),fa(klyr),ftot(klyr),tau(klyr),
595 1 taum(klyr),taua(klyr),taur(klyr),tauw(klyr),tauc(klyr),
596 2 tauozn(klyr),ppod(kmac),lgppod(kmac),lgpdv(kdlvl),x(koznp),
597 3 dx(kozn),xd(kmac),dxd(kmac),htlvl(klyr),pplvl(klyr),htd(kmac)
618 lgppod(i)=dlog(ppod(i))
623 lgpdv(i)=dlog(pdv(i))
626 if (iair(3).eq.1)
then
636 denm=dlog(dxd(1)/dxd(2))
637 o3h=-(htd(1)-htd(2))/denm
638 xd(1)=o3h*(1.0d+3*dxd(1)/2.1429d-2)
641 xd(i+1)=xd(i)+0.5d0*1.0d+3*(htd(i)-htd(i+1))*
642 1 (dxd(i)+dxd(i+1))/2.1429d-2
653 write (2,1070) ozamtp
660 x(i+1) = x(i) + dx(i)
670 write (2,1070) ozamtp
684 call co2(tcar,pdv,tauc,nd)
687 taua(i)=tauozn(i)+tauw(i)+tauc(i)
690 198
format(
'tauc',1p6e11.3)
692 199
format(
'taua',1p6e11.3)
699 if (iair(2).eq.1)
then
700 if(idust.ge.1 .or. iaprof.eq.1)
then
701 call part1(nm,pdv,ppod,htd,znp,zpp,qtt,tmt,taum)
704 call part2(nm,pdv,ppod,htd,znp,zpp,qtt,tmt,taum)
708 if (iair(1).eq.1)
then
710 taur(i) = tr * pdv(i)
715 tau(i)=taum(i)+taur(i)+taua(i)
718 call linear (lgpdv(i),lgppod,htd,nm,htdv(i))
727 write(3,115)i,htdv(i),pdv(i),taur(i),taum(i),taua(i),tau(i)
738 if(tau(nd).lt.0.02d0)
then
742 if(ioptn.le.0 .or. ioptn.gt.4)ioptn=0
747 dtau1=tau(nd)/dfloat(ntau)
757 if(taur(nd).gt.0.0d0)fr(1)=1.0d-10
758 if(taum(nd).gt.0.0d0)fn(1)=1.0d-10
759 if(taua(nd).gt.0.0d0)fa(1)=1.0d-10
760 if(ifc.eq.0)fn(1)=0.0d0
764 ftot(1)=fr(1)+fn(1)+fa(1)
768 call linear (argi,tau,pdv,nd,pp)
771 call linear (pplg,lgpdv,htdv,nd,htlvl(i+1))
772 if(htlvl(i+1).lt.0.0d0)htlvl(i+1)=0.0d0
773 if (iair(1).eq.1)
call linear (pp,pdv,taur,nd,fr(i+1))
774 if (iair(2).eq.1)
call linear (pp,pdv,taum,nd,fn(i+1))
775 if (iair(3).eq.1)
call linear (pp,pdv,taua,nd,fa(i+1))
776 ftot(i+1)=fr(i+1)+fn(i+1)+fa(i+1)
777 write (2,1110)i,htlvl(i),pplvl(i),fr(i),fn(i),fa(i),ftot(i)
787 write (2,1110)ntaup,htlvl(ntaup),pplvl(ntaup),fr(ntaup),
788 1 fn(ntaup),fa(ntaup),ftot(ntaup)
790 ohtlvl(ntaup) = htlvl(ntaup)
791 opplvl(ntaup) = pplvl(ntaup)
792 ofr(ntaup) = fr(ntaup)
793 ofn(ntaup) = fn(ntaup)
794 ofa(ntaup) = fa(ntaup)
795 oftot(ntaup) = ftot(ntaup)
811 pplvl(k)=1.0d0*dexp(a1*(kdlvl-i)*(1.0d0+a2*(kdlvl-i)))
812 if(pplvl(k).gt.psrfc)
then
826 if(taur(nd).gt.0.0d0)fr(1)=1.0d-10
827 if(taum(nd).gt.0.0d0)fn(1)=1.0d-10
828 if(taua(nd).gt.0.0d0)fa(1)=1.0d-10
829 if(ifc.eq.0)fn(1)=0.0d0
832 ftot(1)=fr(1)+fn(1)+fa(1)
833 write (2,1110)il,htlvl(1),pplvl(1),fr(1),fn(1),fa(1),ftot(1)
845 call linear (pplg,lgpdv,htdv,nd,htlvl(i))
846 if (iair(1).eq.1)
call linear (pp,pdv,taur,nd,fr(i))
847 if (iair(2).eq.1)
call linear (pp,pdv,taum,nd,fn(i))
848 if (iair(3).eq.1)
call linear (pp,pdv,taua,nd,fa(i))
849 ftot(i)=fr(i)+fn(i)+fa(i)
850 write (2,1110)i,htlvl(i),pplvl(i),fr(i),fn(i),fa(i),ftot(i)
864 dtrr(i) = fr(i+1) - fr(i)
865 dtmm(i) = fn(i+1) - fn(i)
866 dtaa(i) = fa(i+1) - fa(i)
867 if(dtrr(i).lt.0.0d0)dtrr(i)=0.0d0
868 if(dtmm(i).lt.0.0d0)dtmm(i)=0.0d0
869 if(dtaa(i).lt.0.0d0)dtaa(i)=0.0d0
884 tots = dtrr(i) + dtmm(i)*
const
885 dtot(i) = dtrr(i) + dtmm(i) + dtaa(i)
887 turbhl=(dtmm(i)*
const)/tots
888 write (2,1210) i,pplvl(i+1),dtrr(i),dtmm(i),dtaa(i),dtot(i),
891 opplvl(i) = pplvl(i+1)
901 tautot = trp + tmp + tap
903 write(2,1230)trp,tmp,tap,tautot
911 write(23,1023)wvlth,psrfc,rrho,ozamtp,tautot,dtau1,nolyr
922 write(23,1025)trp,tmp,tap,tcar,twat,toznp,ifc
934 write(23,1027)i,htlvl(i+1),pplvl(i+1),dtrr(i),dtmm(i),
937 ohtlvl(i) = htlvl(i+1)
938 opplvl(i) = pplvl(i+1)
950 115
format(i4,1x,1p6e12.4)
951 121
format(t1,
'tot_lvl')
953 128
format(t3,
'lvl',t9,
'ht(km)',t21,
'p(atm)',t33,
'taur',t45,
'taum',
954 1 t57,
'taua',t69,
'tau_tot')
955 1000
format (15x,
'total optical thickness at 3.6 km = ',1pe15.4/
956 1 15x,
'new dtau=',1pe15.4/ 15x,
'new no. of layers=',i5//)
957 1010
format(/,10x,
'number of layers above the cloud = ',i5,10x,
958 1
'layer thickness = ',f10.6)
959 1011
format(/,10x,
'number of layers below the cloud = ',i5,10x,
960 1
'layer thickness = ',f10.6)
961 1012
format(/,10x,
'number of layers in the cloud = ',i5,10x,
962 1
'layer thickness = ',f10.6)
963 1015
format (1x,t50,
'clear atmosphere')
964 1016
format (1x,t50,
'thin cloud')
965 1017
format (1x,t50,
'thick cloud')
966 1020
format (/,t50,
'cumulative optical thicknesses'///t11,
967 1
'press.',t27,
'rayleigh', t47,
'mie',t67,
'ozone',t87,
'total'/
969 1022
format(t5,
'wvlth',t17,
'psrfc',t29,
'rho',t41,
'xozn',t53,
'tautot',
970 1 t65,
'deltau',t74,
'nolyr')
971 1023
format(1p6e12.4,i4)
972 1024
format(t5,
'tr',t17,
'tmt',t29,
'ta',t41,
'tcar',t53,
'twat',
973 1 t65,
'tozn',t75,
'ifc')
974 1025
format(1p6e12.4,i4)
975 1026
format(t3,
'no',t9,
'htl_b',t21,
'pl_b',t33,
'dtrr',t45,
'dtmm',
976 1 t57,
'dtaa',t69,
'dtot')
977 1027
format(i4,1p6e12.4)
978 1030
format (5x,
'delta tau =',1pe15.5,5x,
'no. of layers =',i3/)
979 1040
format (
'interpolated values of press and',
980 1
' tau(rayleigh) etc. corresponding to'/
'delta tau=',1pe15.5//
981 2 t10,
'height',t23,
'press.',t31,
'tau(rayleigh)',t46,
'tau(mie)',t56
982 3
'tau(ozone)',t68,
'tau(tot)'/t10,
'(in km)',t22,
'(in atm)'/)
983 1050
format (
'values of tau(rayleigh) etc. in full and half layers'/
984 1
'(the first and the last layer are half layers)'/)
985 1060
format (//t15,
'division of atmosphere into layers of equal optical
986 1 thickness for pupose of calculating radiative transfer:'//)
987 1070
format (15x,
'total ozone(top to psrfc) in atm-cm',1pe15.5/)
988 1080
format (i4,1x,1p6e12.4)
989 1090
format (i3,2x,1p4e11.3,0pf8.4)
990 1100
format (t2,
'no',t8,
'dtau(ray)',t19,
'dtau(mie)',t30,
991 1
' dtau(o3)',t41,
'dtau(tot)',t53,
'turb'/)
992 1110
format (i4,1x,1p6e12.4)
995 1140
format (t10,
'sum of the total dtau = ',f10.5,
996 1 /t10,
'sum of the total dtaur = ', f10.5,
997 2 /t10,
'sum of the total dtaum(scat.)= ', f10.5,
998 3 /t10,
'sum of the total dtaua = ', f10.5)
999 1190
format(/t5,
'values of tau(rayleigh ) etc. in each layer'/)
1000 1200
format(t2,
'no',t6,
'press(atm)'t17,
'dtau(ray)',t28,
1001 1
'dtau(mie)',t39,
'dtau(o3)',t49,
' dtau(tot)',
1002 2 t60,
'alb_sscat',t71,
'turb'/)
1003 1210
format(i3,1p5e11.3,0p2f8.4)
1004 1230
format(/t10,
'tau_r =',e12.4/t10,
'tau_m =',e12.4/
1005 1 t10,
'tau_a =',e12.4/t10,
'tau_t =',e12.4)
1010 subroutine part2(nm,pdv,ppod,htd,znp,zpp,qtt,tmt,taum)
1012 include
'afrt_rt1.cmn'
1013 real*8 sumxx(nsc+1),hxx(nsc+1),e(nsc+1),u(nsc+1)
1014 real*8 ttozn(klam),th2o(klam),tco2(klam),ppod(kmac),htd(kmac),znp(kmac
1015 1 dxd(kmac),watr(kmac),dx(kozn),x(koznp),pdv(kdlvl),htdv(kdlvl
1016 2 dtrr(klyr),dtmm(klyr),abozn(klam), dtaa(klyr),dtot(klyr),
1017 3 temp1(klyr),xxd(kmacp),tozn101(koznp),xd(kmac),temp2(klyr)
1018 real*8 wvlth,tr,tmt,ta,twat,tcar,rrho,oznabs,qst,qtt,
1019 1 xozn,tautot,dtau1,tozn,p2km,h2km,cc0,cc1,cc2
1020 real*8 fr(klyr),fn(klyr),fa(klyr),ftot(klyr),taur(klyr),
1021 1 taum(klyr),taua(klyr),tauw(klyr),tauc(klyr),
1022 2 tauozn(klyr),tau(klyr),lgppod(kmac),lgpdv(kdlvl),
1023 3 htlvl(klyr),pplvl(klyr)
1024 real*8 ht(kdlvl),hho(kdlvl),zpp(kdlvl),zppt(kdlvl),dnm(kdlvl)
1025 integer*4 n,nm,ifc,nolyr,kndx,ndvsrf,ndv
1034 if(pdv(i).ge.ppod(j) .and. pdv(i).lt.ppod(j+1))
then
1035 xn1=dlog(pdv(i))-dlog(ppod(j))
1036 xd1=dlog(ppod(j+1))-dlog(ppod(j))
1037 hho(i)=htd(j)+(xn1/xd1)*(htd(j+1)-htd(j))
1038 prod1=(hho(i)-htd(j))/(htd(j+1)-htd(j))
1039 zpp(i)=znp(j)*(znp(j+1)/znp(j))**prod1
1045 226
format(
'i,pdv,hho,zpp',i3,1x,1p3e11.3)
1053 dnm(i)=0.5d0*(zpp(i)+zpp(i+1))*(hho(i)-hho(i+1))*1.0d+5
1054 zppt(i+1)=zppt(i)+dnm(i)
1056 151
format(
'integrated # of part i+1,zppt(i+1)',i3,1pe11.3)
1066 if(tmt.le.10.0d0)
then
1073 taum(i) = c * zppt(i) * qtt
1087 119
format(
'i,zppt(i),taum(i)',i3,1x,1p2e11.3)
1094 yn2b=zppt(ndv)-zppt(kndx)
1098 h0=2.0d0/(dlog(znp(nm)/znp(nm-2)))
1107 zpp(j)=zpp(kndx)*dexp((hho(kndx)-hho(j))/hx)
1108 dnm(j-1)=0.5d0*(zpp(j-1)+zpp(j))*(hho(j-1)-hho(j))*1.0d+5
1109 sum2x=sum2x+dnm(j-1)
1111 if(sum2x.gt.xn2b)
then
1117 if(hx.lt.0.10d0)
then
1119 600
format(
'the value of the aerosol scale height is less',
1120 1
' than 0.10',1pe11.3)
1129 dhx=(hg-hl)/dfloat(nsc)
1135 zpp(j)=zpp(kndx)*dexp((hho(kndx)-hho(j))/hx)
1136 dnm(j-1)=0.5d0*(zpp(j-1)+zpp(j))*(hho(j-1)-hho(j))*
1138 sum2x=sum2x+dnm(j-1)
1149 call spline(xn2b,sumxx,hxx,nscp,in,hxz,il,iu,vl,vu,e,u)
1152 zpp(j)=zpp(kndx)*dexp((hho(kndx)-hho(j))/hxz)
1153 dnm(j-1)=0.5d0*(zpp(j-1)+zpp(j))*(hho(j-1)-hho(j))*
1155 zppt(j)=zppt(j-1)+dnm(j-1)
1167 subroutine water(twat,pdv,watr,ppod,ht,nm,ndv,tauw)
1169 implicit real*8 (a-h,o-z)
1170 real*8 pdv(1000),watr(1000),ppod(1000),tauw(1000),u(1000)
1171 real*8 dts(1000),dt(1000),tauww(1000),e(1000),ht(1000)
1176 watr(i)=watr(i)*1.0d-1
1183 tp = tp + (watr(i)+watr(i+1))/2.0d0
1192 dts(i) = c * watr(i)
1195 dt(i) = (dts(i+1) + dts(i)) / 2.0d0
1200 tauww(i+1) = tauww(i) + dt(i)
1207 call spline (pdv(i),ppod,tauww,nm,in,tauw(i),il,iu,vl,vu,e,u)
1209 if(tauw(i).lt.0.0d0 .and. ttww.lt.1.0d-8)
then
1218 include
'afrt_rt1.cmn'
1220 real*8 ee(klyr),uu(klyr)
1221 real*8 ppod(kmac),pdv(kdlvl),tauozn(klyr),oznabs
1228 call spline(pdv(i),ppod,xd,n,in,tempo3,il,iu,vl,vu,ee,uu)
1229 tauozn(i)=tempo3*oznabs
1236 subroutine co2(tcar,pdv,tauc,ndv)
1238 implicit real*8 (a-h,o-z)
1239 include
'afrt_rt1.cmn'
1241 real*8 pdv(kdlvl),tauc(kdlvl)
1254 subroutine linear(xp,x,y,n,yp)
1259 implicit real*8 (a-h,o-z)
1276 slope=(y(ih)-y(il))/(x(ih)-x(il))
1277 yp=y(il)+slope*(xp-x(il))
1284 subroutine part1(nm,pdv,ppod,htd,znp,zpp,qtt,tmt,taum)
1286 include
'afrt_rt1.cmn'
1288 real*8 oznabs,qtt,tmt
1289 real*8 ppod(kmac),htd(kmac),znp(kmac),taum(klyr),pdv(kdlvl)
1290 real*8 ht(kdlvl),hho(kdlvl),zpp(kdlvl),zppt(kdlvl),dnm(kdlvl)
1298 if(pdv(i).ge.ppod(j) .and. pdv(i).lt.ppod(j+1))
then
1299 xn1=dlog(pdv(i))-dlog(ppod(j))
1300 xd1=dlog(ppod(j+1))-dlog(ppod(j))
1301 hho(i)=htd(j)+(xn1/xd1)*(htd(j+1)-htd(j))
1302 prod1=(hho(i)-htd(j))/(htd(j+1)-htd(j))
1303 if(znp(j).gt.0.0)
then
1304 zpp(i)=znp(j)*(znp(j+1)/znp(j))**prod1
1313 226
format(
'i,pdv,hho,zpp',i3,1x,1p3e11.3)
1320 dnm(i)=0.5d0*(zpp(i)+zpp(i+1))*(hho(i)-hho(i+1))*1.0d+5
1321 zppt(i+1)=zppt(i)+dnm(i)
1333 taum(i) = c * zppt(i) * qtt
1343 include
'afrt_rt1.cmn'
1345 real*8 znpdd(kmac),htdd(kmac)
1352 if(htdd(i).le.top_cld .and. htdd(i).gt.btm_cld)
then
1360 znpdd(i)=exp(-0.5d0*((htdd(i)-ht_dust)/sigma_dust)**2)
1369 include
'afrt_rt1.cmn'
1371 real*8 ee(klyr),uu(klyr),temp101(koznp),ppo(koznp),tozn101(koznp),
1372 1 tauozn(klyr),dx(kozn),x(kozn),pdv(kdlvl)
1383 alfatemp=cc0+cc1*(temp101(1)-273.16)+
1384 1 cc2*(temp101(1)-273.16)**2.0
1385 tozn101(1)=alfatemp*dx(1)
1388 alfatemp=cc0+cc1*(0.5d0*(temp101(i)+temp101(i+1))-273.16)+
1389 1 cc2*(0.5d0*(temp101(i)+temp101(i+1))-273.16)**2.0
1390 tozn101(i)=tozn101(i-1)+alfatemp*dx(i)
1397 write(2,100)j,ppo(j),dx(j),x(j),tozn101(j)
1398 100
format(
'i,ppo,dx,x,tozn101',i4,1x,1p4e11.3)
1401 call spline(pdv(i),ppo,tozn101,n,in,tauo3z,il,iu,vl,vu,ee,uu)
1410 subroutine cloud_prof(pcldtop,pcldbtm,ppodd,htdd,znpdd)
1412 implicit real*8 (a-h,o-z)
1413 include
'afrt_rt1.cmn'
1415 real*8 ppodd(kmac),znpdd(kmac),htdd(kmac),pcldtop,pcldbtm,hcldtop,
1416 1 hcldbtm,temp1(klyr),temp2(klyr),qxldtoplg,qcldbtmlg
1426 temp1(i)=dlog(ppodd(k))
1429 qcldtop=(pcldtop*1.0d3)
1430 qcldbtm=(pcldbtm*1.0d3)
1431 qcldtoplg=dlog(qcldtop)
1432 qcldbtmlg=dlog(qcldbtm)
1433 call linear(qcldtoplg,temp1,temp2,nm,hcldtop)
1434 call linear(qcldbtmlg,temp1,temp2,nm,hcldbtm)
1438 diff=dabs(ppodd(1)-qcldtop)
1441 diffx=dabs(ppodd(i)-qcldtop)
1442 if(diffx.le.
diff)
then
1448 diff=dabs(ppodd(1)-qcldbtm)
1450 diffx=dabs(ppodd(i)-qcldbtm)
1451 if(diffx.le.
diff)
then
1462 if(i.ge.kmdx .and. i.le.kndx)znpdd(i)=1.0d0