9 1 aitrans,aiset,airh1,airh2,ailm1,ailm2,aisd1,aisd2,aitau1,aitau2,
10 2 aithe01,aithe02,aiwnd1,aiwnd2,anx,anthe0,anwl,anrh,ansd,aiww,akrhum,aiprin,
11 3 aipol,anpass1,anpass2,aicrft,aiactflx,aisurf,aiglint,aiocn,aifoam,
12 4 aiwatr,aiconc,adtheta,adphi,ahcrft,arx,athe0in,awwl,aalbwat,
13 5 aifunc,amfunc,arefr,arefi,armin,armax,adelr,adelx,arg,asig,anpar,
14 6 ar11,ar22,ar33,ar44,areff,aveff,accn,absr,
15 7 asalb,aasf,aqscat,aqext,at,athd,
16 8 axr,axi,av,athcel,aphcel,atxx,apti,awvlth,apsrfc,arrho,
17 9 axozn,atautot,adeltau,atrp,atmp,atap,atcar,atwat,atozn,
18 * ahtlvl,applvl,adtrr,adtmm,adtaa,adtot,ahtdv,apdv,
19 * ataur,ataum,ataua,aifc,anmodl,anolyr,aipsudo,abfr,
20 * otma,otmb,otmc,otmfd,otmfu,otms,otmg,otmh,otmp,otmq,otmt,otmpp,otmqq,
21 * otmrr,otmss,otransm,otmcfd,otmcfu,otmf1,otmf2,oxzeroz,oxzerod,otupz,
26 implicit real*8 (a-h,o-z)
27 include
'afrt_rt2.cmn'
29 integer*4 ailm,airh,aisd,aitau,aiwnd,aifc,anmodl,anolyr,
30 1 aiww(nwnd),akrhum(nw),aifunc,amfunc,aipsudo
31 integer*4 airef,aiprin,aipol,anpass1,anpass2,ailm1,ailm2,aisd1,aisd2
35 real*8 ar11,ar22,ar33,ar44,areff,aveff,accn,absr,asalb,aasf,
36 1 arefr(nmd),arefi(nmd),armin(nmd),armax(nmd),
37 2 adelr(nmd),adelx(nmd),arg(nmd),asig(nmd),anpar(nmd),
38 3 aqscat,aqext,at(ntf,nstk),athd(ntf),atxx(ntrx,nph,nth,nsz)
41 6 ahtlvl(nlyr),applvl(nlyr),adtrr(nlyr),adtmm(nlyr),
42 7 adtaa(nlyr),adtot(nlyr),ahtdv(nlyr),apdv(nlyr),
43 8 ataur(nlyr),ataum(nlyr),ataua(nlyr)
44 real*8 axr,axi,av,athcel,aphcel,xxx,zzz
45 real*8 adtheta,adphi,ahcrft,totl(1000),dtotl(1000)
46 real*8 arx(nph),athe0in(nsz),awwl(nw),aalbwat(nwnd)
48 real*8 otma(nsz),otmb(nsz),otmc(nsz),otmfd(nsz),otmfu(nsz),otms(nsz
49 1 otmg(nsz),otmh(nsz),otmp(nsz),otmq(nsz),otmt(nsz),otmpp(nsz),
50 2 otmqq(nsz),otmrr(nsz),otmss(nsz),otransm(nth),otmcfd(nsz),otmcfu
51 3 otmf1(nlyr,nsz),otmf2(nlyr),oxzeroz(nstk,nph,nth,nsz),
52 4 oxzerod(nstk,nph,nth,nsz),otupz(nstk,nph,nth,nsz),
53 5 otdwnz(nstk,nph,nth,nsz),oradocn(nph,nth,nsz)
58 real*8 glint_tmp(4,2*nsz,nph)
59 real*4 ee(2),qspp(2*nsz)
60 character*255 odir,xname1,xname2
63 character*2 citau,crh,cset
64 character*2 cisd,cilmd,cwind
156 the0in(:) = athe0in(:)
158 albwat(:) = aalbwat(:)
180 txx(:,:,:,:) = atxx(:,:,:,:)
256 bfr1(34)=float(ipsudo)
257 bfr1(41)=dfloat(ifoam)
258 bfr1(42)=dfloat(iwatr)
261 bfr1(45)=dfloat(iref)
264 bfr1(48)=dfloat(ifunc)
265 bfr1(49)=dfloat(mfunc)
288 len=
index(odir,
' ')-1
289 call convtc(idnint(awwl(ilm)*1.0d3+0.01),4,cilm)
291 iisd = mod(isd-1,ansd/anrh) + 1
294 call convtc(iwnd-1,2,ciwind)
297 call convtc(krhum(isd),2,crh)
300 if(iref.eq.1)ciwind=
'00'
301 if(iref.eq.0)ciwind=
'99'
302 if(iset.eq.0)crh=
'00'
304 xname1=
'rt2_wl'//cilm//
'x'//ciwind
305 xname2=
'sd'//cisd//
'rh'//crh//
'ta'//citau//
'_set'//cset
306 nm1=
index(xname1,
' ')-1
307 nm2=
index(xname2,
' ')-1
309 1 odir(1:len)//
'/'//xname1(1:nm1)//xname2(1:nm2)//
'dn.dat',
312 1 odir(1:len)//
'/'//xname1(1:nm1)//xname2(1:nm2)//
'up.dat',
315 1 odir(1:len)//
'/'//xname1(1:nm1)//xname2(1:nm2)//
'.dat',
316 2 access=
'direct',recl=1915*4,
317 3 form=
'unformatted',status=
'unknown',convert=
'big_endian')
321 1 odir(1:len)//
'/'//xname1(1:nm1)//xname2(1:nm2)//
'crftdn.dat'
324 1 odir(1:len)//
'/'//xname1(1:nm1)//xname2(1:nm2)//
'crftup.dat'
327 1 odir(1:len)//
'/'//xname1(1:nm1)//xname2(1:nm2)//
'crft.dat',
328 2 access=
'direct',recl=1915*4,
329 3 form=
'unformatted',status=
'unknown',convert=
'big_endian')
334 1 odir(1:len)//
'/'//xname1(1:nm1)//xname2(1:nm2)//
'flx.dat'
340 1 odir(1:len)//
'/'//xname1(1:nm1)//xname2(1:nm2)//
'surfup.dat',
344 1 odir(1:len)//
'/'//xname1(1:nm1)//xname2(1:nm2)//
'dirup.dat',
347 1 odir(1:len)//
'/'//xname1(1:nm1)//xname2(1:nm2)//
'ocnup.dat',
350 1 odir(1:len)//
'/'//xname1(1:nm1)//xname2(1:nm2)//
'skyup.dat',
355 open(53,access=
'direct',
357 1 form=
'unformatted',status=
'scratch',recl=18400*4)
358 open(54,access=
'direct',
359 1 form=
'unformatted',status=
'scratch',recl=18400*4)
360 open(55,access=
'direct',
361 1 form=
'unformatted',status=
'scratch',recl=18400*4)
362 open(64,access=
'direct',
363 1 form=
'unformatted',status=
'scratch',recl=18400*4)
364 open(65,access=
'direct',
365 1 form=
'unformatted',status=
'scratch',recl=18400*4)
366 open(71,access=
'direct',
367 1 form=
'unformatted',status=
'scratch',recl=18400*4)
368 open(72,access=
'direct',
369 1 form=
'unformatted',status=
'scratch',recl=18400*4)
372 open(73,access=
'direct',
373 1 form=
'unformatted',status=
'scratch',recl=18400*4)
374 open(74,access=
'direct',
375 1 form=
'unformatted',status=
'scratch',recl=18400*4)
393 conr=3.0d0/(8.0d0*
pi)
395 do ksza=ithe01,ithe02,1
421 cmu(i)=dcos(rmu(i)*conv)
424 xmu = (rmu(i)+rmu(i+1))/2.0d0
427 the(i)=the(nmum1-i+1)
429 if(dabs(xmu-rmuo).le.1.0d-3)
then
433 cosmu(i)=dcos(xmu*conv)
434 sinmu(i)=dsin(xmu*conv)
437 phi(l)=(l-1.0d0)*dphi
446 dcmusq(i)=(cmu(i)**2-cmu(i+1)**2)/2.d0
447 dcmu(i) = cmu(i) - cmu(i+1)
450 call hdrmds(ithe01,ithe02,ebfr1)
455 call spathz(amuo,htp,taur,taum,tauabs,totsp,nmodl)
460 call hump (
const,t,pp,nmum1,dphi+0.001d0,rmu,thd,0,nmum1+1)
461 call hump (
const,t,qq,nmum1,dphi+0.001d0,rmu,thd,1,nmum1+1)
471 taupl(i+1)=taupl(i)+dtot(i)
477 call spline(pl(i),ppo,totsp,nmodl,1,totl(i),1,1,vl,vu,e
480 dtotl(i)=totl(i+1)-totl(i)
485 efact(i)=dexp(-(0.5d0*dtotl(i)+totl(i)))
486 efactb(i+1)=dexp(-totl(i+1))
488 eo(1)=0.5d0*dexp(-totl(nolyr+1))
489 eo(2)=0.5d0*dexp(-totl(nolyr+1))
494 totl(i+1)=totl(i)+dtot(i)
495 efact(i)=dexp(-(0.50d0*dtot(i)+taupl(i))/amuo)
496 efactb(i+1)=dexp(-taupl(i+1)/amuo)
498 eo(1)=0.5d0*dexp(-taupl(nolyr+1)/amuo)
499 eo(2)=0.5d0*dexp(-taupl(nolyr+1)/amuo)
503 emdtm(i,j)=dexp(-dtot(i)/dabs(cosmu(j)))
504 emtm(i,j)=dexp(-(totl(i+1)-0.5d0*dtot(i))/dabs(cosmu(j)
509 atnflx(i,j)=dexp(-totl(i)/dabs(cosmu(j)))
516 agm=(1.0-gam)/(1+2.0*gam)
517 bgm=gam/(1.0+2.0*gam)
518 cgm=(1.0-3.0*gam)/(1.0+2.0*gam)
537 ppin(k,i,ii,kk)=p(k,i)
548 xfot=
const*(ee(1)*(ppin(1,m,i,k)+ppin(5,m,i,k)
549 1 ee(2)*(ppin(2,m,i,k)+ppin(6,m,i,k)
550 if(m.eq.1.or.m.eq.jpart)
then
553 qspp(i)=qspp(i)+2.*xfot
556 qsp(k)=qsp(k)+qspp(i)*dcmu(i)*ddphi
569 if(nsza.eq.1 .and. (iref.eq.0 .or. itrans.eq.1) )
then
585 if(nsza.eq.1 .and. (iref.eq.0 .or. itrans.eq.1) )
then
592 if(kzz.eq.2 .and. iref.eq.0)
then
597 if(kzz.eq.2 .and. itrans.eq.1)
then
615 elseif(kzz.eq.2 .and. iref.eq.0)
then
617 elseif(kzz.eq.2 .and. itrans.eq.1)
then
627 if(jpass.ge.minitr)
then
628 if(d3.le.0.1 .or. jpass.ge.20)
exit
631 if(kzz.eq.1 .and. iglint.eq.1)
then
635 glint_tmp(k,i,j)=fglint(k,i,j)*
636 1 dexp(-tautot/dabs(cosmu(i)))
673 otmpp(i)=otmq(i)/(otmb(i)+otmfd(i))
674 otmqq(i)=otms(i)-otmpp(i)
680 oxzerod(ik,is,ir,m) = xzerod(ik,m,ir,is)
681 oxzeroz(ik,is,ir,m) = xzeroz(ik,m,ir,is)
688 otransm(ir)=xzero_up(m,ir,1)/xzero_btm(m,ir,1)
693 if((iref.eq.1 .or. iref.eq.2) .and. itrans.eq.1)
then
696 if(iref.eq.1 .or. iref.eq.2 .or. iref.eq.3)
then
697 call outdty(oxzeroz,oxzerod)
714 if(iref.eq.0 .and.itrans.eq.0)
then
715 call outdtz(otupz,oxzeroz,otdwnz,oxzerod)
727 INQUIRE( unit=53, opened=ok )
729 INQUIRE( unit=54, opened=ok )
731 INQUIRE( unit=55, opened=ok )
733 INQUIRE( unit=64, opened=ok )
735 INQUIRE( unit=65, opened=ok )
737 INQUIRE( unit=71, opened=ok )
739 INQUIRE( unit=72, opened=ok )
741 INQUIRE( unit=73, opened=ok )
743 INQUIRE( unit=74, opened=ok )
745 INQUIRE( unit=3, opened=ok )
747 INQUIRE( unit=4, opened=ok )
749 INQUIRE( unit=6, opened=ok )
751 INQUIRE( unit=13, opened=ok )
753 INQUIRE( unit=14, opened=ok )
755 INQUIRE( unit=15, opened=ok )
757 INQUIRE( unit=16, opened=ok )
759 INQUIRE( unit=24, opened=ok )
761 INQUIRE( unit=30, opened=ok )
765 355
format( t10,
'fresnel reflection (by a rough surface)',1x,
766 1
'at the lower boundary '/ t10,
'refractive index',t45,
'=',1pe15.5,
767 2
'-',1pe15.5,
'i' / t10,
'velocity',t45,
'=', 1pe15.5,
'meter/sec'/)