32 spccoeff_ismicrowavesensor , &
33 spccoeff_isinfraredsensor , &
34 spccoeff_isvisiblesensor , &
35 spccoeff_isultravioletsensor
89 '$Id: CRTM_CloudScatter.f90 60152 2015-08-13 19:19:13Z paul.vandelst@noaa.gov $' 91 INTEGER,
PARAMETER ::
ml = 256
179 SensorIndex , & ! Input
180 ChannelIndex, & ! Input
183 result( error_status )
186 INTEGER ,
INTENT(IN) :: sensorindex
187 INTEGER ,
INTENT(IN) :: channelindex
191 INTEGER :: error_status
193 CHARACTER(*),
PARAMETER :: routine_name =
'CRTM_Compute_CloudScatter' 195 CHARACTER(ML) :: message
196 INTEGER :: k, kc, l, m, n
197 REAL(fp) :: frequency_mw, frequency_ir
198 LOGICAL :: layer_mask(atm%n_layers)
199 INTEGER :: layer_index(atm%n_layers)
200 INTEGER :: ncloud_layers
208 IF (atm%n_Clouds == 0)
RETURN 211 frequency_mw =
sc(sensorindex)%Frequency(channelindex)
212 frequency_ir =
sc(sensorindex)%Wavenumber(channelindex)
216 SELECT CASE(cscat%n_Legendre_Terms)
226 cscat%n_Legendre_Terms = 0
229 WRITE(message,
'("The n_Legendre_Terms in CloudScatter, ",i0,", do not fit model")') &
230 cscat%n_Legendre_Terms
240 cloud_loop:
DO n = 1, atm%n_Clouds
245 ncloud_layers = count(layer_mask)
246 IF ( ncloud_layers == 0 ) cycle cloud_loop
251 layer_index(1:ncloud_layers) = pack((/(k, k=1,atm%Cloud(n)%n_Layers)/), layer_mask)
252 cloud_layer_loop:
DO k = 1, ncloud_layers
257 IF ( spccoeff_ismicrowavesensor(
sc(sensorindex)) )
THEN 260 atm%Cloud(n)%Type , &
261 atm%Cloud(n)%Effective_Radius(kc), &
262 atm%Temperature(kc) , &
265 csv%pcoeff(:,:,kc,n) , &
267 ELSE IF ( spccoeff_isinfraredsensor(
sc(sensorindex)) .OR. &
268 spccoeff_isvisiblesensor(
sc(sensorindex)) )
THEN 272 atm%Cloud(n)%Type , &
273 atm%Cloud(n)%Effective_Radius(kc), &
276 csv%pcoeff(:,:,kc,n) , &
281 csv%pcoeff(:,:,kc,n) =
zero 285 IF( csv%ke(kc,n) <=
zero )
THEN 289 IF( csv%w(kc,n) <=
zero )
THEN 291 csv%pcoeff(:,:,kc,n) =
zero 294 IF( csv%w(kc,n) >=
one )
THEN 313 cscat%Optical_Depth(kc) = cscat%Optical_Depth(kc) + &
314 (csv%ke(kc,n)*atm%Cloud(n)%Water_Content(kc))
320 IF( cscat%n_Phase_Elements > 0 .and. cscat%Include_Scattering )
THEN 330 bs = atm%Cloud(n)%Water_Content(kc) * csv%ke(kc,n) * csv%w(kc,n)
331 csv%Total_bs(kc) = csv%Total_bs(kc) + bs
332 cscat%Single_Scatter_Albedo(kc) = cscat%Single_Scatter_Albedo(kc) + bs
334 DO m = 1, cscat%n_Phase_Elements
335 DO l = 1, cscat%n_Legendre_Terms
336 cscat%Phase_Coefficient(l,m,kc) = cscat%Phase_Coefficient(l,m,kc) + &
337 (csv%pcoeff(l,m,kc,n) * bs)
342 END DO cloud_layer_loop
440 CScat , & ! FWD Input
441 Atm_TL , & ! TL Input
442 SensorIndex , & ! Input
443 ChannelIndex, & ! Input
444 CScat_TL , & ! TL Output
446 result( error_status )
451 INTEGER ,
INTENT(IN) :: sensorindex
452 INTEGER ,
INTENT(IN) :: channelindex
456 INTEGER :: error_status
458 CHARACTER(*),
PARAMETER :: routine_name =
'CRTM_Compute_CloudScatter' 460 INTEGER :: k, kc, l, m, n
461 INTEGER :: n_legendre_terms, n_phase_elements
462 REAL(fp) :: frequency_mw, frequency_ir
463 LOGICAL :: layer_mask(atm%n_layers)
464 INTEGER :: layer_index(atm%n_layers)
465 INTEGER :: ncloud_layers
466 REAL(fp) :: ke_tl, w_tl
467 REAL(fp) :: pcoeff_tl(0:cscat%n_legendre_terms, cscat%n_phase_elements)
468 REAL(fp) :: bs, bs_tl
474 IF (atm%n_Clouds == 0)
RETURN 476 frequency_mw =
sc(sensorindex)%Frequency(channelindex)
477 frequency_ir =
sc(sensorindex)%Wavenumber(channelindex)
479 n_legendre_terms = cscat_tl%n_Legendre_Terms
480 n_phase_elements = cscat_tl%n_Phase_Elements
481 cscat_tl%lOffset = cscat%lOffset
487 cloud_loop:
DO n = 1, atm%n_Clouds
492 ncloud_layers = count(layer_mask)
493 IF ( ncloud_layers == 0 ) cycle cloud_loop
498 layer_index(1:ncloud_layers) = pack((/(k, k=1,atm%Cloud(n)%n_Layers)/), layer_mask)
499 cloud_layer_loop:
DO k = 1, ncloud_layers
503 IF ( spccoeff_ismicrowavesensor(
sc(sensorindex)) )
THEN 505 atm%Cloud(n)%Type , &
508 atm_tl%Cloud(n)%Effective_Radius(kc), &
509 atm_tl%Temperature(kc) , &
514 ELSE IF ( spccoeff_isinfraredsensor(
sc(sensorindex)) .OR. &
515 spccoeff_isvisiblesensor(
sc(sensorindex)) )
THEN 517 atm%Cloud(n)%Type , &
520 atm_tl%Cloud(n)%Effective_Radius(kc), &
532 IF( csv%ke(kc,n) <=
zero )
THEN 536 IF( csv%w(kc,n) <=
zero )
THEN 540 IF( csv%w(kc,n) >=
one )
THEN 545 cscat_tl%Optical_Depth(kc) = cscat_tl%Optical_Depth(kc) + &
546 (ke_tl * atm%Cloud(n)%Water_Content(kc)) + &
547 (csv%ke(kc,n) * atm_tl%Cloud(n)%Water_Content(kc))
549 IF( n_phase_elements > 0 .and. cscat%Include_Scattering )
THEN 551 bs = atm%Cloud(n)%Water_Content(kc) * csv%ke(kc,n) * csv%w(kc,n)
552 bs_tl = (atm_tl%Cloud(n)%Water_Content(kc) * csv%ke(kc,n) * csv%w(kc,n) ) + &
553 (atm%Cloud(n)%Water_Content(kc) * ke_tl * csv%w(kc,n) ) + &
554 (atm%Cloud(n)%Water_Content(kc) * csv%ke(kc,n) * w_tl )
556 cscat_tl%Single_Scatter_Albedo(kc) = cscat_tl%Single_Scatter_Albedo(kc) + bs_tl
557 DO m = 1, n_phase_elements
558 DO l = 0, n_legendre_terms
559 cscat_tl%Phase_Coefficient(l,m,kc) = cscat_tl%Phase_Coefficient(l,m,kc) + &
560 (pcoeff_tl(l,m) * bs ) + &
561 (csv%pcoeff(l,m,kc,n) * bs_tl)
565 END DO cloud_layer_loop
667 CScat , & ! FWD Input
668 CScat_AD , & ! AD Input
669 SensorIndex , & ! Input
670 ChannelIndex, & ! Input
671 Atm_AD , & ! AD Output
673 result( error_status )
678 INTEGER ,
INTENT(IN) :: sensorindex
679 INTEGER ,
INTENT(IN) :: channelindex
683 INTEGER :: error_status
685 CHARACTER(*),
PARAMETER :: routine_name =
'CRTM_Compute_CloudScatter_AD' 687 INTEGER :: k, kc, l, m, n
688 INTEGER :: n_legendre_terms, n_phase_elements
689 REAL(fp) :: frequency_mw, frequency_ir
690 LOGICAL :: layer_mask(atm%n_layers)
691 INTEGER :: layer_index(atm%n_layers)
692 INTEGER :: ncloud_layers
693 REAL(fp) :: ke_ad, w_ad
694 REAL(fp) :: pcoeff_ad(0:cscat%n_legendre_terms, cscat%n_phase_elements)
695 REAL(fp) :: bs, bs_ad
701 IF ( atm%n_Clouds == 0 )
RETURN 703 frequency_mw =
sc(sensorindex)%Frequency(channelindex)
704 frequency_ir =
sc(sensorindex)%Wavenumber(channelindex)
706 n_legendre_terms = cscat_ad%n_Legendre_Terms
707 n_phase_elements = cscat_ad%n_Phase_Elements
708 cscat_ad%lOffset = cscat%lOffset
713 cloud_loop:
DO n = 1, atm%n_Clouds
718 ncloud_layers = count(layer_mask)
719 IF ( ncloud_layers == 0 ) cycle cloud_loop
725 layer_index(1:ncloud_layers) = pack((/(k, k=1,atm%Cloud(n)%n_Layers)/), layer_mask)
726 cloud_layer_loop:
DO k = ncloud_layers, 1, -1
738 IF( n_phase_elements > 0 .and. cscat%Include_Scattering )
THEN 741 bs = atm%Cloud(n)%Water_Content(kc) * csv%ke(kc,n) * csv%w(kc,n)
743 DO m = 1, n_phase_elements
744 DO l = 0, n_legendre_terms
745 bs_ad = bs_ad + (csv%pcoeff(l,m,kc,n) * cscat_ad%Phase_Coefficient(l,m,kc))
746 pcoeff_ad(l,m) = pcoeff_ad(l,m) + (bs * cscat_ad%Phase_Coefficient(l,m,kc))
752 bs_ad = bs_ad + cscat_ad%Single_Scatter_Albedo(kc)
753 w_ad = w_ad + (atm%Cloud(n)%Water_Content(kc) * csv%ke(kc,n)* bs_ad )
758 atm_ad%Cloud(n)%Water_Content(kc) = atm_ad%Cloud(n)%Water_Content(kc) + &
759 (csv%ke(kc,n) * cscat_ad%Optical_Depth(kc))
760 ke_ad = ke_ad + (atm%Cloud(n)%Water_Content(kc) * cscat_ad%Optical_Depth(kc))
765 ke_ad = ke_ad + (atm%Cloud(n)%Water_Content(kc) * bs_ad * csv%w(kc,n) )
766 atm_ad%Cloud(n)%Water_Content(kc) = atm_ad%Cloud(n)%Water_Content(kc) + &
767 ( bs_ad * csv%ke(kc,n) * csv%w(kc,n) )
770 IF( csv%w(kc,n) >=
one )
THEN 773 IF( csv%ke(kc,n) <=
zero )
THEN 777 IF( csv%w(kc,n) <=
zero )
THEN 783 IF ( spccoeff_ismicrowavesensor(
sc(sensorindex)) )
THEN 785 atm%Cloud(n)%Type , &
791 atm_ad%Cloud(n)%Effective_Radius(kc), &
792 atm_ad%Temperature(kc) , &
794 ELSE IF ( spccoeff_isinfraredsensor(
sc(sensorindex)) .OR. &
795 spccoeff_isvisiblesensor(
sc(sensorindex)) )
THEN 797 atm%Cloud(n)%Type , &
803 atm_ad%Cloud(n)%Effective_Radius(kc), &
810 END DO cloud_layer_loop
834 Frequency , & ! Input Frequency (cm^-1)
842 TYPE(CRTM_AtmOptics_type),
INTENT(IN) :: CloudScatter
843 REAL(fp) ,
INTENT(IN) :: Frequency
844 INTEGER ,
INTENT(IN) :: Cloud_Type
845 REAL(fp) ,
INTENT(IN) :: Reff
846 REAL(fp) ,
INTENT(OUT) :: ke
847 REAL(fp) ,
INTENT(OUT) :: w
848 REAL(fp) ,
INTENT(IN OUT) :: pcoeff(0:,:)
849 TYPE(CSinterp_type) ,
INTENT(IN OUT) :: csi
858 CALL find_index(
cloudc%Frequency_IR, csi%f_int, csi%i1,csi%i2, csi%f_outbound)
859 csi%f =
cloudc%Frequency_IR(csi%i1:csi%i2)
863 csi%r =
cloudc%Reff_IR(csi%j1:csi%j2)
868 CALL lpoly( csi%f, csi%f_int, &
871 CALL lpoly( csi%r, csi%r_int, &
877 SELECT CASE (cloud_type)
878 CASE(water_cloud) ; k=0
879 CASE(ice_cloud) ; k=3
880 CASE(rain_cloud) ; k=0
881 CASE(snow_cloud) ; k=1
882 CASE(graupel_cloud); k=2
883 CASE(hail_cloud) ; k=3
888 CALL interp_2d(
cloudc%ke_IR(csi%i1:csi%i2,csi%j1:csi%j2,k), csi%wlp, csi%xlp, ke )
889 CALL interp_2d(
cloudc%w_IR(csi%i1:csi%i2,csi%j1:csi%j2,k) , csi%wlp, csi%xlp, w )
890 IF (cloudscatter%n_Phase_Elements > 0 .and. cloudscatter%Include_Scattering )
THEN 892 DO l = 1, cloudscatter%n_Legendre_Terms
893 CALL interp_2d(
cloudc%pcoeff_IR(csi%i1:csi%i2,csi%j1:csi%j2,k,l+cloudscatter%lOffset), &
894 csi%wlp, csi%xlp, pcoeff(l,1) )
912 cloud_type , & ! Input see CRTM_Cloud_Define.f90
915 Reff_TL , & ! TL Input effective radius (mm)
921 TYPE(CRTM_AtmOptics_type),
INTENT(IN) :: CloudScatter_TL
922 INTEGER ,
INTENT(IN) :: Cloud_Type
923 REAL(fp),
INTENT(IN) :: ke, w, Reff_TL
924 REAL(fp),
INTENT(OUT) :: ke_TL
925 REAL(fp),
INTENT(OUT) :: w_TL
926 REAL(fp),
INTENT(IN OUT) :: pcoeff_TL(0:,:)
927 TYPE(CSinterp_type),
INTENT(IN) :: csi
930 REAL(fp) :: f_int_TL, r_int_TL
931 REAL(fp) :: f_TL(NPTS), r_TL(NPTS)
932 REAL(fp) :: z_TL(NPTS,NPTS)
933 TYPE(LPoly_type) :: wlp_TL, xlp_TL
934 REAL(fp),
POINTER :: z(:,:) => null()
941 IF ( csi%f_outbound .AND. csi%r_outbound )
THEN 972 SELECT CASE (cloud_type)
973 CASE(water_cloud) ; k=0
974 CASE(ice_cloud) ; k=3
975 CASE(rain_cloud) ; k=0
976 CASE(snow_cloud) ; k=1
977 CASE(graupel_cloud); k=2
978 CASE(hail_cloud) ; k=3
985 z =>
cloudc%ke_IR(csi%i1:csi%i2,csi%j1:csi%j2,k)
987 z_tl, wlp_tl , xlp_tl , &
990 z =>
cloudc%w_IR(csi%i1:csi%i2,csi%j1:csi%j2,k)
992 z_tl, wlp_tl , xlp_tl , &
995 IF ( cloudscatter_tl%n_Phase_Elements > 0 .and. cloudscatter_tl%Include_Scattering )
THEN 996 pcoeff_tl(0,1) =
zero 997 DO l = 1, cloudscatter_tl%n_Legendre_Terms
998 z =>
cloudc%pcoeff_IR(csi%i1:csi%i2,csi%j1:csi%j2,k,l+cloudscatter_tl%lOffset)
1000 z_tl, wlp_tl , xlp_tl , &
1006 ke_tl = ke_tl * (
one - w) - ke/(
one -w) * w_tl
1022 cloud_type , & ! Input see CRTM_Cloud_Define.f90
1025 ke_AD , & ! AD Input extinction coefficient (=~ optical depth for 1 mm water content)
1031 TYPE(CRTM_AtmOptics_type),
INTENT(IN) :: CloudScatter_AD
1032 INTEGER ,
INTENT(IN) :: Cloud_Type
1033 REAL(fp),
INTENT(IN) :: ke, w
1034 REAL(fp),
INTENT(IN OUT) :: ke_AD
1035 REAL(fp),
INTENT(IN OUT) :: w_AD
1036 REAL(fp),
INTENT(IN OUT) :: pcoeff_AD(0:,:)
1037 REAL(fp),
INTENT(IN OUT) :: Reff_AD
1038 TYPE(CSinterp_type),
INTENT(IN) :: csi
1041 REAL(fp) :: f_int_AD, r_int_AD
1042 REAL(fp) :: f_AD(NPTS), r_AD(NPTS)
1043 REAL(fp) :: z_AD(NPTS,NPTS)
1044 TYPE(LPoly_type) :: wlp_AD, xlp_AD
1045 REAL(fp),
POINTER :: z(:,:) => null()
1052 IF ( csi%f_outbound .AND. csi%r_outbound )
THEN 1072 SELECT CASE (cloud_type)
1073 CASE(water_cloud) ; k=0
1074 CASE(ice_cloud) ; k=3
1075 CASE(rain_cloud) ; k=0
1076 CASE(snow_cloud) ; k=1
1077 CASE(graupel_cloud); k=2
1078 CASE(hail_cloud) ; k=3
1084 IF (cloudscatter_ad%n_Phase_Elements > 0 .and. cloudscatter_ad%Include_Scattering )
THEN 1085 DO l = 1, cloudscatter_ad%n_Legendre_Terms
1086 z =>
cloudc%pcoeff_IR(csi%i1:csi%i2,csi%j1:csi%j2,k,l+cloudscatter_ad%lOffset)
1089 z_ad, wlp_ad, xlp_ad )
1091 pcoeff_ad(0,1) =
zero 1095 w_ad = w_ad - ke/(
one -w) * ke_ad
1096 ke_ad = ke_ad * (
one - w)
1102 z =>
cloudc%w_IR(csi%i1:csi%i2,csi%j1:csi%j2,k)
1105 z_ad, wlp_ad, xlp_ad )
1107 z =>
cloudc%ke_IR(csi%i1:csi%i2,csi%j1:csi%j2,k)
1110 z_ad, wlp_ad, xlp_ad )
1129 reff_ad = reff_ad + r_int_ad
1142 SUBROUTINE get_cloud_opt_mw( CloudScatter, & ! Input CloudScatter structure
1143 Frequency , & ! Input Frequency (GHz)
1152 TYPE(CRTM_AtmOptics_type),
INTENT(IN) :: CloudScatter
1153 REAL(fp) ,
INTENT(IN) :: Frequency
1154 INTEGER ,
INTENT(IN) :: Cloud_Type
1155 REAL(fp) ,
INTENT(IN) :: Reff
1156 REAL(fp) ,
INTENT(IN) :: Temperature
1157 REAL(fp) ,
INTENT(OUT) :: ke
1158 REAL(fp) ,
INTENT(OUT) :: w
1159 REAL(fp) ,
INTENT(IN OUT) :: pcoeff(0:,:)
1160 TYPE(CSinterp_type) ,
INTENT(IN OUT) :: csi
1162 INTEGER :: j, k, l, m
1175 CALL find_index(
cloudc%Frequency_MW, csi%f_int, csi%i1,csi%i2, csi%f_outbound)
1176 csi%f =
cloudc%Frequency_MW(csi%i1:csi%i2)
1180 csi%r =
cloudc%Reff_MW(csi%j1:csi%j2)
1183 CALL find_index(
cloudc%Temperature, csi%t_int, csi%k1,csi%k2, csi%t_outbound)
1184 csi%t =
cloudc%Temperature(csi%k1:csi%k2)
1189 CALL lpoly( csi%f, csi%f_int, &
1192 CALL lpoly( csi%r, csi%r_int, &
1195 CALL lpoly( csi%t, csi%t_int, &
1200 SELECT CASE (cloud_type)
1207 CALL interp_2d(
cloudc%ke_L_MW(csi%i1:csi%i2,j,csi%k1:csi%k2), csi%wlp, csi%ylp, ke )
1211 CALL interp_3d(
cloudc%ke_L_MW(csi%i1:csi%i2,csi%j1:csi%j2,csi%k1:csi%k2), csi%wlp, csi%xlp, csi%ylp, ke )
1212 CALL interp_3d(
cloudc%w_L_MW(csi%i1:csi%i2,csi%j1:csi%j2,csi%k1:csi%k2) , csi%wlp, csi%xlp, csi%ylp, w )
1213 IF ( cloudscatter%n_Phase_Elements > 0 .and. cloudscatter%Include_Scattering )
THEN 1215 DO m = 1, cloudscatter%n_Phase_Elements
1216 DO l = 1, cloudscatter%n_Legendre_Terms
1217 CALL interp_3d(
cloudc%pcoeff_L_MW(csi%i1:csi%i2,csi%j1:csi%j2,csi%k1:csi%k2,l+cloudscatter%lOffset,m), &
1218 csi%wlp, csi%xlp, csi%ylp, pcoeff(l,m) )
1237 SELECT CASE (cloud_type)
1238 CASE (graupel_cloud); k = 2
1239 CASE (hail_cloud) ; k = 3
1240 CASE DEFAULT ; k = 1
1243 CALL interp_2d(
cloudc%ke_S_MW(csi%i1:csi%i2,csi%j1:csi%j2,k), csi%wlp, csi%xlp, ke )
1244 CALL interp_2d(
cloudc%w_S_MW(csi%i1:csi%i2,csi%j1:csi%j2,k) , csi%wlp, csi%xlp, w )
1245 IF (cloudscatter%n_Phase_Elements > 0 .and. cloudscatter%Include_Scattering )
THEN 1247 DO m = 1, cloudscatter%n_Phase_Elements
1248 DO l = 1, cloudscatter%n_Legendre_Terms
1249 CALL interp_2d(
cloudc%pcoeff_S_MW(csi%i1:csi%i2,csi%j1:csi%j2,k,l+cloudscatter%lOffset,m), &
1250 csi%wlp, csi%xlp, pcoeff(l,m) )
1272 cloud_type , & ! Input see CRTM_Cloud_Define.f90
1275 Reff_TL , & ! TL Input effective radius (mm)
1282 TYPE(CRTM_AtmOptics_type),
INTENT(IN) :: CloudScatter_TL
1283 INTEGER ,
INTENT(IN) :: Cloud_Type
1284 REAL(fp),
INTENT(IN) :: ke, w, Reff_TL
1285 REAL(fp),
INTENT(IN) :: Temperature_TL
1286 REAL(fp),
INTENT(OUT) :: ke_TL
1287 REAL(fp),
INTENT(OUT) :: w_TL
1288 REAL(fp),
INTENT(IN OUT) :: pcoeff_TL(0:,:)
1289 TYPE(CSinterp_type),
INTENT(IN) :: csi
1291 INTEGER :: j, k, l, m
1292 REAL(fp) :: f_int_TL, r_int_TL, t_int_TL
1293 REAL(fp) :: f_TL(NPTS), r_TL(NPTS), t_TL(NPTS)
1294 REAL(fp) :: z2_TL(NPTS,NPTS)
1295 REAL(fp) :: z3_TL(NPTS,NPTS,NPTS)
1296 TYPE(LPoly_type) :: wlp_TL, xlp_TL, ylp_TL
1297 REAL(fp),
POINTER :: z2(:,:) => null()
1298 REAL(fp),
POINTER :: z3(:,:,:) => null()
1312 t_int_tl = temperature_tl
1339 SELECT CASE (cloud_type)
1347 IF ( csi%f_outbound .AND. csi%t_outbound )
THEN 1352 z2 =>
cloudc%ke_L_MW(csi%i1:csi%i2,j,csi%k1:csi%k2)
1354 z2_tl, wlp_tl , ylp_tl , &
1361 IF ( csi%f_outbound .AND. csi%r_outbound .AND. csi%t_outbound )
THEN 1366 z3 =>
cloudc%ke_L_MW(csi%i1:csi%i2,csi%j1:csi%j2,csi%k1:csi%k2)
1368 z3_tl, wlp_tl , xlp_tl , ylp_tl , &
1371 z3 =>
cloudc%w_L_MW(csi%i1:csi%i2,csi%j1:csi%j2,csi%k1:csi%k2)
1373 z3_tl, wlp_tl , xlp_tl , ylp_tl , &
1376 IF ( cloudscatter_tl%n_Phase_Elements > 0 .and. cloudscatter_tl%Include_Scattering )
THEN 1377 pcoeff_tl(0,1) =
zero 1378 DO m = 1, cloudscatter_tl%n_Phase_Elements
1379 DO l = 1, cloudscatter_tl%n_Legendre_Terms
1380 z3 =>
cloudc%pcoeff_L_MW(csi%i1:csi%i2,csi%j1:csi%j2,csi%k1:csi%k2,l+cloudscatter_tl%lOffset,m)
1382 z3_tl, wlp_tl , xlp_tl , ylp_tl , &
1389 ke_tl = ke_tl * (
one - w) - ke/(
one -w) * w_tl
1405 IF ( csi%f_outbound .AND. csi%r_outbound )
THEN 1410 SELECT CASE (cloud_type)
1411 CASE (graupel_cloud); k = 2
1412 CASE (hail_cloud) ; k = 3
1413 CASE DEFAULT ; k = 1
1416 z2 =>
cloudc%ke_S_MW(csi%i1:csi%i2,csi%j1:csi%j2,k)
1418 z2_tl, wlp_tl , xlp_tl , &
1421 z2 =>
cloudc%w_S_MW(csi%i1:csi%i2,csi%j1:csi%j2,k)
1423 z2_tl, wlp_tl , xlp_tl , &
1426 IF ( cloudscatter_tl%n_Phase_Elements > 0 .and. cloudscatter_tl%Include_Scattering )
THEN 1427 pcoeff_tl(0,1) =
zero 1428 DO m = 1, cloudscatter_tl%n_Phase_Elements
1429 DO l = 1, cloudscatter_tl%n_Legendre_Terms
1430 z2 =>
cloudc%pcoeff_S_MW(csi%i1:csi%i2,csi%j1:csi%j2,k,l+cloudscatter_tl%lOffset,m)
1432 z2_tl, wlp_tl , xlp_tl , &
1440 ke_tl = ke_tl * (
one - w) - ke/(
one -w) * w_tl
1458 cloud_type , & ! Input see CRTM_Cloud_Define.f90
1461 ke_AD , & ! AD Input extinction coefficient (=~ optical depth for 1 mm water content)
1468 TYPE(CRTM_AtmOptics_type),
INTENT(IN) :: CloudScatter_AD
1469 INTEGER ,
INTENT(IN) :: Cloud_Type
1470 REAL(fp),
INTENT(IN) :: ke, w
1471 REAL(fp),
INTENT(IN OUT) :: ke_AD
1472 REAL(fp),
INTENT(IN OUT) :: w_AD
1473 REAL(fp),
INTENT(IN OUT) :: pcoeff_AD(0:,:)
1474 REAL(fp),
INTENT(IN OUT) :: Reff_AD
1475 REAL(fp),
INTENT(IN OUT) :: Temperature_AD
1476 TYPE(CSinterp_type),
INTENT(IN) :: csi
1478 INTEGER :: j, k, l, m
1479 REAL(fp) :: f_int_AD, r_int_AD, t_int_AD
1480 REAL(fp) :: f_AD(NPTS), r_AD(NPTS), t_AD(NPTS)
1481 REAL(fp) :: z2_AD(NPTS,NPTS)
1482 REAL(fp) :: z3_AD(NPTS,NPTS,NPTS)
1483 TYPE(LPoly_type) :: wlp_AD, xlp_AD, ylp_AD
1484 REAL(fp),
POINTER :: z2(:,:) => null()
1485 REAL(fp),
POINTER :: z3(:,:,:) => null()
1505 SELECT CASE (cloud_type)
1515 IF ( csi%f_outbound .AND. csi%t_outbound )
THEN 1523 z2 =>
cloudc%ke_L_MW(csi%i1:csi%i2,j,csi%k1:csi%k2)
1526 z2_ad, wlp_ad, ylp_ad )
1539 temperature_ad = temperature_ad + t_int_ad
1547 IF ( csi%f_outbound .AND. csi%r_outbound .AND. csi%t_outbound )
THEN 1555 IF (cloudscatter_ad%n_Phase_Elements > 0 .and. cloudscatter_ad%Include_Scattering )
THEN 1556 DO m = 1, cloudscatter_ad%n_Phase_Elements
1557 DO l = 1, cloudscatter_ad%n_Legendre_Terms
1558 z3 =>
cloudc%pcoeff_L_MW(csi%i1:csi%i2,csi%j1:csi%j2,csi%k1:csi%k2,l+cloudscatter_ad%lOffset,m)
1561 z3_ad, wlp_ad , xlp_ad , ylp_ad )
1564 pcoeff_ad(0,1) =
zero 1569 w_ad = w_ad - ke/(
one -w) * ke_ad
1570 ke_ad = ke_ad * (
one - w)
1576 z3 =>
cloudc%w_L_MW(csi%i1:csi%i2,csi%j1:csi%j2,csi%k1:csi%k2)
1579 z3_ad, wlp_ad , xlp_ad , ylp_ad )
1581 z3 =>
cloudc%ke_L_MW(csi%i1:csi%i2,csi%j1:csi%j2,csi%k1:csi%k2)
1584 z3_ad, wlp_ad , xlp_ad , ylp_ad )
1602 temperature_ad = temperature_ad + t_int_ad
1603 reff_ad = reff_ad + r_int_ad
1621 IF ( csi%f_outbound .AND. csi%r_outbound )
THEN 1628 SELECT CASE (cloud_type)
1629 CASE (graupel_cloud); k = 2
1630 CASE (hail_cloud) ; k = 3
1631 CASE DEFAULT ; k = 1
1635 IF (cloudscatter_ad%n_Phase_Elements > 0 .and. cloudscatter_ad%Include_Scattering )
THEN 1636 DO m = 1, cloudscatter_ad%n_Phase_Elements
1637 DO l = 1, cloudscatter_ad%n_Legendre_Terms
1638 z2 =>
cloudc%pcoeff_S_MW(csi%i1:csi%i2,csi%j1:csi%j2,k,l+cloudscatter_ad%lOffset,m)
1641 z2_ad, wlp_ad , xlp_ad )
1644 pcoeff_ad(0,1) =
zero 1648 w_ad = w_ad - ke/(
one -w) * ke_ad
1649 ke_ad = ke_ad * (
one - w)
1656 z2 =>
cloudc%w_S_MW(csi%i1:csi%i2,csi%j1:csi%j2,k)
1659 z2_ad, wlp_ad , xlp_ad )
1661 z2 =>
cloudc%ke_S_MW(csi%i1:csi%i2,csi%j1:csi%j2,k)
1664 z2_ad, wlp_ad , xlp_ad )
1677 reff_ad = reff_ad + r_int_ad
type(cloudcoeff_type), target, save, public cloudc
subroutine, public interp_3d_ad(z, ulp, vlp, wlp, z_int_AD, z_AD, ulp_AD, vlp_AD, wlp_AD)
subroutine, public interp_3d_tl(z, ulp, vlp, wlp, z_TL, ulp_TL, vlp_TL, wlp_TL, z_int_TL)
integer, parameter, public failure
real(fp), parameter, public onepointfive
real(fp), parameter, public zero
integer, parameter, public max_n_phase_elements
integer, parameter, public max_n_clouds
integer, parameter six_streams
integer, parameter sixteen_streams
integer, parameter, public fp
subroutine get_cloud_opt_ir_ad(CloudScatter_AD, cloud_type, ke, w, ke_AD, w_AD, pcoeff_AD, Reff_AD, csi)
integer, parameter thirtytwo_streams
subroutine get_cloud_opt_ir_tl(CloudScatter_TL, cloud_type, ke, w, Reff_TL, ke_TL, w_TL, pcoeff_TL, csi)
elemental subroutine, public csvar_create(self, n_Legendre_Terms, n_Phase_Elements, n_Layers, n_Clouds)
integer, parameter, public max_n_legendre_terms
logical, parameter, public hgphase
subroutine, public clear_lpoly(p)
subroutine, public lpoly_ad(x, x_int, p, p_AD, x_AD, x_int_AD)
real(fp), parameter, public bs_threshold
integer, parameter eight_streams
character(*), parameter module_version_id
integer function, public crtm_compute_cloudscatter(Atm, SensorIndex, ChannelIndex, CScat, CSV)
real(fp), parameter, public water_content_threshold
real(fp), parameter, public one
recursive subroutine, public display_message(Routine_Name, Message, Error_State, Message_Log)
elemental logical function, public csvar_associated(self)
integer, parameter two_streams
elemental subroutine, public csvar_destroy(self)
integer function, public crtm_compute_cloudscatter_ad(Atm, CScat, CScat_AD, SensorIndex, ChannelIndex, Atm_AD, CSV)
subroutine get_cloud_opt_ir(CloudScatter, Frequency, cloud_type, Reff, ke, w, pcoeff, csi)
integer, parameter four_streams
subroutine, public interp_2d_ad(z, ulp, vlp, z_int_AD, z_AD, ulp_AD, vlp_AD)
subroutine, public lpoly(x, x_int, p)
integer, parameter, public npts
type(spccoeff_type), dimension(:), allocatable, save, public sc
integer, parameter, public max_n_layers
subroutine get_cloud_opt_mw_tl(CloudScatter_TL, cloud_type, ke, w, Reff_TL, Temperature_TL, ke_TL, w_TL, pcoeff_TL, csi)
real(fp), parameter, public point_5
subroutine, public interp_3d(z, ulp, vlp, wlp, z_int)
subroutine get_cloud_opt_mw(CloudScatter, Frequency, cloud_type, Reff, Temperature, ke, w, pcoeff, csi)
subroutine get_cloud_opt_mw_ad(CloudScatter_AD, cloud_type, ke, w, ke_AD, w_AD, pcoeff_AD, Reff_AD, Temperature_AD, csi)
integer function, public crtm_compute_cloudscatter_tl(Atm, CScat, Atm_TL, SensorIndex, ChannelIndex, CScat_TL, CSV)
subroutine, public lpoly_tl(x, x_int, p, x_TL, x_int_TL, p_TL)
subroutine, public interp_1d(z, ulp, z_int)
integer, parameter, public success
subroutine, public interp_2d_tl(z, ulp, vlp, z_TL, ulp_TL, vlp_TL, z_int_TL)
subroutine, public interp_2d(z, ulp, vlp, z_int)