14 INTEGER,
INTENT(IN)::ntheta
15 REAL,
INTENT(IN)::theta,thetaarray(1:ntheta)
16 INTEGER,
INTENT(OUT)::ianglow, ianghi
31 IF((ianghi - ianglow) == 1)
EXIT
32 iang = (ianghi + ianglow)/2
33 IF(thetaarray(iang) < theta)
THEN
40 if (ianglow < 1) ianglow = 1
41 if (ianghi < 1) ianghi = 1
42 if (ianghi > ntheta) ianghi = ntheta
43 if (ianglow > ntheta) ianglow = ntheta
53 INTEGER,
INTENT(INOUT) :: jlo, jhi
55 REAL,
DIMENSION(:),
INTENT(IN) :: xx
59 ascnd = (xx(n) >= xx(1))
60 if (jlo <= 0 .or. jlo > n)
then
65 if (x >= xx(jlo) .eqv. ascnd)
then
72 if (x < xx(jhi) .eqv. ascnd)
exit
85 if (x >= xx(jlo) .eqv. ascnd)
exit
93 if (jhi-jlo <= 1)
then
95 if (x >= xx(n)) jlo=n-1
100 if (x >= xx(jm) .eqv. ascnd)
then
118 logical function real_s_equal(x,y)
120 real_s_equal = (
abs(x-y) <= epsilon(x))
121 end function real_s_equal
123 logical function realsingle_s_equal(x,y)
125 realsingle_s_equal = (
abs(x-y) <= epsilon(x))
126 end function realsingle_s_equal
157 real,
intent(in) :: x(2), xx
158 real,
intent(in) :: y(2)
160 if (realsingle_s_equal(x(1),x(2)))
then
163 elseif(realsingle_s_equal(x(1),xx))
then
166 elseif (realsingle_s_equal(x(2),xx))
then
180 real,
dimension(2),
intent(in) :: x, y
181 real,
intent(in) :: xx, yy
182 integer,
intent(in) :: method
183 real,
dimension(:,:),
intent(in) :: source
188 real :: area1, area2, area3, area4
189 real :: deltax1, deltax2, deltay1, deltay2
193 if (method == 1)
then
201 area1 =
abs(deltax1 * deltay1)
202 area2 =
abs(deltax2 * deltay1)
203 area3 =
abs(deltax1 * deltay2)
204 area4 =
abs(deltax2 * deltay2)
206 num2 = area1 + area2 + area3 + area4
208 num1 = source(2, 2) * area1 + &
209 source(1, 1) * area4 + &
210 source(1, 2) * area2 + &
227 index_theta1, index_theta2, &
228 index_phi1, index_phi2,&
255 integer,
intent(in) :: index_theta1, index_theta2, index_phi1,index_phi2, &
256 index_theta01, index_theta02
258 real,
intent(in) :: reflectance(:,:,:)
259 real,
intent(in) :: theta_grid(:), &
260 theta0_grid(:),phi_grid(:),theta,theta0,phi
262 logical,
intent(in) :: debug
264 real :: corner1, corner2, corner3, corner4, &
265 corner5, corner6, corner7, corner8
266 real :: volume1, volume2, volume3, volume4, &
267 volume5, volume6, volume7, volume8
269 real :: theta0_val_1, theta0_val_2, theta_val_1, theta_val_2,phi_val_1, phi_val_2
272 theta0_val_1 = theta0_grid(index_theta01)-theta0
273 theta0_val_2 = theta0_grid(index_theta02)-theta0
275 theta_val_1 = theta_grid(index_theta1)-theta
276 theta_val_2 = theta_grid(index_theta2)-theta
278 phi_val_1 = phi_grid(index_phi1)-phi
279 phi_val_2 = phi_grid(index_phi2)-phi
281 volume2=
abs(theta0_val_1 * theta_val_1 * phi_val_2)
282 volume3=
abs(theta0_val_1 * theta_val_2 * phi_val_2)
283 volume4=
abs(theta0_val_1 * theta_val_2 * phi_val_1)
284 volume5=
abs(theta0_val_2 * theta_val_1 * phi_val_1)
285 volume6=
abs(theta0_val_2 * theta_val_1 * phi_val_2)
286 volume7=
abs(theta0_val_2 * theta_val_2 * phi_val_2)
287 volume8=
abs(theta0_val_2 * theta_val_2 * phi_val_1)
288 volume1=
abs(theta0_val_1 * theta_val_1 * phi_val_1)
290 num_1 = reflectance(index_theta01,index_theta1,index_phi1) * volume7 + &
291 reflectance(index_theta01,index_theta1,index_phi2) * volume8 + &
292 reflectance(index_theta02,index_theta1,index_phi2) * volume4 + &
293 reflectance(index_theta02,index_theta1,index_phi1) * volume3 + &
294 reflectance(index_theta01,index_theta2,index_phi1) * volume6 + &
295 reflectance(index_theta01,index_theta2,index_phi2) * volume5 + &
296 reflectance(index_theta02,index_theta2,index_phi2) * volume1 + &
297 reflectance(index_theta02,index_theta2,index_phi1) * volume2
299 num_2 = volume1 + volume2 + &
300 volume3 + volume4 + &
301 volume5 + volume6 + &