1 #if SEV_PR06OD || VIIRS_OD
47 INTEGER,
PARAMETER :: NumberOfPressureHeights = 10
48 REAL,
DIMENSION(NumberOfPressureHeights),
PARAMETER :: &
49 heightScale = (/ 100., 200., 300., 400., 500., 600., 700., 800., 900., 1000. /)
51 INTEGER,
PARAMETER :: NumberOfPrecipitableWater = 53
52 REAL,
DIMENSION(NumberOfPrecipitableWater),
PARAMETER :: &
53 pwScale = (/ 0.0, 0.02, 0.04, 0.06, 0.08, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, &
54 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6,1.8, &
55 2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, &
56 4.2, 4.4, 4.6, 4.8, 5.0, 5.2, 5.4, 5.6, 5.8, 6.0, 6.2, &
57 6.4, 6.6, 6.8, 7.0, 7.2, 7.4, 7.6, 7.8, 8.0, 8.2, 8.4, &
60 INTEGER,
PARAMETER :: NumberOfMiu = 20
61 REAL,
DIMENSION(NumberOfMiu),
PARAMETER :: &
62 miuscale = (/ 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, &
63 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, &
67 integer,
parameter :: nvza = 7
68 integer,
parameter :: nsza = 8
69 integer,
parameter :: nsct = 18
73 real*8,
dimension(7,8) :: a_win_over, b_win_over, c_win_over, d_win_over, e_win_over
76 real,
dimension (7,8) :: MIN_win_over
80 real*8,
dimension(18) :: a_nir_over_water, b_nir_over_water, c_nir_over_water, d_nir_over_water, e_nir_over_water
83 real*8,
dimension(18) :: a_nir_over_land, b_nir_over_land, c_nir_over_land, d_nir_over_land, e_nir_over_land
106 tau, tau1621, xpoint, ypoint, &
170 real(
single),
dimension(:,:,:,:),
intent(in) :: bigtranstable
171 real,
dimension(:),
intent(in) :: measurements
172 real,
intent(in) :: mod06_pc, mod06_pw, sat_zen, sol_zen, rel_az
173 real,
intent(in) :: tau, tau1621
175 integer*1,
intent(in) :: surface
176 integer,
intent(in) :: xpoint, ypoint
178 real(
single),
dimension(:),
intent(in) :: p_ncep, t_ncep, mixr_ncep
180 integer(integer_onebyte),
intent(out) :: mlayer, mlayer_test
181 real(
single) :: refl_86, refl_94, iir_data, refl_65, refl_12
184 real :: t, p, pw, totalprecipwater,
newt, temp, pw_at_900, miu, miu0
186 real :: plant_ratio, pw_fraction, pw_fraction_900, ice_ratio
187 integer(integer_onebyte) :: pw_test, pw_900_test, tau_test, cloud_phase_test
188 integer :: ph_test, delta_tau
191 integer :: mlayer_add
192 logical :: ice_ratio_var
198 miu = cos(sat_zen *
d2r)
199 miu0 = cos(sol_zen *
d2r)
217 call find_tpw(refl_86, refl_94, p, pw, bigtranstable, miu, miu0, xpoint, ypoint)
221 iir_data, bigtranstable, miu, first)
226 call find_tpw(refl_86, refl_94, p, pw, bigtranstable, miu, miu0, xpoint, ypoint)
228 iir_data, bigtranstable, miu, first)
238 if (p_ncep(surface) >= 900.)
then
239 call find_tpw(refl_86, refl_94, 900., pw_at_900, bigtranstable, miu, miu0, xpoint, ypoint)
241 call find_tpw(refl_86, refl_94, p_ncep(surface) - 100., pw_at_900, bigtranstable, miu, miu0, xpoint, ypoint)
250 if (pw > totalprecipwater) pw = totalprecipwater
251 if (pw_at_900 > totalprecipwater) pw_at_900 = totalprecipwater
253 plant_ratio = refl_86 / refl_65
254 pw_fraction =
abs(mod06_pw - pw) / totalprecipwater
255 pw_fraction_900 =
abs(mod06_pw - pw_at_900) / totalprecipwater
256 ice_ratio = refl_86 / refl_12
262 if (pw_fraction > 0.08 .and. mod06_pc < 550.0 .and. plant_ratio < 1.25 .and. ice_ratio_var )
then
268 if (pw_fraction_900 > 0.08 .and. mod06_pc < 550.0 .and. plant_ratio < 1.25 .and. ice_ratio_var )
then
276 if (tau < 4. .and. tau >= 0.)
then
285 if (
cloud_phase%watercloud .and. baum_phase%watercloud == 1 ) cloud_phase_test = 0
286 if (
cloud_phase%icecloud .and. baum_phase%icecloud == 1) cloud_phase_test = 0
288 if (
cloud_phase%watercloud .and. baum_phase%icecloud == 1) cloud_phase_test = 1
289 if (
cloud_phase%icecloud .and. baum_phase%watercloud == 1) cloud_phase_test = 2
292 if (tau_test == 1)
then
308 if (measurements(
band_1350) < db_th)
then
320 if (db_co2 == 0 .and. tau_test == 0)
then
327 if (tau < 30. .and. tau1621 > 80.)
then
346 if (cloud_phase_test == 1) mlayer = mlayer + 1
347 if (delta_tau == 1) mlayer = mlayer + 1
348 if (pw_test == 1) mlayer = mlayer + 2
349 if (pw_900_test == 1) mlayer = mlayer + 2
350 if (ph_test == 1) mlayer = mlayer + 3
352 if (cloud_phase_test == 1) mlayer_test = ibset(mlayer_test, 0)
353 if (pw_test == 1) mlayer_test = ibset(mlayer_test, 1)
354 if (pw_900_test == 1) mlayer_test = ibset(mlayer_test, 2)
355 if (delta_tau == 1) mlayer_test = ibset(mlayer_test, 3)
356 if (ph_test == 1) mlayer_test = ibset(mlayer_test, 4)
362 subroutine find_tpw(refl_86, refl_94, P, PW, BigTransTable, miu1, miu0, xpoint, ypoint)
407 real,
intent(in) :: p, miu1, miu0, refl_86, refl_94
408 real,
intent(inout) :: pw
409 real(
single),
dimension(:,:,:,:),
intent(in) :: bigtranstable
410 integer,
intent(in) :: xpoint, ypoint
415 real,
dimension(:),
allocatable :: trans2way
418 integer,
dimension(4) :: mindex
420 integer :: miu_index, pindex, pwindex, miu2index, first_pindex, second_pindex
421 integer :: bandindexmapsw1(2)
423 REAL :: miu, transvalue
427 real,
dimension(53) :: pix086, pix094, ans_diff, ans_diff_abs
428 real :: answer, trans_mid1, trans_mid2
429 integer :: first_miuindex, second_miuindex
430 real :: trans_p_1, trans_p_2
431 real :: trans1, trans2
433 real :: point1, point2, x1, x2
434 integer :: idx1, idx2
436 bandindexmapsw1(1) = 2
437 bandindexmapsw1(2) = 3
440 pindex = nint( (p - heightscale(1)) / 100.0 ) + 1
445 elseif(pindex > numberofpressureheights)
then
446 pindex = numberofpressureheights
447 first_pindex = pindex
448 second_pindex = pindex
451 if (heightscale(pindex) >= p)
then
452 first_pindex = pindex-1
453 second_pindex = pindex
455 first_pindex = pindex
456 second_pindex = pindex+1
459 if (first_pindex == 0 )
then
464 if (second_pindex > numberofpressureheights) &
465 second_pindex = numberofpressureheights
469 miu = (miu0*miu1)/(miu0+miu1)
475 miu2index = nint( (miu - miuscale(1)) / 0.05 ) + 1
476 if (miu2index < 1)
then
478 elseif(miu2index > numberofmiu)
then
479 miu2index = numberofmiu
489 mindex(3) = miu2index
490 mindex(4) = bandindexmapsw1(1)
492 if (miuscale(miu2index) >= miu )
then
493 first_miuindex = miu2index -1
494 second_miuindex = miu2index
496 first_miuindex = miu2index
497 second_miuindex = miu2index + 1
500 do k=1, numberofprecipitablewater
507 trans_mid1 =
linearinterpolation( (/miuscale(first_miuindex), miuscale(second_miuindex)/), &
508 (/bigtranstable(first_pindex, k, first_miuindex, bandindexmapsw1(1)), &
509 bigtranstable(first_pindex, k, second_miuindex, bandindexmapsw1(1))/), &
518 trans_mid2 =
linearinterpolation( (/miuscale(first_miuindex), miuscale(second_miuindex)/), &
519 (/bigtranstable(first_pindex, k, first_miuindex, bandindexmapsw1(2)), &
520 bigtranstable(first_pindex, k, second_miuindex, bandindexmapsw1(2))/), &
529 trans_p_1 =
linearinterpolation( (/miuscale(first_miuindex), miuscale(second_miuindex)/), &
530 (/ bigtranstable(second_pindex, k, first_miuindex, bandindexmapsw1(1)), &
531 bigtranstable(second_pindex, k, second_miuindex, bandindexmapsw1(1)) /), &
538 trans_p_2 =
linearinterpolation( (/ miuscale(first_miuindex), miuscale(second_miuindex) /), &
539 (/ bigtranstable(second_pindex, k, first_miuindex, bandindexmapsw1(2)), &
540 bigtranstable(second_pindex, k, second_miuindex, bandindexmapsw1(2)) /), &
545 (/trans_mid1, trans_p_1/), &
548 (/trans_mid2, trans_p_2/), &
550 if (trans_mid1 < 0. .or. trans_p_1 < 0.) trans1 = -1.0
551 if (trans_mid2 < 0. .or. trans_p_2 < 0.) trans2 = -1.0
553 pix086(k) = refl_86 / trans1
554 pix094(k) = refl_94 / trans2
556 if (trans1 < 0.0) pix086(k) = 20
557 if (trans2 < 0.0) pix094(k) = 300
561 do k=1, numberofprecipitablewater
562 ans_diff(k) = pix086(k)-pix094(k)
563 ans_diff_abs(k) = ans_diff(k)
564 if (ans_diff(k) < 0) ans_diff_abs(k) = -ans_diff(k)
569 answer = minval(ans_diff_abs)
570 do k=1, numberofprecipitablewater
577 if (ans_diff(k) < 0.)
then
580 if (idx1 < 1) idx1 = 1
583 if (idx1 == idx2)
then
588 point1 = ans_diff(idx1)
589 point2 = ans_diff(idx2)
594 if (point1 == -280.)
then
603 if (idx2 > numberofprecipitablewater) idx2 = numberofprecipitablewater
605 if (idx1 == idx2)
then
610 point1 = ans_diff(idx1)
611 point2 = ans_diff(idx2)
616 if (point2 == -280.)
then
667 real,
intent(in) :: t
668 real,
intent(inout) :: p
669 integer*1,
intent(in) :: surface
670 real,
dimension(:),
intent(in) :: p_ncep, t_ncep
677 if ( t > t_ncep(k)) &
683 elseif (k == surface)
then
694 if (p < 100.) p = 100.
702 subroutine find_brightness_t(platform_name,PW, P, newT, TotalPrecipWater, p_ncep, t_ncep, mixR_ncep, surface, &
703 IIR_data, BigTransTable, miu, FIRST)
751 real,
intent(in) :: pw, p, iir_data, miu
752 logical,
intent(inout) :: first
753 integer*1,
intent(in) :: surface
754 real,
intent(inout) ::
newt, totalprecipwater
755 real(
single),
dimension(:),
intent(in) :: p_ncep, t_ncep, mixr_ncep
756 real(
single),
dimension(:,:,:,:),
intent(in) :: bigtranstable
759 integer :: pindex, miu2index, pwindex, first_miuindex, second_miuindex, k
760 real :: tpw, trans_mid1
761 integer :: mindex(4), first_pindex, second_pindex
764 real :: total_pw, pw_layer, sum_t, slope, mixr_lower, mixr_upper, t_lower, t_upper, t_layer
765 real :: tmeanabovecloud, tpwabovecloud
768 integer :: bandindexmaplw1(1)
770 bandindexmaplw1(1) = 8
772 pindex = nint( (p - heightscale(1)) / 100.0 ) + 1
777 elseif(pindex > numberofpressureheights)
then
778 pindex = numberofpressureheights
779 first_pindex = pindex
780 second_pindex = pindex
783 if (heightscale(pindex) >= p)
then
784 first_pindex = pindex-1
785 second_pindex = pindex
787 first_pindex = pindex
788 second_pindex = pindex+1
791 if (first_pindex == 0)
then
796 if (second_pindex > numberofpressureheights) &
797 second_pindex = numberofpressureheights
802 miu2index = nint( (miu - miuscale(1)) / 0.05 ) + 1
803 if (miu2index < 1)
then
805 elseif(miu2index > numberofmiu)
then
806 miu2index = numberofmiu
812 elseif(pw < 0.2)
then
813 pwindex = nint( (pw- pwscale(1)) / 0.02 ) + 1
815 pwindex = nint( (pw - pwscale(11)) / 0.20 ) + 11
816 if(pwindex > numberofprecipitablewater)
then
817 pwindex = numberofprecipitablewater
824 mindex(3) = miu2index
825 mindex(4) = bandindexmaplw1(1)
827 if (miuscale(miu2index) >= miu )
then
828 first_miuindex = miu2index -1
829 second_miuindex = miu2index
831 first_miuindex = miu2index
832 second_miuindex = miu2index + 1
838 trans_mid1 =
linearinterpolation( (/miuscale(first_miuindex), miuscale(second_miuindex)/), &
839 (/bigtranstable(first_pindex, pwindex, first_miuindex, bandindexmaplw1(1)), &
840 bigtranstable(first_pindex, pwindex, second_miuindex, bandindexmaplw1(1))/), &
848 (/bigtranstable(second_pindex, pwindex, first_miuindex, bandindexmaplw1(1)), &
849 bigtranstable(second_pindex, pwindex, second_miuindex, bandindexmaplw1(1))/), &
856 (/trans_mid1, trans_p_1/), &
859 if (trans_mid1 >= 0. .and. trans_p_1 < 0.) trans1 = trans_p_1
860 if (trans_mid1 < 0. .and. trans_p_1 >= 0.) trans1 = trans_mid1
882 pw_layer = (p_ncep(k)-p_ncep(k-1)) * (mixr_ncep(k-1) + mixr_ncep(k))*0.5/ 980.616
883 total_pw = total_pw+pw_layer
885 totalprecipwater = total_pw
895 DO WHILE(p_ncep(k) < p .AND. k < surface)
902 pw_layer = (p_ncep(k)-p_ncep(k-1)) * (mixr_ncep(k-1) + mixr_ncep(k))*0.5/ 980.616
904 t_layer = (t_ncep(k)+t_ncep(k-1))*0.5
905 total_pw = total_pw + pw_layer
906 sum_t = sum_t + pw_layer*t_layer
920 slope = (mixr_ncep(k) - mixr_ncep(k-1)) / (p_ncep(k) - p_ncep(k-1))
921 mixr_upper = mixr_ncep(k-1)
922 mixr_lower = slope * (p - p_ncep(k-1)) + mixr_upper
923 pw_layer = (p - p_ncep(k-1))*(mixr_upper + mixr_lower)*0.5/980.616
924 tpwabovecloud = total_pw + pw_layer
926 slope = (t_ncep(k) - t_ncep(k-1)) / (p_ncep(k) - p_ncep(k-1))
927 t_upper = t_ncep(k-1)
928 t_lower = slope * (p - p_ncep(k-1)) + t_upper
929 t_layer = (t_upper + t_lower)*0.5
930 tmeanabovecloud = (sum_t + pw_layer*t_layer)/tpwabovecloud
938 if (trans1 < -0.0001) trans1 = 1.0
939 b_11_crude = b_11_crude * (1. - trans1)
945 temp = iir_data - b_11_crude
964 subroutine init_coeffs
999 real*8,
dimension(56) :: temp
1002 temp = (/0.70,0.70,0.70,0.70,0.75,0.80,0.80, &
1003 0.70,0.70,0.70,0.70,0.75,0.80,0.80,&
1004 0.70,0.70,0.70,0.70,0.75,0.80,0.80,&
1005 0.70,0.70,0.70,0.70,0.75,0.80,0.80,&
1006 0.70,0.70,0.70,0.70,0.75,0.80,0.80,&
1007 0.70,0.70,0.70,0.70,0.75,0.90,0.90,&
1008 0.75,0.75,0.75,0.80,0.80,0.90,0.90,&
1009 0.75,0.75,0.75,0.80,0.80,0.90,0.90 /)
1011 min_win_over = reshape(temp, (/ 7,8 /))
1014 temp = (/-5.09e+01,-3.83e+01,-4.20e+01,-5.52e+01,-4.80e+01,-3.16e+01,-3.16e+01 , &
1015 -5.09e+01,-3.83e+01,-4.20e+01,-5.52e+01,-4.80e+01,-3.16e+01,-3.16e+01 , &
1016 -6.02e+01,-4.36e+01,-4.01e+01,-4.14e+01,-4.67e+01,-6.36e+01,-6.36e+01 , &
1017 -4.67e+01,-5.81e+01,-4.20e+01,-3.79e+01,-3.25e+01,-4.11e+01,-4.11e+01 , &
1018 -6.25e+01,-5.49e+01,-5.42e+01,-4.99e+01,-5.63e+01,-7.13e+01,-7.13e+01 , &
1019 -7.72e+01,-6.02e+01,-6.28e+01,-5.13e+01,-4.70e+01,-3.22e+01,-3.22e+01 , &
1020 -1.00e+02,-1.12e+02,-8.96e+01,-7.65e+01,-7.04e+01,-8.40e+01,-8.40e+01 , &
1021 -2.85e+02,-2.52e+02,-1.49e+02,-1.82e+02,-1.28e+02,-5.21e+01,-5.21e+01 /)
1023 a_win_over = reshape(temp, (/ 7,8 /))
1025 temp = (/ 8.58e+01, 6.05e+01, 6.69e+01, 9.35e+01, 7.91e+01, 4.24e+01, 4.24e+01 , &
1026 8.58e+01, 6.05e+01, 6.69e+01, 9.35e+01, 7.91e+01, 4.24e+01, 4.24e+01 , &
1027 1.05e+02, 7.15e+01, 6.50e+01, 6.78e+01, 7.92e+01, 1.07e+02, 1.07e+02 , &
1028 7.88e+01, 1.03e+02, 7.16e+01, 6.47e+01, 5.46e+01, 6.82e+01, 6.82e+01 , &
1029 1.11e+02, 9.79e+01, 1.01e+02, 9.37e+01, 1.08e+02, 1.33e+02, 1.33e+02 , &
1030 1.41e+02, 1.08e+02, 1.20e+02, 1.03e+02, 9.63e+01, 7.01e+01, 7.01e+01 , &
1031 1.78e+02, 2.08e+02, 1.70e+02, 1.53e+02, 1.43e+02, 1.87e+02, 1.87e+02 , &
1032 5.08e+02, 4.55e+02, 2.75e+02, 3.69e+02, 2.66e+02, 1.40e+02, 1.40e+02 /)
1035 b_win_over = reshape(temp, (/ 7,8 /))
1037 temp = (/-4.12e+01,-2.41e+01,-2.77e+01,-4.57e+01,-3.60e+01,-8.56e+00,-8.56e+00 , &
1038 -4.12e+01,-2.41e+01,-2.77e+01,-4.57e+01,-3.60e+01,-8.56e+00,-8.56e+00 , &
1039 -5.47e+01,-3.20e+01,-2.77e+01,-2.96e+01,-3.80e+01,-5.29e+01,-5.29e+01 , &
1040 -3.76e+01,-5.51e+01,-3.41e+01,-3.01e+01,-2.40e+01,-3.02e+01,-3.02e+01 , &
1041 -6.08e+01,-5.30e+01,-5.77e+01,-5.38e+01,-6.41e+01,-7.67e+01,-7.67e+01 , &
1042 -8.14e+01,-5.96e+01,-7.29e+01,-6.59e+01,-6.21e+01,-4.88e+01,-4.88e+01 , &
1043 -1.02e+02,-1.27e+02,-1.06e+02,-1.00e+02,-9.37e+01,-1.38e+02,-1.38e+02 , &
1044 -3.09e+02,-2.80e+02,-1.69e+02,-2.56e+02,-1.86e+02,-1.23e+02,-1.23e+02 /)
1046 c_win_over = reshape(temp, (/ 7,8 /))
1049 temp = (/ 9.36e-01,-3.25e+00,-2.60e+00, 1.71e+00,-7.43e-01,-8.27e+00,-8.27e+00 , &
1050 9.36e-01,-3.25e+00,-2.60e+00, 1.71e+00,-7.43e-01,-8.27e+00,-8.27e+00 , &
1051 4.48e+00,-1.20e+00,-2.31e+00,-1.98e+00, 1.48e-01, 2.65e+00, 2.65e+00 , &
1052 3.65e-01, 4.94e+00,-2.40e-01,-1.20e+00,-2.60e+00,-2.09e+00,-2.09e+00 , &
1053 6.62e+00, 4.96e+00, 6.72e+00, 5.76e+00, 8.27e+00, 9.71e+00, 9.71e+00 , &
1054 1.21e+01, 6.67e+00, 1.12e+01, 1.05e+01, 9.62e+00, 7.24e+00, 7.24e+00 , &
1055 1.67e+01, 2.45e+01, 1.99e+01, 1.99e+01, 1.81e+01, 3.37e+01, 3.37e+01 , &
1056 6.92e+01, 6.26e+01, 3.53e+01, 6.57e+01, 4.58e+01, 3.56e+01, 3.56e+01 /)
1058 d_win_over = reshape(temp, (/ 7,8 /))
1060 temp = (/ 2.94e+00, 3.14e+00, 3.15e+00, 3.03e+00, 3.27e+00, 3.77e+00, 3.77e+00 , &
1061 2.94e+00, 3.14e+00, 3.15e+00, 3.03e+00, 3.27e+00, 3.77e+00, 3.77e+00 , &
1062 2.76e+00, 3.04e+00, 3.14e+00, 3.20e+00, 3.23e+00, 3.25e+00, 3.25e+00 , &
1063 2.95e+00, 2.75e+00, 3.03e+00, 3.15e+00, 3.34e+00, 3.48e+00, 3.48e+00 , &
1064 2.62e+00, 2.71e+00, 2.65e+00, 2.80e+00, 2.80e+00, 2.97e+00, 2.97e+00 , &
1065 2.26e+00, 2.59e+00, 2.33e+00, 2.43e+00, 2.62e+00, 3.01e+00, 3.01e+00 , &
1066 1.94e+00, 1.29e+00, 1.65e+00, 1.65e+00, 1.88e+00, 6.49e-01, 6.49e-01 , &
1067 -2.33e+00,-1.83e+00, 4.17e-01,-2.67e+00,-7.20e-01, 2.34e-01, 2.34e-01 /)
1069 e_win_over = reshape(temp, (/ 7,8 /))
1075 a_nir_over_water = (/ 1.98e+01,-3.83e+00,-1.41e+01,-1.49e+01,-3.62e+00, &
1076 -1.52e+01, 1.24e+01, 3.23e+00,-5.14e+00,-2.54e-01,&
1077 -1.42e+00,-4.17e+00, 4.11e+00, 9.23e+00, 6.03e+00, &
1078 3.11e+00, 3.11e+00, 3.11e+00 /)
1080 b_nir_over_water = (/-1.44e+01, 3.48e+00, 1.27e+01, 1.37e+01, 4.81e+00,&
1081 1.30e+01,-1.22e+01,-2.07e+00, 2.57e+00, 2.52e+00,&
1082 4.71e+00, 4.44e-01,-3.24e+00,-1.10e+01,-6.34e+00,&
1083 -3.65e+00,-3.65e+00,-3.65e+00 /)
1085 c_nir_over_water = (/ 2.64e+00,-1.87e+00,-4.24e+00,-4.98e+00,-3.13e+00,&
1086 -4.11e+00, 2.64e+00,-1.19e+00,-6.22e-01,-3.04e+00,&
1087 -4.57e+00, 1.19e+00,-6.76e-01, 3.30e+00, 7.73e-01,&
1088 9.53e-01, 9.53e-01, 9.53e-01 /)
1090 d_nir_over_water = (/ 8.73e-01, 1.18e+00, 1.45e+00, 1.43e+00, 1.36e+00,&
1091 1.18e+00, 6.15e-01, 1.09e+00, 6.95e-01, 1.26e+00,&
1092 1.74e+00,-1.17e-01, 9.93e-01, 2.53e-01, 9.02e-01,&
1093 2.00e-01, 2.00e-01, 2.00e-01 /)
1095 e_nir_over_water = (/ 5.34e-02, 4.15e-02, 3.46e-02, 2.77e-02, 3.93e-02,&
1096 6.08e-02, 7.28e-02, 5.06e-02, 7.56e-02, 3.34e-02,&
1097 1.97e-02, 1.92e-01, 5.29e-02, 1.07e-01, 7.66e-02,&
1098 3.03e-01, 3.03e-01, 3.03e-01 /)
1102 a_nir_over_land = (/ -1.94e+00, 9.09e-01, 2.51e+00,-1.01e+01, 1.01e+01, &
1103 -7.71e-01, 1.31e+00, 5.42e+00,-2.80e-01, 7.54e-01,&
1104 1.85e+00,-1.02e+01, 2.79e+00, 2.83e+00, 9.51e-01,&
1105 -3.39e+00,-3.39e+00,-3.39e+00 /)
1107 b_nir_over_land = (/ 2.55e+00,-9.93e-01,-2.95e+00, 7.17e+00,-9.65e+00, &
1108 -2.59e+00,-2.52e+00,-7.57e+00,-1.93e+00,-1.93e+00,&
1109 -2.33e+00, 7.87e+00,-3.29e+00,-3.75e+00,-5.92e-01,&
1110 4.13e+00, 4.13e+00, 4.13e+00 /)
1112 c_nir_over_land = (/ -1.24e+00, 1.82e-01, 1.15e+00,-5.48e-01, 3.33e+00, &
1113 3.19e+00, 1.93e+00, 3.63e+00, 2.45e+00, 1.87e+00, &
1114 1.33e+00,-6.52e-01, 1.53e+00, 1.79e+00,-3.28e-02, &
1115 -1.26e+00,-1.26e+00,-1.26e+00 /)
1117 d_nir_over_land = (/ 2.33e-01,-4.16e-03,-1.74e-01,-5.56e-01,-5.56e-01, &
1118 -1.13e+00,-7.03e-01,-7.78e-01,-1.01e+00,-7.98e-01, &
1119 -5.12e-01,-7.32e-01,-4.81e-01,-4.57e-01,-1.50e-02, &
1120 -1.05e-01,-1.05e-01,-1.05e-01 /)
1122 e_nir_over_land = (/ 3.16e-01, 3.17e-01, 3.34e-01, 3.27e-01, 3.29e-01, &
1123 3.43e-01, 3.12e-01, 3.19e-01, 3.46e-01, 3.25e-01, &
1124 3.14e-01, 3.98e-01, 3.17e-01, 3.22e-01, 3.08e-01, &
1125 4.77e-01, 4.77e-01, 4.77e-01 /)
1128 end subroutine init_coeffs
1131 function poly4(a, b, c, d, e, x)
1168 real*8,
intent(in) :: a, b, c, d, e
1169 real,
intent(in) ::x
1172 poly4 = a*x**4 + b*x**3 + c*x**2 + d*x + e
1179 function ph_multilayer (sza, vza, rel_az, measurements, cloud_info, instrument, lat)
1230 real,
intent(in) :: lat, sza, vza, rel_az
1231 real,
dimension(:),
intent(in) :: measurements
1233 character(len=*) :: instrument
1235 integer*1 :: ph_multilayer
1238 real :: r065, r040, r138, r163, i11, i12
1240 real :: bt11, bt12, btdiff, miu0, scata
1241 integer :: index1, index2, index3
1242 real :: win_over_thres, nir_overlap_thres, min_ref26_over
1243 real,
parameter :: bad = 9999.
1244 logical :: over_avhrr, over_viirs
1245 real :: min_ref26_ocean_low, min_ref26_ocean_high, min_ref26_land_low, min_ref26_land_high
1246 real :: ref26_win_check_thres, snow_ref6_thres
1247 real :: ref26_win_check_thres_water, ref26_win_check_thres_land
1249 integer :: store1, store2, store3
1252 miu0 = cos(sza / 180. * dtor)
1254 scata = acos( miu0 * cos(vza / 180. *dtor) + &
1255 sin( sza / 180. *dtor) * sin(vza / 180. * dtor) * sin(rel_az / 180. *dtor)) * 180. / dtor
1270 min_ref26_ocean_high = 0.1
1271 min_ref26_ocean_low = 0.025
1272 min_ref26_land_low = 0.027
1273 min_ref26_land_high = 0.1
1275 ref26_win_check_thres_water = 0.08
1276 ref26_win_check_thres_land = 0.12
1282 index1 =
min(nvza-1,
max(0, store1 )) + 1
1283 index2 =
min(nsza-1,
max(0, store2 ) ) + 1
1284 index3 =
min(nsct-1,
max(0, store3 ) ) + 1
1287 if (r065 >= 0.3 .and. r065 <= 0.6)
then
1288 win_over_thres =
max( poly4(a_win_over(index1, index2), b_win_over(index1, index2), &
1289 c_win_over(index1, index2), d_win_over(index1, index2), e_win_over(index1, index2), &
1290 r065), min_win_over(index1, index2)) - 0.25
1291 else if (r065 > 0.6 .and. r065 <= 1.0)
then
1292 win_over_thres = min_win_over(index1, index2) - 0.25
1294 win_over_thres = bad
1301 call set_ph_desert(cloud_info%desert_surface, r040, win_over_thres)
1306 if (r138 >= 0.4 .or. cloud_info%desert_surface)
then
1307 nir_overlap_thres = bad
1308 ref26_win_check_thres = ref26_win_check_thres_land
1311 if (cloud_info%ocean_surface)
then
1313 nir_overlap_thres = poly4(a_nir_over_water(index3), b_nir_over_water(index3), &
1314 c_nir_over_water(index3), d_nir_over_water(index3), e_nir_over_water(index3), &
1318 if (instrument ==
"Aqua") nir_overlap_thres = nir_overlap_thres - 0.09
1320 ref26_win_check_thres = ref26_win_check_thres_water
1324 nir_overlap_thres =
max(poly4(a_nir_over_land(index3), b_nir_over_land(index3), &
1325 c_nir_over_land(index3), d_nir_over_land(index3), e_nir_over_land(index3), r138), 0.25 ) + 0.05
1327 if (instrument ==
"Aqua") nir_overlap_thres = nir_overlap_thres - 0.09
1329 ref26_win_check_thres = ref26_win_check_thres_land
1338 if (cloud_info%ocean_surface)
then
1339 if (lat >= 50. .or. lat <= -50.)
then
1340 min_ref26_over = min_ref26_ocean_high
1342 min_ref26_over = min_ref26_ocean_low
1344 else if (cloud_info%desert_surface)
then
1345 if (lat >= 50. .or. lat <= -50.)
then
1346 min_ref26_over = min_ref26_land_high
1348 min_ref26_over = min_ref26_land_low
1351 if (lat >= 40. .or. lat <= -40.)
then
1352 min_ref26_over = min_ref26_land_high
1354 min_ref26_over = min_ref26_land_low
1358 if (lat >= 60. .or. lat <= -60)
then
1359 snow_ref6_thres = 0.3
1361 snow_ref6_thres = 0.1
1364 btdiff = bt11 - bt12
1369 if (r065 > 0.3 .and. r065 < 1.0 .and. btdiff > win_over_thres .and. bt11 < 270.) ph_multilayer = 1
1372 if (r138 < ref26_win_check_thres)
then
1374 if ( r138 > min_ref26_over .and. r163 > nir_overlap_thres .and. r163/r065 < 1.0 .and. &
1375 bt11 < 280.0 .and. btdiff > win_over_thres .and. bt11 > 220.) ph_multilayer = 1
1379 if ( r138 > min_ref26_over .and. r163 > nir_overlap_thres .and. r163/r065 < 1.0 .and. &
1380 bt11 < 280.0 .and. bt11 > 220.) ph_multilayer = 1
1386 if (btdiff > win_over_thres .and. bt11 < 270. .and. r163 > snow_ref6_thres .and. bt11 > 220.) &
1392 end function ph_multilayer