4 & delphi,chlor,ta865,correct)
49 integer NRAD,NPHI,NWAVE,NPHASE,NGAUS,NNG,NG,NUM,NBIG
50 integer I, J, M, Ibig, Iwave, Iphase
55 parameter(ngaus=2*nrad-1, nng=50, ng=2*nng)
58 REAL Sun, View, Delphi, Ta865, Ta, Tr(NWAVE)
59 REAL Correct(NWAVE), Chlor
60 REAL MBRDF(NWAVE,NRAD,NPHI)
62 REAL SmMBRDF(NWAVE,NBIG,NPHI)
63 REAL PHSA(Nphase,Nwave,Nbig,NGAUS,NPHI), PHSR(Nbig,NGAUS,NPHI)
65 REAL APHSRADA(NPHASE,NWAVE,NGAUS,NGAUS,NPHI)
67 REAL MU(NGAUS),PDIV(NG),PWT(NG), THETA(NGAUS)
68 REAL PHSRADA(NGAUS,NGAUS,NPHI), PHSRADR(NGAUS,NGAUS,NPHI)
69 REAL TAUA_RAT(NPHASE,NWAVE)
74 REAL TSTARR(NWAVE,NRAD), TSTARA(NPHASE,NWAVE,NRAD)
80 REAL f1,f2,yl,order,fac,rfres
81 REAL aint_p_a, aint_p_r, aint_pl_a, aint_pl_r
82 REAL pterm_a, pterm_r, plterm_a, plterm_r
83 REAL taur, taua, adelphi
84 REAL t_star_r, t_star_a, t_diff_r, t_diff_a
85 REAL tstar1, tstar2, tdiff1, tdiff2
86 REAL ans1, ans2, ans, slope_ans, slope_tst, slope_tdf
87 REAL PI, aindex, fresref, rad, ang, x
89 REAL tstartest1, tstartest2
91 INTEGER JP, JDN, JUP, MAXPHI, MGAUS, IVIEW
93 CHARACTER INFL1(2)*80,INFL2*80, DUMMY*80
96 common /comphase/ phsa, phsr, taua_rat
97 COMMON /tstar/ tstarr, tstara
99 DATA tr /0.3132, 0.2336, 0.1547, 0.1330, 0.0957, 0.0446/
112 theta(i) = float(i-1)*90./float(nrad-1)
113 mu(i) = cos(rad(theta(i)))
128 IF( view .LT. theta(i) )
THEN
137 400
FORMAT( 5(3x, e12.6))
143 DO jup = iview-1,iview
145 adelphi = ang(delphi)
146 jdn = mgaus + 1 - jup
163 x2 = phsa(iphase,iwave,i,jup,m)*smmbrdf(iwave,i,m)
165 v2 = phsr(i,jup,m)*smmbrdf(iwave,i,m)
179 ya1 = ya1 + cos(order*delphi)*x1
181 yr1 = yr1 + cos(order*delphi)*v1
199 x2 = phsa(iphase,iwave,i,jdn,m)*smmbrdf(iwave,i,m)
201 v2 = phsr(i,jdn,m)*smmbrdf(iwave,i,m)
214 za1 = za1 + cos(order*delphi)*x1
216 zr1 = zr1 + cos(order*delphi)*v1
226 IF (m .GT. 1) fac = 2.
227 yl = yl + mbrdf(iwave,jup,m)*fac*cos(order*delphi)
233 rfres = fresref(mu(jup), aindex)
236 aint_pl_a = (ya1 + rfres*za1)/yl /(1.-rfres)
238 aint_pl_r = (yr1 + rfres*zr1)/yl /(1.-rfres)
241 plterm_a = (1.-aint_pl_a/2.)/mu(jup)
243 plterm_r = (1.-aint_pl_r/2.)/mu(jup)
246 t_diff_a = exp(-plterm_a*ta*taua_rat(iphase,iwave))
248 t_diff_r = exp(-plterm_r*tr(iwave))
251 if (jup .EQ. iview-1)
THEN
253 tstar1 = tstarr(iwave,jup)
254 & * (tstara(iphase,iwave,jup)**(ta*taua_rat(iphase,iwave)))
255 tdiff1 = t_diff_a * t_diff_r
256 ans1 = (tdiff1 - tstar1)/(tstar1)
260 tstar2 = tstarr(iwave,jup)
261 & * (tstara(iphase,iwave,jup)**(ta*taua_rat(iphase,iwave)))
262 tdiff2 = t_diff_a * t_diff_r
263 ans2 = (tdiff2 - tstar2)/(tstar2)
269 slope_ans = (ans2 - ans1)/(theta(iview)-theta(iview-1))
270 slope_tst = (tstar2-tstar1)/(theta(iview)-theta(iview-1))
271 slope_tdf = (tdiff2-tdiff1)/(theta(iview)-theta(iview-1))
272 correct(iwave) = ans1 + slope_ans*(view-theta(iview-1))
294 stheta1 = sin(theta1)
295 stheta2 = stheta1/
index
296 theta2 = asin(stheta2)
298 if(theta1 .gt. 0.)
then
301 & ( tan(theta1-theta2)/tan(theta1+theta2) )**2
302 & +( sin(theta1-theta2)/sin(theta1+theta2) )**2
315 subroutine morel_brdf(Sun, Chlor, MBRDF, SmMBRDF)
319 integer NRAD,NPHI,NSUN,NCHL,NWAVE,NCASE,NBIG
320 integer IRAD,IPHI,ISUN,ICHL,IWAVE,ICASE,IBIG
324 parameter(nsun=6,nchl=6,nwave=6,ncase=nsun*nchl*nwave)
326 REAL BRDF(NWAVE,NSUN,NCHL,NRAD,NPHI)
327 REAL SmBRDF(NWAVE,NSUN,NCHL,NBIG,NPHI)
328 REAL Theta0(NSUN), Chl(NCHL), Wave(NWAVE), Thetav(NRAD)
330 REAL SUN, Chlor, LChlor, chl_interp, sun_interp
331 REAL INTERP1, INTERP2
332 REAL MBRDF(NWAVE,NRAD,NPHI), SmMBRDF(NWAVE,NBIG,NPHI)
334 CHARACTER*80 INFL_FOURIER31
335 CHARACTER*80 INFL_FOURIER10
338 CHARACTER filedir*255
347 IF (ionce .EQ. 0)
THEN
349 call getenv(
'OCDATAROOT',filedir)
350 if (filedir .eq.
'')
then
352 .
'-E- : Environment variable OCDATAROOT undefined'
355 len = lenstr(filedir)
357 infl_fourier31 = filedir(1:len)//
358 .
'/eval/common/dtran_brdf/NEW_Morel_NRAD31-1-EDITED'
359 infl_fourier10 = filedir(1:len)//
360 .
'/eval/common/dtran_brdf/NEW_Morel_SMALL-1-EDITED'
362 OPEN(unit=11,file=infl_fourier31,status=
'UNKNOWN')
363 OPEN(unit=12,file=infl_fourier10,status=
'UNKNOWN')
366 2
format(
' ', 13(2x,f10.6))
367 400
FORMAT( 5(3x, e12.6))
374 brdf(iwave,isun,ichl,irad,iphi)=0.
377 smbrdf(iwave,isun,ichl,ibig,iphi)=0.
389 Read(11, *) wave(iwave), theta0(isun), chl(ichl)
394 Read(11,400) (brdf(iwave,isun,ichl,irad,iphi),irad =1,nrad)
398 Read(12, *) wave(iwave), theta0(isun), chl(ichl)
403 Read(12,400) (smbrdf(iwave,isun,ichl,ibig,iphi),ibig =1,nbig)
414 lchl(i) = alog10(chl(i))
419 IF( sun .LT. theta0(i) )
THEN
428 IF( chlor .LT. chl(i) )
THEN
437 lchlor = alog10(chlor)
442 sun_interp = (sun - theta0(isun-1) )/(theta0(isun)-theta0(isun
443 chl_interp = (lchlor - lchl(ichl-1) )/(lchl(ichl)-lchl(ichl-1))
452 interp1 = (1.-sun_interp)*(1.-chl_interp)*
453 & brdf(iwave,isun-1,ichl-1,i,m)
454 interp1 = interp1 + sun_interp*(1.-chl_interp)*
455 & brdf(iwave,isun,ichl-1,i,m)
456 interp1 = interp1 + (1.-sun_interp)*chl_interp*
457 & brdf(iwave,isun-1,ichl,i,m)
458 interp1 = interp1 + sun_interp*chl_interp*
459 & brdf(iwave,isun,ichl,i,m)
460 mbrdf(iwave, i, m) = interp1
463 interp2 = (1.-sun_interp)*(1.-chl_interp)*
464 & smbrdf(iwave,isun-1,ichl-1,i,m)
465 interp2 = interp2 + sun_interp*(1.-chl_interp)*
466 & smbrdf(iwave,isun,ichl-1,i,m)
467 interp2 = interp2 + (1.-sun_interp)*chl_interp*
468 & smbrdf(iwave,isun-1,ichl,i,m)
469 interp2 = interp2 + sun_interp*chl_interp*
470 & smbrdf(iwave,isun,ichl,i,m)
471 smmbrdf(iwave, i, m) = interp2
498 integer NRAD,NPHI,NWAVE,NPHASE,NGAUS,NBIG
500 parameter(nrad=31,nphi=4,nbig=10,ngaus=2*nrad-1)
503 integer I, J, JUP, M, Iwave, Iphase, Ibig, IONCE
505 REAL PHSA(Nphase,Nwave,Nbig,NGAUS,NPHI), PHSR(Nbig,NGAUS,NPHI)
506 REAL TAUA_RAT(NPHASE,NWAVE)
508 CHARACTER INFL_AER*512,INFL_RAY*512, DUMMY*80
509 CHARACTER INFL_RAT*512
511 character filedir*255
514 common /comphase/ phsa, phsr, taua_rat
520 IF (ionce .EQ. 0)
THEN
522 call getenv(
'OCDATAROOT',filedir)
523 if (filedir .eq.
'')
then
525 .
'-E- : Environment variable OCDATAROOT undefined'
528 len = lenstr(filedir)
529 filedir = filedir(1:len)//
'/eval/common/dtran_brdf/'
530 len = lenstr(filedir)
532 infl_aer = filedir(1:len)//
'Aerosols_Partial_Inegr.dat'
533 infl_ray = filedir(1:len)//
'Rayleigh_Partial_Inegr.dat'
534 infl_rat = filedir(1:len)//
'spec_var_EDITED.dat'
536 OPEN(unit=11,file=infl_aer,status=
'OLD')
537 OPEN(unit=12,file=infl_ray,status=
'OLD')
538 OPEN(unit=15,file=infl_rat,status=
'OLD')
541 400
FORMAT( 5(3x, e12.6))
550 Read(11,400) (phsa(iphase,iwave,ibig,jup,m), ibig = 1, nbig)
563 Read (12,400) (phsr(ibig,jup,m), ibig = 1, nbig)
572 do iphase = 1, nphase
576 read(15,*) j, taua_rat(iphase,iwave)
594 integer NRAD,NPHI,NWAVE,NPHASE
595 integer I, J, Iwave, Iphase, IONCE
600 REAL TSTARR(NWAVE,NRAD), TSTARA(NPHASE,NWAVE,NRAD)
604 character filedir*255
607 COMMON /tstar/ tstarr, tstara
613 397
Format(
' ' ,
' Iwave = ', i2)
614 398
Format(
' ' ,
' Iphase = ', i2,
' Iwave = ', i2)
616 400
FORMAT( 5(3x, e12.6))
619 If (ionce .EQ. 0)
THEN
621 call getenv(
'OCDATAROOT',filedir)
622 if (filedir .eq.
'')
then
624 .
'-E- : Environment variable OCDATAROOT undefined'
627 len = lenstr(filedir)
628 filedir = filedir(1:len)//
'/eval/common/dtran_brdf/'
629 len = lenstr(filedir)
631 OPEN(unit=21,file=filedir(1:len)//
'tstar_rayleigh.dat',
633 OPEN(unit=22,file=filedir(1:len)//
'tstar_aerosol.dat',
636 DO iphase = 1, nphase
638 If(iphase .eq.1)
then
640 Read(21,400) (tstarr(iwave, j), j = 1, nrad-3)
645 Read(22,400) (tstara(iphase,iwave, j), j = 1, nrad-3)