57 '$Id: CRTM_IR_Water_SfcOptics.f90 60152 2015-08-13 19:19:13Z paul.vandelst@noaa.gov $' 59 REAL(fp),
PARAMETER ::
cm_1 = 0.003_fp,
cm_2 = 5.12e-3_fp
71 REAL(fp) :: tan2_theta_f
73 TYPE(irssem_type) :: irssem
180 GeometryInfo, & ! Input
181 SensorIndex , & ! Input
182 ChannelIndex, & ! Input
183 SfcOptics , & ! Output
185 result( error_status )
189 INTEGER,
INTENT(IN) :: sensorindex
190 INTEGER,
INTENT(IN) :: channelindex
194 INTEGER :: error_status
196 CHARACTER(*),
PARAMETER :: routine_name =
'Compute_IR_Water_SfcOptics' 199 REAL(fp) :: frequency
200 REAL(fp) :: relative_azimuth_radian, brdf
206 nz = sfcoptics%n_Angles
207 iz = sfcoptics%Index_Sat_Ang
209 frequency =
sc(sensorindex)%Wavenumber(channelindex)
215 surface%Wind_Speed , &
217 sfcoptics%Angle(1:nz) , &
219 sfcoptics%Emissivity(1:nz,1) )
220 IF ( error_status /=
success )
THEN 222 'Error computing IR sea surface emissivity', &
229 IF ( spccoeff_issolar(
sc(sensorindex), channelindex=channelindex) )
THEN 231 IF( geometryinfo%Source_Zenith_Radian <
pi/
two )
THEN 232 relative_azimuth_radian = geometryinfo%Sensor_Azimuth_Radian - &
233 geometryinfo%Source_Azimuth_Radian
235 geometryinfo%Source_Zenith_Radian, &
236 relative_azimuth_radian, &
237 geometryinfo%Sensor_Zenith_Radian, &
238 surface%Wind_Speed, &
241 sfcoptics%Direct_Reflectivity(1:nz,1) = brdf
243 sfcoptics%Direct_Reflectivity(1:nz,1) =
zero 250 sfcoptics%Reflectivity(j,1,j,1) =
one-sfcoptics%Emissivity(j,1)
365 SfcOptics , & ! Input
366 Surface_TL , & ! Input
367 GeometryInfo, & ! Input
368 SensorIndex , & ! Input
369 ChannelIndex, & ! Input
370 SfcOptics_TL, & ! Output
372 result( error_status )
378 INTEGER,
INTENT(IN) :: sensorindex
379 INTEGER,
INTENT(IN) :: channelindex
383 INTEGER :: error_status
385 CHARACTER(*),
PARAMETER :: routine_name =
'Compute_IR_Water_SfcOptics_TL' 388 REAL(fp) :: relative_azimuth_radian, brdf_tl
393 nz = sfcoptics%n_Angles
394 iz = sfcoptics%Index_Sat_Ang
399 surface_tl%Wind_Speed , &
401 sfcoptics_tl%Emissivity(1:nz,1) )
402 IF ( error_status /=
success )
THEN 404 'Error computing Tangent_linear IR sea surface emissivity', &
411 IF ( spccoeff_issolar(
sc(sensorindex), channelindex=channelindex) )
THEN 413 IF( geometryinfo%Source_Zenith_Radian <
pi/
two )
THEN 414 relative_azimuth_radian = geometryinfo%Sensor_Azimuth_Radian - &
415 geometryinfo%Source_Azimuth_Radian
417 surface_tl%Wind_Speed, &
420 sfcoptics_tl%Direct_Reflectivity(1:nz,1) = brdf_tl
422 sfcoptics_tl%Direct_Reflectivity(1:nz,1) =
zero 429 sfcoptics_tl%Reflectivity(j,1,j,1) = -sfcoptics_tl%Emissivity(j,1)
548 SfcOptics , & ! Input
549 SfcOptics_AD, & ! Input
550 GeometryInfo, & ! Input
551 SensorIndex , & ! Input
552 ChannelIndex, & ! Input
553 Surface_AD , & ! Output
555 result( error_status )
561 INTEGER,
INTENT(IN) :: sensorindex
562 INTEGER,
INTENT(IN) :: channelindex
566 INTEGER :: error_status
568 CHARACTER(*),
PARAMETER :: routine_name =
'Compute_IR_Water_SfcOptics_AD' 571 REAL(fp) :: relative_azimuth_radian, brdf_ad
576 nz = sfcoptics%n_Angles
577 iz = sfcoptics%Index_Sat_Ang
581 sfcoptics_ad%Emissivity(j,1) = sfcoptics_ad%Emissivity(j,1) - &
582 sfcoptics_ad%Reflectivity(j,1,j,1)
583 sfcoptics_ad%Reflectivity(j,1,j,1) =
zero 587 IF ( spccoeff_issolar(
sc(sensorindex), channelindex=channelindex) )
THEN 589 IF( geometryinfo%Source_Zenith_Radian <
pi/
two )
THEN 591 relative_azimuth_radian = geometryinfo%Sensor_Azimuth_Radian - &
592 geometryinfo%Source_Azimuth_Radian
594 brdf_ad = sum(sfcoptics_ad%Direct_Reflectivity(1:nz,1))
595 sfcoptics_ad%Direct_Reflectivity(1:nz,1) =
zero 598 surface_ad%Wind_Speed, &
601 sfcoptics_ad%Direct_Reflectivity(1:nz,1) =
zero 608 sfcoptics_ad%Emissivity(1:nz,1), &
610 surface_ad%Wind_Speed )
611 IF ( error_status /=
success )
THEN 613 'Error computing Adjoint IR sea surface emissivity', &
662 SUBROUTINE brdf_rough_sea(Frequency, theta_s, dphi, theta_r, Wind_Speed, &
664 REAL(fp),
INTENT(IN) :: Frequency
665 REAL(fp),
INTENT(IN) :: theta_s
666 REAL(fp),
INTENT(IN) :: dphi
667 REAL(fp),
INTENT(IN) :: theta_r
668 REAL(fp),
INTENT(IN) :: Wind_Speed
669 REAL(fp),
INTENT(OUT) :: brdf
670 TYPE(iVar_type),
INTENT(IN OUT) :: iVar
673 REAL(fp),
PARAMETER :: MIN_THETA = 1.0e-15_fp
674 REAL(fp) :: sin_theta_s, cos_theta_s, sin_theta_r, cos_theta_r, sin2_theta_s, &
675 sin2_theta_r, cos_dphi, CosSum2, sec4_theta_f, &
676 cos2_alpha, cos_alpha, alpha, rho
679 sin_theta_s = sin(theta_s)
680 cos_theta_s =
max(cos(theta_s), min_theta)
681 sin_theta_r = sin(theta_r)
682 cos_theta_r =
max(cos(theta_r), min_theta)
683 sin2_theta_s = sin_theta_s*sin_theta_s
684 sin2_theta_r = sin_theta_r*sin_theta_r
686 cossum2 = (cos_theta_s + cos_theta_r)**2
689 cos2_alpha = (
one + sin_theta_s*sin_theta_r*cos_dphi + cos_theta_s*cos_theta_r)/
two 690 cos_alpha = sqrt( cos2_alpha )
691 alpha = acos(
min(cos_alpha,
one))
698 ivar%tan2_theta_f = (sin2_theta_s + sin2_theta_r &
699 +
two*sin_theta_s*sin_theta_r*cos_dphi) &
703 CALL slope_pdf(ivar%tan2_theta_f, wind_speed, ivar%pdf)
706 sec4_theta_f = (ivar%tan2_theta_f +
one)**2
707 ivar%W =
pi * rho * sec4_theta_f / (
four*cos_theta_r*cos_theta_s)
708 brdf = ivar%W * ivar%pdf
713 Wind_Speed_TL, brdf_TL, iVar)
714 REAL(fp),
INTENT(IN) :: Wind_Speed
715 REAL(fp),
INTENT(IN) :: Wind_Speed_TL
716 REAL(fp),
INTENT(OUT) :: brdf_TL
717 TYPE(iVar_type),
INTENT(IN) :: iVar
722 CALL slope_pdf_tl(ivar%tan2_theta_f, wind_speed, ivar%pdf, wind_speed_tl, pdf_tl)
724 brdf_tl = ivar%W * pdf_tl
729 brdf_AD, Wind_Speed_AD, iVar)
730 REAL(fp),
INTENT(IN) :: Wind_Speed
731 REAL(fp),
INTENT(INOUT) :: brdf_AD
732 REAL(fp),
INTENT(INOUT) :: Wind_Speed_AD
733 TYPE(iVar_type),
INTENT(IN) :: iVar
738 pdf_ad = ivar%W * brdf_ad
741 CALL slope_pdf_ad(ivar%tan2_theta_f, wind_speed, ivar%pdf, pdf_ad, wind_speed_ad)
750 SUBROUTINE slope_pdf(tan2_theta_f, Wind_Speed, pdf)
751 REAL(fp),
INTENT(IN) :: tan2_theta_f
752 REAL(fp),
INTENT(IN) :: Wind_Speed
753 REAL(fp),
INTENT(OUT) :: pdf
760 pdf = exp(-tan2_theta_f / sigma2) / (
pi*sigma2)
764 SUBROUTINE slope_pdf_tl(tan2_theta_f, Wind_Speed, pdf, Wind_Speed_TL, pdf_TL)
765 REAL(fp),
INTENT(IN) :: tan2_theta_f
766 REAL(fp),
INTENT(IN) :: Wind_Speed
767 REAL(fp),
INTENT(IN) :: pdf
768 REAL(fp),
INTENT(IN) :: Wind_Speed_TL
769 REAL(fp),
INTENT(OUT) :: pdf_TL
772 REAL(fp) :: Sigma2, Sigma2_TL
775 sigma2_tl =
cm_2*wind_speed_tl
776 pdf_tl = ( pdf*(tan2_theta_f/sigma2 -
one)/sigma2 )*sigma2_tl
780 SUBROUTINE slope_pdf_ad(tan2_theta_f, Wind_Speed, pdf, pdf_AD, Wind_Speed_AD)
781 REAL(fp),
INTENT(IN) :: tan2_theta_f
782 REAL(fp),
INTENT(IN) :: Wind_Speed
783 REAL(fp),
INTENT(IN) :: pdf
784 REAL(fp),
INTENT(IN OUT) :: pdf_AD
785 REAL(fp),
INTENT(IN OUT) :: Wind_Speed_AD
788 REAL(fp) :: Sigma2, Sigma2_AD
791 sigma2_ad = ( pdf*(tan2_theta_f/sigma2 -
one)/sigma2 )*pdf_ad
793 wind_speed_ad = wind_speed_ad + 5.12e-3_fp*sigma2_ad
808 REAL(fp),
INTENT(IN) :: frequency
809 REAL(fp),
INTENT(IN) :: ang_i
815 COMPLEX(fp) :: ccos_i, ccos_t, n, z
822 z = cmplx(sin(ang_i),
zero,
fp)/n
823 ccos_t = sqrt(cmplx(
one,
zero,
fp) - z*z)
825 ccos_i = cmplx(cos(ang_i),
zero,
fp)
827 rv = ( abs( (n*ccos_i - ccos_t) / (n*ccos_i + ccos_t) ) )**2
828 rh = ( abs( (ccos_i - n*ccos_t) / (ccos_i + n*ccos_t) ) )**2
839 FUNCTION ref_index(Frequency)
RESULT(ref)
840 REAL(fp),
INTENT(IN) :: frequency
851 INTEGER,
PARAMETER :: nf = 151
853 REAL(fp),
PARAMETER :: freq(nf) = (/ &
854 500.0, 520.0, 540.0, 560.0, 580.0, 600.0, 620.0, 640.0, 660.0, 680.0,&
855 700.0, 720.0, 740.0, 760.0, 780.0, 800.0, 820.0, 840.0, 860.0, 880.0,&
856 900.0, 920.0, 940.0, 960.0, 980.0, 1000.0, 1020.0, 1040.0, 1060.0, 1080.0,&
857 1100.0, 1120.0, 1140.0, 1160.0, 1180.0, 1200.0, 1220.0, 1240.0, 1260.0, 1280.0,&
858 1300.0, 1320.0, 1340.0, 1360.0, 1380.0, 1400.0, 1420.0, 1440.0, 1460.0, 1480.0,&
859 1500.0, 1520.0, 1540.0, 1560.0, 1580.0, 1600.0, 1620.0, 1640.0, 1660.0, 1680.0,&
860 1700.0, 1720.0, 1740.0, 1760.0, 1780.0, 1800.0, 1820.0, 1840.0, 1860.0, 1880.0,&
861 1900.0, 1920.0, 1940.0, 1960.0, 1980.0, 2000.0, 2020.0, 2040.0, 2060.0, 2080.0,&
862 2100.0, 2120.0, 2140.0, 2160.0, 2180.0, 2200.0, 2220.0, 2240.0, 2260.0, 2280.0,&
863 2300.0, 2320.0, 2340.0, 2360.0, 2380.0, 2400.0, 2420.0, 2440.0, 2460.0, 2480.0,&
864 2500.0, 2520.0, 2540.0, 2560.0, 2580.0, 2600.0, 2620.0, 2640.0, 2660.0, 2680.0,&
865 2700.0, 2720.0, 2740.0, 2760.0, 2780.0, 2800.0, 2820.0, 2840.0, 2860.0, 2880.0,&
866 2900.0, 2920.0, 2940.0, 2960.0, 2980.0, 3000.0, 3020.0, 3040.0, 3060.0, 3080.0,&
867 3100.0, 3120.0, 3140.0, 3160.0, 3180.0, 3200.0, 3220.0, 3240.0, 3260.0, 3280.0,&
868 3300.0, 3320.0, 3340.0, 3360.0, 3380.0, 3400.0, 3420.0, 3440.0, 3460.0, 3480.0,&
871 REAL(fp),
PARAMETER :: nr(nf) = (/ &
872 1.5300, 1.5050, 1.4752, 1.4427, 1.4111, 1.3787, 1.3468, 1.3167, 1.2887, 1.2620,&
873 1.2348, 1.2077, 1.1823, 1.1596, 1.1417, 1.1268, 1.1152, 1.1143, 1.1229, 1.1327,&
874 1.1520, 1.1630, 1.1770, 1.1920, 1.2050, 1.2170, 1.2280, 1.2371, 1.2450, 1.2523,&
875 1.2580, 1.2636, 1.2680, 1.2740, 1.2780, 1.2820, 1.2850, 1.2880, 1.2910, 1.2940,&
876 1.2970, 1.3000, 1.3020, 1.3040, 1.3070, 1.3080, 1.3100, 1.3120, 1.3150, 1.3170,&
877 1.3200, 1.3230, 1.3280, 1.3350, 1.3490, 1.3530, 1.3430, 1.3080, 1.2630, 1.2460,&
878 1.2410, 1.2540, 1.2670, 1.2760, 1.2810, 1.2900, 1.2950, 1.3000, 1.3040, 1.3070,&
879 1.3100, 1.3130, 1.3160, 1.3180, 1.3200, 1.3210, 1.3220, 1.3240, 1.3240, 1.3250,&
880 1.3260, 1.3250, 1.3250, 1.3250, 1.3250, 1.3250, 1.3260, 1.3270, 1.3280, 1.3280,&
881 1.3290, 1.3300, 1.3310, 1.3330, 1.3350, 1.3360, 1.3380, 1.3400, 1.3410, 1.3430,&
882 1.3450, 1.3480, 1.3500, 1.3520, 1.3550, 1.3580, 1.3600, 1.3610, 1.3640, 1.3660,&
883 1.3680, 1.3710, 1.3740, 1.3770, 1.3810, 1.3850, 1.3890, 1.3940, 1.3980, 1.4020,&
884 1.4070, 1.4120, 1.4180, 1.4240, 1.4310, 1.4370, 1.4440, 1.4510, 1.4590, 1.4660,&
885 1.4720, 1.4780, 1.4840, 1.4830, 1.4820, 1.4750, 1.4690, 1.4580, 1.4390, 1.4230,&
886 1.4130, 1.3960, 1.3810, 1.3560, 1.3290, 1.2970, 1.2600, 1.2170, 1.1860, 1.1590,&
889 REAL(fp),
PARAMETER :: ni(nf) = (/ &
890 0.3874, 0.4031, 0.4149, 0.4213, 0.4243, 0.4227, 0.4180, 0.4105, 0.3997, 0.3877,&
891 0.3731, 0.3556, 0.3341, 0.3079, 0.2803, 0.2489, 0.2144, 0.1776, 0.1505, 0.1243,&
892 0.0970, 0.0822, 0.0693, 0.0593, 0.0517, 0.0469, 0.0432, 0.0404, 0.0384, 0.0369,&
893 0.0357, 0.0353, 0.0352, 0.0348, 0.0343, 0.0340, 0.0338, 0.0334, 0.0329, 0.0330,&
894 0.0329, 0.0326, 0.0323, 0.0320, 0.0318, 0.0317, 0.0316, 0.0317, 0.0323, 0.0329,&
895 0.0337, 0.0352, 0.0394, 0.0454, 0.0538, 0.0711, 0.1040, 0.1239, 0.1144, 0.0844,&
896 0.0539, 0.0364, 0.0264, 0.0177, 0.0145, 0.0127, 0.0117, 0.0108, 0.0104, 0.0103,&
897 0.0104, 0.0105, 0.0108, 0.0114, 0.0122, 0.0129, 0.0135, 0.0143, 0.0150, 0.0155,&
898 0.0156, 0.0155, 0.0152, 0.0148, 0.0140, 0.0132, 0.0123, 0.0115, 0.0106, 0.0098,&
899 0.0091, 0.0085, 0.0079, 0.0073, 0.0068, 0.0064, 0.0060, 0.0056, 0.0052, 0.0049,&
900 0.0046, 0.0043, 0.0041, 0.0039, 0.0038, 0.0037, 0.0036, 0.0036, 0.0037, 0.0038,&
901 0.0040, 0.0042, 0.0046, 0.0050, 0.0055, 0.0061, 0.0070, 0.0080, 0.0092, 0.0106,&
902 0.0124, 0.0146, 0.0174, 0.0197, 0.0259, 0.0350, 0.0429, 0.0476, 0.0541, 0.0655,&
903 0.0793, 0.0921, 0.1058, 0.1232, 0.1450, 0.1656, 0.1833, 0.1990, 0.2161, 0.2267,&
904 0.2369, 0.2487, 0.2606, 0.2740, 0.2819, 0.2854, 0.2826, 0.2765, 0.2637, 0.2451,&
906 REAL(fp),
PARAMETER :: df = freq(2) - freq(1)
910 IF(frequency < freq(1))
THEN 911 ref = cmplx( nr(1), ni(1),
fp )
912 ELSE IF( frequency > freq(nf) )
THEN 913 ref = cmplx( nr(nf), ni(nf),
fp )
916 idx = int((frequency - freq(1))/df) + 1
917 c = (frequency - freq(idx))/(freq(idx+1) - freq(idx))
918 ref = cmplx( nr(idx) + c*(nr(idx+1) - nr(idx)), &
919 ni(idx) + c*(ni(idx+1) - ni(idx)), &
real(fp) function fresnel_reflectance(Frequency, Ang_i)
real(fp), parameter, public zero
integer function, public compute_ir_water_sfcoptics_tl(Surface, SfcOptics, Surface_TL, GeometryInfo, SensorIndex, ChannelIndex, SfcOptics_TL, iVar)
subroutine slope_pdf_ad(tan2_theta_f, Wind_Speed, pdf, pdf_AD, Wind_Speed_AD)
type(irwatercoeff_type), save, public irwaterc
real(fp), parameter, public four
integer, parameter, public fp
complex(fp) function ref_index(Frequency)
subroutine brdf_rough_sea(Frequency, theta_s, dphi, theta_r, Wind_Speed, brdf, iVar)
integer function, public compute_ir_water_sfcoptics(Surface, GeometryInfo, SensorIndex, ChannelIndex, SfcOptics, iVar)
real(fp), parameter, public one
recursive subroutine, public display_message(Routine_Name, Message, Error_State, Message_Log)
real(fp), parameter, public two
subroutine slope_pdf(tan2_theta_f, Wind_Speed, pdf)
character(*), parameter module_version_id
real(fp), parameter, public degrees_to_radians
type(spccoeff_type), dimension(:), allocatable, save, public sc
integer function, public compute_ir_water_sfcoptics_ad(Surface, SfcOptics, SfcOptics_AD, GeometryInfo, SensorIndex, ChannelIndex, Surface_AD, iVar)
subroutine brdf_rough_sea_ad(Wind_Speed, brdf_AD, Wind_Speed_AD, iVar)
subroutine slope_pdf_tl(tan2_theta_f, Wind_Speed, pdf, Wind_Speed_TL, pdf_TL)
subroutine brdf_rough_sea_tl(Wind_Speed, Wind_Speed_TL, brdf_TL, iVar)
integer, parameter, public success
real(fp), parameter, public pi