9 subroutine find_v_viirs(realbuf, tmpvg, outbuf, qa_flag, px_elev, lm, windsp, wv)
17 1 get_geographic_zone,
42 include
'newaottbl.inc'
44 real realbuf(26), outbuf(21)
47 c taking into account the terrain effect
on rayleigh
50 real pdiff(3), Dstar1, tmpvg(7), bt11
51 c ---intermediate parameters
52 integer doy, ilat, ilon, ilat6, ilon6
53 real terrain_flag_new5
54 real trflg, pteran, x1, x2, xr470
55 real aot_mod(6),r470new, xday, r470ss2
56 real sza, scat_ang_2, amf
58 real model_frac, aod_frac
60 real :: toa_ndvi, tmp412, tmp470, tmp670, ndvi_thold
61 real :: px_elev, bgaod
62 integer :: lc, gzflg, season, mod_sfc, gzflg_sav, regid
63 type(gdatetime) :: gdt1
66 real :: r412_tbl, r470_tbl, r650_tbl, windsp, wv
67 real :: r412_135, r470_135, r650_135
69 real :: tau_x412, tau_x412ss, tau_x412ss2, tau_x412_91
70 real :: tau_x412ss_995, tau_x412ss2_995, tau_x412ss_96
71 real :: tau_x412ss_97, tau_x412ss_94, tau_x412ss_95
72 real :: tau_x412ss_98, tau_x412ss_91, tau_smoke, tau_x412ss2_98
74 real :: tau_x412_new_91, tau_x412_new_93, tau_x412_new_94
75 real :: tau_x412_new_96, tau_x412_new_995
76 real :: tau_x470_new_91, tau_x470_new_92, tau_x470_new_93
77 real :: tau_x470_new_94, tau_x470_new_95, tau_x470_new_96, tau_x470_new_995
79 real :: tau_x412_dust_91, tau_x412_dust_93, tau_x412_dust_94
80 real :: tau_x412_dust_96, tau_x412_dust_995
81 real :: tau_x470_dust_91, tau_x470_dust_92, tau_x470_dust_93
82 real :: tau_x470_dust_94, tau_x470_dust_95, tau_x470_dust_96, tau_x470_dust_995
84 real :: swir_coeffs412(3), swir_coeffs470(3)
85 real :: swir_stderr412, swir_stderr470
88 integer :: tau_x412_flag, tau_x412ss_flag, tau_x412ss2_flag, tau_x412_91_flag
89 integer :: tau_x412_flag_dust, tau_x470_flag_dust, tau_x470_flag_veg
91 real :: tau_x470, tau_x470ss, tau_x470ss2, tau_x470_new
92 integer :: tau_x470_flag2, tau_x470ss_flag, tau_x470_new_flag, tau_x470_new_91_flag
94 integer :: tau_x650_flag
95 integer :: tau_x412_flag2, tau_x470_flag, tau_x412_flag_91
98 real :: r470sv, r412sv, r470sv_veg, r412sv_veg
99 real :: tau_x412sv94, tau_x412sv96, tau_x412sv98
100 real :: tau_x470sv94, tau_x470sv96, tau_x470sv995
101 real :: tau_x470sv96_dust
102 integer :: tau_flagsv
103 logical :: abs_aero_flag
105 logical :: sr_fail_flag, do_veg
106 integer :: alg_flag, brdf_flag
108 logical dflag, dflag2
109 logical :: debug, use_alternate_brdf
112 c ---output parameters
113 real xtau(3), alpha, ssa(3), tau550, sfc_typ
115 c ---
common parameter
118 integer handle_lut_out_of_bounds
123 c-----------------------------------------------------------------------
125 c-----------------------------------------------------------------------
132 tau_x470_flag_veg = -999
134 c-----------------------------------------------------------------------
135 c start processing the
data
136 c-----------------------------------------------------------------------
138 use_alternate_brdf = .false.
140 c
load the input
data into local storage
149 toa_ndvi = realbuf(14)
152 pdiff(1) = realbuf(18)
153 pdiff(2) = realbuf(19)
154 pdiff(3) = realbuf(20)
158 c
if (
abs(xlat-32.64) < 0.05 .AND.
abs(xlong-(-114.5827)) < 0.05 .and. gzflg
eq 31)
then
164 if (xphi.gt.179.99)
go to 10
165 if (xphi.lt.6.0) xphi = 6.
169 psi = acos(cos(sza*cc)*cos(xthet*cc) +
170 1 sin(sza*cc)*sin(xthet*cc)*cos(xphi*cc))
172 c
if (
abs(psi/cc).lt.35.0)
go to 10
174 c -- scattering angle(scat_ang)
176 psi = acos(cos(sza*cc)*cos(xthet*cc) -
177 1 sin(sza*cc)*sin(xthet*cc)*cos(xphi*cc))
178 scat_ang = 180. - psi/cc
179 c
if (scat_ang .gt. 175.)
go to 10
182 amf = 1.0/cos(sza*cc)+1.0/cos(xthet*cc)
184 ilat = floor(xlat*10.0) + 900 + 1
185 if (ilat > 1800) ilat = 1800
186 if (ilat < 1) ilat = 1
188 ilon = floor(xlong*10.0) + 1800 + 1
189 if (ilon > 3600) ilon = 3600
190 if (ilon < 1) ilon = 1
192 ilat6 = floor(xlat/0.06) + 1500 + 1
193 if (ilat > 3000) ilat = 3000
194 if (ilat < 1) ilat = 1
196 ilon6 = floor(xlong/0.06) + 3000 + 1
197 if (ilon > 6000) ilon = 6000
198 if (ilon < 1) ilon = 1
203 trflg = terrain_flag(ilon,ilat)
204 terrain_flag_new5 = terrain_flag_new(ilon,ilat)
205 gzflg = get_geographic_zone(xlat, xlong, status)
206 if (status /= 0)
then
207 print *,
"ERROR: Failed to get geographic zone: ", xlat, xlong, status
213 regid = regid_2(ilon,ilat)
216 bgaod = get_background_aod(xlat, xlong, season, status)
217 if (status /= 0)
then
218 print *,
"ERROR: Failed to get background aod: ", xlat, xlong, status
222 xr470 = get_ler470(ilat, ilon, toa_ndvi, scat_ang, xphi)/100.0
225 if (pdiff(i).lt.0.0.and.pdiff(i).gt.-1.e-4)
229 if (xr470.lt.0.) pdiff(2) = 0.
240 refl1_newgc = realbuf(10)
241 refl3_newgc = realbuf(8)
245 if (px_elev > 750.0 .AND. (xlat > 28.0 .AND. xlat < 37.0 .AND. xlong > -12.0 .AND.
246 1 xlong < 10.0))
then
247 refl3 = realbuf(9) + pdiff(2)/1.30
250 if (px_elev > 900.0 .AND. (xlat > 10.5 .AND. xlat < 19.5 .AND. xlong > 20.5 .AND.
251 1 xlong < 29.0))
then
252 refl3 = realbuf(9) + pdiff(2)/1.50
255 if (refl6 > 0.2)
go to 10
257 rr412_mod = realbuf(22)
258 rr470_mod = realbuf(23)
261 rat1 = rr470_mod / rr412_mod
262 rat_650_470 = ref650 / rr470_mod
263 rat_650_412 = ref650 / rr412_mod
266 print *,
'find_v, in: ', xlat, xlong, sza, xthet, xphi, realbuf(11), realbuf(9), realbuf(7), dstar1, lm
267 print *,
'ler, 412, 470, 650: ', realbuf(22), realbuf(23), realbuf(6)
271 c---------------------------------------------------------------
273 c---------------------------------------------------------------
274 c --intermediate parameters
286 tau_x412ss_995 = -999.0
287 tau_x412ss2_995 = -999.0
288 tau_x412ss2_98 = -999.0
289 tau_x412ss_96 = -999.0
290 tau_x412ss_97 = -999.0
291 tau_x412ss_94 = -999.0
292 tau_x412ss_95 = -999.0
293 tau_x412ss_98 = -999.0
294 tau_x412ss_91 = -999.0
296 tau_x412_new_91 = -999.0
297 tau_x412_new_93 = -999.0
298 tau_x412_new_94 = -999.0
299 tau_x412_new_96 = -999.0
300 tau_x412_new_995 = -999.0
301 tau_x470_new = -999.0
302 tau_x470_new_91 = -999.0
303 tau_x470_new_92 = -999.0
304 tau_x470_new_93 = -999.0
305 tau_x470_new_94 = -999.0
306 tau_x470_new_95 = -999.0
307 tau_x470_new_96 = -999.0
308 tau_x470_new_995 = -999.0
317 tau_x412_flag2 = -999
318 tau_x470_flag2 = -999
319 tau_x412_flag_91 = -999
337 tau_x470_new_91 = -999.
338 sr_fail_flag = .false.
339 abs_aero_flag = .false.
342 c -- 2.2 um surface database aod parameters
347 tau_x412sv94 = -999.0
348 tau_x412sv96 = -999.0
349 tau_x412sv98 = -999.0
350 tau_x470sv94 = -999.0
351 tau_x470sv96 = -999.0
352 tau_x470sv995 = -999.0
353 tau_x470sv96_dust = -999.0
355 swir_coeffs412(:) = -999.0
356 swir_coeffs470(:) = -999.0
357 swir_stderr412 = -999.0
358 swir_stderr470 = -999.0
359 swir_range(:) = -999.0
361 c -- output parameters
387 c---------------------------------------------------------------
388 c screen
for pixels outside reasonable ranges of reflectance
389 c---------------------------------------------------------------
390 c
if (refl1.gt.0.0.and.refl1.lt.0.09.and.
391 c 1 refl6.gt.0.0.and.refl6.lt.0.14)
go to 11
392 c
if (refl1.gt.0.09.and.refl1.lt.0.50.and.
393 c 1 res.gt.6.0)
go to 11
399 if (sza > 84.0)
go to 10
401 c--------------------------------------------------------
402 c
load surface reflectance
403 c--------------------------------------------------------
404 c -- get base surf. reflc. values from surf. coeff. tables
and save.
405 r412_tbl = get_ler412(ilat, ilon, toa_ndvi, scat_ang, xphi)
406 r470_tbl = get_ler470(ilat, ilon, toa_ndvi, scat_ang, xphi)
407 r650_tbl = get_ler650(ilat, ilon, toa_ndvi, scat_ang, xphi)
408 r865_tbl = get_modis_ler865(ilat, ilon)
410 r412_135 = get_ler412(ilat, ilon, toa_ndvi, 135.0, xphi)
411 r470_135 = get_ler470(ilat, ilon, toa_ndvi, 135.0, xphi)
412 r650_135 = get_ler650(ilat, ilon, toa_ndvi, 135.0, xphi)
413 r865_135 = get_modis_ler865(ilat, ilon)
415 c --
set to surface reflectance values to default
table values.
421 if (r865.lt.12.0.and.glint_ang.lt.30.0)
go to 10
423 if (debug) print *,
'glint, scat. ang, r865: ', glint_ang, scat_ang, r865
424 if (debug) print *,
'ilat, ilon, toa_ndvi, xphi: ', ilat, ilon, toa_ndvi, xphi
425 if (debug) print *,
"r412, r470, r650: ", r412, r470, r650
427 c -- out of scope, skip.
428 c
if (r412.gt.30.0)
go to 10
429 c
if (r470.gt.50.0)
go to 10
430 c
if (r650.gt.60.0)
go to 10
445 if (status .ne. 0)
then
446 print *,
"ERROR: Failed to get land cover value: ", i, j, xlat, xlong, status
451 if (gzflg == 27 .AND. (xday >= 60 .AND. xday < 335)) gzflg = 5
452 if (gzflg == 27 .AND. realbuf(22) > 8.0) gzflg = 26
455 tmp412=-999.0 ; tmp470=-999.0 ; tmp670=-999.0
456 brdf_flag =
get_brdfcorr_sr(xlat, xlong, xphi, scat_ang, xthet, amf, px_elev, gdt1%month,
457 & toa_ndvi, stdv, gzflg, lc, bgaod, tmp412, tmp470, tmp670, use_alternate_brdf=use_alternate_brdf,
459 if (brdf_flag == 0 .OR. brdf_flag == 1)
then
462 if (tmp670 > -900.0)
then
467 print *,
'surface reflc, 412, 490, 670: ', r412, r470, r650
470 if (gzflg == 31 .and. px_elev >= 750.0) gzflg = 13
472 if (gzflg == 18 .and. toa_ndvi < 0.3 .and. lc /= 6 .and. lc /= 4 .and.
473 1 realbuf(22) < 12.0 .and. realbuf(22)/realbuf(23) < 0.8)
then
488 if (gzflg >= 6 .AND. gzflg <= 11 .AND. gzflg /= 10)
then
489 if (r650_135 > 32.0 .AND. (r650_135/r412_135) > 3.7)
then
495 & scat_ang,terrain_flag_new5,r412_135,r412new)
496 if ((r412_135 < 7.25) .OR. r650_135 > 42.0 .OR. dstar1 >1.03 .OR. use_alternate_brdf)
then
506 if (r412 < -900.0) r412 = r412_tbl
507 if (r470 < -900.0) r470 = r470_tbl
508 if (r650 < -900.0) r650 = r650_tbl
514 if (r412 < -900.0 .OR. r470 < -900.0 .OR. r650 < -900.0)
then
515 if (brdf_flag == -2)
then
518 sr_fail_flag = .true.
532 swir_coeffs412 = get_swir_coeffs412(ilat6,ilon6)
533 swir_stderr412 = get_swir_stderr412(ilat6,ilon6)
534 swir_coeffs470 = get_swir_coeffs470(ilat6,ilon6)
535 swir_stderr470 = get_swir_stderr470(ilat6,ilon6)
536 swir_range = get_swir_range(ilat6,ilon6)
540 refp_2100 = refl11*3.14159/cos(sza*cc)*100
541 if(refp_2100.ge.(swir_range(1)-2).and.refp_2100.le.(swir_range(2)+2))
then
542 if(swir_coeffs470(1).gt.-900.0.and.swir_coeffs470(2).gt.-900.0.and.
543 1 swir_coeffs470(3).gt.-900.0.and.swir_stderr470.lt.1.0)
then
545 r470sv = swir_coeffs470(1)
546 1 + swir_coeffs470(2)*refp_2100
547 1 + swir_coeffs470(3)*refp_2100*refp_2100
551 if(swir_coeffs412(1).gt.-900.0.and.swir_coeffs412(2).gt.-900.0.and.
552 1 swir_coeffs412(3).gt.-900.0.and.swir_stderr412.lt.1.0)
then
554 r412sv = swir_coeffs412(1)
555 1 + swir_coeffs412(2)*refp_2100
556 1 + swir_coeffs412(3)*refp_2100*refp_2100
563 if (r470sv > 0.0 .and. r470sv < 24.0)
then
564 if (r470sv < 1.0) r470sv = 1.0
567 call aero_470(dflag,refl3_newgc,x1,x2,x3,mm,nn,ll,ma,
568 1 imod,r470sv,tau_x470sv94,tau_flagsv,trflg,0.0,debug)
570 status = handle_lut_out_of_bounds(gzflg,tau_flagsv,tau_x470sv94)
571 if (status /= 0)
then
573 1
"ERROR: Failed to check/reset AOT out of bounds condition: ",status
578 call aero_470(dflag,refl3_newgc,x1,x2,x3,mm,nn,ll,ma,
579 1 imod,r470sv,tau_x470sv96,tau_flagsv,trflg,0.0,debug)
581 status = handle_lut_out_of_bounds(gzflg,tau_flagsv,tau_x470sv96)
582 if (status /= 0)
then
584 1
"ERROR: Failed to check/reset AOT out of bounds condition: ",status
589 call aero_470(dflag,refl3_newgc,x1,x2,x3,mm,nn,ll,ma,
590 1 imod,r470sv,tau_x470sv995,tau_flagsv,trflg,0.0,debug)
592 status = handle_lut_out_of_bounds(gzflg,tau_flagsv,tau_x470sv995)
593 if (status /= 0)
then
595 1
"ERROR: Failed to check/reset AOT out of bounds condition: ",status
602 if (r412sv > 0.0 .and. r412sv < 20.0)
then
603 if (r412sv < 1.0) r412sv = 1.0
605 call aero_412(dflag,refl1_newgc,x1,x2,x3,mm,nn,ll,ma,
606 1 imod,r412sv,tau_x412sv94,tau_flagsv,trflg,0.0,debug)
608 status = handle_lut_out_of_bounds(gzflg,tau_flagsv,tau_x412sv94)
609 if (status /= 0)
then
611 1
"ERROR: Failed to check/reset AOT out of bounds condition: ",status
616 call aero_412(dflag,refl1_newgc,x1,x2,x3,mm,nn,ll,ma,
617 1 imod,r412sv,tau_x412sv96,tau_flagsv,trflg,0.0,debug)
619 status = handle_lut_out_of_bounds(gzflg,tau_flagsv,tau_x412sv96)
620 if (status /= 0)
then
622 1
"ERROR: Failed to check/reset AOT out of bounds condition: ",status
627 call aero_412(dflag,refl1_newgc,x1,x2,x3,mm,nn,ll,ma,
628 1 imod,r412sv,tau_x412sv98,tau_flagsv,trflg,0.0,debug)
630 status = handle_lut_out_of_bounds(gzflg,tau_flagsv,tau_x412sv98)
631 if (status /= 0)
then
633 1
"ERROR: Failed to check/reset AOT out of bounds condition: ",status
640 if (px_elev < 500.0)
then
641 if (xphi < 90.0 .and. r470sv > 0.0 .and. r470sv < 24.0)
then
643 if (r412_tbl > 12.0) ddx = xthet*0.5/65.0
644 if (r412_tbl > 14.0) ddx = 0.0
645 r470sv = r470sv - ddx
647 if (xphi >= 90.0 .and. r412_tbl > 12.0 .and. r470sv > 0.0 .and. r470sv < 24.0)
then
649 r470sv = r470sv + ddx
654 if (r470sv > 0.0 .and. r470sv < 24.0)
then
655 if (r470sv < 1.0) r470sv = 1.0
657 call aero_470_dust(dflag,refl3_newgc,x1,x2,x3,mm,nn,ll,ma,
658 1 imod,r470sv,tau_x470sv96_dust,tau_flagsv,trflg,0.0,debug)
660 status = handle_lut_out_of_bounds(gzflg,tau_flagsv,tau_x470sv96_dust)
661 if (status /= 0)
then
663 1
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
681 if (xday > 150.0 .and. xday < 258.0) ddx = 1.0
684 if (xday > 150.0 .and. xday < 258.0) ddx2 = 1.5
691 if (scat_ang >= 100.0 .and. scat_ang < 155.0)
692 1 r470ss = r470_tbl + dda1*(scat_ang-100.)/55.
693 if (scat_ang >= 155.0)
694 1 r470ss = r470_tbl+dda1
695 r470ss = r470ss - ddx - ddx2
699 if (r470_tbl > 9.0)
then
700 if (scat_ang >= 100.0 .and. scat_ang < 155.0)
701 1 r470ss = r470_tbl + dda1*(scat_ang-100.)/55.
702 if (scat_ang >= 155.0)
703 1 r470ss = r470_tbl+dda1
704 r470ss = r470ss - ddx - ddx2
708 if (xlat >21. .and. xlong > 12.0)
then
710 if (r412_tbl > 12.0) dda1 = 3.0
712 if (r412_tbl > 10.0)
then
713 if (scat_ang >= 100.0 .and. scat_ang < 155.0)
714 1 r470ss = r470_tbl + dda1*(scat_ang-100.)/55.
715 if (scat_ang >= 155.0)
716 1 r470ss = r470_tbl+dda1
717 r470ss = r470ss - ddx
722 if (xlat >15. .and. xlong > 22.0)
then
724 if (r412_tbl > 12.0) dda1 = 3.0
726 if (r412_tbl > 10.0)
then
727 if (scat_ang >= 100.0 .and. scat_ang < 155.0)
728 1 r470ss = r470_tbl + dda1*(scat_ang-100.)/55.
729 if (scat_ang >= 155.0)
730 1 r470ss = r470_tbl+dda1
731 r470ss = r470ss - ddx
736 if (xday > 243.0 .and. xday < 274.0)
then
737 if (xlat >22.5 .and. xlat <30. .and. xlong > -4.0.and. xlong < 1.)
then
739 if (r412_tbl > 10.)
then
740 if (scat_ang >= 100.0 .and. scat_ang < 155.0)
741 1 r470ss = r470_tbl + dda1*(scat_ang-100.)/55.
742 if (scat_ang >= 155.0)
743 1 r470ss = r470_tbl+dda1
744 r470ss = r470ss - ddx - ddx2
750 if (xlat >31.5 .and. xlong > 4. .and. xlong < 10.)
then
753 if (r412_tbl > 9.0)
then
754 if (scat_ang >= 100.0 .and. scat_ang < 155.0)
755 1 r470ss = r470_tbl + dda1*(scat_ang-100.)/55.
756 if (scat_ang >= 155.0)
757 1 r470ss = r470_tbl+dda1
758 r470ss = r470ss - ddx
763 if (xlat>22.5 .and. xlat<30.0.and. xlong>-11.0.and. xlong< -5.)
then
764 if (r412_tbl > 9.)
then
765 r470ss = r470ss + 0.0
770 if (xlat>22.5 .and. xlat<26.0.and. xlong>-13.0.and. xlong< -11.001)
then
771 if (r412_tbl > 9.)
then
772 r470ss = r470ss + 0.0
777 if (xlat>20.0 .and. xlat<30.0.and. xlong>-20.0.and. xlong< -12.0)
then
778 if (r412_tbl > 9.)
then
779 r470ss = r470ss + 0.0
784 if (xlat>15.0 .and. xlat<20.0 .and. xlong< -14.9)
then
785 if (r412_tbl > 10.5)
then
786 if (xday >= 244.0 .and. xday < 274.0) r470ss = r470_tbl - ddx - ddx2
791 if (xphi > 90.0)
then
794 if (xday > 150.0 .and. xday < 258.0) dda2 = 2.0
795 if (xthet >= 30.0 .and. xthet < 70.0) dda1 = (xthet-30.0) * dda2/40.
796 if (xthet >= 70.0) dda1 = dda2
797 r470ss = r470ss + dda1
800 if (dstar1 > 1.1) r470ss = r470_tbl - ddx - ddx2
801 if (dstar1 > 1.06.and.xday > 150.0 .and. xday < 258.0) r470ss = r470_tbl - ddx - ddx2
802 if (dstar1 > 1.04.and.wv>1.5.and.xday > 150.0 .and. xday < 258.0) r470ss = r470_tbl - ddx - ddx2
804 if (gzflg >= 6 .and. gzflg <= 11)
then
807 if (xday > 59.0 .and. xday < 151.0) ddx = 0.5+0.5
808 if (xday > 150.0 .and. xday < 258.0) ddx = 1.0+1.5
809 if (xday > 243.0 .and. xday < 335.0) ddx = 0.7+1.5
810 if (xday > 243.0 .and. xday < 335.0.and.r412_tbl >11.0) ddx = 0.7+1.0
813 if (xday > 150.0 .and. xday < 258.0.and.r412_tbl <11.0) ddx2 = 0.5
818 dda1 = r470_tbl*0.1 +0.5
820 if (scat_ang >= 90.0 .and. scat_ang < 170.0)
821 1 r470ss = r470_tbl + dda1*(scat_ang-90.)/80.
822 if (scat_ang >= 170.0)
823 1 r470ss = r470_tbl+dda1+dda2*(scat_ang-170.)/10.
824 r470ss = r470ss - ddx - ddx2
826 dda1 = r470_tbl*0.1 +1.0
828 if (r412_tbl > 11.0) dda1 = r470_tbl*0.1 +1.0
829 if (r412_tbl > 12.0) dda1 = r470_tbl*0.1 +1.0
830 if (xday > 120.0 .and. xday < 152.0 .and. r412_tbl > 11.0) dda1 = dda1 - 1.5
831 if (xday > 59.0 .and. xday < 244.0.and.r412_tbl > 10.3) dda1 = r470_tbl*0.1 +1.5
832 if (xday > 243.0 .and. xday < 335.0.and.r412_tbl > 11.0) dda1 = r470_tbl*0.1 +1.0
834 if (r412_tbl > 9.0)
then
835 scat_ang_2 = scat_ang
836 if (scat_ang_2 >= 90.0 .and. scat_ang_2 < 160.0)
837 1 r470ss = r470_tbl + dda1*(scat_ang_2-90.)/70.
838 if (scat_ang_2 >= 160.0)
839 1 r470ss = r470_tbl+dda1+dda2*(scat_ang_2-160.)/20.
840 r470ss = r470ss - ddx - ddx2
843 if (xday > 150.0 .and. xday < 244.0)
then
844 if (dstar1 > 1.1) r470ss = r470_tbl
847 if (xday > 243.0 .and. xday < 274.0.and.dstar1 > 1.02)
then
848 r470ss = r470_tbl-1.0
850 if (xday > 120.0 .and. xday < 152.0.and.dstar1 > 1.08)
then
851 r470ss = r470_tbl-1.0
855 if (xday > 152.0 .and. xday < 244.0)
then
858 if (xday > 152.0 .and. xday < 182.) ddx = 0.5
859 if (xday > 181.0 .and. xday < 244.0) ddx = 1.5
862 if (r412_tbl > 11.0) dda1 = 1.8
863 if (r412_tbl > 12.0) dda1 = 2.0
864 if (xday > 181.0 .and. xday < 244.0)
then
865 if (r412_tbl > 11.0) dda1 = 1.8
866 if (r412_tbl > 12.0) dda1 = 2.0
869 if (xlat < 18.0.and. xlong <= 49.0)
then
870 if (r412_tbl > 11.)
then
871 if (scat_ang >= 100.0 .and. scat_ang < 175.0)
872 1 r470ss = r470_tbl-ddx + dda1*(scat_ang-100.)/75.
873 if (scat_ang >= 175.0)
874 1 r470ss = r470_tbl-ddx +dda1+dda2*(scat_ang-175.)/5.
878 if (xlat < 18.5 .and. xlong > 49.0.and. xlong <= 52.5)
then
879 if (r412_tbl > 11.)
then
880 if (scat_ang >= 100.0 .and. scat_ang < 175.0)
881 1 r470ss = r470_tbl-ddx + dda1*(scat_ang-100.)/75.
882 if (scat_ang >= 175.0)
883 1 r470ss = r470_tbl-ddx +dda1+dda2*(scat_ang-175.)/5.
887 if (xlat < 23.0 .and. xlong > 52.5)
then
888 if (r412_tbl > 11.)
then
889 if (scat_ang >= 100.0 .and. scat_ang < 175.0)
890 1 r470ss = r470_tbl-ddx + dda1*(scat_ang-100.)/75.
891 if (scat_ang >= 175.0)
892 1 r470ss = r470_tbl-ddx +dda1+dda2*(scat_ang-175.)/5.
899 if (xday > 151.0 .and. xday < 244.0) dda2 = 1.1
900 if (xphi > 90.0 .and. dstar1 <dda2)
then
903 if (xday > 151.0 .and. xday < 244.0) dda1 = 1.8
904 if (xday > 151.0 .and. xday < 244.0.and.r412_tbl > 10.3.and.(rr470_mod-r470ss) > 0.0) dda1 = 2.2
905 if (xday > 243.0 .and. xday < 335.0) dda1 = 1.8
907 if (xday > 243.0 .and. xday < 335.0.and.r412_tbl > 10.3.and.(rr470_mod-r470ss) > 0.0) dda1 = 2.5
908 if (xday > 243.0 .and. xday < 335.0.and.r412_tbl > 11.) dda1 = 1.8
909 if (xthet >= 30.0 .and. xthet < 70.0) ddx = (xthet-30.0) * dda1/40.
910 if (xthet >= 70.0) ddx = dda1
911 r470ss = r470ss + ddx
916 if (r470 >= 24.0) r470 = 23.9
917 if (r470 < 1.0) r470 = 1.0
918 if (r470ss >= 24.0) r470ss = 23.9
919 if (r470ss < 1.0 .AND. (gzflg > 0 .AND. (gzflg <= 11 .OR. gzflg == 27)))
go to 10
921 if (lprint > 0) print *,
'final r470,r470ss =', r470,r470ss
926 if (xday > 32.0 .and. xday < 60.0) ddx = 0.5
927 if (xday > 59.0 .and. xday < 152.0) ddx = 1.0 + 0.4+0.3
928 if (xday > 151.0 .and. xday < 213.0) ddx = 1.0 + 0.8+0.5
929 if (xday > 212.0 .and. xday < 244.0) ddx = 0.5+0.5
930 if (xday > 243.0 .and. xday < 335.0) ddx = 0.5+0.5
931 if (xday > 273.0 .and. xday < 305.0) ddx = 0.7+0.5
934 if (xday < 32.0) ddx1 = 0.5
935 if (xday > 59.0 .and. xday < 152.0) ddx1 = 0.7
936 if (xday > 151.0 .and. xday < 244.0) ddx1 = 0.5
937 if (xday > 243.0 .and. xday < 305.0) ddx1 = 0.5
938 if (xday > 304.0) ddx1 = 0.5
941 if (xday < 32.0) ddx2 = 0.7
942 if (xday > 59.0 .and. xday < 152.0) ddx2 = 0.7
943 if (xday > 243.0 .and. xday < 305.0) ddx2 = 0.7
944 if (xday > 304.0) ddx2 = 0.7
947 if (xday > 0.0 .and. xday < 152.0) ddx3 = 1.0
949 if (xday > 32.0 .and. xday < 60.0) ddx33 = 0.7
950 if (xday > 59.0 .and. xday < 152.0) ddx33 = 1.0
951 if (xday > 151.0 .and. xday < 244.0) ddx33 = 0.7
952 if (xday > 243.0 .and. xday < 305.0) ddx33 = 0.4
953 if (xday > 304.0) ddx33 = 0.6
955 r412ss2 = r412_tbl - ddx
957 if (scat_ang >= 120.0 .and. scat_ang < 170.0)
958 1 r412ss2 = r412_tbl- ddx + ddx1*(scat_ang-120.)/50.
959 if (scat_ang >= 170.0)
960 1 r412ss2 = r412_tbl- ddx+ddx1+0.0*(scat_ang-170.)/10.
962 if (r412_tbl > 9.0)
then
963 if (scat_ang >= 120.0 .and. scat_ang < 170.0)
964 1 r412ss2 = r412_tbl- ddx + ddx2*(scat_ang-120.)/50.
965 if (scat_ang >= 170.0)
966 1 r412ss2 = r412_tbl- ddx+ddx2+0.0*(scat_ang-170.)/10.
969 if (r412_tbl > 11.0)
then
970 if (scat_ang >= 110.0 .and. scat_ang < 160.0)
971 1 r412ss2 = r412_tbl - ddx+ ddx3*(scat_ang-110.)/50.
972 if (scat_ang >= 160.0)
973 1 r412ss2 = r412_tbl- ddx+ddx3+0.0*(scat_ang-160.)/20.
976 if (r412_tbl > 12.0)
then
977 if (scat_ang >= 110.0 .and. scat_ang < 160.0)
978 1 r412ss2 = r412_tbl - ddx+ ddx33*(scat_ang-110.)/50.
979 if (scat_ang >= 160.0)
980 1 r412ss2 = r412_tbl- ddx+ddx33+0.0*(scat_ang-160.)/20.
983 if (xphi > 90.0)
then
986 if (xday > 243.0 .and. xday < 305.0) ddx33 = 0.0
987 if (r412_tbl > 12.0)
then
989 if (xday > 243.0 .and. xday < 305.0) ddx33 = 1.5
991 if (xthet < 70.0) ddx = xthet * ddx33/70.
992 if (xthet >= 70.0) ddx = ddx33
993 r412ss2 = r412ss2 + ddx
999 if (xday > 0.0 .and. xday < 32.0) ddx = 0.5 + 0.7
1000 if (xday > 31.0 .and. xday < 60.0) ddx = 0.5 + 0.4
1001 if (xday > 59.0 .and. xday < 152.0) ddx = 0.5 + 0.4+0.8
1002 if (xday > 151.0 .and. xday < 244.0) ddx = 0.5 + 0.4+1.0
1003 if (xday > 243.0 .and. xday < 305.0) ddx = 0.5 + 0.4+1.0
1004 if (xday > 304.0 .and. xday < 335.0) ddx = 0.5 + 0.4
1005 if (xday > 334.0) ddx = 0.5 + 0.4
1007 if (xday > 59.0 .and. xday < 152.0) ddx2 = 1.0
1008 if (xday > 151.0 .and. xday < 244.0) ddx2 = 1.2
1009 if (xday > 243.0 .and. xday < 305.0) ddx2 = 0.7
1010 if (xday > 304.0 .and. xday < 335.0) ddx2 = 1.0
1012 if (xday < 32.0) ddx3 = 1.0
1013 if (xday > 151.0 .and. xday < 244.0) ddx3 = 1.5
1014 if (xday > 243.0 .and. xday < 305.0) ddx3 = 0.8
1016 if (xday > 151.0 .and. xday < 244.0) ddx33 = 0.0
1018 if (xday > 151.0 .and. xday < 244.0)
then
1019 dda1 = rr412_mod - r412_tbl
1020 if (dda1 <-1.5 .and.dstar1 >1.0 ) ddx2 = 0.
1023 r412ss = r412_tbl - ddx
1025 if (xday > 151.0 .and. xday < 274.0)
then
1026 dd = (xlong - 8.0) /4.0
1027 if (xlong > 12.0) dd = 1.
1028 if (xlong <= 8.0) dd = 0.
1033 if (scat_ang >= 100.0 .and. scat_ang < 160.0)
1034 1 r412ss = r412_tbl- ddx + ddx2*(scat_ang-100.)/60.
1035 if (scat_ang >= 160.0)
1036 1 r412ss = r412_tbl- ddx+ddx2+ddx33*(scat_ang-160.)/20.
1038 if (xday > 243.0 .and. xday < 305.0)
then
1039 if (scat_ang >= 140.0 .and. scat_ang < 160.0)
1040 1 r412ss = r412_tbl- ddx + ddx2*(scat_ang-140.)/20.
1041 if (scat_ang >= 160.0)
1042 1 r412ss = r412_tbl- ddx+ddx2
1045 if (r412_tbl > 12.0)
then
1046 if (scat_ang >= 120.0 .and. scat_ang < 170.0)
1047 1 r412ss = r412_tbl- ddx + ddx3*(scat_ang-120.)/50.
1048 if (scat_ang >= 170.0)
1049 1 r412ss = r412_tbl- ddx+ddx3+0.0*(scat_ang-170.)/10.
1052 if (xday > 151.0 .and. xday < 244.0)
then
1053 if (r412_tbl > 10.0) r412ss = r412ss + 0.5
1062 if (xday > 181.0 .and. xday < 305.0)
then
1069 if (xday > 151.0 .and. xday < 182.0) dda1 = 1.5
1070 if (xday > 243.0 .and. xday < 274.0) dda1 = 0.7
1071 if (xday > 59.0 .and. xday < 152.0) dda1 = 1.0
1073 if (xlat>27. .and. xlat<36. .and. xlong>2.5 .and. xlong<11.5)
then
1074 if (r412_135 > dda2)
then
1075 if (scat_ang >= dda3 .and. scat_ang < 170.0)
1076 1 r412ss = r412_tbl- ddx + dda1*(scat_ang-dda3)/dda5
1077 if (scat_ang >= 170.0)
1078 1 r412ss = r412_tbl- ddx+dda1+dda4*(scat_ang-170.)/10.
1083 if (xlat >20. .and. xlong > 14.9)
then
1084 dda1 = r412_tbl*0.08 +0.5
1085 if (r412_tbl > 12.0) dda1 = r412_tbl*0.08 + 0.8
1086 if (xday > 59.0 .and. xday < 91.0 .and.r412_tbl > 12.0) dda1 = r412_tbl*0.08 + 1.5
1087 if (xday > 151.0 .and. xday < 244.0 .and.r412_tbl > 12.0) dda1 = r412_tbl*0.08 + 0.4
1089 if (r412_tbl > 9.6)
then
1090 if (scat_ang >= 110.0 .and. scat_ang < 160.0)
1091 1 r412ss = r412_tbl- ddx + dda1*(scat_ang-110.)/50.
1092 if (scat_ang >= 160.0)
1093 1 r412ss = r412_tbl- ddx+dda1+dda2*(scat_ang-160.)/20.
1094 if (xday > 151.0 .and. xday < 244.0)
then
1095 if (xday > 151.0 .and. xday < 182.0)
then
1096 if (r412_tbl >10.0.and.xlat>20.0 .and. xlat<24.8.and. xlong>24.7.and.xlong<30.0)
go to 211
1097 if (r412_tbl >10.0.and.xlat>17.5 .and. xlat<=20.0.and. xlong>24.0.and.xlong<30.0)
go to 211
1099 dda1 = r412_tbl- ddx+r412_tbl*0.08 +0.5
1100 if (scat_ang >= 110.0 .and. scat_ang < 160.0) r412ss = dda1+0.8*(scat_ang-110.)/50.
1101 if (scat_ang >= 160.0) r412ss = dda1+0.8
1102 if (r412_tbl > 14.0)
then
1103 dda1 = r412_tbl- ddx+r412_tbl*0.08 +0.5
1104 if (scat_ang >= 110.0 .and. scat_ang < 160.0) r412ss = dda1+1.0*(scat_ang-110.)/50.
1105 if (scat_ang >= 160.0) r412ss = dda1+1.0
1113 if (xlat >15. .and. xlong > 22.0)
then
1114 dda1 = r412_tbl*0.08 +0.5
1115 if (r412_tbl > 12.0) dda1 = r412_tbl*0.08 + 0.8
1116 if (xday > 59.0 .and. xday < 91.0 .and.r412_tbl > 12.0) dda1 = r412_tbl*0.08 + 1.5
1117 if (xday > 151.0 .and. xday < 244.0 .and.r412_tbl > 12.0) dda1 = r412_tbl*0.08 + 0.4
1119 if (r412_tbl > 9.6)
then
1120 if (scat_ang >= 110.0 .and. scat_ang < 160.0)
1121 1 r412ss = r412_tbl- ddx + dda1*(scat_ang-110.)/50.
1122 if (scat_ang >= 160.0)
1123 1 r412ss = r412_tbl- ddx+dda1+dda2*(scat_ang-160.)/20.
1124 if (xday > 151.0 .and. xday < 244.0)
then
1125 if (xday > 151.0 .and. xday < 182.0)
then
1126 if (r412_tbl >10.0.and.xlat>20.0 .and. xlat<24.8.and. xlong>24.7.and.xlong<30.0)
go to 212
1127 if (r412_tbl >10.0.and.xlat>17.5 .and. xlat<=20.0.and. xlong>24.0.and.xlong<30.0)
go to 212
1129 dda1 = r412_tbl- ddx+r412_tbl*0.08 +0.5
1130 if (scat_ang >= 110.0 .and. scat_ang < 160.0) r412ss = dda1+0.8*(scat_ang-110.)/50.
1131 if (scat_ang >= 160.0) r412ss = dda1+0.8
1132 if (r412_tbl > 14.0)
then
1133 dda1 = r412_tbl- ddx+r412_tbl*0.08 +0.5
1134 if (scat_ang >= 110.0 .and. scat_ang < 160.0) r412ss = dda1+1.0*(scat_ang-110.)/50.
1135 if (scat_ang >= 160.0) r412ss = dda1+1.0
1143 if (xlat >31.5 .and. xlong > 4. .and. xlong < 10.)
then
1144 dda1 = r412_tbl*0.08 + 0.5
1145 dda2 = r412_tbl*0.05 + 0.5
1146 if (xday > 151.0 .and. xday < 244.0)
then
1147 dda1 = r412_tbl*0.08 -0.3
1150 if (xday > 243.0 .and. xday < 274.0)
then
1151 dda1 = r412_tbl*0.08 -0.3
1154 if (r412_tbl > 9.4)
then
1155 if (scat_ang >= 120.0 .and. scat_ang < 170.0)
1156 1 r412ss = r412_tbl - ddx+0.3+ dda1*(scat_ang-120.)/50.
1157 if (scat_ang >= 170.0)
1158 1 r412ss = r412_tbl- ddx+0.3+dda1+dda2*(scat_ang-170.)/10.
1164 if (xlat >30.0 .and. xlat <32.0 .and. xlong > 4.8 .and. xlong < 7.)
then
1165 dda1 = r412_tbl*0.08 + 0.5
1167 if (xday > 151.0 .and. xday < 244.0)
then
1168 dda1 = r412_tbl*0.08 -0.3
1171 if (xday > 243.0 .and. xday < 274.0)
then
1172 dda1 = r412_tbl*0.08 -0.3
1175 if (r412_tbl > 9.4)
then
1176 if (scat_ang >= 100.0 .and. scat_ang < 160.0)
1177 1 r412ss = r412_tbl- ddx+0.3 + dda1*(scat_ang-100.)/60.
1178 if (scat_ang >= 160.0)
1179 1 r412ss = r412_tbl- ddx+0.3+dda1+dda2*(scat_ang-160.)/20.
1184 if (xday > 31.0 .and. xday < 60.0)
go to 36
1185 if (xlat >20. .and. xlat <25. .and. xlong >15.0.and. xlong <17.5)
then
1186 if (r412_tbl > 12.0)
then
1187 r412ss = r412ss + 0.5
1193 if (xday > 59.0 .and. xday < 121.0) dda2 = 1.0
1195 if (xlat>22.5 .and. xlat<30.0.and. xlong>-11.0.and. xlong< -5.)
then
1196 if (r412_tbl > 9.)
then
1197 r412ss = r412ss + dda2
1198 if (xday > 151.0 .and. xday < 274.0) r412ss = r412_tbl-1.5
1203 if (xday > 59.0 .and. xday < 121.0) dda2 = 1.0
1205 if (xlat>22.5 .and. xlat<26.0.and. xlong>-13.0.and. xlong< -11.001)
then
1206 if (r412_tbl > 9.)
then
1207 r412ss = r412ss + dda2
1208 if (xday > 151.0 .and. xday < 274.0) r412ss = r412_tbl-1.5
1213 if (xday > 59.0 .and. xday < 121.0) dda2 = 1.0
1215 if (xlat>=20.0 .and. xlat<29.0.and. xlong< -12.5)
then
1216 if (r412_tbl > 10.5)
then
1217 r412ss = r412ss + dda2
1218 if (xday > 151.0 .and. xday < 274.0) r412ss = r412_tbl-1.5
1223 if (xday > 59.0 .and. xday < 121.0) dda2 = 1.0
1225 if (xlat>15.0 .and. xlat<20.0 .and. xlong< -14.9)
then
1226 if (r412_tbl > 10.5)
then
1227 r412ss = r412ss + dda2
1228 if (xday > 151.0 .and. xday < 244.0) r412ss = r412_tbl-1.5
1229 if (xday >= 244.0 .and. xday < 274.0) r412ss = r412ss-1.5
1234 if (xlat >10.0 .and. xlat <21.0 .and. xlong > 10.0 .and. xlong < 20.0)
then
1235 if (r412_tbl > 12.)
then
1236 if (xday > 181.0 .and. xday < 244.0) r412ss = r412_tbl
1241 if (xlat>30.0 .and. xlat<36.0 .and. xlong<= -7.5)
then
1242 if (r412_tbl > 5.8)
then
1243 if (scat_ang >= 100.0 .and. scat_ang < 175.0)
1244 1 r412ss = r412_tbl + 4.0*(scat_ang-100.)/75.
1245 if (scat_ang >= 175.0)
1246 1 r412ss = r412_tbl+4.0+0.0*(scat_ang-175.)/5.
1251 if (xlat>31.5 .and. xlat<36.0 .and. xlong<= -5.0.and. xlong> -7.5)
then
1252 if (r412_tbl > 5.8)
then
1253 if (scat_ang >= 100.0 .and. scat_ang < 175.0)
1254 1 r412ss = r412_tbl + 4.0*(scat_ang-100.)/75.
1255 if (scat_ang >= 175.0)
1256 1 r412ss = r412_tbl+4.0+0.0*(scat_ang-175.)/5.
1261 if (xday > 151.0 .and. xday < 244.0)
go to 37
1264 if (xday > 243.0 .and. xday < 274.0) dda2 = 0.0
1266 if (xlat >22.5 .and. xlat <30. .and. xlong > -4.0.and. xlong < 1.)
then
1267 if (r412_tbl > 10.)
then
1268 r412ss = r412ss + dda2
1273 if (xlat>20. .and. xlat<22.501.and. xlong>-2.0.and. xlong< 2.)
then
1274 if (r412_tbl > 10.)
then
1275 r412ss = r412ss + dda2-1.0
1279 if (xday > 243.0 .and. xday < 274.0)
then
1280 if (xlat>16. .and. xlat<22.501.and. xlong>-12.5.and. xlong< 2.)
then
1281 if (r412_tbl > 12.)
then
1282 r412ss = r412ss - 1.0
1289 if (xday > 59.0 .and. xday < 244.0)
then
1290 if (xphi > 90.0)
then
1293 if (r412_tbl > 12.0) ddx33 = 0.9
1294 if (xthet < 70.0) ddx = xthet * ddx33/70.
1295 if (xthet >= 70.0) ddx = ddx33
1296 r412ss = r412ss + ddx
1299 if (xday > 59.0 .and. xday < 152.0)
go to 38
1300 if (r412_tbl > 9.6)
then
1301 if (xlat >20. .and. xlong > 14.9)
go to 38
1302 if (xlat >15. .and. xlong > 22.0)
go to 38
1308 if (gzflg == 21)
then
1309 if (xphi > 90.0)
then
1312 if (xthet < 70.0) ddx = xthet * ddx33/70.
1313 if (xthet >= 70.0) ddx = ddx33
1318 if (lprint > 0) print *,
'scat_ang,b,f r412ss =',r412_tbl,scat_ang,r412ss
1320 if (r412ss2 > 20.0) r412ss2 = 19.9
1321 if (r412ss2 < 1.0) r412ss2 = 1.0
1322 if (r412 > 20.0 .and. r412 < 40.0) r412 = 19.9
1323 if (r412 > 40.0)
go to 10
1324 if (r412 < 1.0) r412 = 1.0
1325 if (r412ss >= 20.0 .and. r412ss < 40.0) r412ss = 19.9
1326 if (r412ss < 1.0) r412ss = 1.0
1328 if (r470 >= 24.0) r470 = 23.9
1329 if (r470 < 1.0) r470 = 1.0
1330 if (r470ss >= 24.0) r470ss = 23.9
1331 if (r470ss < 1.0) r470ss = 1.0
1333 if (lprint > 0) print *,
'final r412,r412ss =',r412,r412ss
1336 if (r650 >= 47.0) r650 = 46.9
1337 if (r650 < 1.0) r650 = 1.0
1339 c --
END DIRECT COPY SEAWIFS
code
1341 if (r412.gt.12.0.and.r412.lt.80.) qa_flag(4) = 2
1343 c--------------------------------------------------------
1345 c--------------------------------------------------------
1346 c-- band26 values should be fill value(-999) so most of these
1347 c-- test are non-functional. confirmed w/ dr. hsu 2013-03-01 --cb.
1348 if (debug) print *,
'--- start cloud screening ----'
1349 if (debug) print *,
'band26, realbuf(7), realbuf(11): ', band26, realbuf(7), realbuf(11)
1350 if (band26.lt.0.0.and.realbuf(11).lt.0.0.and.
1351 1 realbuf(7).gt.0.0)
go to 620
1352 if (band26.gt.0.0.and.realbuf(11).lt.0.0.and.
1353 1 realbuf(7).gt.0.0)
go to 10
1354 rat = ref650/ rr412_mod
1355 rat1 = rr470_mod / rr412_mod
1356 if (debug) print *,
'rat, rat1, ref650: ', rat, rat1, ref650
1357 if (ref650.gt.45.0.and.rat.lt.1.4)
go to 10
1358 if (ref650.gt.56.0.and.rat.lt.1.3)
go to 10
1360 if (debug) print *,
'trflg, rr412_mod, rat1, r412: ', trflg, rr412_mod, rat1, r412
1361 if (trflg.gt.0.0.and.rr412_mod.gt.10.0.and.
1362 1 rat1.gt.1.25)
go to 50
1364 if (r412.gt.6.0)
then
1365 if (band26.gt.0.0.and.rr412_mod.gt.6.0)
go to 10
1367 if (band26.gt.0.0.and.rr412_mod.gt.10.0.and.rat1.lt.1.25)
1370 if (debug) print *,
'--- end cloud screening ---'
1374 c--------------------------------------------------------
1375 c special case:
for thick strong-absorbing
dust plume,
1377 c--------------------------------------------------------
1379 if (ref650 > 32.0 .and. (gzflg >= 6 .and. gzflg /= 21 .and. gzflg /= 24
1380 1 .and. gzflg /= 13 .and. gzflg /= 31) .and. dstar1 > 1.1)
then
1383 abs_aero_flag = .true.
1390 if (gzflg == 1 .AND. (gdt1%month >= 6 .AND. gdt1%month <= 8))
then
1391 if (r650_135 < 16.0)
then
1392 if (toa_ndvi < 0.18)
then
1393 r412 =
min(r412 + 2.0, 20.0)
1394 r470new =
min(r470new + 2.0, 24.0)
1395 r650 =
min(r650 + 2.0, 47.0)
1397 r412 =
max(r412 - 2.0, 1.0)
1398 r470new =
max(r470new - 2.0, 1.0)
1399 r650 =
max(r650 - 2.0, 1.0)
1404 c--------------------------------------------------------
1405 c preliminary retrieval
on aot
1406 c--------------------------------------------------------
1409 c
for moderate aot,
Use 412 - 470 nm pair
1411 c retrieving 470 nm aot
1413 if (debug) print *,
'--- starting aot470 --- '
1417 tau_x470_flag = -999
1418 tau_x470_flag2 = -999
1421 tau_x470_new_91 = -999.0 ; tau_x470_new_92 = -999.0 ; tau_x470_new_93 = -999.0
1422 tau_x470_new_94 = -999.0 ; tau_x470_new_95 = -999.0 ; tau_x470_new_96 = -999.0
1423 tau_x470_new_995 = -999.0
1426 call aero_470(dflag,refl,x1,x2,x3,mm,nn,ll,ma,
1427 1 imod,r470,tau_x470,tau_x470_flag,trflg,0.0,debug)
1430 if (status /= 0)
then
1431 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1438 call aero_470(dflag,refl,x1,x2,x3,mm,nn,ll,ma,
1439 1 imod,r470ss,tau_x470ss,tau_x470_flag2,trflg,0.0,debug)
1442 if (status /= 0)
then
1443 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1447 if (tau_x470.lt.0.0601.and.dstar1.gt.1.1.and.rat1.gt.1.6)
1450 r470ss = r470ss - 1.0
1451 if (r470ss .lt. 1.0) r470ss = 1.0
1452 call aero_470(dflag,refl,x1,x2,x3,mm,nn,ll,ma,
1453 1 imod,r470ss,tau_x470ss,tau_x470_flag2,trflg,0.0,debug)
1458 if (tau_x470.lt.0.5.and.dstar1.gt.0.98.and.rat1.gt.1.46)
1461 r470ss = r470ss - 1.0
1462 if (dstar1.gt.1.04) r470ss = r470ss - 0.5
1463 if (r470ss .lt. 1.0) r470ss = 1.0
1464 call aero_470(dflag,refl,x1,x2,x3,mm,nn,ll,ma,
1465 1 imod,r470ss,tau_x470ss2,tau_x470_flag2,trflg,0.0,debug)
1470 if (r470new >= 24.0)
go to 81
1471 if (r470new .lt. 1.0) r470new = 1.0
1474 call aero_470(dflag,refl,x1,x2,x3,mm,nn,ll,ma,
1475 1 imod,r470new,tau_x470_new,tau_x470_flag2,trflg,0.0,debug)
1478 if (status /= 0)
then
1479 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1483 tau_x470_new_96 = tau_x470_new
1486 call aero_470(dflag,refl,sza,xthet,xphi,mm,nn,ll,ma,
1487 1 imod,r470new,tau_x470_new_995,tau_x470_flag2,trflg,0.0,debug)
1490 if (status /= 0)
then
1491 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1498 call aero_470(dflag,refl,sza,xthet,xphi,mm,nn,ll,ma,
1499 1 imod,r470new,tau_x470_new_95,tau_x470_flag2,trflg,model_frac,debug)
1502 if (status /= 0)
then
1503 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1508 call aero_470(dflag,refl,sza,xthet,xphi,mm,nn,ll,ma,
1509 1 imod,r470new,tau_x470_new_94,tau_x470_flag2,trflg,0.0,debug)
1512 if (status /= 0)
then
1513 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1518 model_frac = 2.0/3.0
1519 call aero_470(dflag,refl,sza,xthet,xphi,mm,nn,ll,ma,
1520 1 imod,r470new,tau_x470_new_93,tau_x470_flag2,trflg,model_frac,debug)
1523 if (status /= 0)
then
1524 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1529 model_frac = 1.0/3.0
1530 call aero_470(dflag,refl,sza,xthet,xphi,mm,nn,ll,ma,
1531 1 imod,r470new,tau_x470_new_92,tau_x470_flag2,trflg,model_frac,debug)
1534 if (status /= 0)
then
1535 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1540 call aero_470(dflag,refl,x1,x2,x3,mm,nn,ll,ma,
1541 1 imod,r470new,tau_x470_new_91,tau_x470_flag2,trflg,0.0,debug)
1544 if (status /= 0)
then
1545 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1549 if (r470 < 12.0 .and. rr470_mod > 11.0)
then
1550 rat_470_412 = rr470_mod / rr412_mod
1551 if (rat_470_412 > 1.85)
then
1553 call aero_470(dflag,refl,x1,x2,x3,mm,nn,ll,ma,
1554 1 imod,r470new,tau_x470_new_91,tau_x470_flag2,trflg,0.0,debug)
1557 if (status /= 0)
then
1558 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1564 if (xthet > 62.0)
then
1565 rat_470_412 = rr470_mod / rr412_mod
1566 if (rat_470_412 > 1.7)
then
1568 call aero_470(dflag,refl,x1,x2,x3,mm,nn,ll,ma,
1569 1 imod,r470new,tau_x470_new_91,tau_x470_flag2,trflg,0.0,debug)
1572 if (status /= 0)
then
1573 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1582 tau_x470_flag_dust = -999
1585 tau_x470_dust_91 = -999.0 ; tau_x470_dust_92 = -999.0 ; tau_x470_dust_93 = -999.0
1586 tau_x470_dust_94 = -999.0 ; tau_x470_dust_95 = -999.0 ; tau_x470_dust_96 = -999.0
1587 tau_x470_dust_995 = -999.0
1590 call aero_470_dust(dflag,refl,x1,x2,x3,mm,nn,ll,ma,
1591 1 imod,r470new,tau_x470_dust_96,tau_x470_flag_dust,trflg,0.0,debug)
1594 if (status /= 0)
then
1595 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1600 call aero_470_dust(dflag,refl,sza,xthet,xphi,mm,nn,ll,ma,
1601 1 imod,r470new,tau_x470_dust_995,tau_x470_flag_dust,trflg,0.0,debug)
1604 if (status /= 0)
then
1605 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1611 call aero_470_dust(dflag,refl,sza,xthet,xphi,mm,nn,ll,ma,
1612 1 imod,r470new,tau_x470_dust_95,tau_x470_flag_dust,trflg,model_frac,debug)
1615 if (status /= 0)
then
1616 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1621 call aero_470_dust(dflag,refl,sza,xthet,xphi,mm,nn,ll,ma,
1622 1 imod,r470new,tau_x470_dust_94,tau_x470_flag_dust,trflg,0.0,debug)
1625 if (status /= 0)
then
1626 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1631 model_frac = 2.0/3.0
1632 call aero_470_dust(dflag,refl,sza,xthet,xphi,mm,nn,ll,ma,
1633 1 imod,r470new,tau_x470_dust_93,tau_x470_flag_dust,trflg,model_frac,debug)
1636 if (status /= 0)
then
1637 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1642 model_frac = 1.0/3.0
1643 call aero_470_dust(dflag,refl,sza,xthet,xphi,mm,nn,ll,ma,
1644 1 imod,r470new,tau_x470_dust_92,tau_x470_flag_dust,trflg,model_frac,debug)
1647 if (status /= 0)
then
1648 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1653 call aero_470_dust(dflag,refl,x1,x2,x3,mm,nn,ll,ma,
1654 1 imod,r470new,tau_x470_dust_91,tau_x470_flag_dust,trflg,0.0,debug)
1657 if (status /= 0)
then
1658 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1662 if (r470 < 12.0 .and. rr470_mod > 11.0)
then
1663 rat_470_412 = rr470_mod / rr412_mod
1664 if (rat_470_412 > 1.85)
then
1666 call aero_470_dust(dflag,refl,x1,x2,x3,mm,nn,ll,ma,
1667 1 imod,r470new,tau_x470_dust_91,tau_x470_flag_dust,trflg,0.0,debug)
1670 if (status /= 0)
then
1671 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1677 if (xthet > 62.0)
then
1678 rat_470_412 = rr470_mod / rr412_mod
1679 if (rat_470_412 > 1.7)
then
1681 call aero_470_dust(dflag,refl,x1,x2,x3,mm,nn,ll,ma,
1682 1 imod,r470new,tau_x470_dust_91,tau_x470_flag_dust,trflg,0.0,debug)
1685 if (status /= 0)
then
1686 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1693 if (debug) print *,
'--- end aot470 ---'
1696 c
if (lprint > 0) print *,
'tau_x470,tau_x470ss,tau_x470_new=',
1697 c 1 tau_x470,tau_x470ss,tau_x470_new
1700 c--------------------------------------------------------
1701 c retrieving 412 nm aot
1702 c--------------------------------------------------------
1707 tau_x412_flag = -999
1708 tau_x412_flag2 = -999
1713 call aero_412(dflag,refl,x1,x2,x3,mm,nn,ll,ma,
1714 1 imod,r412,tau_x412,tau_x412_flag2,trflg,0.0,debug)
1717 if (status /= 0)
then
1718 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1722 if (r412 > 11.0 .and. tau_x412 < 0.4)
then
1723 tau_x412_91 = tau_x412 * 2.
1725 else if (r412 > 12.0)
then
1726 tau_x412_91 = tau_x412 * 2.
1733 tau_x412_flag_91 = -999
1736 call aero_412(dflag,refl,x1,x2,x3,mm,nn,ll,ma,
1737 1 imod,r412,tau_x412_91,tau_x412_flag_91,trflg,0.0,debug)
1740 if (status /= 0)
then
1741 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1747 tau_x412_flag = -999
1748 tau_x412_new_91 = -999.0 ; tau_x412_new_93 = -999.0 ; tau_x412_new_94 = -999.0
1749 tau_x412_new_96 = -999.0 ; tau_x412_new_995 = -999.0
1751 tau_x412ss_995 = -999.0 ; tau_x412ss2_995 = -999.0 ; tau_x412ss_96 = -999.0
1752 tau_x412ss_97 = -999.0 ; tau_x412ss_94 = -999.0 ; tau_x412ss_95 = -999.0
1753 tau_x412ss_98 = -999.0
1755 if (r412new < 1.0)
go to 631
1756 if (r412new >= 20.0)
go to 631
1759 call aero_412(dflag,refl,sza,xthet,xphi,mm,nn,ll,ma,
1760 1 imod,r412new,tau_x412_new_995,tau_x412_flag,trflg,0.0,debug)
1763 if (status /= 0)
then
1764 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1772 call aero_412(dflag,refl,sza,xthet,xphi,mm,nn,ll,ma,
1773 1 imod,r412new,tau_x412_new_96,tau_x412_flag,trflg,0.0,debug)
1776 if (status /= 0)
then
1777 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1782 call aero_412(dflag,refl,sza,xthet,xphi,mm,nn,ll,ma,
1783 1 imod,r412new,tau_x412_new_94,tau_x412_flag,trflg,0.0,debug)
1786 if (status /= 0)
then
1787 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1792 model_frac = 2.0/3.0
1793 if (dflag) print *,
'calling aero_412, model_frac: imod, model_frac: ', imod, model_frac
1794 call aero_412(dflag,refl,sza,xthet,xphi,mm,nn,ll,ma,
1795 1 imod,r412new,tau_x412_new_93,tau_x412_flag,trflg,model_frac,debug)
1798 if (status /= 0)
then
1799 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1804 call aero_412(dflag,refl,sza,xthet,xphi,mm,nn,ll,ma,
1805 1 imod,r412new,tau_x412_new_91,tau_x412_flag,trflg,0.0,debug)
1808 if (status /= 0)
then
1809 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1814 if (gzflg >= 6 .and. gzflg <= 11)
then
1815 tau_x412_new = tau_x412_new_94
1818 if (gzflg == 6)
then
1819 if (xday >= 60.0 .and. xday < 274.0)
go to 602
1820 tau_x470_new = tau_x412_new
1825 if (gzflg == 8)
then
1826 if (xday >= 182.0 .and. xday < 274.0)
go to 603
1827 tau_x470_new = tau_x412_new
1831 if (gzflg == 7) tau_x470_new = tau_x412_new
1833 if (gzflg == 9) tau_x470_new = tau_x412_new
1835 if (gzflg == 10)
then
1836 if (xday >= 60.0 .and. xday < 274.0)
go to 605
1837 tau_x470_new = tau_x412_new
1844 tau_x412_flag_dust = -999
1845 tau_x412_dust_91 = -999.0 ; tau_x412_dust_93 = -999.0 ; tau_x412_dust_94 = -999.0
1846 tau_x412_dust_96 = -999.0 ; tau_x412_dust_995 = -999.0
1849 call aero_412_dust(dflag,refl,sza,xthet,xphi,mm,nn,ll,ma,
1850 1 imod,r412new,tau_x412_dust_995,tau_x412_flag_dust,trflg,0.0,debug)
1853 if (status /= 0)
then
1854 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1859 call aero_412_dust(dflag,refl,sza,xthet,xphi,mm,nn,ll,ma,
1860 1 imod,r412new,tau_x412_dust_96,tau_x412_flag_dust,trflg,0.0,debug)
1863 if (status /= 0)
then
1864 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1869 call aero_412_dust(dflag,refl,sza,xthet,xphi,mm,nn,ll,ma,
1870 1 imod,r412new,tau_x412_dust_94,tau_x412_flag_dust,trflg,0.0,debug)
1873 if (status /= 0)
then
1874 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1879 model_frac = 2.0/3.0
1880 call aero_412_dust(dflag,refl,sza,xthet,xphi,mm,nn,ll,ma,
1881 1 imod,r412new,tau_x412_dust_93,tau_x412_flag_dust,trflg,model_frac,debug)
1884 if (status /= 0)
then
1885 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1890 call aero_412_dust(dflag,refl,sza,xthet,xphi,mm,nn,ll,ma,
1891 1 imod,r412new,tau_x412_dust_91,tau_x412_flag_dust,trflg,0.0,debug)
1894 if (status /= 0)
then
1895 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1902 if ((gzflg <= 5 .and. gzflg > 0) .OR. gzflg == 27)
then
1904 tau_x412_flag = -999
1908 call aero_412(dflag,refl,x1,x2,x3,mm,nn,ll,ma,
1909 1 imod,r412ss,tau_x412ss_91,tau_x412_flag,trflg,0.0,debug)
1912 if (status /= 0)
then
1913 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1918 call aero_412(dflag,refl,x1,x2,x3,mm,nn,ll,ma,
1919 1 imod,r412ss,tau_x412ss,tau_x412_flag,trflg,0.0,debug)
1922 if (status /= 0)
then
1923 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1927 tau_x412ss_94 = tau_x412ss
1929 call aero_412(dflag,refl,x1,x2,x3,mm,nn,ll,ma,
1930 1 imod,r412ss,tau_x412ss_995,tau_x412_flag,trflg,0.0,debug)
1933 if (status /= 0)
then
1934 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1939 call aero_412(dflag,refl,x1,x2,x3,mm,nn,ll,ma,
1940 1 imod,r412ss,tau_x412ss_98,tau_x412_flag,trflg,0.0,debug)
1943 if (status /= 0)
then
1944 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1950 call aero_412(dflag,refl,x1,x2,x3,mm,nn,ll,ma,
1951 1 imod,r412ss,tau_x412ss_96,tau_x412_flag,trflg,0.0,debug)
1954 if (status /= 0)
then
1955 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1961 call aero_412(dflag,refl,sza,xthet,xphi,mm,nn,ll,ma,
1962 1 imod,r412ss,tau_x412ss_95,tau_x412_flag,trflg,model_frac,debug)
1965 if (status /= 0)
then
1966 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
1971 if (xday < 60.0 .or. xday > 334.0)
then
1972 if (tau_x412ss_97 <0.6) tau_x412ss = tau_x412ss_96
1974 if (xday > 243.0 .and. xday < 274.0)
then
1975 if (tau_x412ss_97 <0.6) tau_x412ss = tau_x412ss_96
1977 if (xday > 273.0 .and. xday < 335.0)
then
1978 if (tau_x412ss < 0.5) tau_x412ss = tau_x412ss_96
1980 if (xday > 59.0 .and. xday < 121.0)
then
1981 if (tau_x412ss < 0.5) tau_x412ss = tau_x412ss_96
1986 if (xday > 151.0 .and. xday < 244.0) ddx = 12.0
1987 if (xday > 243.0 .and. xday < 274.0) ddx = 12.0
1988 if (r412_tbl > ddx )
then
1989 if (tau_x412ss_97 < 0.6) tau_x412ss = tau_x412ss_96
1990 if (xday > 243.0 .or. xday < 60.0)
then
1991 if (tau_x412ss_995 < 0.5) tau_x412ss = tau_x412ss_995
1992 if (xday > 273.0 .and. xday < 305.0)
then
1993 if (tau_x412ss_97 < 0.6) tau_x412ss = tau_x412ss_96
1995 if (xlat >10.0 .and. xlat <21.0 .and. xlong > 10.0 .and. xlong < 20.0)
1996 1 tau_x412ss = tau_x412ss_96
1998 if (xday > 59.0 .and. xday < 121.0)
then
1999 tau_x412ss = tau_x412ss_96
2000 if (xlat >10.0 .and. xlat <21.0 .and. xlong > 10.0 .and. xlong < 20.0)
2001 1 tau_x412ss = tau_x412ss_96
2002 if (dstar1 < 1.01 .and. tau_x412ss>0.6) tau_x412ss = tau_x412ss_995
2003 if (dstar1 > 1.01 .and. dstar1 < 1.04 .and. tau_x412ss>0.6) tau_x412ss = tau_x412ss_98
2008 if (r412_tbl > 10.5 .and. dstar1 > 1.04)
then
2009 if (xlat >20.0 .and. xlat <25.0 .and. xlong > 25.0 .and. xlong < 30.0)
2010 1 tau_x412ss = tau_x412ss_94
2015 if (xday > 151.0 .and. xday < 305.0) ddx = 1.04
2019 if (xlat >20. .and. xlong > 12.9)
then
2020 if (r412_tbl > 8.5)
then
2021 if (xlat <22. .and. xlong < 17.0)
go to 632
2022 if (dstar1 .lt. ddx)
then
2023 dd = (xlong - 11.9) /3.0
2024 if (xlong > 14.9) dd = 1.
2025 tau_x412ss = tau_x412ss-(tau_x412ss-tau_x412ss_995)*dd
2027 dd = (xlat - 18.0) /4.0
2028 if (xlat > 22.0) dd = 1.
2029 tau_x412ss = dda1-(dda1-dda2)*dd
2033 if (xlat >15. .and. xlat <=20. .and. xlong > 22.0)
then
2034 if (r412_tbl > 8.5)
then
2035 if (dstar1 .lt. ddx)
then
2036 dda2 = tau_x412ss_995
2037 dd = (xlat - 18.0) /4.0
2038 if (xlat > 22.0) dd = 1.
2039 if (xlat < 18.0) dd = 0.
2040 tau_x412ss = dda1-(dda1-dda2)*dd
2044 if (xlat >19.0 .and. xlat <=20.0 .and. xlong > 19.8)
then
2045 if (r412_tbl > 8.5)
then
2046 if (dstar1 .lt. ddx)
then
2047 dda2 = tau_x412ss_995
2048 dd = (xlat - 18.0) /4.0
2049 if (xlat > 22.0) dd = 1.
2050 tau_x412ss = dda1-(dda1-dda2)*dd
2055 if (xday > 243.0 .and. xday < 274.0)
then
2056 if (xlat >19.0 .and. xlat <=21.0 .and. xlong > 19.8.and. xlong <23.5)
then
2057 if (r412_tbl > 8.5)
then
2058 if (dstar1 .lt. ddx) tau_x412ss = tau_x412ss_995
2064 if (xday > 243.0 .and. xday < 274.0)
then
2065 if (xlat>22.5 .and. xlat<30.0.and. xlong>-11.0.and. xlong< -5.)
then
2066 if (r412_tbl > 9.0) tau_x412ss = tau_x412ss_94
2068 if (xlat>22.5 .and. xlat<26.0.and. xlong>-13.0.and. xlong< -11.001)
then
2069 if (r412_tbl > 9.0) tau_x412ss = tau_x412ss_94
2071 if (xlat>=20.0 .and. xlat<29.0.and. xlong< -12.5)
then
2072 if (r412_tbl > 10.5) tau_x412ss = tau_x412ss_94
2074 if (xlat>15.0 .and. xlat<20.0 .and. xlong< -14.9)
then
2075 if (r412_tbl > 10.5) tau_x412ss = tau_x412ss_94
2079 if (xday > 151.0 .and. xday < 274.0)
go to 632
2082 if (xlat>20.0 .and. xlat<30.0 .and. xlong< -12.5)
then
2083 if (r412_tbl > 9.)
then
2084 if (dstar1 .lt. 1.01) tau_x412ss = tau_x412ss_995
2089 if (xlat>26.0 .and. xlat<30.0.and. xlong>=-12.5.and. xlong< -11.001)
then
2090 if (r412_tbl > 9.)
then
2091 if (dstar1 .lt. 1.01) tau_x412ss = tau_x412ss_995
2096 if (xlat>30.0 .and. xlat<36.0 .and. xlong<= -7.5)
then
2097 if (r412_tbl > 5.8)
then
2098 if (dstar1 .lt. 1.01) tau_x412ss = tau_x412ss_995
2103 if (xlat>31.5 .and. xlat<36.0 .and. xlong<= -5.0.and. xlong> -7.5)
then
2104 if (r412_tbl > 5.8)
then
2105 if (dstar1 .lt. 1.01) tau_x412ss = tau_x412ss_995
2113 if (tau_x412ss_97 < 0.6) tau_x412ss = tau_x412ss_96
2114 if (xday > 181.0 .and. xday < 274.0)
then
2115 if (tau_x412ss_995 <0.5) tau_x412ss = tau_x412ss_995
2117 if (xday > 273.0 .and. xday < 335.0)
then
2118 if (tau_x412ss_995 <0.5) tau_x412ss = tau_x412ss_995
2120 if (xday > 59.0 .and. xday < 121.0)
then
2121 if (tau_x412ss_995 <0.5) tau_x412ss = tau_x412ss_995
2127 if (gzflg >= 6 .and. gzflg <= 11)
then
2129 tau_x412_flag = -999
2130 if (r412ss2 > 20.0) print *,
'out, r412ss2: ', r412ss2
2131 if (r412ss2 < 1.0) print *,
'less, r412ss2: ', r412ss2
2134 call aero_412(dflag,refl,x1,x2,x3,mm,nn,ll,ma,
2135 1 imod,r412ss2,tau_x412ss2,tau_x412_flag,trflg,0.0,debug)
2138 if (status /= 0)
then
2139 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
2144 call aero_412(dflag,refl,x1,x2,x3,mm,nn,ll,ma,
2145 1 imod,r412ss2,tau_x412ss2_98,tau_x412_flag,trflg,0.0,debug)
2148 if (status /= 0)
then
2149 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
2154 call aero_412(dflag,refl,x1,x2,x3,mm,nn,ll,ma,
2155 1 imod,r412ss2,tau_x412ss2_995,tau_x412_flag,trflg,0.0,debug)
2158 if (status /= 0)
then
2159 print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
2164 c
If surface is vegetated, derive the surface reflectivity at 490 nm
and 670 nm
2165 c from 865 nm surface ler
and ndvi. specifically exclude sahara
and arabia via gzflg
2166 c flag. exclude areas with aeronet-based brdf info via brdf_flag == 0.
2167 c--------------------------------------------------------------------------------------------------
2175 if (sr_fail_flag .eqv. .true.)
then
2185 if (gzflg == 13)
then
2186 if (px_elev >= 500.0 .OR. lc == 6)
then
2193 if (gzflg < -900 .AND. (xlat < 30.0 .AND. xlong < -30.0))
then
2194 if (px_elev >= 500)
then
2201 if (toa_ndvi >= ndvi_thold .AND. brdf_flag /= 0)
then
2207 if (gzflg > 0 .AND. gzflg <= 11) do_veg = .false.
2208 if (gzflg == 15) do_veg = .false.
2209 if (gzflg == 20) do_veg = .false.
2210 if (gzflg == 19) do_veg = .false.
2211 if (gzflg == 34) do_veg = .false.
2212 if (gzflg == 21) do_veg = .false.
2213 if (gzflg == 23) do_veg = .false.
2214 if (gzflg == 24) do_veg = .false.
2215 if (gzflg == 27) do_veg = .false.
2218 if (gzflg == 16 .AND. (xday >= 335 .OR. xday < 60))
then
2219 if (toa_ndvi > 0.2)
then
2220 if (lc == 1 .OR. lc == 2 .OR. lc == 4)
then
2223 if (lc == 3 .AND. xlat < 25.0)
then
2232 if ((gzflg == 15 .or. gzflg == 19) .and. toa_ndvi > 0.4)
then
2237 if (gzflg == 13 .and. toa_ndvi > 0.4)
then
2246 if (debug) print *,
"ndvi, gzflg, brdf_flag, sr_fail_flag, do_veg: ", toa_ndvi, gzflg, brdf_flag, sr_fail_flag, do_veg
2248 c -- skip pixel
if no surf. reflc.
value and not suitable
for vege. retrieval.
2249 if ((do_veg .eqv. .false.) .AND. (sr_fail_flag .eqv. .true.))
go to 10
2253 c
if (ndvi670 >= 0.1 .AND. (gzflg < -900 .OR. gzflg > 11) .AND. brdf_flag /= 0)
then
2254 c print *,
'doing veg retrieval: ', itmp, jtmp, alg_flag
2255 c get current season
and tweak
for swf_aero_veg input.
2256 c iopss = season_from_doy(yr, doy)
2258 c
if (iopss == 0) iopss = 4
2260 c... *******************************************************************
2261 c... *******************************************************************
2262 c... *******************************************************************
2263 c-----------------------------------------------------------------------
2264 c...
do retrieval over vegetated surfaces(ndvi=>0.1)
2265 c-----------------------------------------------------------------------
2267 c...
do loop
"do 2500 imod=1,4", or use
2268 c... -->
"call swf_aero_veg(nvalx470,nvalx650,iopss,2,sza,xthet,"
2269 c... ------------------------------------------------------
2270 c gdt1 = gregorian_from_doy(yr,doy)
2272 c idx=int((xlong-(-180.0))/0.10)+1
2273 c idy=int((xlat-(-90.0))/0.10)+1
2274 c
if(idx.ge.1.and.idx.le.3600.and.idy.ge.1.and.idy.le.1800)
then
2275 c ioprg=veg_regions(idx,idy)
2280 c
select case (ioprg)
2282 c
select case (gdt1%month)
2292 c tau_x470_flag = -999
2293 c tau_x650_flag = -999
2295 tau_x470_flag_veg = -999
2296 call find_v_veg(gdt1%month,season,realbuf,tmpvg,
2297 1 r412sv_veg,r470sv_veg,gzflg,outbufvg,tau_x470_flag_veg)
2298 if (outbufvg(7) < 0.0 .and. tau_x470_flag_veg == 1)
go to 805
2300 c translate outbufvg back to local variables.
2302 xtau(i) = outbufvg(i)
2303 ssa(i) = outbufvg(i+3)
2304 outbuf(i+3) = ssa(i)
2306 tau550 = outbufvg(7)
2311 tau_x650_flag = outbufvg(10)
2312 xthet = outbufvg(13)
2313 scat_ang = outbufvg(14)
2314 sfc_typ = outbufvg(15)
2316 if (debug) print *,
"veg final: aot550, aot: ", tau550, xtau(1),
2322 if ((outbufvg(3).gt.0.2.and.alpha.lt.-0.5).or.
2323 & (outbufvg(3).gt.0.2.and.(realbuf(23)/realbuf(6)).lt.0.7).or.
2324 & (outbufvg(2).gt.0.4.and.(realbuf(23)/realbuf(6)).lt.0.7))
2325 & tau550 = tau_x470sv96
2327 c
Return fill
for 412 nm, no dark
target retrieval yet.
2329 c tau_x412_flag2 = -999
2330 c
if (lprint > 0) print *,
'after veg: ', i, j, xtau(2), xtau(4), tau550, &
2331 c & alpha, tau_x470_flag, tau_x650_flag
2335 c
if (status /= 0)
then
2336 c print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
2340 c
if (status /= 0)
then
2341 c print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
2345 c
if (status /= 0)
then
2346 c print *,
"ERROR: Failed to check/reset AOT out of bounds condition: ", status
2351 c
write (500,
'(7(F10.5,1X))') xlat, xlong, r470, r650, xtau(2), xtau(4), tau550
2353 c
if (lprint > 0) print *,
'after LUT check, veg: ', i, j, xlat, xlong, ndvi670, &
2354 c & r470, r650, xtau(2), xtau(4), tau550, alpha
2357 if (xtau(2) < 0.0 .or. xtau(3) < 0.0 .or. tau550 < 0.0)
then
2369 tau_x470_flag = -999
2370 tau_x650_flag = -999
2372 outbufvg(:) = -999.0
2375 if (debug) print *,
'final: ', xlat, xlong, xtau(2), xtau(3), tau550, alpha
2376 c
write(888,
'(7(F12.5), I3)') xlat, xlong, xtau(2), xtau(4), r470, r650, z_ndvi, proc_flag(i,j)
2377 c-----------------------------------------------------------------------
2378 c...
end of retrieval over vegetated surfaces
2379 c-----------------------------------------------------------------------
2380 c... *******************************************************************
2381 c... *******************************************************************
2382 c... *******************************************************************
2384 c r470 = get_ssr_490(yr, doy, ler650(i,j)*100.0, ler865(i,j)*100.0, status)
2385 c
if (status < 0)
then
2386 c print *,
"ERROR: Unable to derive vegetated surface "//
2387 c 1
"reflectivity for 490 nm: ", status
2392 c r650 = get_ssr_670(yr, doy, ler650(i,j)*100.0, ler865(i,j)*100.0, status)
2393 c
if (status < 0)
then
2394 c print *,
"ERROR: Unable to derive vegetated surface "//
2395 c 1
"reflectivity for 670 nm: ", status
2404 c
if (lprint > 0) print *,
'tau_x412,tau_x412_new,tau_x412ss,tau_x412ss2=',
2405 c 1 tau_x412,tau_x412_new,tau_x412ss,tau_x412ss2
2406 c--------------------------------------------------------
2407 c retrieving 412 nm ssa(412 - 470 nm)
2408 c--------------------------------------------------------
2409 if (dstar1.gt.1.05.and.rat1.gt.1.6)
go to 620
2410 if (tau_x470.lt.0.2.and.tau_x470.gt.0.0)
go to 805
2411 if (rr412_mod.gt.20.0.and.tau_x470.lt.0.0)
go to 620
2412 if (tau_x470.lt.0.0)
go to 620
2419 if (tau_x >= 3.5) tau_x = 3.5-0.0001
2420 call aero_412_abs(dflag,refl,x1,x2,x3,mm,nn,ll,
2426 if (w0_x.lt.0.0)
go to 10
2428 w0_int_470 = w0_x +(0.976 -w0_x)*(470.-412.)/(650.-412.)
2429 if (w0_int_470.lt.0.0) w0_int_470 = -999.
2431 c--------------------------------------------------------
2432 c retrieving 650 nm aot
2433 c--------------------------------------------------------
2434 if (dstar1 > 1.1 .and. xlong < -30.0)
go to 620
2435 if (xthet.gt.60.0.and.xphi.lt.90.0.and.tau_x470.gt.0.5)
2437 if (xlong < -30.0)
then
2438 if (r650.lt.30.0.and.tau_x470.lt.0.7.and.tau_x470.gt.0.0)
2441 if (r650.lt.30.0.and.r650.gt.15.0.and.tau_x470.lt.0.7.and.tau_x470.gt.0.0)
2444 c
if (r650.lt.30.0.and.tau_x470.lt.0.7.and.tau_x470.gt.0.0)
2446 if (r650.ge.30.0.and.tau_x470.lt.1.0.and.tau_x470.gt.0.0)
2448 if (scat_ang.gt.165.0.and.tau_x470.lt.1.8)
go to 805
2454 tau_x650_flag = -999
2456 call aero_650(dflag,refl,x1,x2,x3,mm,nn,ll,ma,
2457 1 r650,tau_x650,tau_x650_flag,tau_x470_flag2,
2458 1 tau_x412, tau_x470,tau_x412_flag_91,trflg)
2461 if (status /= 0)
then
2462 print *,
"ERROR: Failed to check/reset AOT out of bounds
2463 1 condition: ", status
2470 if (tau_x650 < 0.0)
go to 805
2471 c
if (tau_x650 > 3.5)
go to 805
2478 if (rat1.lt.1.8.and.tau_x470ss.gt.0.8) tau_x = tau_x470ss
2480 if (tau_x > 3.5) tau_x = 3.5
2481 if (tau_x > 3.5)
then
2484 if (tau_x >= 3.5) tau_x = 3.5-0.0001
2486 call aero_412_abs(dflag,refl,x1,x2,x3,mm,nn,ll,
2491 if (w0_x < 0.0)
go to 10
2499 if (tau_x >= 3.5) tau_x = 3.5-0.0001
2501 if (r470 > 24.0)
go to 805
2503 call aero_470_abs(dflag2,refl,x1,x2,x3,mm,nn,ll,
2504 1 r470,tau_x,w0_x470)
2505 if (dflag2)
go to 10
2507 if (w0_x470 < 0.0) w0_x470 = -999.
2514 call aero_mod (tau_x412,tau_x470,tau_x650,tau_x412_91,aot_mod)
2516 if (xlong < -30.0 .and. xlat >= 10.0 .and. dstar1 > 1.1 .and.
2517 1 realbuf(23) > 12.0 )
then
2518 if ((gzflg == 13 .or. gzflg == 31) .and. realbuf(22)/realbuf(6) < 0.3)
go to 807
2526 if (tau_x412 > 0.0 .and. tau_x470 > 0.0) xxrat = tau_x412 / tau_x470
2527 if (tau_x650 > 0.0 .and. tau_x470 > 0.0) xxrat2 = tau_x470 / tau_x650
2531 if (tau_x412 > 0.0 .AND. tau_x470 > 0.0) xxrat =
min(tau_x412, 3.5)/
min(tau_x470, 3.5)
2532 if (tau_x650 > 0.0 .and. tau_x470 > 0.0) xxrat2 =
min(tau_x470, 3.5)/
min(tau_x650, 3.5)
2534 if (xxrat < 0.0)
then
2539 dd = alog(412./490.)
2541 alpha = -1.*alpha/dd
2545 dd = ref650 / rr470_mod
2546 dd1 = ref650 / rr412_mod
2547 dd2 = rr470_mod / rr412_mod
2551 if (r650 < 30.0 .and. r650 > 9.0 .and. sfcdd < 2.4)
go to 850
2552 if (r650 < 30.0 .and. r650 > 9.0 .and. sfcdd > 2.4 .and.
2553 1 sfcdd < 3.2 .and. trflg > 0.)
go to 850
2557 if (px_elev > 500.0 .and. r650 > 10.0 .and. xlong < -30.0) aot = tau_x412
2558 if (px_elev > 500.0 .and. 1./rat_650_470 < 0.6 .and. tau_x650 > 0.6)
then
2559 if (xlong < -30.0 .and. xlat < 10.0)
go to 10
2560 if (xlong < -30.0 .and. xlat >= 10.0 .and. lc /= 6)
go to 10
2563 if (tau_x412_91 < 0.0 .and. tau_x650 > 0.0 .and. r650 < 30.0) aot = aot_mod(1)
2564 if (tau_x412_91 < 0.0 .and. r650 >= 30.0 .and. tau_x412 > 0.0) aot = aot_mod(4)
2565 if (aot < 0.3 .and. aot > 0.0)
go to 860
2566 if (w0_int < 0.92 .and. aot > 0.0) aot = aot_mod(2)
2567 if (r650 < 30.0 .and. tau_x412_91 > 1.2
2568 1 .and. tau_x412_91 > tau_x650 .and. tau_x650 > tau_x470
2569 1 .and. w0_int >= 0.939) aot = aot_mod(1)
2570 if (tau_x412_91 < 0.0 .and. tau_x470 < 0.0 .and. tau_x650 > 0.0) aot = aot_mod(1)
2571 if (aot < 0.0 .and. tau_x650 > 0.0) aot = aot_mod(1)
2572 if (tau_x412 < 0.0 .and. tau_x470 < 0.0 .and. dd1 > 1.35) alpha = -0.4
2573 if (tau_x412 < 0.0 .and. tau_x470 < 0.0 .and. dd1 <= 1.35) alpha = 1.8
2574 if (tau_x412 < 0.0 .and. tau_x470 > 0.0 .and. dd1 <= 1.4) alpha = 1.8
2575 if (aot < 0.0)
go to 10
2582 if (tau_x650 > aot .and. xlong > -30.0) aot = aot_mod(1)
2583 if (px_elev > 500.0 .and. r650 > 10.0 .and. xlong < -30.0) aot = tau_x412
2584 if (px_elev > 500.0 .and. 1./rat_650_470 < 0.6 .and. tau_x650 > 0.6)
then
2585 if (xlong < -30.0 .and. xlat < 10.0)
go to 10
2586 if (xlong < -30.0 .and. xlat >= 10.0 .and. lc /= 6)
go to 10
2589 if (aot < 0.0)
go to 10
2590 if (gzflg /= 16 .and. tau_x650 > 1.0 .and. dd2 < 1.1 .and. r650 > 15.)
go to 10
2592 if (tau_x412 > 0.0 .and. tau_x650 > 1.9 .and. dd2 < 1.2)
go to 10
2593 if (tau_x412 > 0.0 .and. tau_x470 > 1.9 .and. tau_x650 > 0.4
2594 1 .and. dd2 < 1.2 .and. gzflg /= 31 .and. gzflg /= 13)
go to 10
2595 if (gzflg /= 16 .and. tau_x412 > 0.0 .and. aot > 1.0 .and. dd2 < 1.1 .and.
2596 1 tau_x650 > 0.4 .and. r650 > 13.0 .and. r650 <= 15.0 .and. gzflg /= 31
2597 1 .and. gzflg /= 13)
go to 10
2599 if (tau_x412 > 0.0 .and. r412 > 18.0 .and. tau_x650 > 0.4
2600 1 .and. dd < 1.4 .and. r650 <= 15.)
go to 10
2602 if (gzflg /= 16 .and. tau_x412 > 1.0 .and. xxrat > 1.2 .and. r650 > 15.0
2603 1 .and. tau_x650 > 0.4 .and. gzflg /= 31 .and. gzflg /= 13)
go to 10
2605 if (tau_x650 > 1.5 .and. xxrat > 1.05 .and. tau_x412 < tau_x650 .and. tau_x412 > 0.0)
go to 10
2606 if (tau_x650 > 1.5 .and. tau_x412 < 0.0 .and. tau_x470 < 0.0 .and.
2607 1 dd2 < 1.6 .and. w0_x412 > 0.96)
go to 10
2608 if (tau_x650 > 1.2 .and. tau_x412 < 0.0 .and. xxrat2 > 1.2 .and. w0_x412 > 0.97)
go to 10
2611 if (tau_x412 < 0.0 .and. tau_x470 < 0.0 .and. dd1 > 1.35) alpha = -0.4
2612 if (tau_x412 < 0.0 .and. tau_x470 < 0.0 .and. dd1 <= 1.35) alpha = 1.8
2613 if (tau_x412 < 0.0 .and. tau_x470 > 0.0 .and. dd1 <= 1.4) alpha = 1.8
2615 if (tau_x650 > 2.0 .and. tau_x412 < 0.0 .and. tau_x470 > 2.0
2616 1 .and. tau_x470 < 3.0 .and. xxrat2 < 1.2 .and. xxrat2 > 1.0)
2619 if (tau_x650 > 2.0 .and. tau_x412 < 0.0 .and. tau_x470 > 3.0
2620 1 .and. xxrat2 < 1.45 .and. xxrat2 > 1.0)
go to 10
2622 if (tau_x412 < 0.0 .and. tau_x470 > 0.0 .and. xxrat2 > 2.)
2624 if (tau_x412 > 1.5 .and. tau_x470 > 0.0 .and. tau_x650 < 0.3)
2626 if (alpha > 1.0 .and. tau_x470 > 0.2) aot = aot_mod(5)
2627 if (alpha > 1.0 .and. tau_x470 <= 0.2) aot = aot_mod(5)*0.75
2628 if (tau_x412 < 0.0 .and. tau_x470 < 0.0 .and. dd1 <= 1.35) aot = aot_mod(6)
2632 c --- additional cloud screening
2638 if (abs_aero_flag .eqv. .true.)
then
2666 if (regid == 8 .and. gzflg < 0)
then
2667 aot = tau_x470_new_995
2669 model_frac = 1.0-aot/0.7
2670 aot = tau_x470_new_995*model_frac + tau_x470_new_96*(1.0-model_frac)
2672 aot = tau_x470_new_96
2677 if (regid == 9 .and. gzflg < 0)
then
2678 aot = tau_x470_new_96
2680 model_frac = 1.0-aot/0.7
2681 aot = tau_x470_new_96*model_frac + tau_x470_new_94*(1.0-model_frac)
2683 aot = tau_x470_new_94
2689 if (lc == 6 .AND. (gzflg /= 16 .AND. gzflg /= 2) .AND. gzflg /= 14 .AND. gzflg /= 21 .AND.
2690 1 gzflg /= 10 .AND. gzflg /= 20 .AND. gzflg /= 30 .and. gzflg/=31)
then
2691 tau550 = get_aot500(xlat, xlong, 0.0, scat_ang, season, toa_ndvi, 12, lc, stdv,
2692 1 tau_x412_new_91, tau_x412_new_93, tau_x412_new_94,
2693 1 tau_x412_new_96, tau_x412_new_995, tau_x470_new_91,
2694 1 tau_x470_new_92, tau_x470_new_93, tau_x470_new_94,
2695 1 tau_x470_new_95, tau_x470_new_96, tau_x470_new_995,
2696 1 tau_x412_dust_91, tau_x412_dust_93, tau_x412_dust_94,
2697 1 tau_x412_dust_96, tau_x412_dust_995,tau_x470_dust_91,
2698 1 tau_x470_dust_92, tau_x470_dust_93, tau_x470_dust_94,
2699 1 tau_x470_dust_95, tau_x470_dust_96, tau_x470_dust_995,
2700 1 alpha, status, (lprint > 0))
2701 if (status /= 0)
then
2708 tau550 = get_aot500(xlat, xlong, px_elev, scat_ang, season, toa_ndvi, gzflg, lc, stdv,
2709 1 tau_x412_new_91, tau_x412_new_93, tau_x412_new_94,
2710 1 tau_x412_new_96, tau_x412_new_995, tau_x470_new_91,
2711 1 tau_x470_new_92, tau_x470_new_93, tau_x470_new_94,
2712 1 tau_x470_new_95, tau_x470_new_96, tau_x470_new_995,
2713 1 tau_x412_dust_91, tau_x412_dust_93, tau_x412_dust_94,
2714 1 tau_x412_dust_96, tau_x412_dust_995,tau_x470_dust_91,
2715 1 tau_x470_dust_92, tau_x470_dust_93, tau_x470_dust_94,
2716 1 tau_x470_dust_95, tau_x470_dust_96, tau_x470_dust_995,
2717 1 alpha, status, (lprint > 0))
2718 if (status /= 0) then
2723 c
if (gzflg == 20)
then
2724 c tau550 = get_aot500(xlat, xlong, 0.0, scat_ang, season, toa_ndvi, 15, 3, stdv,
2725 c 1 tau_x412_new_91, tau_x412_new_93, tau_x412_new_94,
2726 c 1 tau_x412_new_96, tau_x412_new_995, tau_x470_new_91,
2727 c 1 tau_x470_new_92, tau_x470_new_93, tau_x470_new_94,
2728 c 1 tau_x470_new_95, tau_x470_new_96, tau_x470_new_995,
2729 c 1 alpha, status, (lprint > 0))
2730 c
if (status /= 0)
then
2736 if (gzflg == 21)
then
2737 tau550 = get_aot500(xlat, xlong, 0.0, scat_ang, season, toa_ndvi, 16, 4, stdv,
2738 1 tau_x412_new_91, tau_x412_new_93, tau_x412_new_94,
2739 1 tau_x412_new_96, tau_x412_new_995, tau_x470_new_91,
2740 1 tau_x470_new_92, tau_x470_new_93, tau_x470_new_94,
2741 1 tau_x470_new_95, tau_x470_new_96, tau_x470_new_995,
2742 1 tau_x412_dust_91, tau_x412_dust_93, tau_x412_dust_94,
2743 1 tau_x412_dust_96, tau_x412_dust_995,tau_x470_dust_91,
2744 1 tau_x470_dust_92, tau_x470_dust_93, tau_x470_dust_94,
2745 1 tau_x470_dust_95, tau_x470_dust_96, tau_x470_dust_995,
2746 1 alpha, status, (lprint > 0))
2747 if (status /= 0)
then
2753 if (gzflg == 23)
then
2754 tau550 = get_aot500(xlat, xlong, 0.0, scat_ang, season, toa_ndvi, 12, 6, stdv,
2755 1 tau_x412_new_91, tau_x412_new_93, tau_x412_new_94,
2756 1 tau_x412_new_96, tau_x412_new_995, tau_x470_new_91,
2757 1 tau_x470_new_92, tau_x470_new_93, tau_x470_new_94,
2758 1 tau_x470_new_95, tau_x470_new_96, tau_x470_new_995,
2759 1 tau_x412_dust_91, tau_x412_dust_93, tau_x412_dust_94,
2760 1 tau_x412_dust_96, tau_x412_dust_995,tau_x470_dust_91,
2761 1 tau_x470_dust_92, tau_x470_dust_93, tau_x470_dust_94,
2762 1 tau_x470_dust_95, tau_x470_dust_96, tau_x470_dust_995,
2763 1 alpha, status, (lprint > 0))
2764 if (status /= 0)
then
2770 if (lc == 6 .AND. (gzflg /= 16 .AND. gzflg /= 2) .AND. gzflg /= 14 .AND. gzflg /= 20 .AND.
2771 1 gzflg /= 21 .AND. gzflg /= 23 .AND. gzflg /= 24 .AND. gzflg /= 10 .AND. gzflg /= 30 .and. gzflg/=31)
then
2772 tau550 = get_aot500(xlat, xlong, 0.0, scat_ang, season, toa_ndvi, 12, lc, stdv,
2773 1 tau_x412_new_91, tau_x412_new_93, tau_x412_new_94,
2774 1 tau_x412_new_96, tau_x412_new_995, tau_x470_new_91,
2775 1 tau_x470_new_92, tau_x470_new_93, tau_x470_new_94,
2776 1 tau_x470_new_95, tau_x470_new_96, tau_x470_new_995,
2777 1 tau_x412_dust_91, tau_x412_dust_93, tau_x412_dust_94,
2778 1 tau_x412_dust_96, tau_x412_dust_995,tau_x470_dust_91,
2779 1 tau_x470_dust_92, tau_x470_dust_93, tau_x470_dust_94,
2780 1 tau_x470_dust_95, tau_x470_dust_96, tau_x470_dust_995,
2781 1 alpha, status, (lprint > 0))
2782 if (status /= 0)
then
2786 if ((gzflg <= 6 .OR. gzflg == 27) .and. (gzflg > 0 .and. gzflg /= 2))
then
2788 if (dstar1 > 1.08 .and. tau_x470ss > tau550) tau550 = tau_x470ss
2789 if (xday > 151.0.and.xday < 244.0)
then
2791 if (dstar1 > 1.09.and. wv <= 1.5 .and. tau_x470ss > tau550) tau550 = tau_x470ss
2792 if (dstar1 > 1.07 .and. tau_x470ss/tau_x412ss > 3.5) tau550 = tau_x470ss
2795 if (xday > 243.0.and.xday < 274.0) ddx = 1.0
2796 if (xday > 120.0.and.xday < 152.0) ddx = 1.0
2797 if (xday > 151.0.and.xday < 244.0) ddx = 1.0
2799 if (xday > 243.0.and.xday < 274.0)
then
2800 if (dstar1 > 1.01 .and. r412_tbl <12.0 .and. tau_x470ss > tau550) tau550 = tau_x470ss
2801 if (dstar1 > 0.98 .and. wv > 1.7 .and. tau_x470ss > tau550) tau550 = tau_x470ss
2803 if (tau_x470ss > tau550)
then
2804 if (xlong <= -5.0) tau550 = tau_x470ss
2805 if (xlong > -5.0 .and. xlong < 0.0)
then
2806 dd = (5.+xlong) / 5.
2807 tau550 = (1.-dd)* tau_x470ss + dd * tau_x412ss
2809 if (xday > 120.0.and.xday < 152.0)
then
2810 if (xlong <= -5.0) tau550 = tau_x470ss
2811 if (xlong > -5.0 .and. xlong < 10.0)
then
2812 dd = (5.+xlong) / 15.
2813 tau550 = (1.-dd)* tau_x470ss + dd * tau_x412ss
2818 if (tau_x470ss > tau550)
then
2819 if (xlong >= 35.0) tau550 = tau_x470ss
2820 if (xlong > 27.0 .and. xlong < 35.0)
then
2821 dd = (xlong-27.0) / 8.
2822 tau550 = dd* tau_x470ss + (1.-dd) * tau_x412ss
2827 if (tau550 < 0.1) tau550 = tau550 + 0.05
2829 if (dstar1 > 1.1 .and. tau_x470ss > tau_x412ss) tau550 = tau_x470ss
2831 if (xday > 151.0.and.xday < 258.0.and.
2832 1 dstar1 > 1.2.and.tau_x650 < 0.0.and.tau550 < 0.8)
2833 1 tau550 = tau_x470ss * 2.
2835 if (dstar1 > 1.2.and.tau_x412ss < 0.5 .and.tau550< 0.7)
2838 if (wv < 0.45.and.tau_x470ss >0.9.and.tau_x412ss < 0.7) tau550 = tau_x412ss
2839 if (dstar1 > 1.08 .and. tau_x470ss > tau550) tau550 = tau_x470ss
2843 if (gzflg >= 6 .and. gzflg <= 11 .AND. gzflg /= 10)
then
2845 if (tau550 < 0.45) tau550 = (tau_x470ss+tau_x412ss2)/2.
2846 if (xday > 243.0 .and. xday < 274.0)
then
2848 if (tau550 < 0.45.and. tau_x412ss2 > tau550) tau550 = (tau_x470ss+tau_x412ss2)/2.
2850 if (xday > 120.0 .and. xday < 151.0)
then
2852 if (tau550 < 0.45.and. tau_x412ss2 > tau550) tau550 = (tau_x470ss+tau_x412ss2)/2.
2854 if (xday > 90.0 .and. xday < 121.0)
then
2855 tau550 = tau_x412ss2
2856 if (tau550 < 0.5 .and. tau_x470ss > tau550) tau550 = tau_x470ss
2858 if (xlat > 29.5 .and. dstar1 < 0.97)
then
2859 if (tau550 > 0.6) tau550 = tau_x412ss2_995
2862 if (xday < 182.0)
then
2863 if (xlat > 20.0.and. xlat < 28.0.and.xlong > 42.0.and. xlong < 50.0)
then
2864 if (dstar1 < 1.06.and.r412_tbl > 14.0.and.tau550 > 0.8)
go to 10
2868 if (dstar1 > 1.1 .and. tau_x470ss <0.45) tau550 = dstar1
2870 if (xday > 243.0 .and. xday < 274.0)
then
2871 if (dstar1 < 0.98.and.r412_tbl > 12.0.and.tau550 > 0.8)
go to 10
2873 if (xday > 273.0 .and. xday < 305.0)
then
2874 if (dstar1 < 1.04.and.r412_tbl > 12.0.and.tau550 > 0.75)
go to 10
2877 if (xday > 150.0 .and. xday < 258.0)
then
2878 if (xlat > 20.0.and. xlat < 28.0.and.xlong > 42.0.and. xlong < 50.0)
then
2879 if (dstar1 < 1.06.and.r412_tbl > 12.8.and.tau550 > 0.78)
go to 10
2881 if (dstar1 < 1.04.and.r412_tbl > 12.0.and.tau550 > 0.78.and. xlat>21.0.and.xlong<53.0)
go to 10
2882 if (dstar1 < 1.04.and.r412_tbl > 12.0.and.tau550 > 0.78.and. xlat>23.0.and.xlong>=53.0)
go to 10
2888 if (gzflg < 6 .and. gzflg >0 .and. dstar1 > 1.08 .and. tau_x470ss > tau550) tau550 = tau_x470ss
2893 if (gzflg >= 6 .and. gzflg <= 11 .AND. gzflg /= 10)
then
2894 if ((r650_135 > 32.0) .AND. (r650_135/r412_135) > 3.7)
then
2895 if (xlat > 20.5 .and. xlong < 50.0)
go to 861
2896 if (xlat > 19.0.and. xlat < 20.5 .and. xlong > 43.0 .and. xlong < 48.0)
go to 861
2897 if ((r412_135 < 7.25) .OR. r650_135 > 42.0 .OR. dstar1 >1.03 .OR. use_alternate_brdf)
then
2900 else if (xday >= 152.0 .AND. xday <= 243.0)
then
2901 if (dstar1 < 0.99) tau550 = (tau_x412_new_94+tau_x412_new_96)/2.0
2903 else if (xday >= 244.0 .AND. xday < 335.0)
then
2904 tau550 = (tau_x412_new_94+tau_x412_new_96)/2.0
2907 tau550 = tau_x412_new_94
2908 if (xday >= 120.0 .AND. xday < 152.0.AND.tau550<0.3.AND.tau_x470ss>tau550) tau550 = tau_x470ss
2915 if (lprint > 0) print *,
'after get_aot500: xlat, xlong, tau550: ', gzflg, xlat, xlong, tau550
2925 if (((gzflg <6 .and. gzflg >0) .OR. gzflg == 27) .and. xlat <20.0 .and. lc <5)
then
2926 if (xday > 335.0 .or. xday < 32.0)
then
2927 if (tau550 < 0.065 .or. tau_x470 <0.05)
then
2928 dd412 = rr412_mod - r412_tbl
2929 dd470 = rr470_mod - r470_tbl
2930 dd650 = ref650 - r650_tbl
2931 if (debug) print *,
'smoke check, dd412, dd470, dd650: ', dd412, dd470, dd650
2933 if (dd412 < 1.0)
then
2934 call smoke_mod(xthet,scat_ang,dd412,dd470,dd650,
2935 1 tau_x412ss,tau_x412ss_91,tau_smoke)
2936 if (debug) print *,
'smoke_mod, dd412, dd470, dd650,t412ss, t412_91, tsmoke: ',
2937 1 dd412, dd470, dd650, tau_x412ss, tau_x412ss_91, tau_smoke
2939 if (tau_smoke < 0.25)
then
2940 tau550 = tau_smoke *2.0
2941 if (debug) print *,
'smoke detected, aot550 reset: ', tau550
2947 if (lprint > 0) print *,
'after smoke check: tau550: ', tau550
2949 if (lprint > 0) print *,
2950 1
'gzflg,lc, tau_x412ss,tau_x470ss,tau550 =',
2951 1 gzflg,lc,tau_x412ss,tau_x470ss,tau550
2953 864
if (lprint > 0)
then
2954 print *,
'lat,lon,gzflg,r650,tau_x650,tau_x470,tau550: ', xlat, xlong, gzflg, r650,
2955 1 tau_x650, tau_x470, tau550
2956 print *,
'abs_aero_flag: ', abs_aero_flag
2959 c -- try to detect
and remove smoke over clouds.
for example, see rgb:
2960 c -- myd021km.a2007081.0640*.hdf
2961 if (debug) print *,
'smoke detection: ', xlat, xlong, r650, tau_x650, refl6, w0_x470
2962 if (r650 <8.0 .and. tau_x650 > 3.49 .and. refl6 > 0.1 .and.w0_x470 > 0.999)
go to 10
2972 if (px_elev > 750.0 .AND. (xlat > 28.0 .AND. xlat < 37.0 .AND. xlong > -12.0 .AND.
2973 1 xlong < 10.0))
then
2978 if (px_elev > 750.0 .AND. (xlat > 10.5 .AND. xlat < 19.5 .AND. xlong > 20.5 .AND.
2979 1 xlong < 29.0))
then
2984 if (lc == 6 .AND. gzflg < 6 .AND. (xlat > -5.0 .AND. xlat < 18.0 .AND. xlong > 35.0 .AND.
2985 1 xlong < 52.0))
then
2991 if ((rr412_mod - r412_135) < -1.0.and.px_elev < 1000.0 .and.
2992 1 gzflg >= 6 .and. gzflg <= 11)
go to 10
2995 if (gzflg == 13 .and. lc == 6 .and. tau550 > 1.2 .and. dstar1 < 1.0 .and.
2996 1 realbuf(6)/realbuf(22) > 1.65)
go to 10
2998 if (gzflg_sav == 31 .and. tau550 > 0.6 .and. dstar1 < 1.1 .and.
2999 1 realbuf(22)/realbuf(6) < 0.5)
go to 10
3001 c -- check d*
for dust plumes globally except
for n.africa(1-5, 26, 27),
3002 c -- arabian peninsula(6-11), taklimakan desert(24),
and beijing(east china, 16)
3003 c -- zones. limit to locations at less than 4500 m elevation. otherwise,
3004 c -- abnormally high aot
's are seen over Tibetan Plateau.
3005 c ----------------------------------------------------------------------------
3006 c ----------------------------------------------------------------------------
3007 c -- Increased threshold to 1.15 from 1.05 over globe. Created exception for
3008 c -- ConUS (1.05). Needs to be tested and results analysed after next SIPS
3009 c -- large-scale test!
3010 c ----------------------------------------------------------------------------
3011 c ----------------------------------------------------------------------------
3012 .OR..AND..AND..AND.
if ((gzflg < 0 gzflg > 11) (gzflg /= 24 gzflg /= 26
3013 .AND.
& gzflg /= 27 gzflg /= 16)) then
3014 if (px_elev < 4750.0) then
3016 .and.
if (gzflg_sav == 13 realbuf(22)/realbuf(6) > 0.3) dda1 = 1.05
3017 .and.
if (gzflg_sav == 31 realbuf(22)/realbuf(6) > 0.5) dda1 = 1.05
3018 if (Dstar1 > dda1) tau550 = tau_x650
3019 .and.
if (Dstar1 > dda1 tau_x470 > tau550) tau550 = tau_x470
3020 .and..and.
if (gzflg_sav == 31 gzflg == 13 realbuf(22)/realbuf(6) > 0.3
3021 .and..and.
1 Dstar1 > 1.05 tau_x470 > tau550) tau550 = tau_x470
3029 if (w0_x412 > 0.0) w0_x = w0_x412
3030 if (w0_x470 > 0.0) w0_int_470 = w0_x470
3032 if (alpha < 1.0) ssa(1) = w0_x
3033 if (alpha < 1.0) ssa(2) = w0_int_470
3034 if (ssa(1) > 0.0) ssa(3) = 0.976
3035 c-- Set Surface Type
3039 .gt.
if (terrain_flag_new50.0) sfc_typ = 7.
3040 .lt..and..gt.
if (terrain_flag_new55.5terrain_flag_new50.0)
3043 C dd = xsfc650(ilon,ilat) - xsfc650_bk2(ilon,ilat)
3044 C dd1 = xsfc470b_bk(ilon,ilat) - xsfc470_bk(ilon,ilat)
3046 .lt..and..gt..and.
if (terrain_flag_new55.5terrain_flag_new50.0
3047 .le..and..lt.
1 xlat15.0xlong26.0) then
3049 .gt..and..ge.
C if (xlong10.0abs(dd1)0.2) then
3050 .gt.
C if (xsfc470_bk(ilon,ilat)10.0) sfc_typ = 2.
3051 .le..and.
C if (xsfc470_bk(ilon,ilat)10.0
3052 .gt..and.
C 1 xsfc470_bk(ilon,ilat)9.0
3053 .lt.
C 1 xsfc650_bk(ilon,ilat)22.0) sfc_typ = 2.
3055 .gt.
C if (xlong10.0) then
3056 .gt..and.
C if (xsfc470_bk(ilon,ilat)10.0
3057 .lt.
C 1 xsfc650_bk(ilon,ilat)23.0) sfc_typ = 2.
3060 .lt..and..gt..and.
C if (terrain_flag_new55.5terrain_flag_new50.0
3061 .gt..and..le..and..ge.
C 1 xlat15.0xlat20.0dd1.6) then
3063 .gt..and..ge.
C if (xlong10.0abs(dd1)0.2) then
3064 .gt.
C if (xsfc470_bk(ilon,ilat)10.0) sfc_typ = 2.
3065 .gt..and.
C if (xsfc470_bk(ilon,ilat)10.0
3066 .lt.
C 1 xsfc650_bk(ilon,ilat)23.0) sfc_typ = 2.
3067 .le..and.
C if (xsfc470_bk(ilon,ilat)10.0
3068 .gt..and.
C 1 xsfc470_bk(ilon,ilat)9.0
3069 .lt.
C 1 xsfc650_bk(ilon,ilat)22.0) sfc_typ = 2.
3072 .lt..and..gt..and.
C if (terrain_flag_new55.5terrain_flag_new50.0
3073 .ge..and..le..and..ge.
C 1 xlong26.0xlat20.0dd1.6) then
3075 .gt..and..ge.
C if (xlong10.0abs(dd1)0.2) then
3076 .gt.
C if (xsfc470_bk(ilon,ilat)10.0) sfc_typ = 2.
3077 .gt..and.
C if (xsfc470_bk(ilon,ilat)10.0
3078 .lt.
C 1 xsfc650_bk(ilon,ilat)23.0) sfc_typ = 2.
3079 .le..and.
C if (xsfc470_bk(ilon,ilat)10.0
3080 .gt..and.
C 1 xsfc470_bk(ilon,ilat)9.0
3081 .lt.
C 1 xsfc650_bk(ilon,ilat)22.0) sfc_typ = 2.
3085 .gt..and..lt.
if (terrain_flag_new52.5terrain_flag_new53.5)
3088 .gt..and..lt.
if (terrain_flag_new51.5terrain_flag_new52.5) then
3090 .gt..and..lt.
C if (xsfc470_bk(ilon,ilat)6.7xlong-7.9)
3094 .gt..and..lt..and.
C if (terrain_flag_new54.5terrain_flag_new55.5
3095 .gt..and..lt..and.
C 1 xlat31.3xlong-7.9xsfc470_bk(ilon,ilat)
3096 .gt..and..lt.
C 1 6.7xsfc470_bk(ilon,ilat)9.5)
3099 .gt..and..lt.
if (terrain_flag_new53.5terrain_flag_new54.5)
3102 .gt..and..lt.
if (terrain_flag_new58.5terrain_flag_new59.5)
3105 .gt..and..lt.
if (terrain_flag_new59.5terrain_flag_new510.5)
3108 .gt..and..lt..and.
if (terrain_flag_new55.5terrain_flag_new56.5
3109 .gt..and..lt..and..gt..and.
1 xlat24.6xlat25.2xlong46.1
3110 .lt..and..ge..and.
1 xlong46.8r412_tbl7.0
3115 .gt..or..gt.
if (tau_x650_flag0tau_x470_flag0) qa_flag(4)= 3
3116 .lt..and..lt..and.
if (tau_x4120.0tau_x4700.0
3117 .lt.
1 tau_x6500.0) then
3123 .gt..or..gt..or.
if (tau_x4120.0tau_x4700.0
3124 .gt.
1 tau_x6500.0) qa_flag(1)= 1
3125 .lt..or..gt.
if (tau_x4120.05tau_x4700.05)
3127 .ge..and..lt.
if (tau_x4120.05tau_x4120.3)
3129 .ge.
if (tau_x4120.3)
3131 .lt..and..gt.
if (alpha0.5alpha0.0)
3133 .ge..and..lt.
if (alpha0.5alpha1.4)
3138 ! -- in zone 1, in summer, sometimes the BRDF for low NDVI pixels is too high
3139 ! -- resulting in an abnormally low AOT. In these cases, perform a second retrieval
3140 ! -- using a constant fit (an alternate fit) for 470nm that will bring up
3141 ! -- those low areas.
3142 .AND..AND..AND.
if (tau550 < 0.1 (gdt1%month >= 6 gdt1%month <= 8) gzflg == 1) then
3143 .NOT.
if ( use_alternate_brdf) then
3144 use_alternate_brdf = .true.
3149 ! -- over Arabian Peninsula, trouble with some very low AOT's in certain areas. redo
3151 if (.NOT. use_alternate_brdf .AND. (tau550 < 0.25 .AND.
3152 & (gdt1%month >= 6 .AND. gdt1%month< = 8) .AND. gzflg >= 6 .AND. gzflg <= 11 .AND. gzflg /= 10))
then
3153 if (r650_135 > 32.0 .AND. (r650_135/r412_135) > 3.7)
then
3154 use_alternate_brdf = .true.
3160 c --
use tau_x470sv96_dust over high elevation
3162 if (gzflg /= 15 .and. gzflg /= 19 .and. xlong> -20.0 .and. xlong< 70.0 .and.
3163 & xlat> 5.0 .and. xlat< 45.0)
then
3165 if (gzflg < 6 .and. gzflg > 0)
then
3166 if (dstar1 < 1.1)
then
3167 if (r412_tbl > 12.0 .and. dstar1 < 0.95 .and. tau_x470sv96_dust > 0.6) tau_x470sv96_dust = -999.
3169 if (xday >= 91.0 .and. xday < 244.0) dd = 10.0
3170 if (xlat >= 20.0 .and. xlong <= dd .and. tau_x470sv96_dust > 0.0)
then
3171 tau550 = tau_x470sv96_dust
3174 if (xday < 91.0 .or. xday >= 244.0)
go to 871
3175 if (xlong >= 10.0 .and. xlong <15.0 .and. xlat > 15.0)
then
3176 dd = (xlong - 10.0) / 5.
3177 if (tau_x470sv96_dust > 0.0 .and. tau550 > 0.0)
then
3178 tau550 = tau_x470sv96_dust + (tau550 - tau_x470sv96_dust) * dd
3184 if (xday >= 91.0 .and. xday < 244.0) dd = 10.0
3185 if (xlat >= 15.0 .and. xlat <20.0 .and. xlong < dd)
then
3186 dd = (xlat - 15.0) / 5.
3187 if (tau_x470sv96_dust > 0.0 .and. tau550 > 0.0)
then
3188 tau550 = tau550 + (tau_x470sv96_dust - tau550) * dd
3194 if (tau_x470sv96_dust > tau550)
then
3195 tau550 = tau_x470sv96_dust
3198 if (xlat >= 25.0 .and. xlong >= 20)
then
3202 if (xlong >= 10.0 .and. xlong <20.0 .and. xlat > 20.0)
then
3203 dd = (xlong - 10.0) / 10.
3204 if (tau550_sav > 0.0 .and. tau550 > 0.0)
then
3205 tau550 = tau550 + (tau550_sav - tau550) * dd
3209 if (xlat >= 20.0 .and. xlat <25.0 .and. xlong > 10)
then
3210 dd = (xlat - 20.0) / 5.
3211 if (tau550_sav > 0.0 .and. tau550 > 0.0)
then
3212 tau550 = tau550 + (tau550_sav - tau550) * dd
3217 if (r412_tbl > 12.0 .and. tau_x470sv96_dust < 0.0)
then
3218 if (realbuf(23) > 25.0 .and. realbuf(23)/realbuf(6) > 0.7
3219 & .and. realbuf(23)/realbuf(6) < 0.85)
go to 867
3223 if (xday >= 152.0 .and. xday < 244.0 .and. dstar1 >= 1.04 .and. tau_x470sv96_dust > tau550)
then
3224 tau550 = tau_x470sv96_dust
3227 if (dstar1 >= 1.1 .and. tau_x470sv96_dust > tau550)
then
3228 tau550 = tau_x470sv96_dust
3230 if (dstar1 >= 1.1 .and. tau_x470sv96_dust <0.0 .and. tau550 < 0.3)
then
3231 tau550 = tau_x470sv96_dust
3235 if (gzflg == 2 .or. (gzflg > 5 .and. gzflg < 12))
then
3236 tau550 = tau_x470sv96_dust
3239 if (gzflg == 30)
then
3240 if (xlong > 65.0 .and. xlong< 70.0)
then
3241 dd = (xlong - 65.0) / 5.
3242 if (tau_x470sv96_dust > 0.0 .and. tau550 > 0.0)
then
3243 tau550 = tau550 + (tau_x470sv96_dust - tau550) * (1.-dd)
3245 if (tau_x470sv96_dust < 0.0)
then
3246 tau550 = tau_x470sv96_dust
3249 tau550 = tau_x470sv96_dust
3253 if (gzflg /= 30 .and. tau_x470sv96_dust > tau550 .and.
3254 & (px_elev > 750.0 .and. (xlat> 14.0. or. xlong< 5.5 .or. xlong> 19.0))
3255 & .and. (px_elev > 750.0 .and. (xlat> 14.0 .or. xlong > -6.37)))
then
3256 tau550 = tau_x470sv96_dust
3259 if (gzflg == 32) then
3260 if (season == 1)
then
3261 if (tau_x470sv96 < 0.3)
then
3262 tau550 = tau_x470sv96
3263 elseif (tau_x470sv96 < 0.6)
then
3264 aod_frac = (tau_x470sv96-0.3)/(0.6-0.3)
3265 tau550 = (1.0-aod_frac)*tau_x470sv96+aod_frac*tau_x470sv94
3267 tau550 = tau_x470sv94
3270 if (tau_x470sv995 < 0.3)
then
3271 tau550 = tau_x470sv995
3272 elseif (tau_x470sv995 < 0.6)
then
3273 aod_frac = (tau_x470sv995-0.3)/(0.6-0.3)
3274 tau550 = (1.0-aod_frac)*tau_x470sv995+aod_frac*tau_x470sv96
3276 tau550 = tau_x470sv96
3281 if (gzflg == 33) then
3282 if (season == 1)
then
3283 if (tau_x412sv96 < 0.3)
then
3284 tau550 = tau_x412sv96
3285 elseif (tau_x412sv96 < 0.6)
then
3286 aod_frac = (tau_x412sv96-0.3)/(0.6-0.3)
3287 tau550 = (1.0-aod_frac)*tau_x412sv96+aod_frac*tau_x412sv94
3289 tau550 = tau_x412sv94
3292 if (tau_x412sv98 < 0.3)
then
3293 tau550 = tau_x412sv98
3294 elseif (tau_x412sv98 < 0.6)
then
3295 aod_frac = (tau_x412sv98-0.3)/(0.6-0.3)
3296 tau550 = (1.0-aod_frac)*tau_x412sv98+aod_frac*tau_x412sv96
3298 tau550 = tau_x412sv96
3318 if (xtau(1) > 3.5) xtau(1) = 3.5
3319 if (xtau(2) > 3.5) xtau(2) = 3.5
3320 if (xtau(3) > 3.5) xtau(3) = 3.5
3325 if (realbuf(22) > 0.0 .and. realbuf(22) < 50.0)
then
3326 dda1 = (realbuf(22)*realbuf(6)) / (realbuf(23)*realbuf(23))
3330 if (xlong < -20.0 .or. (xlat <30.0 .and. xlat >-40.0 .and.
3331 1 xlong >-30.0 .and. xlong <60.0 .and. gzflg < 1) .or.
3332 1 gzflg == 26 .or. gzflg == 27 .or. (gzflg > 0 .and. gzflg < 6))
go to 868
3333 if (xphi >= 90.0 .and. xthet > 50.0 .and. realbuf(23) < 33.0)
then
3334 ddx = 0.90 - (0.90-0.83)*(xthet-50.0)/15.0
3335 if (xthet > 65.0) ddx = 0.83
3339 if (tau550 > 0.4 .and. dda1 < ddx .and. bt11 > 286.0) dda2 = 1.0
3342 if (realbuf(22) > 0.0 .and. realbuf(22) < 50.0)
then
3343 dda3 = realbuf(23)-realbuf(22) - (realbuf(6)-realbuf(23))*(488.-412.)/(670.-488.)
3345 if (dda1 < 0.90 .and. dda1 > 0.86 .and. dda3 < 1.4) dda2 = 0.0
3348 if (tau550 < -900.0)
then
3360 tau_x470_flag = -999
3361 tau_x650_flag = -999
3364 c-------------------------------------------------------------
3366 c-------------------------------------------------------------
3367 if (debug) print *,
'final spectra aot: ', xtau(1), xtau(2), xtau(3)
3368 if (debug) print *,
'final tau550, ae: ', tau550, alpha
3369 if (debug) print *,
'final SSA: ', ssa(1), ssa(2), ssa(3)
3372 outbuf(i+3) = ssa(i)
3379 if (tau_x470_flag_veg == 1 .or. tau_x470_flag > 0) outbuf(10) = 1.0
3386 outbuf(15) = sfc_typ
3387 outbuf(18) = float(alg_flag)
3388 outbuf(19) = outbufvg(21)
3389 outbuf(20) = outbufvg(7)
3391 if (realbuf(22) > 0.0 .and. realbuf(22) < 50.0)
3392 1 outbuf(21) = realbuf(22)/realbuf(23)
3400 subroutine search(dflag,xbar,x,n,i)
3403 c
locate position in
table of point at which interpolation is
3407 c
call search (xbar, x, n, i)
3409 c description of parameters
3410 c xbar - point at which interpolation is required
3411 c x - array containing independent variable
3412 c n - number of points in x array
3413 c i -
index specifying segment containing xbar
3419 if (n.lt.2)
go to 15
3420 if(x(1).gt.x(2))
go to 17
3421 m = int((log(float(n)))/b)
3423 if (i .ge. n) i = n-1
3426 if (k .eq. 0) icnt = icnt + 1
3427 if (icnt .ge. 2)
goto 27
3428 if (xbar.ge.x(i).and.xbar.lt.x(i+1))
return
3429 if (xbar.gt.x(i))
go to 12
3433 if (i.lt.n)
go to 10
3436 15 print *,
"Search n is less than 2."
3438 17 print *,
"Search table is not in increasing order."
3443 if (xbar.ge.x(i).and.xbar.le.x(i+1))
return
3445 write(6,*)
"setting dflag = true"
3451 subroutine search2(dflag,xbar,x,n,i,fx)
3453 c
call search (xbar, x, n, i)
3455 c description of parameters
3456 c xbar - point at which interpolation is required
3457 c x - array containing independent variable
3458 c n - number of points in x array
3459 c i -
index specifying segment containing xbar
3460 c fx - fraction from i(between i
and i+1)
3465 call search(dflag,xbar,x,n,i)
3467 fx = (xbar-x(i))/ (x(i+1)-x(i))
3473 c------------------------------------------------------------
3474 subroutine aero_mod (tau_x412,tau_x470,tau_x650,
3475 1 tau_x412_91,aot_mod)
3479 aot_mod(1) = tau_x650
3480 aot_mod(2) = tau_x470
3481 aot_mod(3) = tau_x412_91
3482 aot_mod(4) = tau_x412*1.9
3483 aot_mod(5) = tau_x470*2.
3484 aot_mod(6) = tau_x650*2.8
3491 integer,
intent(in) :: geo_zone
3492 integer,
intent(in) :: retr_flag
3493 real,
intent(inout) :: aot
3497 if (retr_flag == -10)
then
3498 select case (geo_zone)
3499 case (5:11, 15, 16, 19, 20, 21, 23, 24, 26, 27)
3501 case (1:4, 12:14, 17, 18, 22, 25, 28, 29, 30, 31, 32, 33, 34)
3507 print *,
"ERROR: Invalid geographical zone in handle_lut_out_of_bounds: ", geo_zone
3508 print *,
"Use default aot of 0.02 rather than return without output"
3519 subroutine smoke_mod(view,scat_ang,dd412,dd470,dd650,
3520 1 tau_x412ss,tau_x412ss_91,tau_smoke)
3523 real,
intent(in) :: view
3524 real,
intent(in) :: scat_ang
3525 real,
intent(in) :: dd412
3526 real,
intent(in) :: dd470
3527 real,
intent(in) :: dd650
3528 real,
intent(in) :: tau_x412ss, tau_x412ss_91
3531 if (dd412 <1.0 .and. dd470 <1.0)
then
3532 tau_smoke = tau_x412ss * 2.85
3533 if (dd470 > dd412 .and. dd650 > dd412)
3534 1 tau_smoke = tau_x412ss_91 * 1.77
3535 if (
abs(dd412-dd470) < 0.25)
then
3536 if (dd412 <0.35) tau_smoke = tau_x412ss * 4.3
3537 if (scat_ang <158.0 .and. dd412 <0.8)
then
3538 tau_smoke = tau_x412ss * 3.5
3539 if (view >45.0 .and. dd470 <0.2 .and.
abs(dd412-dd470) < 0.24)
3540 1 tau_smoke = tau_x412ss * 6.0
3543 if (
abs(dd412-dd650) < 0.1 .and. dd412 >0.7)
3544 1 tau_smoke = tau_x412ss_91
3545 if (dd650 > 1.0 .and.
abs(dd412-dd470) < 0.25)
then
3546 tau_smoke = tau_x412ss * 4.5
3547 if (scat_ang <158.0 .and. dd412 >0.8)
3548 1 tau_smoke = tau_x412ss * 3.5
3552 if (dd412 >1.0 .and. dd470 <1.0)
then
3553 tau_smoke = tau_x412ss * 2.7
3554 if (
abs(dd412-dd470) < 0.25 .and. dd650 <0.)
3555 1 tau_smoke = tau_x412ss * 2.4
3558 if (dd412 <1.0 .and. dd470 >1.0)
then
3559 tau_smoke = tau_x412ss * 2.7
3560 if (
abs(dd412-dd470) < 0.25 .and. dd650 <0.)
3561 1 tau_smoke = tau_x412ss * 2.4
3562 if (dd650 - dd470 > -0.2)
then
3563 tau_smoke = tau_x412ss * 2.1
3564 if (view < 45.0) tau_smoke = tau_x412ss_91
3568 if (dd412 >1.0 .and. dd470 >1.0)
then
3569 if (dd412 > dd470) tau_smoke = tau_x412ss_91 * 1.15
3570 if (dd470 > dd650 .and. dd650 > dd412 .and. dd650 >1.0)
then
3571 if (view >= 45.0) tau_smoke = tau_x412ss * 2.1
3572 if (view < 45.0) tau_smoke = tau_x412ss_91
3574 if (dd412 <2.0 .and. dd470 >2.0)
3575 1 tau_smoke = tau_x412ss * 1.4
3576 if (dd650 > dd470 .and. dd470 > dd412)
then
3577 if (view <= 25.0) tau_smoke = (tau_x412ss+tau_x412ss_91)/2.
3578 if (view > 25.0 .and.
abs(dd412-dd470) < 0.2)
3579 1 tau_smoke = (tau_x412ss+tau_x412ss_91)/2.
3581 if (dd650 > 3.5) tau_smoke = tau_x412ss
3584 if (dd650 <-1.0 .and.
abs(dd412-dd650)>1.9 .and. view >45.)
then
3585 if (dd412 >= 0.88) tau_smoke = tau_x412ss * 4.0
3586 if (dd412 <0.88 .and. dd412 >= 0.6) tau_smoke = tau_x412ss *6.0
3587 if (dd412 <0.6 .and. dd412 >= 0.35) tau_smoke = tau_x412ss *8.0
3588 if (dd412 <0.35) tau_smoke = tau_x412ss_91 *8.0
3589 if (
abs(dd412-dd470) < 0.14 .and. dd650 > -1.7 .and. dd412 <0.4)
3590 1 tau_smoke = tau_x412ss * 3.5
3591 if (dd412 <0.) tau_smoke = tau_x412ss_91 *9.0