OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
dtran_brdf.f
Go to the documentation of this file.
1 
2  subroutine
3  & diff_tran_corr(iphase,sun,view,
4  & delphi,chlor,ta865,correct)
5 
6 C Iphase is the aerosol model index (1=O50, 2=O70, ... 16=T99)
7 C Iwave is the wavelength index (1=412nm, 2=443nm, ... 6=670nm)
8 C Sun is the solar zenith angle (DEGREES)
9 C View is the satellite viewing angle (DEGREES)
10 C Delphi is the relative azimuth angle (RADIANS) <---- NOTE NOTE NOTE
11 C Chlor is the chlorophyll concentration (mg/m^3)
12 C Ta is the aerosol optical depth for the GIVEN WAVELENGTH
13 C Tr is the Rayleigh optical depth for the GIVEN WAVELENGTH
14 C Correct is vhe value of (t-t*)/t* for the GIVEN WAVELENGTH
15 
16 
17 c The procedure is to apply the standard SeaWiFS/MODIS atmospheric correction
18 c algorithm, which provides tvLw. During this procedure, the atmospheric
19 c correction algorithm yields two aerosol models (and the associated aerosol
20 c optical depths) and an interpolation parameter (Ratio?) that provides the
21 c fraction of each of the aerosol models to be used in the computation of
22 c the aerosol radiance. Using the approximation tv = tv* and ts = ts* for
23 c each aerosol model (with the t*'s computed from the aerosol models and
24 c optical thicknesses and already provided in the Gordon and Wang algorithm)
25 c and interpolating between them using the same parameter (Ratio), the
26 c normalized water-leaving radiance and the chlorophyll concentration (Chl)
27 c is computed. Then, using Chl, the subroutine above diff_tran_corr is
28 c entered for each visible wavelength (412 to 670 nm, SeaWiFS Bands) using
29 c the appropriate optical thicknesses for the each wavelength and the
30 c sun-sensor viewing geometry. This provides the diffuse transmittance
31 c correction factor Correct =(tv-tv*)/tv*. The corrected diffuse
32 c transmittance is then
33 c
34 c (Correct + 1) _ tv*.
35 c
36 c
37 c This value of tv is then used with the original tvLw to provide a better
38 c estimate of Lw. It is expected that using the approximation tv = tv* will
39 c not have much influence on Chl so this probably does not need to be
40 c iterated. If iteration is required, simply recomputed Chl and enter
41 c diff_tran_corr again. This procedure will result in more precise
42 c values of Lw.
43 
44 
45 
46  IMPLICIT NONE
47  SAVE
48 
49  integer NRAD,NPHI,NWAVE,NPHASE,NGAUS,NNG,NG,NUM,NBIG
50  integer I, J, M, Ibig, Iwave, Iphase
51 
52  parameter(nbig=10,nrad=31,nphi=4) ! Note NRAD=31 NOT 91
53  parameter(nphase=16,nwave=6)
54 
55  parameter(ngaus=2*nrad-1, nng=50, ng=2*nng)
56  parameter(num=75)
57 
58  REAL Sun, View, Delphi, Ta865, Ta, Tr(NWAVE)
59  REAL Correct(NWAVE), Chlor
60  REAL MBRDF(NWAVE,NRAD,NPHI) ! Same as RAD1 in subroutine,
61  ! but has wave index RAD1(NWAVE,NRAD,NPHI)
62  REAL SmMBRDF(NWAVE,NBIG,NPHI) ! Shortened version with Mu averaging
63  REAL PHSA(Nphase,Nwave,Nbig,NGAUS,NPHI), PHSR(Nbig,NGAUS,NPHI)
64 
65  REAL APHSRADA(NPHASE,NWAVE,NGAUS,NGAUS,NPHI)
66 
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)
70 
71  REAL RAD1(NRAD,NPHI)
72  REAL tst(2),tdf(2)
73 
74  REAL TSTARR(NWAVE,NRAD), TSTARA(NPHASE,NWAVE,NRAD)
75 
76  REAL ya1,ya2,yr1,yr2
77  REAL za1,za2,zr1,zr2
78  REAL x1,z1,v1,w1
79  REAL x2,z2,v2,w2
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
88 
89  REAL tstartest1, tstartest2
90 
91  INTEGER JP, JDN, JUP, MAXPHI, MGAUS, IVIEW
92 
93  CHARACTER INFL1(2)*80,INFL2*80, DUMMY*80
94 
95 c common /comfour/ aphsrada, taua_rat
96  common /comphase/ phsa, phsr, taua_rat
97  COMMON /tstar/ tstarr, tstara
98 
99  DATA tr /0.3132, 0.2336, 0.1547, 0.1330, 0.0957, 0.0446/
100 
101  rad(x)=x*pi/180.
102  ang(x)=x*180./pi
103 
104  pi=4.0*atan(1.0)
105 
106  aindex = 1.334
107 
108  mgaus = ngaus
109  maxphi = nphi
110 
111  DO i = 1, ngaus !NRAD
112  theta(i) = float(i-1)*90./float(nrad-1)
113  mu(i) = cos(rad(theta(i)))
114  ENDDO
115 
116 C Load the appropriate aerosol quantities
117  call read_partial_phase_integrations ! After the first call to
118  ! this it just RETURNs
119  call read_tstar ! After the first call to this it just RETURNs
120 
121 c Load the Radiance/BRDF tables
122 
123  call morel_brdf(sun, chlor, mbrdf, smmbrdf)
124 
125 C Find where they are in the tables.
126 
127  DO i = 1, nrad
128  IF( view .LT. theta(i) ) THEN
129  iview = i
130  GO TO 10
131  ENDIF
132  ENDDO
133 10 CONTINUE ! USE IVIEW and IVIEW -1
134 
135 
136 399 FORMAT(a)
137 400 FORMAT( 5(3x, e12.6))
138 
139 
140  ta = ta865
141  DO iwave = 1, nwave
142 
143  DO jup = iview-1,iview
144 
145  adelphi = ang(delphi)
146  jdn = mgaus + 1 - jup
147 
148 C First do the integrals that result from the scattering of Lw toward
149 C the sensor
150 
151 
152  ya1 = 0
153 c YA2 = 0.
154  yr1 = 0.
155 c YR2 = 0.
156  DO m = 1, maxphi
157  order = float(m-1)
158  x1 = 0.
159 c Z1 = 0.
160  v1 = 0.
161 c W1 = 0.
162  DO i = 1, nbig
163  x2 = phsa(iphase,iwave,i,jup,m)*smmbrdf(iwave,i,m)
164 c Z2 = PHSA(Iphase,Iwave,I,JUP,M)
165  v2 = phsr(i,jup,m)*smmbrdf(iwave,i,m)
166 c W2 = PHSR(I,JUP,M)
167  x1 = x1 + x2
168 c Z1 = Z1 + Z2
169  v1 = v1 + v2
170 c W1 = W1 + W2
171  ENDDO
172 
173  IF(m.GT.1) THEN
174  x1 = x1*2
175  v1 = v1*2
176 c Z1 = 0.
177 c W1 = 0.
178  ENDIF
179  ya1 = ya1 + cos(order*delphi)*x1 ! Index 1 has Rad1 (for t)
180 c YA2 = YA2 + COS(ORDER*DELPHI)*Z1 ! Index 2 is w/o Rad1 (for t*)
181  yr1 = yr1 + cos(order*delphi)*v1
182 c YR2 = YR2 + COS(ORDER*DELPHI)*W1
183  ENDDO
184 
185 C Now do the integrals that result from the scattering of Lw back
186 C toward the surface with subsequint Fresnel reflection from the water.
187 
188  za1 = 0
189 c ZA2 = 0.
190  zr1 = 0.
191 c ZR2 = 0.
192  DO m = 1, maxphi
193  order = float(m-1)
194  x1 = 0.
195 c Z1 = 0.
196  v1 = 0.
197 c W1 = 0.
198  DO i = 1, nbig
199  x2 = phsa(iphase,iwave,i,jdn,m)*smmbrdf(iwave,i,m)
200 c Z2 = PHSA(Iphase,Iwave,I,JDN,M)
201  v2 = phsr(i,jdn,m)*smmbrdf(iwave,i,m)
202 c W2 = PHSR(I,JDN,M)
203  x1 = x1 + x2
204 c Z1 = Z1 + Z2
205  v1 = v1 + v2
206 c W1 = W1 + W2
207  ENDDO
208  IF(m.GT.1) THEN
209  x1 = x1*2
210  v1 = v1*2
211 c Z1 = 0.
212 c W1 = 0.
213  ENDIF
214  za1 = za1 + cos(order*delphi)*x1 ! Aerosol w Rad1 for t
215 c ZA2 = ZA2 + COS(ORDER*DELPHI)*Z1 ! Aerosol w/o Rad1 for t*
216  zr1 = zr1 + cos(order*delphi)*v1 ! Rayleigh w Rad1 for t
217 c ZR2 = ZR2 + COS(ORDER*DELPHI)*W1 ! Rayleigh w/o Rad1 for t*
218  ENDDO
219 
220 C Compute the radiance in the viewing direction from Fourier coefficients
221 
222  yl = 0.
223  DO m = 1, maxphi
224  order = float(m-1)
225  fac = 1.
226  IF (m .GT. 1) fac = 2.
227  yl = yl + mbrdf(iwave,jup,m)*fac*cos(order*delphi)
228  ENDDO
229 
230 C Combine the two contributions above the integrals to form the diffuse
231 C reflectance in single scattering
232 
233  rfres = fresref(mu(jup), aindex)
234 
235 c aint_p_a = (YA2 + rfres*ZA2) /(1.-rfres)
236  aint_pl_a = (ya1 + rfres*za1)/yl /(1.-rfres)
237 c aint_p_r = (YR2 + rfres*ZR2) /(1.-rfres)
238  aint_pl_r = (yr1 + rfres*zr1)/yl /(1.-rfres)
239 
240 c pterm_a = (1.-aint_p_a/2. )/MU(JUP) ! aint_p should be *omega0
241  plterm_a = (1.-aint_pl_a/2.)/mu(jup) ! "
242 c pterm_r = (1.-aint_p_r/2. )/MU(JUP)
243  plterm_r = (1.-aint_pl_r/2.)/mu(jup)
244 
245 c t_star_a = exp(-pterm_a*ta)
246  t_diff_a = exp(-plterm_a*ta*taua_rat(iphase,iwave))
247 c t_star_r = exp(-pterm_r*tr)
248  t_diff_r = exp(-plterm_r*tr(iwave))
249 
250 
251  if (jup .EQ. iview-1) THEN
252 c tstar1 = t_star_a * t_star_r
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)
257 
258  else
259 c tstar2 = t_star_a * t_star_r
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)
264 
265  endif
266 
267  ENDDO ! JUP
268 
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))
273 
274  ENDDO ! IWAVE
275 
276 C tst(iphase) = tstar1 + slope_tst*(view-theta(iview-1))
277 C tdf(iphase) = tdiff1 + slope_tdf*(view-theta(iview-1))
278 
279 C ans = correct
280 
281 c print*, tstar1, tstar2
282 c print*, adelphi, tst(Iphase), tdf(Iphase), ans
283 
284  END
285 
286 
287 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
288 
289  function fresref(muair, index)
290 
291  real muair, index
292 
293  theta1 = acos(muair)
294  stheta1 = sin(theta1)
295  stheta2 = stheta1/index
296  theta2 = asin(stheta2)
297 
298  if(theta1 .gt. 0.) then
299 
300  fresref = 0.5*(
301  & ( tan(theta1-theta2)/tan(theta1+theta2) )**2
302  & +( sin(theta1-theta2)/sin(theta1+theta2) )**2
303  & )
304  else
305  fresref = ( (index-1)/(index+1) )**2
306  endif
307  return
308  end
309 
310 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
311 
312 
313 C *********************************************************
314 
315  subroutine morel_brdf(Sun, Chlor, MBRDF, SmMBRDF)
316 
317  implicit none
318 
319  integer NRAD,NPHI,NSUN,NCHL,NWAVE,NCASE,NBIG
320  integer IRAD,IPHI,ISUN,ICHL,IWAVE,ICASE,IBIG
321  integer I, M
322 
323  parameter(nbig=10,nrad=31,nphi=4) ! Note NRAD=31 NOT 91
324  parameter(nsun=6,nchl=6,nwave=6,ncase=nsun*nchl*nwave)
325 
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)
329  REAL LChl(NCHL)
330  REAL SUN, Chlor, LChlor, chl_interp, sun_interp
331  REAL INTERP1, INTERP2
332  REAL MBRDF(NWAVE,NRAD,NPHI), SmMBRDF(NWAVE,NBIG,NPHI)
333 
334  CHARACTER*80 INFL_FOURIER31
335  CHARACTER*80 INFL_FOURIER10
336  CHARACTER*20 DUMMY
337 
338  CHARACTER filedir*255
339  INTEGER len, lenstr
340 
341  INTEGER IONCE
342 
343  SAVE
344 
345  DATA ionce /0/
346 
347  IF (ionce .EQ. 0) THEN
348 
349  call getenv('OCDATAROOT',filedir)
350  if (filedir .eq. '') then
351  write(*,*)
352  . '-E- : Environment variable OCDATAROOT undefined'
353  call exit(1)
354  endif
355  len = lenstr(filedir)
356 
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'
361 
362  OPEN(unit=11,file=infl_fourier31,status='UNKNOWN')
363  OPEN(unit=12,file=infl_fourier10,status='UNKNOWN')
364 
365 1 format(a)
366 2 format(' ', 13(2x,f10.6))
367 400 FORMAT( 5(3x, e12.6))
368 
369  DO iwave = 1, nwave
370  DO isun = 1, nsun
371  DO ichl = 1, nchl
372  DO iphi = 1, nphi
373  DO irad = 1, nrad
374  brdf(iwave,isun,ichl,irad,iphi)=0.
375  ENDDO
376  DO ibig = 1, nbig
377  smbrdf(iwave,isun,ichl,ibig,iphi)=0.
378  ENDDO
379  ENDDO
380  ENDDO
381  ENDDO
382  ENDDO
383 
384 C READ IN THE FILES
385 
386  DO iwave = 1, nwave
387  DO isun = 1, nsun
388  DO ichl = 1, nchl
389  Read(11, *) wave(iwave), theta0(isun), chl(ichl)
390 c Write(6,*) wave(iwave), theta0(isun), chl(ichl)
391  DO iphi = 1, nphi
392  Read(11, 1) dummy
393 c Write(6, 1) DUMMY
394  Read(11,400) (brdf(iwave,isun,ichl,irad,iphi),irad =1,nrad)
395 c Write(6,400) (BRDF(iWAVE,iSUN,iCHL,iRAD,iPHI),irad =1,nrad)
396  ENDDO
397 c Read(12, *) wave(iwave), theta0(isun), chl(ichl)
398  Read(12, *) wave(iwave), theta0(isun), chl(ichl)
399 c Write(6,*) wave(iwave), theta0(isun), chl(ichl)
400  DO iphi = 1, nphi
401  Read(12, 1) dummy
402 c Write(6, 1) DUMMY
403  Read(12,400) (smbrdf(iwave,isun,ichl,ibig,iphi),ibig =1,nbig)
404 c Write(6,400) (SMBRDF(iWAVE,iSUN,iCHL,iBIG,iPHI),ibig =1,nbig)
405  ENDDO
406  ENDDO
407  ENDDO
408  ENDDO
409 
410  ionce = 1
411  ENDIF
412 
413  DO i = 1, nchl
414  lchl(i) = alog10(chl(i))
415  ENDDO
416 
417 C For sun angle interpolation
418  DO i = 1, nsun
419  IF( sun .LT. theta0(i) ) THEN
420  isun = i
421  GO TO 10
422  ENDIF
423  ENDDO
424 10 CONTINUE ! USE ISUN and ISUN -1
425 
426 C For Chl interpolation
427  DO i = 1, nchl
428  IF( chlor .LT. chl(i) ) THEN
429  ichl = i
430  GO TO 11
431  ENDIF
432  ichl = nchl
433  ENDDO
434 11 CONTINUE ! USE ICHL and ICHL -1
435 
436 c Compute the log10 of the chlorophyll
437  lchlor = alog10(chlor)
438 
439 
440 C Interpolate in the tables to get the water radiance
441 
442  sun_interp = (sun - theta0(isun-1) )/(theta0(isun)-theta0(isun-1))
443  chl_interp = (lchlor - lchl(ichl-1) )/(lchl(ichl)-lchl(ichl-1))
444 c PRINT*, 'Interpolation terms ', sun_interp, chl_interp
445 
446 c 1 2 3 4 5 6 7
447 c23456789012345678901234567890123456789012345678901234567890123456789012
448 
449  DO iwave = 1, nwave
450  DO i = 1, nrad
451  DO m = 1, nphi
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
461 
462  IF(i .LE. nbig) THEN
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
472  ENDIF
473 c print*, 'Iwave,I,M,MBRDF = ',Iwave,I,M,MBRDF(Iwave, I, M)
474  ENDDO
475  ENDDO
476  ENDDO
477 
478  DO iwave = 1, nwave
479  DO i = 1, nbig
480  DO m = 1, nphi
481 c print*, 'Iwave,I,M,SmMBRDF = ',Iwave,I,M,SmMBRDF(Iwave, I, M)
482  ENDDO
483  ENDDO
484  ENDDO
485 
486 
487  RETURN
488  END
489 
490 
491 
492 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
493 
495 
496  IMPLICIT NONE
497 
498  integer NRAD,NPHI,NWAVE,NPHASE,NGAUS,NBIG
499 
500  parameter(nrad=31,nphi=4,nbig=10,ngaus=2*nrad-1) !Note NRAD=31 NOT 91
501  parameter(nphase=16,nwave=6)
502 
503  integer I, J, JUP, M, Iwave, Iphase, Ibig, IONCE
504 
505  REAL PHSA(Nphase,Nwave,Nbig,NGAUS,NPHI), PHSR(Nbig,NGAUS,NPHI)
506  REAL TAUA_RAT(NPHASE,NWAVE)
507 
508  CHARACTER INFL_AER*512,INFL_RAY*512, DUMMY*80
509  CHARACTER INFL_RAT*512
510 
511  character filedir*255
512  integer len, lenstr
513 
514  common /comphase/ phsa, phsr, taua_rat
515 
516  DATA ionce /0/
517 
518  Save
519 
520  IF (ionce .EQ. 0) THEN
521 
522  call getenv('OCDATAROOT',filedir)
523  if (filedir .eq. '') then
524  write(*,*)
525  . '-E- : Environment variable OCDATAROOT undefined'
526  call exit(1)
527  endif
528  len = lenstr(filedir)
529  filedir = filedir(1:len)//'/eval/common/dtran_brdf/'
530  len = lenstr(filedir)
531 
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'
535 
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')
539 
540 399 FORMAT(a)
541 400 FORMAT( 5(3x, e12.6))
542 
543 
544  DO iphase = 1,nphase
545  DO iwave = 1,nwave
546  DO m = 1, nphi
547  DO jup = 1, ngaus ! Read in for thetav = 0, 3, 6, 9, etc.
548  Read(11,399) dummy
549 c Write(6,399) Dummy
550  Read(11,400) (phsa(iphase,iwave,ibig,jup,m), ibig = 1, nbig)
551 c Write(6,400) (PHSA(Iphase,Iwave,Ibig,JUP,M), Ibig = 1, NBIG)
552  ENDDO !JUP
553  ENDDO !M
554  ENDDO !Iwave
555  ENDDO !Iphase
556 
557  CLOSE(11)
558 
559  DO m = 1, nphi
560  DO jup = 1, ngaus ! Read in for thetav = 0, 3, 6, 9, etc.
561  Read (12,399) dummy
562 c Write( 6,399) Dummy
563  Read (12,400) (phsr(ibig,jup,m), ibig = 1, nbig)
564 c Write( 6,400) (PHSR(Ibig,JUP,M), Ibig = 1, NBIG)
565  ENDDO !JUP
566  ENDDO !M
567 
568  CLOSE(12)
569 
570 C READ THE TAUA RATIOS (Lambda to 865)
571 
572  do iphase = 1, nphase
573  read(15,399) dummy
574 C write(6,399) Dummy
575  do iwave = 1, nwave
576  read(15,*) j, taua_rat(iphase,iwave)
577 C write(6,*) iphase, iwave, j, taua_rat(iphase,iwave)
578  enddo
579  enddo
580  close(15)
581 
582  ionce = 1
583  ENDIF
584  RETURN
585  END
586 
587 
588 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
589 
590  SUBROUTINE read_tstar
591 
592  IMPLICIT NONE
593 
594  integer NRAD,NPHI,NWAVE,NPHASE
595  integer I, J, Iwave, Iphase, IONCE
596 
597  parameter(nrad=31) ! Note NRAD=31 NOT 91
598  parameter(nphase=16,nwave=6)
599 
600  REAL TSTARR(NWAVE,NRAD), TSTARA(NPHASE,NWAVE,NRAD)
601 
602  CHARACTER*80 Dummy
603 
604  character filedir*255
605  integer len, lenstr
606 
607  COMMON /tstar/ tstarr, tstara
608 
609  DATA ionce /0/
610 
611  SAVE
612 
613  397 Format(' ' , ' Iwave = ', i2)
614  398 Format(' ' , ' Iphase = ', i2, ' Iwave = ', i2)
615  399 FORMAT(a)
616  400 FORMAT( 5(3x, e12.6))
617 
618 
619  If (ionce .EQ. 0) THEN
620 
621  call getenv('OCDATAROOT',filedir)
622  if (filedir .eq. '') then
623  write(*,*)
624  . '-E- : Environment variable OCDATAROOT undefined'
625  call exit(1)
626  endif
627  len = lenstr(filedir)
628  filedir = filedir(1:len)//'/eval/common/dtran_brdf/'
629  len = lenstr(filedir)
630 
631  OPEN(unit=21,file=filedir(1:len)//'tstar_rayleigh.dat',
632  . status='UNKNOWN')
633  OPEN(unit=22,file=filedir(1:len)//'tstar_aerosol.dat',
634  . status='UNKNOWN')
635 
636  DO iphase = 1, nphase
637  DO iwave = 1, nwave
638  If(iphase .eq.1) then
639  Read(21,399) dummy
640  Read(21,400) (tstarr(iwave, j), j = 1, nrad-3)
641 c Write(6,397) Iwave
642 c Write(6,400) (TSTARR(Iwave, J), J = 1, Nrad-3)
643  Endif
644  Read(22,399) dummy
645  Read(22,400) (tstara(iphase,iwave, j), j = 1, nrad-3)
646 c Write(6,398) Iphase, Iwave
647 c Write(6,400) (TSTARA(Iphase,Iwave, J), J = 1, Nrad-3)
648  ENDDO
649  ENDDO
650 
651  Close(21)
652  Close(22)
653 
654  ionce = 1
655 
656  RETURN
657  ELSE
658  RETURN
659  ENDIF
660 
661  END
662 
663 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
an array had not been initialized Several spelling and grammar corrections were which is read from the appropriate MCF the above metadata values were hard coded A problem calculating the average background DN for SWIR bands when the moon is in the space view port was corrected The new algorithm used to calculate the average background DN for all reflective bands when the moon is in the space view port is now the same as the algorithm employed by the thermal bands For non SWIR changes in the averages are typically less than Also for non SWIR the black body DNs remain a backup in case the SV DNs are not available For SWIR the changes in computed averages were larger because the old which used the black body suffered from contamination by the micron leak As a consequence of the if SV DNs are not available for the SWIR the EV pixels will not be the granule time is used to identify the appropriate tables within the set given for one LUT the first two or last two tables respectively will be used for the interpolation If there is only one LUT in the set of it will be treated as a constant LUT The manner in which Earth View data is checked for saturation was changed Previously the raw Earth View DNs and Space View DNs were checked against the lookup table values contained in the table dn_sat The change made is to check the raw Earth and Space View DNs to be sure they are less than the maximum saturation value and to check the Space View subtracted Earth View dns against a set of values contained in the new lookup table dn_sat_ev The metadata configuration and ASSOCIATEDINSTRUMENTSHORTNAME from the MOD02HKM product The same metatdata with extensions and were removed from the MOD021KM and MOD02OBC products ASSOCIATEDSENSORSHORTNAME was set to MODIS in all products These changes are reflected in new File Specification which users may consult for exact the pow functions were eliminated in Emissive_Cal and Emissive bands replaced by more efficient code Other calculations throughout the code were also made more efficient Aside from a few round off there was no difference to the product The CPU time decreased by about for a day case and for a night case A minor bug in calculating the uncertainty index for emissive bands was corrected The frame index(0-based) was previously being used the frame number(1-based) should have been used. There were only a few minor changes to the uncertainty index(maximum of 1 digit). 3. Some inefficient arrays(Sigma_RVS_norm_sq) were eliminated and some code lines in Preprocess_L1A_Data were moved into Process_OBCEng_Emiss. There were no changes to the product. Required RAM was reduced by 20 MB. Now
subroutine morel_brdf(Sun, Chlor, MBRDF, SmMBRDF)
Definition: dtran_brdf.f:316
function fresref(muair, index)
Definition: dtran_brdf.f:290
subroutine read_partial_phase_integrations
Definition: dtran_brdf.f:495
README for MOD_PR03(V6.1.0) 2. POINTS OF CONTACT it can be either SDP Toolkit or MODIS Packet for Terra input files The orbit validation configuration parameter(LUN 600281) must be either "TRUE" or "FALSE". It needs to be "FALSE" when running in Near Real Time mode
subroutine diff_tran_corr(Iphase, Sun, View, Delphi, Chlor, Ta865, Correct)
Definition: dtran_brdf.f:5
subroutine read_tstar
Definition: dtran_brdf.f:591