69 '$Id: CRTM_RTSolution.f90 60152 2015-08-13 19:19:13Z paul.vandelst@noaa.gov $' 189 Atmosphere , & ! Input
191 AtmOptics , & ! Input
192 SfcOptics , & ! Input
193 GeometryInfo, & ! Input
194 SensorIndex , & ! Input
195 ChannelIndex, & ! Input
196 RTSolution , & ! Output
198 result( error_status )
205 INTEGER,
INTENT(IN) :: sensorindex
206 INTEGER,
INTENT(IN) :: channelindex
208 TYPE(
rtv_type),
INTENT(IN OUT) :: rtv
210 INTEGER :: error_status
212 CHARACTER(*),
PARAMETER :: routine_name =
'CRTM_Compute_RTSolution' 214 CHARACTER(256) :: message
230 IF ( error_status /=
success )
THEN 231 message =
'Error assigning input for RTSolution algorithms' 238 IF( rtv%Visible_Flag_true )
THEN 240 sfcoptics%Direct_Reflectivity(i,1) = sfcoptics%Direct_Reflectivity(i,1) *
pi 242 IF (sfcoptics%Direct_Reflectivity(i,1) >
one)
THEN 243 sfcoptics%Direct_Reflectivity(i,1) =
one 253 IF( rtv%Scattering_RT )
THEN 256 SELECT CASE(rtv%RT_Algorithm_Id)
258 rtsolution%RT_Algorithm_Name =
'ADA' 261 atmosphere%n_Layers , &
262 atmoptics%Single_Scatter_Albedo , &
263 atmoptics%Optical_Depth , &
264 rtv%Cosmic_Background_Radiance , &
265 sfcoptics%Emissivity( 1:nz, 1 ) , &
266 sfcoptics%Reflectivity( 1:nz, 1, 1:nz, 1 ), &
267 sfcoptics%Direct_Reflectivity(1:nz,1) , &
270 rtsolution%RT_Algorithm_Name =
'SOI' 273 atmosphere%n_Layers , &
274 atmoptics%Single_Scatter_Albedo , &
275 atmoptics%Optical_Depth , &
276 rtv%Cosmic_Background_Radiance , &
277 sfcoptics%Emissivity( 1:nz, 1 ) , &
278 sfcoptics%Reflectivity( 1:nz, 1, 1:nz, 1 ), &
279 sfcoptics%Index_Sat_Ang , &
288 rtsolution%RT_Algorithm_Name =
'Emission' 290 atmosphere%n_Layers, &
292 rtv%Diffuse_Surface, &
293 geometryinfo%Cosine_Sensor_Zenith, &
294 atmoptics%Optical_Depth, &
295 rtv%Planck_Atmosphere, &
296 rtv%Planck_Surface, &
297 sfcoptics%Emissivity(1:nz,1), &
298 sfcoptics%Reflectivity(1:nz,1,1:nz,1), &
299 sfcoptics%Direct_Reflectivity(1:nz,1), &
300 rtv%Cosmic_Background_Radiance, &
301 rtv%Solar_Irradiance, &
302 rtv%Is_Solar_Channel, &
303 geometryinfo%Source_Zenith_Radian, &
315 IF ( error_status /=
success )
THEN 316 message =
'Error assigning output for RTSolution algorithms' 470 Atmosphere , & ! FWD Input
471 Surface , & ! FWD Input
472 AtmOptics , & ! FWD Input
473 SfcOptics , & ! FWD Input
474 RTSolution , & ! FWD Input
475 Atmosphere_TL, & ! TL Input
476 Surface_TL , & ! TL Input
477 AtmOptics_TL , & ! TL Input
478 SfcOptics_TL , & ! TL Input
479 GeometryInfo , & ! Input
480 SensorIndex , & ! Input
481 ChannelIndex , & ! Input
482 RTSolution_TL, & ! TL Output
484 result( error_status )
496 INTEGER,
INTENT(IN) :: sensorindex
497 INTEGER,
INTENT(IN) :: channelindex
501 INTEGER :: error_status
503 CHARACTER(*),
PARAMETER :: routine_name =
'CRTM_Compute_RTSolution_TL' 505 CHARACTER(256) :: message
507 REAL(fp) :: user_emissivity_tl, direct_reflectivity_tl
508 REAL(fp) :: planck_surface_tl
509 REAL(fp),
DIMENSION( 0:Atmosphere%n_Layers ) :: planck_atmosphere_tl
512 REAL(fp),
DIMENSION( MAX_N_ANGLES, &
MAX_N_ANGLES+1, &
Atmosphere%n_Layers ) :: pff_tl
513 REAL(fp),
DIMENSION( MAX_N_ANGLES, &
MAX_N_ANGLES+1, &
Atmosphere%n_Layers ) :: pbb_tl
514 REAL(fp),
DIMENSION( MAX_N_ANGLES ) :: scattering_radiance_tl
515 REAL(fp) :: radiance_tl
522 rtsolution_tl%RT_Algorithm_Name = rtsolution%RT_Algorithm_Name
537 user_emissivity_tl , &
538 direct_reflectivity_tl , &
539 planck_surface_tl , &
540 planck_atmosphere_tl , &
544 IF ( error_status /=
success )
THEN 545 message =
'Error assigning input for TL RTSolution algorithms' 554 IF( rtv%Scattering_RT )
THEN 557 SELECT CASE(rtv%RT_Algorithm_Id)
562 atmosphere%n_Layers, &
563 atmoptics%Single_Scatter_Albedo, &
564 atmoptics%Optical_Depth, &
565 rtv%Cosmic_Background_Radiance, &
566 sfcoptics%Emissivity(1:nz,1), &
567 sfcoptics%Direct_Reflectivity(1:nz,1), &
569 planck_atmosphere_tl, &
571 atmoptics_tl%Single_Scatter_Albedo, &
572 atmoptics_tl%Optical_Depth, &
573 sfcoptics_tl%Emissivity(1:nz,1), &
574 sfcoptics_tl%Reflectivity(1:nz,1,1:nz,1), &
575 sfcoptics_tl%Direct_Reflectivity(1:nz,1), &
576 pff_tl(1:nz,1:(nz+1),:), &
577 pbb_tl(1:nz,1:(nz+1),:), &
578 scattering_radiance_tl(1:nz) )
582 atmosphere%n_Layers, &
583 atmoptics%Single_Scatter_Albedo, &
584 atmoptics%Optical_Depth, &
585 sfcoptics%Emissivity(1:nz,1), &
586 sfcoptics%Reflectivity(1:nz,1,1:nz,1), &
587 sfcoptics%Index_Sat_Ang, &
589 planck_atmosphere_tl, &
591 atmoptics_tl%Single_Scatter_Albedo, &
592 atmoptics_tl%Optical_Depth, &
593 sfcoptics_tl%Emissivity(1:nz,1), &
594 sfcoptics_tl%Reflectivity(1:nz,1,1:nz,1), &
595 pff_tl(1:nz,1:nz,:), &
596 pbb_tl(1:nz,1:nz,:), &
597 scattering_radiance_tl(1:nz) )
604 atmosphere%n_Layers, &
606 geometryinfo%Cosine_Sensor_Zenith, &
607 rtv%Planck_Atmosphere, &
608 rtv%Planck_Surface, &
609 sfcoptics%Emissivity(1:nz,1), &
610 sfcoptics%Reflectivity(1:nz,1,1:nz,1), &
611 sfcoptics%Direct_Reflectivity(1:nz,1), &
612 rtv%Solar_Irradiance, &
613 rtv%Is_Solar_Channel, &
614 geometryinfo%Source_Zenith_Radian, &
616 atmoptics_tl%Optical_Depth, &
617 planck_atmosphere_tl, &
619 sfcoptics_tl%Emissivity(1:nz,1), &
620 sfcoptics_tl%Reflectivity(1:nz,1,1:nz,1), &
621 sfcoptics_tl%Direct_Reflectivity(1:nz,1), &
629 scattering_radiance_tl, &
634 IF ( error_status /=
success )
THEN 635 message =
'Error assigning output for TL RTSolution algorithms' 788 Atmosphere , & ! FWD Input
789 Surface , & ! FWD Input
790 AtmOptics , & ! FWD Input
791 SfcOptics , & ! FWD Input
792 RTSolution , & ! FWD Input
793 RTSolution_AD, & ! AD Input
794 GeometryInfo , & ! Input
795 SensorIndex , & ! Input
796 ChannelIndex , & ! Input
797 Atmosphere_AD, & ! AD Output
798 Surface_AD , & ! AD Output
799 AtmOptics_AD , & ! AD Output
800 SfcOptics_AD , & ! AD Output
802 result( error_status )
811 INTEGER,
INTENT(IN) :: sensorindex
812 INTEGER,
INTENT(IN) :: channelindex
819 INTEGER :: error_status
821 CHARACTER(*),
PARAMETER :: routine_name =
'CRTM_Compute_RTSolution_AD' 823 CHARACTER(256) :: message
825 REAL(fp) :: planck_surface_ad
826 REAL(fp),
DIMENSION( 0:Atmosphere%n_Layers ) :: planck_atmosphere_ad
827 REAL(fp) :: user_emissivity_ad
829 REAL(fp),
DIMENSION( MAX_N_ANGLES, &
MAX_N_ANGLES+1, &
Atmosphere%n_Layers ) :: pff_ad
830 REAL(fp),
DIMENSION( MAX_N_ANGLES, &
MAX_N_ANGLES+1, &
Atmosphere%n_Layers ) :: pbb_ad
831 REAL (fp),
DIMENSION( MAX_N_ANGLES ) :: scattering_radiance_ad
832 REAL (fp) :: radiance_ad
839 rtsolution_ad%RT_Algorithm_Name = rtsolution%RT_Algorithm_Name
848 planck_surface_ad , &
849 planck_atmosphere_ad , &
853 IF ( error_status /=
success )
THEN 854 message =
'Error assigning input for AD RTSolution algorithms' 863 IF( rtv%Scattering_RT )
THEN 866 scattering_radiance_ad =
zero 867 scattering_radiance_ad( sfcoptics%Index_Sat_Ang ) = radiance_ad
871 IF ( rtv%RT_Algorithm_Id ==
rt_ada )
THEN 874 atmosphere%n_Layers, &
875 atmoptics%Single_Scatter_Albedo, &
876 atmoptics%Optical_Depth, &
877 rtv%Cosmic_Background_Radiance, &
878 sfcoptics%Emissivity(1:nz,1), &
879 sfcoptics%Direct_Reflectivity(1:nz,1), &
881 scattering_radiance_ad(1:nz), &
882 planck_atmosphere_ad, &
884 atmoptics_ad%Single_Scatter_Albedo, &
885 atmoptics_ad%Optical_Depth, &
886 sfcoptics_ad%Emissivity(1:nz,1), &
887 sfcoptics_ad%Reflectivity(1:nz,1,1:nz,1), &
888 sfcoptics_ad%Direct_Reflectivity(1:nz,1), &
889 pff_ad(1:nz,1:(nz+1),:), &
890 pbb_ad(1:nz,1:(nz+1),:) )
894 atmosphere%n_Layers, &
895 atmoptics%Single_Scatter_Albedo, &
896 atmoptics%Optical_Depth, &
897 sfcoptics%Emissivity(1:nz,1), &
898 sfcoptics%Reflectivity(1:nz,1,1:nz,1), &
899 sfcoptics%Index_Sat_Ang, &
901 scattering_radiance_ad(1:nz), &
902 planck_atmosphere_ad, &
904 atmoptics_ad%Single_Scatter_Albedo, &
905 atmoptics_ad%Optical_Depth, &
906 sfcoptics_ad%Emissivity(1:nz,1), &
907 sfcoptics_ad%Reflectivity(1:nz,1,1:nz,1), &
908 pff_ad(1:nz,1:(nz+1),:), &
909 pbb_ad(1:nz,1:(nz+1),:) )
919 atmosphere%n_Layers, &
921 geometryinfo%Cosine_Sensor_Zenith, &
922 rtv%Planck_Atmosphere, &
923 rtv%Planck_Surface, &
924 sfcoptics%Emissivity(1:nz,1), &
925 sfcoptics%Reflectivity(1:nz,1,1:nz,1), &
926 sfcoptics%Direct_Reflectivity(1:nz,1), &
927 rtv%Solar_Irradiance, &
928 rtv%Is_Solar_Channel, &
929 geometryinfo%Source_Zenith_Radian, &
932 atmoptics_ad%Optical_Depth, &
933 planck_atmosphere_ad, &
935 sfcoptics_ad%Emissivity(1:nz,1), &
936 sfcoptics_ad%Reflectivity(1:nz,1,1:nz,1), &
937 sfcoptics_ad%Direct_Reflectivity(1:nz,1) )
952 planck_surface_ad , &
953 planck_atmosphere_ad , &
954 user_emissivity_ad , &
959 IF ( error_status /=
success )
THEN 960 message =
'Error assigning output for AD RTSolution algorithms' 1027 Atmosphere , & ! Input
1028 SensorIndex , & ! Input
1029 ChannelIndex, & ! Input
1034 INTEGER,
INTENT(IN) :: sensorindex
1035 INTEGER,
INTENT(IN) :: channelindex
1040 REAL(fp) :: maxreff, reff, mieparameter
1045 rtsolution%n_full_Streams = nstreams
1046 rtsolution%Scattering_FLAG = .false.
1049 IF ( atmosphere%n_Clouds == 0 .AND. &
1050 atmosphere%n_Aerosols == 0 )
RETURN 1054 DO n = 1, atmosphere%n_Clouds
1055 reff = maxval(atmosphere%Cloud(n)%Effective_Radius)
1056 IF( reff > maxreff) maxreff = reff
1058 DO n = 1, atmosphere%n_Aerosols
1059 reff = maxval(atmosphere%Aerosol(n)%Effective_Radius)
1060 IF( reff > maxreff) maxreff = reff
1064 mieparameter =
two *
pi * maxreff *
sc(sensorindex)%Wavenumber(channelindex)/10000.0_fp
1067 IF ( mieparameter < 0.01_fp )
THEN 1069 ELSE IF( mieparameter <
one )
THEN 1079 rtsolution%Scattering_Flag = .true.
1080 rtsolution%n_full_Streams = nstreams + 2
1108 CHARACTER(*),
INTENT(OUT) :: id
1113
integer function, public assign_common_output(Atmosphere, SfcOptics, GeometryInfo, SensorIndex, ChannelIndex, RTV, RTSolution)
integer function, public assign_common_output_ad(Atmosphere, Surface, AtmOptics, SfcOptics, Pff_AD, Pbb_AD, GeometryInfo, SensorIndex, ChannelIndex, nZ, AtmOptics_AD, SfcOptics_AD, Planck_Surface_AD, Planck_Atmosphere_AD, User_Emissivity_AD, Atmosphere_AD, Surface_AD, RTSolution_AD, RTV)
integer, parameter, public failure
real(fp), parameter, public zero
subroutine, public crtm_ada(n_Layers, w, T_OD, cosmic_background, emissivity, reflectivity, direct_reflectivity, RTV)
integer, parameter, public fp
integer function, public assign_common_output_tl(SfcOptics, RTSolution, GeometryInfo, Radiance_TL, Scattering_Radiance_TL, SensorIndex, ChannelIndex, RTV, RTSolution_TL)
integer, parameter, public max_n_angles
integer function, public crtm_compute_rtsolution_tl(Atmosphere, Surface, AtmOptics, SfcOptics, RTSolution, Atmosphere_TL, Surface_TL, AtmOptics_TL, SfcOptics_TL, GeometryInfo, SensorIndex, ChannelIndex, RTSolution_TL, RTV)
subroutine, public crtm_emission_ad(n_Layers, n_Angles, u, Planck_Atmosphere, Planck_Surface, emissivity, reflectivity, direct_reflectivity, Solar_irradiance, Is_Solar_Channel, Source_Zenith_Radian, RTV, up_rad_AD_in, T_OD_AD, Planck_Atmosphere_AD, Planck_Surface_AD, emissivity_AD, reflectivity_AD, direct_reflectivity_AD)
subroutine, public crtm_soi(n_Layers, w, T_OD, cosmic_background, emissivity, reflectivity, Index_Sat_Angle, RTV)
integer function, public crtm_compute_rtsolution(Atmosphere, Surface, AtmOptics, SfcOptics, GeometryInfo, SensorIndex, ChannelIndex, RTSolution, RTV)
subroutine, public crtm_ada_tl(n_Layers, w, T_OD, cosmic_background, emissivity, direct_reflectivity, RTV, Planck_Atmosphere_TL, Planck_Surface_TL, w_TL, T_OD_TL, emissivity_TL, reflectivity_TL, direct_reflectivity_TL, Pff_TL, Pbb_TL, s_rad_up_TL)
character(*), parameter module_version_id
real(fp), parameter, public one
recursive subroutine, public display_message(Routine_Name, Message, Error_State, Message_Log)
integer function, public assign_common_input_ad(SfcOptics, RTSolution, GeometryInfo, SensorIndex, ChannelIndex, RTSolution_AD, SfcOptics_AD, Planck_Surface_AD, Planck_Atmosphere_AD, Radiance_AD, nz, RTV)
real(fp), parameter, public two
integer function, public crtm_compute_nstreams(Atmosphere, SensorIndex, ChannelIndex, RTSolution)
subroutine, public crtm_emission(n_Layers, n_Angles, Diffuse_Surface, u, T_OD, Planck_Atmosphere, Planck_Surface, emissivity, reflectivity, direct_reflectivity, cosmic_background, Solar_irradiance, Is_Solar_Channel, Source_Zenith_Radian, RTV)
integer function, public crtm_compute_rtsolution_ad(Atmosphere, Surface, AtmOptics, SfcOptics, RTSolution, RTSolution_AD, GeometryInfo, SensorIndex, ChannelIndex, Atmosphere_AD, Surface_AD, AtmOptics_AD, SfcOptics_AD, RTV)
integer, parameter, public rt_soi
type(spccoeff_type), dimension(:), allocatable, save, public sc
subroutine, public crtm_soi_tl(n_Layers, w, T_OD, emissivity, reflectivity, Index_Sat_Angle, RTV, Planck_Atmosphere_TL, Planck_Surface_TL, w_TL, T_OD_TL, emissivity_TL, reflectivity_TL, Pff_TL, Pbb_TL, s_rad_up_TL)
integer function, public assign_common_input(Atmosphere, Surface, AtmOptics, SfcOptics, GeometryInfo, SensorIndex, ChannelIndex, RTSolution, nz, RTV)
integer, parameter, public rt_ada
subroutine, public crtm_soi_ad(n_Layers, w, T_OD, emissivity, reflectivity, Index_Sat_Angle, RTV, s_rad_up_AD, Planck_Atmosphere_AD, Planck_Surface_AD, w_AD, T_OD_AD, emissivity_AD, reflectivity_AD, Pff_AD, Pbb_AD)
integer function, public assign_common_input_tl(Atmosphere, Surface, AtmOptics, SfcOptics, Atmosphere_TL, Surface_TL, AtmOptics_TL, SfcOptics_TL, GeometryInfo, SensorIndex, ChannelIndex, RTSolution_TL, nz, User_Emissivity_TL, Direct_Reflectivity_TL, Planck_Surface_TL, Planck_Atmosphere_TL, Pff_TL, Pbb_TL, RTV)
subroutine, public crtm_emission_tl(n_Layers, n_Angles, u, Planck_Atmosphere, Planck_Surface, emissivity, reflectivity, direct_reflectivity, Solar_irradiance, Is_Solar_Channel, Source_Zenith_Radian, RTV, T_OD_TL, Planck_Atmosphere_TL, Planck_Surface_TL, emissivity_TL, reflectivity_TL, direct_reflectivity_TL, up_rad_TL)
subroutine, public crtm_rtsolution_version(Id)
integer, parameter, public success
real(fp), parameter, public pi
subroutine, public crtm_ada_ad(n_Layers, w, T_OD, cosmic_background, emissivity, direct_reflectivity, RTV, s_rad_up_AD, Planck_Atmosphere_AD, Planck_Surface_AD, w_AD, T_OD_AD, emissivity_AD, reflectivity_AD, direct_reflectivity_AD, Pff_AD, Pbb_AD)