8 real :: new_water_radii(25), new_ice_radii(25)
50 delta_transmittance_w1, &
51 delta_transmittance_w2, &
52 transmittance_stddev_w1, &
53 transmittance_stddev_w2, &
57 uTau,uRe,uWaterPath, xpoint, ypoint)
119 integer,
intent(in) :: xpoint, ypoint
120 real,
intent(in) :: thickness,
re, water_path, &
122 transmittance_w1,transmittance_w2, &
123 delta_transmittance_w1,delta_transmittance_w2, &
124 transmittance_stddev_w1, transmittance_stddev_w2, meas_error(2), &
125 emission_pw(:), emission_tc(:), sigma_r37_pw(:)
128 integer,
intent(in) :: r1r2wavelengthidx(2)
129 character(10),
intent(in) ::
phase
130 real,
intent(out) :: utau, ure,uwaterpath
132 real :: meancloudtopreflw1, meancloudtopreflw2
133 real :: partialderivtauwrtr1atconstr2, partialderivtauwrtr2atconstr1
134 real :: partialderivrewrtr2atconstr1 , partialderivrewrtr1atconstr2
135 real :: meandeltar1trans, meandeltar2trans
136 real :: deltarcloudtopmean(2), density, sdev_refl(2)
138 real :: correlation_trans, correlation_wp
139 real :: emis_pw_val, emis_tc_val, sigma_r37_val
142 real,
dimension(2,2) :: s, s_transpose, retrieval_covariance, dummy, &
143 refl_cov_total, refl_cov_sfc_albedo, &
144 refl_cov_trans, refl_cov_trans_pw, refl_cov_trans_table, &
145 refl_cov_calibration, refl_cov_cm_sdev, refl_cov_ws, &
146 refl_cov_emission_pw, refl_cov_emission_tc, refl_cov_trans_o3
148 integer :: band37_index
175 deltarcloudtopmean, meancloudtopreflw1, meancloudtopreflw2)
181 deltarcloudtopmean, meancloudtopreflw1, meancloudtopreflw2)
195 partialderivtauwrtr1atconstr2, &
196 partialderivtauwrtr2atconstr1, &
197 partialderivrewrtr1atconstr2, &
198 partialderivrewrtr2atconstr1 )
201 s(1,1) = partialderivtauwrtr1atconstr2
202 s(1,2) = partialderivtauwrtr2atconstr1
203 s(2,1) = partialderivrewrtr1atconstr2
204 s(2,2) = partialderivrewrtr2atconstr1
215 refl_cov_cm_sdev(1,1) = sdev_refl(1)**2
217 refl_cov_cm_sdev(2,2) = 0.0
219 refl_cov_cm_sdev(2,2) = sdev_refl(2)**2
221 refl_cov_cm_sdev(1,2) = 0.
222 refl_cov_cm_sdev(2,1) = refl_cov_cm_sdev(1,2)
226 refl_cov_ws(1,1) = deltarcloudtopmean(1)**2
228 refl_cov_ws(2,2) = 0.0
231 refl_cov_ws(2,2) = deltarcloudtopmean(2)**2
233 refl_cov_ws(1,2) = 0.
234 refl_cov_ws(2,1) = refl_cov_ws(1,2)
237 refl_cov_sfc_albedo = refl_cov_ws + refl_cov_cm_sdev
240 refl_cov_sfc_albedo(1,1) = deltarcloudtopmean(1)**2
242 refl_cov_sfc_albedo(2,2) = 0.0
244 refl_cov_sfc_albedo(2,2) = deltarcloudtopmean(2)**2
246 refl_cov_sfc_albedo(1,2) = 0.
247 refl_cov_sfc_albedo(2,1) = refl_cov_sfc_albedo(1,2)
249 refl_cov_sfc_albedo = refl_cov_sfc_albedo + refl_cov_cm_sdev
257 meandeltar1trans = meancloudtopreflw1 *
abs(delta_transmittance_w1)/transmittance_w1
259 meandeltar2trans = 0.0
261 meandeltar2trans = meancloudtopreflw2 *
abs(delta_transmittance_w2)/transmittance_w2
264 correlation_trans = 1.0
265 refl_cov_trans_pw(1,1) = meandeltar1trans**2
266 refl_cov_trans_pw(2,2) = meandeltar2trans**2
268 if (r1r2wavelengthidx(2) == band37_index)
then
274 refl_cov_trans_pw(1,2) =
abs(meandeltar1trans * sqrt(sigma_r37_val + refl_cov_trans_pw(2,2) ))*correlation_trans
275 refl_cov_trans_pw(2,1) = refl_cov_trans_pw(1,2)
277 refl_cov_trans_pw(2,2) = refl_cov_trans_pw(2,2) + sigma_r37_val
279 refl_cov_trans_pw(1,2) =
abs(meandeltar1trans*meandeltar2trans)*correlation_trans
280 refl_cov_trans_pw(2,1) = refl_cov_trans_pw(1,2)
288 meandeltar1trans = meancloudtopreflw1 * transmittance_stddev_w1/transmittance_w1
290 meandeltar2trans = 0.0
292 meandeltar2trans = meancloudtopreflw2 * transmittance_stddev_w2/transmittance_w2
295 refl_cov_trans_table(1,1) = meandeltar1trans**2
297 refl_cov_trans_table(2,2) = 0.0
299 refl_cov_trans_table(2,2) = meandeltar2trans**2
301 refl_cov_trans_table(1,2) = 0.
302 refl_cov_trans_table(2,1) = refl_cov_trans_table(1,2)
306 refl_cov_trans_o3 = 0.
315 refl_cov_trans = refl_cov_trans_pw + refl_cov_trans_table + refl_cov_trans_o3
319 refl_cov_calibration(1,1) = (meas_error(1) * meancloudtopreflw1)**2
321 refl_cov_calibration(2,2) = 0.0
323 refl_cov_calibration(2,2) = (meas_error(2) * meancloudtopreflw2)**2
327 if (r1r2wavelengthidx(2) == band37_index)
then
328 refl_cov_calibration(2,2) = refl_cov_calibration(2,2) + (( 0.42 * meancloudtopreflw2 ) /
solar_constant_37)**2
331 refl_cov_calibration(1,2) = 0.
332 refl_cov_calibration(2,1) = refl_cov_calibration(1,2)
336 refl_cov_total = refl_cov_sfc_albedo + refl_cov_trans + refl_cov_calibration
342 dummy = matmul(refl_cov_total, s_transpose)
343 retrieval_covariance = matmul(s, dummy)
348 if (
phase ==
'water')
then
349 retrieval_covariance(1,1) = retrieval_covariance(1,1) + &
350 (optical_thickness_37_final(xpoint,ypoint))**2
351 retrieval_covariance(2,2) = 64.0
353 retrieval_covariance(1,1) = retrieval_covariance(1,1) + &
354 (optical_thickness_1621_final(xpoint,ypoint))**2
355 retrieval_covariance(2,2) = 289.0
364 utau = sqrt( retrieval_covariance(1,1) )
365 ure = sqrt( retrieval_covariance(2,2) )
373 if ((100.*utau/thickness) >= 200. .OR. (100.*ure/
re) >= 200. )
then
379 if (
phase ==
'water')
then
385 uwaterpath = (
re**2)*(utau**2) + (thickness**2)*(ure**2) + (utau**2)*(ure**2) + &
386 2*retrieval_covariance(1,2)*utau*ure + retrieval_covariance(1,2)**2
387 if (uwaterpath < 0.)
then
390 uwaterpath= sqrt( density**2 * uwaterpath )
399 utau = 100.*utau/thickness
401 uwaterpath = 100.*uwaterpath/water_path
410 if (utau > 200. ) utau = 200.
411 if (ure > 200. ) ure = 200.
412 if (uwaterpath > 200.) uwaterpath = 200.
425 character*(*),
intent(in) :: phase
426 real,
intent(in) :: sigma37(:), re
427 real,
intent(inout) :: sigma37_val
429 integer :: i, n, ilow, ihigh
437 if (phase ==
'water')
then
440 (/ sigma37(ilow), sigma37(ihigh) /), re)
444 (/ sigma37(ilow), sigma37(ihigh) /), re)
457 reflectancediff, meancloudtopreflw1, meancloudtopreflw2)
468 real,
intent(in) :: radius
469 integer,
intent(in) :: wave_index(2)
470 real,
intent(in) :: optical_thickness
471 character(10),
intent(in) :: phase
472 real,
intent(out) :: reflectancediff(2), meancloudtopreflw1, meancloudtopreflw2
474 integer :: radii_size , radius_upperbound, radius_lowerbound, radius_index, i,j, vectorsize
475 real :: reflectance_lower(2), reflectance_middle(2), reflectance_upper(2)
476 real,
dimension(:),
allocatable :: opticalthick_vector
478 real,
dimension(:,:,:),
allocatable :: temp_refl
483 integer :: TOTAL_POINTS
485 integer :: start_time, end_time, cmax, crate
492 allocate(opticalthick_vector(total_points))
495 reflectance_upper = 0.
496 reflectance_lower = 0.
497 reflectance_middle = 0.
500 if (phase ==
'water')
then
512 opticalthick_vector(1) = 0.
513 opticalthick_vector(2:total_points) =
library_taus(1:(total_points-1))
516 if (phase ==
'water')
then
520 call nonasymptotic_calcu_cox_munk(opticalthick_vector, &
523 reflectance_middle(j))
537 call nonasymptotic_calcu_cox_munk(opticalthick_vector, &
539 temp_refl(:,wave_index(j),i), &
540 reflectance_upper(j))
549 call nonasymptotic_calcu_cox_munk(opticalthick_vector, &
551 temp_refl(:,wave_index(j),i), &
552 reflectance_lower(j))
556 deallocate(temp_refl)
560 reflectancediff(j) = (
abs(reflectance_lower(j) - reflectance_middle(j)) + &
561 abs(reflectance_upper(j) - reflectance_middle(j)))/2.
563 meancloudtopreflw1 = reflectance_middle(j)
565 meancloudtopreflw2 = reflectance_middle(j)
574 call nonasymptotic_calcu_cox_munk(opticalthick_vector, &
577 reflectance_middle(j))
589 call nonasymptotic_calcu_cox_munk(opticalthick_vector, &
591 temp_refl(:,wave_index(j),i), &
592 reflectance_upper(j))
601 call nonasymptotic_calcu_cox_munk(opticalthick_vector, &
603 temp_refl(:,wave_index(j),i), &
604 reflectance_lower(j))
608 deallocate(temp_refl)
612 reflectancediff(j) = (
abs(reflectance_lower(j) - reflectance_middle(j)) + &
613 abs(reflectance_upper(j) - reflectance_middle(j)))/2.
615 meancloudtopreflw1 = reflectance_middle(j)
617 meancloudtopreflw2 = reflectance_middle(j)
627 deallocate(opticalthick_vector)
643 real,
intent(in) :: radius
644 integer,
intent(in) :: wave_index(2)
645 real,
intent(in) :: optical_thickness
646 character(10),
intent(in) :: phase
647 real,
intent(out) :: sdev_refl(2)
649 integer :: radii_size , radius_upperbound, radius_lowerbound, radius_index, i,j, vectorsize
650 real,
dimension(:),
allocatable :: opticalthick_vector
656 integer :: TOTAL_POINTS
660 allocate(opticalthick_vector(total_points))
664 if (phase ==
'water')
then
676 opticalthick_vector(1) = 0.
677 opticalthick_vector(2:total_points) =
library_taus(1:(total_points-1))
680 if (phase ==
'water')
then
683 call nonasymptotic_calcu_cox_munk(opticalthick_vector, &
692 call nonasymptotic_calcu_cox_munk(opticalthick_vector, &
701 deallocate(opticalthick_vector)
713 reflectancediff, meancloudtopreflw1, meancloudtopreflw2)
721 real,
intent(in) :: radius
722 integer,
intent(in) :: wave_index(2)
723 real,
intent(in) :: optical_thickness, surface_albedo(2)
724 character(10),
intent(in) :: phase
725 real,
intent(out) :: reflectancediff(2), meancloudtopreflw1, meancloudtopreflw2
727 integer :: radii_size , radius_upperbound, radius_lowerbound, radius_index, i,j, vectorsize
728 real :: reflectance_lower, reflectance_middle, reflectance_upper
729 real,
dimension(:),
allocatable :: opticalthick_vector
732 integer :: TOTAL_POINTS
737 allocate(opticalthick_vector(total_points))
740 reflectance_upper = 0.
741 reflectance_lower = 0.
742 reflectance_middle = 0.
745 if (phase ==
'water')
then
758 opticalthick_vector(1) = 0.
759 opticalthick_vector(2:total_points) =
library_taus(1:(total_points-1))
761 if (phase ==
'water')
then
773 reflectance_middle, &
777 reflectancediff(j) = (
abs(reflectance_lower - reflectance_middle) + &
778 abs(reflectance_upper - reflectance_middle))/2.
780 meancloudtopreflw1 = reflectance_middle
782 meancloudtopreflw2 = reflectance_middle
796 reflectance_middle, &
799 reflectancediff(j) = (
abs(reflectance_lower - reflectance_middle) + &
800 abs(reflectance_upper - reflectance_middle))/2.
802 meancloudtopreflw1 = reflectance_middle
804 meancloudtopreflw2 = reflectance_middle
810 deallocate(opticalthick_vector)
817 integer,
intent(in):: numberradii
818 real,
intent(in) :: radiidata(numberradii), radius
819 integer,
intent(out):: index
822 index1 = minloc(
abs(radiidata-radius))
829 subroutine nonasymptotic_calcu_cox_munk(tau_vector,tc, rf, rf_calculated)
836 real,
intent(in) :: tau_vector(:),tc
837 real,
intent(in) :: rf(:)
838 real,
intent(out) :: rf_calculated
841 integer :: lowbound, highbound, taubounds(2)
842 real :: iftau(2), refvals(2)
848 taubounds(1) = lowbound
849 taubounds(2) = highbound
850 iftau(1) = tau_vector(taubounds(1))
851 iftau(2) = tau_vector(taubounds(2))
853 refvals(1) = rf(lowbound)
854 refvals(2) = rf(highbound)
858 end subroutine nonasymptotic_calcu_cox_munk
864 albedo,rf_calculated)
872 real,
intent(in) :: tau_vector(:),tc,albedo
873 real,
intent(in) :: rf(:), ft0(:), ft1(:), sfr(:)
874 real,
intent(out) :: rf_calculated
876 real,
dimension(:),
allocatable :: reflectance_vector
878 integer :: lowbound, highbound, taubounds(2)
879 real :: iftau(2), refvals(2)
881 integer :: TOTAL_POINTS
886 total_points =
size(tau_vector)
888 allocate(reflectance_vector(total_points))
890 reflectance_vector(1) = albedo
892 reflectance_vector(2:total_points) = rf(1:(total_points-1)) + &
893 ft1(1:(total_points-1)) * ft0(1:(total_points-1)) * albedo /( 1. - albedo*sfr(1:(total_points-1)))
897 taubounds(1) = lowbound
898 taubounds(2) = highbound
899 iftau(1) = tau_vector(taubounds(1))
900 iftau(2) = tau_vector(taubounds(2))
902 refvals(1) = reflectance_vector(lowbound)
903 refvals(2) = reflectance_vector(highbound)
907 deallocate(reflectance_vector)
913 albedo,rf_lower, rf_middle, rf_upper)
918 real,
intent(in) :: tau_vector(:),tc,albedo
919 real,
intent(in) :: rf(:), ft0(:), ft1(:), sfr(:)
920 real,
intent(out) :: rf_middle, rf_lower, rf_upper
933 if(albedoupper .gt. 0.99) albedoupper = 0.99
936 albedoupper,rf_upper)
944 phase, surface_albedo, &
945 partialDerivTauWrtR1AtConstR2,&
946 partialDerivTauWrtR2AtConstR1,&
947 partialDerivReWrtR1AtConstR2, &
948 partialDerivReWrtR2AtConstR1)
995 integer,
intent(in) :: R1R2wavelengthIdx(2)
996 real,
intent(in) :: re, tau
997 real,
intent(in) :: surface_albedo(2)
998 character(10),
intent(in):: phase
999 real,
intent(out) :: partialDerivTauWrtR1AtConstR2, &
1000 partialDerivTauWrtR2AtConstR1, &
1001 partialDerivReWrtR1AtConstR2, &
1002 partialDerivReWrtR2AtConstR1
1004 real :: partialDerivR1wrtTauAtConstRe, &
1005 partialDerivR2wrtTauAtConstRe, &
1006 partialDerivR1wrtReAtConstTau, &
1007 partialDerivR2wrtReAtConstTau
1012 real :: partialDerivativesTau, partialDerivativesRe
1013 real :: upperLimit, lowerLimit,abscissaintervalstartingpoint
1014 real :: halfAbscissaInterval
1015 real,
parameter :: halfAbscissaIntervalTau = 1., halfabscissaintervalre = 1.
1016 real,
parameter :: tauUpperLimit = 200.
1017 real,
parameter :: tauLowerLimit = 0.
1019 integer,
parameter :: tauParamPosition = 4
1020 integer,
parameter :: reParamPosition = 5
1021 real :: small_number
1026 halfabscissainterval = halfabscissaintervaltau
1027 abscissaintervalstartingpoint = tau
1028 wrtparam = tauparamposition
1033 upperlimit=tauupperlimit
1034 lowerlimit=taulowerlimit
1038 upperlimit, lowerlimit, &
1039 halfabscissainterval, &
1040 abscissaintervalstartingpoint, &
1042 surface_albedo(i), &
1044 r1r2wavelengthidx(i), &
1045 partialderivativestau)
1047 small_number = epsilon(partialderivativestau)
1049 if(
abs(partialderivativestau) .lt. small_number) partialderivativestau = &
1052 partialderivtauwrtr1atconstr2 = 1. / partialderivativestau
1053 partialderivtauwrtr2atconstr1 = 0.0
1054 partialderivrewrtr1atconstr2 = 0.0
1055 partialderivrewrtr2atconstr1 = 0.0
1062 upperlimit=tauupperlimit
1063 lowerlimit=taulowerlimit
1067 upperlimit, lowerlimit, &
1068 halfabscissainterval, &
1069 abscissaintervalstartingpoint, &
1071 surface_albedo(i), &
1073 r1r2wavelengthidx(i), &
1074 partialderivativestau)
1077 partialderivr1wrttauatconstre = partialderivativestau
1080 partialderivr2wrttauatconstre = partialderivativestau
1085 halfabscissainterval = halfabscissaintervalre
1086 abscissaintervalstartingpoint = re
1091 if(phase ==
'water')
then
1100 wrtparam = reparamposition
1104 upperlimit, lowerlimit, &
1105 halfabscissainterval, &
1106 abscissaintervalstartingpoint, &
1108 surface_albedo(i), &
1110 r1r2wavelengthidx(i), &
1111 partialderivativesre)
1115 partialderivr1wrtreatconsttau = partialderivativesre
1118 partialderivr2wrtreatconsttau = partialderivativesre
1125 small_number = epsilon(partialderivr1wrttauatconstre)
1127 if(
abs(partialderivr1wrttauatconstre) .lt. small_number) partialderivr1wrttauatconstre = &
1129 if(
abs(partialderivr2wrttauatconstre) .lt. small_number) partialderivr2wrttauatconstre = &
1131 if(
abs(partialderivr1wrtreatconsttau) .lt. small_number) partialderivr1wrtreatconsttau = &
1133 if(
abs(partialderivr2wrtreatconsttau) .lt. small_number) partialderivr2wrtreatconsttau = &
1137 partialderivtauwrtr1atconstr2 = 1. / &
1138 (partialderivr1wrttauatconstre - &
1139 partialderivr1wrtreatconsttau * &
1140 (partialderivr2wrttauatconstre/partialderivr2wrtreatconsttau) )
1142 partialderivtauwrtr2atconstr1 = 1. / &
1143 (partialderivr2wrttauatconstre - &
1144 partialderivr2wrtreatconsttau * &
1145 (partialderivr1wrttauatconstre/partialderivr1wrtreatconsttau) )
1147 partialderivrewrtr1atconstr2 = 1. / &
1148 (partialderivr1wrtreatconsttau - &
1149 partialderivr1wrttauatconstre * &
1150 (partialderivr2wrtreatconsttau/partialderivr2wrttauatconstre) )
1152 partialderivrewrtr2atconstr1 = 1. / &
1153 (partialderivr2wrtreatconsttau - &
1154 partialderivr2wrttauatconstre * &
1155 (partialderivr1wrtreatconsttau/partialderivr1wrttauatconstre) )
1160 print*,
'partialDerivTauWrtR1AtConstR2 = ', partialderivtauwrtr1atconstr2
1161 print*,
'partialDerivTauWrtR2AtConstR1 = ', partialderivtauwrtr2atconstr1
1162 print*,
'partialDerivReWrtR1AtConstR2 = ', partialderivrewrtr1atconstr2
1163 print*,
'partialDerivReWrtR2AtConstR1 = ', partialderivrewrtr2atconstr1
1168 halfAbscissaInterval, abscissaIntervalStartingPoint, &
1171 wrtParam, wavelengthIdx, &
1219 integer,
intent(in) :: wrtParam, wavelengthIdx
1220 real,
intent(in) :: re, tau
1221 real,
intent(in) :: surface_albedo
1222 real,
intent(in) :: upperLimit, lowerLimit
1223 character(10),
intent(in) :: phase
1224 real,
intent(out) :: partialDerivative
1227 real :: tmpTau, tmpRe
1229 real :: halfAbscissaInterval, abscissaIntervalStartingPoint
1230 real :: abscissaIntervalLower, abscissaIntervalUpper
1231 integer,
parameter :: tauParamPosition = 4
1232 integer,
parameter :: reParamPosition = 5
1236 halfabscissainterval, abscissaintervalstartingpoint, &
1237 abscissaintervallower, abscissaintervalupper)
1246 select case (wrtparam)
1247 case(tauparamposition)
1251 abscissaintervalupper, &
1252 abscissaintervallower, &
1255 wavelengthidx, rb, ra)
1256 partialderivative = (rb - ra)
1257 partialderivative = partialderivative / (abscissaintervalupper - abscissaintervallower)
1259 case(reparamposition)
1264 abscissaintervalupper, &
1265 abscissaintervallower, &
1268 wavelengthidx, partialderivative)
1281 halfAbscissaInterval, abscissaIntervalStartingPoint, &
1282 abscissaIntervalLower, abscissaIntervalUpper)
1330 real,
intent(in) :: upperLimit, lowerLimit, &
1331 halfAbscissaInterval, abscissaIntervalStartingPoint
1332 real,
intent(out) :: abscissaIntervalLower, abscissaIntervalUpper
1336 if((abscissaintervalstartingpoint+halfabscissainterval) > upperlimit)
then
1337 abscissaintervalupper = abscissaintervalstartingpoint
1339 abscissaintervalupper = (abscissaintervalstartingpoint+halfabscissainterval)
1342 if((abscissaintervalstartingpoint-halfabscissainterval) < lowerlimit)
then
1343 abscissaintervallower = abscissaintervalstartingpoint
1345 abscissaintervallower = (abscissaintervalstartingpoint-halfabscissainterval)
1350 optical_thickness_upper, &
1351 optical_thickness_lower, &
1356 reflectance_upper, &
1366 real,
intent(in) :: optical_thickness_upper, optical_thickness_lower
1367 integer,
intent(in) :: wave_index
1368 real,
intent(in) :: radius, surface_albedo
1369 character(10),
intent(in) :: phase
1370 real,
intent(out) :: reflectance_upper, reflectance_lower
1372 integer :: radii_size , radius_upperbound, radius_lowerbound, radius_index, i,j, points
1373 real,
dimension(:),
allocatable :: opticalthick_vector
1374 real :: reflectance_vector_upper(3), reflectance_vector_lower(3), yy2(3)
1376 integer :: TOTAL_POINTS
1381 allocate(opticalthick_vector(total_points))
1384 opticalthick_vector(1) = 0.
1385 opticalthick_vector(2:total_points) =
library_taus(1:(total_points-1))
1388 if (phase ==
'water')
then
1395 call nonasymptotic_calcu_cox_munk(opticalthick_vector, &
1396 optical_thickness_lower, &
1400 call nonasymptotic_calcu_cox_munk(opticalthick_vector, &
1401 optical_thickness_upper, &
1410 surface_albedo, reflectance_lower)
1414 surface_albedo, reflectance_upper)
1424 call nonasymptotic_calcu_cox_munk(opticalthick_vector, &
1425 optical_thickness_lower, &
1429 call nonasymptotic_calcu_cox_munk(opticalthick_vector, &
1430 optical_thickness_upper, &
1438 surface_albedo, reflectance_lower)
1442 surface_albedo, reflectance_upper)
1447 deallocate(opticalthick_vector)
1453 radius, optical_thickness, &
1466 real,
intent(inout) :: radius_upper, radius_lower
1467 integer,
intent(in) :: wave_index
1468 real,
intent(in) :: optical_thickness, radius, surface_albedo
1469 character(10),
intent(in) :: phase
1470 real,
intent(out) :: partial_derivative
1472 real :: reflectance_upper, reflectance_lower
1474 integer :: radii_size , radius_upperbound, radius_lowerbound, radius_index, i,j, vectorsize
1475 real,
dimension(:),
allocatable :: opticalthick_vector, opticalthick_vector2
1476 real,
dimension(20):: reflectance_vector
1478 integer :: dummy, il, jl, iu, ju, k
1479 real :: my_radius, myrefl(90), myres(90), myx(3), myy(3), half_rad(2)
1480 integer :: TOTAL_POINTS
1481 real :: mymid1, mymid2, reflectance_middle, delre
1482 real :: new_derivatives(25)
1483 integer :: istart, jstart
1488 allocate(opticalthick_vector(total_points), opticalthick_vector2(total_points))
1491 opticalthick_vector(1) = 0.
1492 opticalthick_vector(2:total_points) =
library_taus(1:(total_points-1))
1493 opticalthick_vector2 = opticalthick_vector
1494 if (phase ==
'water')
then
1510 new_derivatives = 0.
1520 call nonasymptotic_calcu_cox_munk(opticalthick_vector, &
1521 optical_thickness, &
1525 call nonasymptotic_calcu_cox_munk(opticalthick_vector, &
1526 optical_thickness, &
1530 new_derivatives(il+1) = (reflectance_upper - reflectance_lower) / &
1540 surface_albedo, reflectance_lower)
1545 surface_albedo, reflectance_upper)
1547 new_derivatives(il+1) = (reflectance_upper - reflectance_lower) / &
1554 new_derivatives(1) = new_derivatives(2)
1559 partial_derivative =
linearinterpolation( (/ new_water_radii(il), new_water_radii(iu) /), &
1560 (/ new_derivatives(il), new_derivatives(iu) /), &
1569 new_derivatives = 0.
1578 call nonasymptotic_calcu_cox_munk(opticalthick_vector, &
1579 optical_thickness, &
1583 call nonasymptotic_calcu_cox_munk(opticalthick_vector, &
1584 optical_thickness, &
1588 new_derivatives(il+1) = (reflectance_upper - reflectance_lower) / &
1598 surface_albedo, reflectance_lower)
1603 surface_albedo, reflectance_upper)
1605 new_derivatives(il+1) = (reflectance_upper - reflectance_lower) / &
1611 new_derivatives(1) = new_derivatives(2)
1618 (/ new_derivatives(il), new_derivatives(iu) /), &
1624 deallocate(opticalthick_vector, opticalthick_vector2)
1629 subroutine getradiibounds(radiisize, radiidata, radius, upperbound, lowerbound)
1633 integer,
intent(in) :: radiisize
1634 real,
intent(in) :: radiidata(:),
radius
1635 integer,
intent(out) :: upperbound, lowerbound
1641 do i = 1, radiisize - 1
1642 if (
radius >= radiidata(i).and.
radius <= radiidata(i+1))
then