Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 105 additions & 1 deletion common/coefficients_spectral_response_correction.inc
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
! b=2: slope/offset
! c=2: day/night_tw
! d=22: satellite
real, DIMENSION(6,2,2,22) :: n19mimic = reshape( &
real, DIMENSION(6,2,2,22) :: n19mimic_old = reshape( &
(/ &
1.01947, 1.01667, 1.00000, 0.98555, 0.99971, 1.00000 , & ! noaa_5_avhrr (day)
-0.39193,-0.16725, 0.00000, 3.63161, 0.10648, 0.00000 , & ! noaa_5_avhrr (day)
Expand Down Expand Up @@ -290,4 +290,108 @@
1.00000, 1.00000, 1.00000, 1.00007, 0.99918, 1.00368 , & ! envisat_1_aatsr (twilight & night)
0.00000, 0.00000, 0.00000,-0.18492, 0.23179,-0.82334 & ! envisat_1_aatsr (twilight & night)
/), &
shape(n19mimic_old), order=(/1, 2, 3, 4/))


! dimensions:
! a=6: n channels
! b=2: slope/offset
! c=2: day/night_tw
! d=22: satellite
real, DIMENSION(6,2,2,22) :: n19mimic = reshape( &
(/ &
1.00863, 1.01129, 1.00000, 0.98519, 0.99932, 1.00000 ,& ! noaa_5_avhrr (day)------------- begin new 25.09.2017
-0.17359,-0.10159, 0.00000, 3.68068, 0.23559, 0.00000 ,& ! noaa_5_avhrr (day)
1.00000, 1.00000, 1.00000, 0.99084, 0.99880, 1.00000 ,& ! noaa_5_avhrr (twilight & night)
0.00000, 0.00000, 0.00000, 1.39766, 0.34478, 0.00000 ,& ! noaa_5_avhrr (twilight & night)
1.01157, 1.00329, 1.00000, 0.97629, 0.99904, 1.00000 ,& ! noaa_6_avhrr (day)
-0.02680,-0.05198, 0.00000, 6.07805, 0.29959, 0.00000 ,& ! noaa_6_avhrr (day)
1.00000, 1.00000, 1.00000, 0.98521, 0.99859, 1.00000 ,& ! noaa_6_avhrr (twilight & night)
0.00000, 0.00000, 0.00000, 2.45206, 0.39441, 0.00000 ,& ! noaa_6_avhrr (twilight & night)
1.00933, 1.00704, 1.00000, 1.00988, 1.00015, 0.99094 ,& ! noaa_7_avhrr (day)
-0.03615,-0.00695, 0.00000,-2.53120,-0.19754, 1.99137 ,& ! noaa_7_avhrr (day)
1.00000, 1.00000, 1.00000, 1.00801, 1.00012, 0.99188 ,& ! noaa_7_avhrr (twilight & night)
0.00000, 0.00000, 0.00000,-1.90227,-0.19402, 1.78631 ,& ! noaa_7_avhrr (twilight & night)
1.00980, 1.00304, 1.00000, 0.98545, 0.99934, 1.00000 ,& ! noaa_8_avhrr (day)
-0.00880,-0.04845, 0.00000, 3.27709, 0.20076, 0.00000 ,& ! noaa_8_avhrr (day)
1.00000, 1.00000, 1.00000, 0.98943, 0.99891, 1.00000 ,& ! noaa_8_avhrr (twilight & night)
0.00000, 0.00000, 0.00000, 1.61012, 0.29218, 0.00000 ,& ! noaa_8_avhrr (twilight & night)
1.00915, 1.00590, 1.00000, 1.01401, 1.00008, 0.98757 ,& ! noaa_9_avhrr (day)
-0.01287, 0.01144, 0.00000,-3.53502,-0.21508, 2.77003 ,& ! noaa_9_avhrr (day)
1.00000, 1.00000, 1.00000, 1.01095, 1.00018, 0.98883 ,& ! noaa_9_avhrr (twilight & night)
0.00000, 0.00000, 0.00000,-2.38708,-0.24295, 2.50000 ,& ! noaa_9_avhrr (twilight & night)
1.01043, 1.00521, 1.00000, 1.00059, 0.99856, 1.00000 ,& ! noaa_10_avhrr (day)
-0.04353,-0.01992, 0.00000,-0.46165, 0.46892, 0.00000 ,& ! noaa_10_avhrr (day)
1.00000, 1.00000, 1.00000, 1.00034, 0.99809, 1.00000 ,& ! noaa_10_avhrr (twilight & night)
0.00000, 0.00000, 0.00000,-0.42437, 0.56506, 0.00000 ,& ! noaa_10_avhrr (twilight & night)
1.00897, 1.00503, 1.00000, 1.00836, 0.99999, 0.98903 ,& ! noaa_11_avhrr (day)
-0.00987,-0.01211, 0.00000,-2.28597,-0.16980, 2.44290 ,& ! noaa_11_avhrr (day)
1.00000, 1.00000, 1.00000, 1.00627, 1.00002, 0.99021 ,& ! noaa_11_avhrr (twilight & night)
0.00000, 0.00000, 0.00000,-1.49996,-0.17850, 2.18420 ,& ! noaa_11_avhrr (twilight & night)
1.00792, 1.00523, 1.00000, 0.98642, 1.00060, 0.99359 ,& ! noaa_12_avhrr (day)
0.01240,-0.02886, 0.00000, 3.18954,-0.21188, 1.38279 ,& ! noaa_12_avhrr (day)
1.00000, 1.00000, 1.00000, 0.99121, 1.00018, 0.99432 ,& ! noaa_12_avhrr (twilight & night)
0.00000, 0.00000, 0.00000, 1.19351,-0.11055, 1.21807 ,& ! noaa_12_avhrr (twilight & night)
1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000 ,& ! noaa_13_avhrr (day)
0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000 ,& ! noaa_13_avhrr (day)
1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000 ,& ! noaa_13_avhrr (twilight & night)
0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000 ,& ! noaa_13_avhrr (twilight & night)
1.00783, 1.01084, 1.00000, 0.99179, 1.00103, 0.99493 ,& ! noaa_14_avhrr (day)
0.01594,-0.02593, 0.00000, 2.12215,-0.44593, 1.08124 ,& ! noaa_14_avhrr (day)
1.00000, 1.00000, 1.00000, 0.99618, 1.00098, 0.99553 ,& ! noaa_14_avhrr (twilight & night)
0.00000, 0.00000, 0.00000, 0.29021,-0.42729, 0.94522 ,& ! noaa_14_avhrr (twilight & night)
1.00542, 1.00561, 1.00000, 1.01248, 0.99999, 0.99035 ,& ! noaa_15_avhrr (day)
-0.02722, 0.04747, 0.00000,-3.98429,-0.13650, 2.14467 ,& ! noaa_15_avhrr (day)
1.00000, 1.00000, 1.00000, 1.00601, 0.99987, 0.99142 ,& ! noaa_15_avhrr (twilight & night)
0.00000, 0.00000, 0.00000,-1.30640,-0.10899, 1.90299 ,& ! noaa_15_avhrr (twilight & night)
1.00645, 1.00920, 1.00000, 1.01490, 1.00024, 0.99703 ,& ! noaa_16_avhrr (day)
-0.03902, 0.05657, 0.00000,-4.57169,-0.09508, 0.56112 ,& ! noaa_16_avhrr (day)
1.00000, 1.00000, 1.00000, 1.00770, 0.99974, 0.99730 ,& ! noaa_16_avhrr (twilight & night)
0.00000, 0.00000, 0.00000,-1.57810, 0.02201, 0.51117 ,& ! noaa_16_avhrr (twilight & night)
1.00425, 1.00846, 1.00000, 0.99843, 1.00011, 0.99049 ,& ! noaa_17_avhrr (day)
-0.02071, 0.05342, 0.00000, 0.03672,-0.18490, 2.11172 ,& ! noaa_17_avhrr (day)
1.00000, 1.00000, 1.00000, 0.99866, 1.00006, 0.99153 ,& ! noaa_17_avhrr (twilight & night)
0.00000, 0.00000, 0.00000,-0.07106,-0.17253, 1.87665 ,& ! noaa_17_avhrr (twilight & night)
1.00238, 1.01516, 1.00000, 0.99369, 1.00018, 0.99686 ,& ! noaa_18_avhrr (day)
-0.01270, 0.06648, 0.00000, 1.42173,-0.21360, 0.62588 ,& ! noaa_18_avhrr (day)
1.00000, 1.00000, 1.00000, 0.99626, 1.00016, 0.99723 ,& ! noaa_18_avhrr (twilight & night)
0.00000, 0.00000, 0.00000, 0.36585,-0.20915, 0.54209 ,& ! noaa_18_avhrr (twilight & night)
1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000 ,& ! noaa_19_avhrr (day)
0.00000,-0.00000, 0.00000, 0.00000,-0.00000, 0.00000 ,& ! noaa_19_avhrr (day)
1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000 ,& ! noaa_19_avhrr (twilight & night)
0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000 ,& ! noaa_19_avhrr (twilight & night)
1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000 ,& ! noaa_20_avhrr (day)
0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000 ,& ! noaa_20_avhrr (day)
1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000 ,& ! noaa_20_avhrr (twilight & night)
0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000 ,& ! noaa_20_avhrr (twilight & night)
1.00642, 1.01057, 1.00000, 0.99788, 1.00037, 0.99020 ,& ! metop_1_avhrr (day)
-0.03299, 0.03300, 0.00000, 0.89873,-0.16537, 2.30006 ,& ! metop_1_avhrr (day)
1.00000, 1.00000, 1.00000, 1.00017, 1.00060, 0.99129 ,& ! metop_1_avhrr (twilight & night)
0.00000, 0.00000, 0.00000,-0.04050,-0.21846, 2.05344 ,& ! metop_1_avhrr (twilight & night)
1.00630, 1.00585, 1.00000, 1.01305, 1.00020, 0.99111 ,& ! metop_2_avhrr (day)
-0.03303, 0.03785, 0.00000,-3.20312,-0.19577, 1.98056 ,& ! metop_2_avhrr (day)
1.00000, 1.00000, 1.00000, 1.01122, 1.00009, 0.99213 ,& ! metop_2_avhrr (twilight & night)
0.00000, 0.00000, 0.00000,-2.63335,-0.17000, 1.74438 ,& ! metop_2_avhrr (twilight & night)
0.97782, 0.89682, 1.00000, 0.97528, 0.99838, 0.98472 ,& ! eos_1_modis-terra (day)
0.20248,-0.00408, 0.00000, 5.11309, 0.57084, 3.59604 ,& ! eos_1_modis-terra (day)
1.00000, 1.00000, 1.00000, 0.97911, 0.99749, 0.98719 ,& ! eos_1_modis-terra (twilight & night)
0.00000, 0.00000, 0.00000, 4.23386, 0.78210, 2.96328 ,& ! eos_1_modis-terra (twilight & night)
0.97852, 0.89674, 1.00000, 0.97647, 0.99798, 0.98466 ,& ! eos_2_modis-aqua (day)
0.20091,-0.00488, 0.00000, 4.41328, 0.67351, 3.61425 ,& ! eos_2_modis-aqua (day)
1.00000, 1.00000, 1.00000, 0.97854, 0.99712, 0.98714 ,& ! eos_2_modis-aqua (twilight & night)
0.00000, 0.00000, 0.00000, 4.27745, 0.87638, 2.97834 ,& ! eos_2_modis-aqua (twilight & night)
0.95927, 0.89362, 1.00000, 1.04509, 0.99891, 1.00002 ,& ! ers_2_atsr (day)
0.25914,-0.01229, 0.00000,-9.72701, 0.43453, 0.03421 ,& ! ers_2_atsr (day)
1.00000, 1.00000, 1.00000, 1.03827, 0.99851, 1.00011 ,& ! ers_2_atsr (twilight & night)
0.00000, 0.00000, 0.00000,-7.47003, 0.52056, 0.01765 ,& ! ers_2_atsr (twilight & night)
0.95572, 0.89283, 1.00000, 1.00529, 0.99908, 1.00343 ,& ! envisat_1_aatsr (day)
0.25860,-0.01339, 0.00000,-1.76380, 0.26791,-0.75256 ,& ! envisat_1_aatsr (day)
1.00000, 1.00000, 1.00000, 1.00208, 0.99906, 1.00309 ,& ! envisat_1_aatsr (twilight & night)
0.00000, 0.00000, 0.00000,-0.54811, 0.26531,-0.66652 & ! envisat_1_aatsr (twilight & night)------------- end new 25.09.2017
/), &
shape(n19mimic), order=(/1, 2, 3, 4/))





10 changes: 8 additions & 2 deletions derived_products/broadband_fluxes/driver_for_bugsrad.f90
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
! History:
! 2015/11/15, MC: Initial development. Changed input/output quantities to
! accept satellite data changed name of the driver to driver_for_bugsrad.F90.
! 2018/02/27 MST: Using pyYEAR (now passed from parent routine) to calculate time dependent CO2 concentration
!
! $Id$
!
Expand All @@ -56,7 +57,7 @@ subroutine driver_for_bugsrad(nlm,tsi,theta, &
boapar,boapardif,toapar, &
fulw,fdlw,fusw,fdsw, &
fulwcl,fdlwcl,fuswcl,fdswcl, &
emis,rho0d,rhodd)
emis,rho0d,rhodd,pxYEAR)

use kinds, only: int_kind, dbl_kind
use bugsrad_physconst, only: gravity, cp_dry_air, sol_const
Expand All @@ -74,6 +75,9 @@ subroutine driver_for_bugsrad(nlm,tsi,theta, &
hctopID(nlayers) ,& ! vertical level index for Hctop (-).
hcbaseID(nlayers) ! vertical level index for Hcbase (-).

integer, intent(in) :: &
pxYEAR

! Column quantities
real, intent(in) :: &
tsi ,& ! total solar irradiance (W/m2).
Expand Down Expand Up @@ -210,7 +214,9 @@ subroutine driver_for_bugsrad(nlm,tsi,theta, &
alndf(1)=asfcnirdf

! Read trace gas quantities
umco2(1)=380.
!umco2(1)=380.
!introducting time dependent co2 with 380 representing the year 2006
umco2(1)=380.0+(pxYEAR-2006.)*1.7
umch4(1)=1.80
umn2o(1)=0.26

Expand Down
17 changes: 10 additions & 7 deletions derived_products/broadband_fluxes/process_broadband_fluxes.F90
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
! gravitational acceleration to the appropriate value of 9.80665.
! 2017/07/28, MC: Modified code to accept multi-layer cloud primary output
! files. Note, you must specify 'multi_layer=1' to run in multi-layer mode.
! 2018/01/23, MST: Passing pxYEAR to driver_for_bugsrad to enable time dependent co2 concentration calculation
!
! $Id$
!
Expand Down Expand Up @@ -568,7 +569,7 @@ subroutine process_broadband_fluxes(Fprimary,FPRTM,FALB,FTSI,fname,&
! Read TSI file
!----------------------------------------------------------------------------
call nc_open(ncid,FTSI)

! Allocate arrays
allocate(TSI_tsi_true_earth(nTSI))
allocate(TSI_tsi_1au(nTSI))
Expand Down Expand Up @@ -610,7 +611,7 @@ subroutine process_broadband_fluxes(Fprimary,FPRTM,FALB,FTSI,fname,&
if (lut_mode .eq. 1) then
! Open LUT file
call nc_open(ncid,FToaSW)

! Get LUT dimensions
nASFC = nc_dim_length(ncid, 'n_sfc_albedo', verbose)
nSOLZ = nc_dim_length(ncid, 'n_solar_zenith', verbose)
Expand Down Expand Up @@ -649,7 +650,7 @@ subroutine process_broadband_fluxes(Fprimary,FPRTM,FALB,FTSI,fname,&

! Open primary file
call nc_open(ncid,Fprimary)

! Get satellite dimensions
xN = nc_dim_length(ncid, 'across_track', verbose)
yN = nc_dim_length(ncid, 'along_track', verbose)
Expand Down Expand Up @@ -715,7 +716,7 @@ subroutine process_broadband_fluxes(Fprimary,FPRTM,FALB,FTSI,fname,&

! Open PRTM file
call nc_open(ncid,FPRTM)

! Get PRTM dimensions
xdim_prtm = nc_dim_length(ncid, 'nlon_rtm', verbose)
ydim_prtm = nc_dim_length(ncid, 'nlat_rtm', verbose)
Expand Down Expand Up @@ -771,7 +772,7 @@ subroutine process_broadband_fluxes(Fprimary,FPRTM,FALB,FTSI,fname,&

! Open ALB file
call nc_open(ncid,FALB)

! Get # Channels
nc_alb = nc_dim_length(ncid, 'nc_alb', verbose)
nc_emis = nc_dim_length(ncid, 'nc_emis', verbose)
Expand Down Expand Up @@ -1223,7 +1224,7 @@ subroutine process_broadband_fluxes(Fprimary,FPRTM,FALB,FTSI,fname,&
bpar,bpardif,tpar,&
ulwfx,dlwfx,uswfx,dswfx,&
ulwfxclr,dlwfxclr,uswfxclr,dswfxclr,&
emis_bugsrad,rho_0d_bugsrad,rho_dd_bugsrad)
emis_bugsrad,rho_0d_bugsrad,rho_dd_bugsrad,pxYEAR)
end if ! BUGSrad algorithm

!----------------------------------------------------------------
Expand Down Expand Up @@ -1337,7 +1338,7 @@ subroutine process_broadband_fluxes(Fprimary,FPRTM,FALB,FTSI,fname,&
! Make output NetCDF file
!----------------------------------------------------------------------------
call nc_open(ncid,Fprimary)

! Get common attributes from primary file
call nc_get_common_attributes(ncid, global_atts, source_atts)

Expand Down Expand Up @@ -1871,6 +1872,8 @@ subroutine process_broadband_fluxes(Fprimary,FPRTM,FALB,FTSI,fname,&
!----------------------------------------------------------------------------
! Column_Ozone
!----------------------------------------------------------------------------
write(*,*) ncid, dims_var, 'colO3', colO3_vid, verbose, deflate_lv, shuffle_flag

call nc_def_var_float_packed_float( &
ncid, &
dims_var, &
Expand Down
5 changes: 3 additions & 2 deletions post_processing/orac_postproc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
! 2017/09/05, CP: Added logical flag at the top of the driver file to turn on
! ML post processing.
! 2017/10/05, GM: Get the value of use_ann_phase from the input files.
! 2018/02/27, MST: Setting phase_flag to 2 (some value other than 0) in clear-sky conditions to make those conditions being included in post-processing
!
! $Id$
!
Expand Down Expand Up @@ -615,7 +616,7 @@ subroutine orac_postproc(mytask,ntasks, lower_bound, upper_bound, &
case(ICE)
phase_flag = 2_byte
case default
phase_flag = 0_byte
phase_flag = 2_byte !MST to include clear-sky retrievals in postprocessing files 0_byte
end select
end if
else
Expand All @@ -639,7 +640,7 @@ subroutine orac_postproc(mytask,ntasks, lower_bound, upper_bound, &
phase_flag = 2_byte
end if
case default
phase_flag = 0_byte
phase_flag = 2_byte !MST to include clear-sky retrievals in postprocessing files 0_byte
end select
end if

Expand Down
85 changes: 61 additions & 24 deletions pre_processing/cloud_typing_pavolonis.F90
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,11 @@ subroutine cloud_type_pixel(cview, i, j, ch1, ch2, ch3, ch4, ch5, ch6, &
real(kind=sreal) :: mu0, esd, c_sun
real(kind=sreal) :: solzen, ch1v, ch2v

! --3x3 box stdd of BT 11µm
integer(kind=sint) :: s_i, e_i, s_j, e_j
real(kind=sreal) :: NNN, MN_BT11, SD_BT11
!-------------------------------

! Check if solar zenith angle is < 0
if (imager_angles%solzen(i,j,cview) .lt. 0.) return

Expand Down Expand Up @@ -925,6 +930,15 @@ subroutine cloud_type_pixel(cview, i, j, ch1, ch2, ch3, ch4, ch5, ch6, &
BTD_Ch3b_Ch4 = imager_measurements%data(i,j,ch4) - &
imager_measurements%data(i,j,ch5)

! Calculate spatial stddev of BT(11)
s_i = max(i-1,1)
e_i = min(i+1,imager_geolocation%ENDX)
s_j = max(j-1,1)
e_j = min(j+1,imager_geolocation%ENDY)
NNN = ( e_i - s_i +1) * ( e_j- s_j +1)
MN_BT11 = SUM(imager_measurements%DATA(s_i:e_i,s_j:e_j,ch5) ) / NNN
SD_BT11 = SQRT (SUM((imager_measurements%DATA(s_i:e_i,s_j:e_j,ch5) - MN_BT11)**2) / (NNN - 1))

! Calculate ch3b radiance and emissivity
plank_inv_out = plank_inv(platform, imager_measurements%data(i,j,ch4))
rad_ch3b = plank_inv_out(1)
Expand Down Expand Up @@ -976,6 +990,24 @@ subroutine cloud_type_pixel(cview, i, j, ch1, ch2, ch3, ch4, ch5, ch6, &
bt_ch3b = imager_measurements%data(i,j,ch4)
end if

!-- Determine the viewing zenith angle bin.
index1 = min(7,max(1,int(imager_angles%SATZEN(i,j,cview)/10.0) + 1))
!-- Determine the solar zenith angle bin.
index2 = min(8,max(1,int(imager_angles%SOLZEN(i,j,cview)/10.0) + 1))

!-- Set 11um - 12um cirrus thresholds.
! Absorption of radiation by water vapor and ice crystals in
! semitransparent cirrus clouds is greater at 12 than 11 micron

BTD1112_CIRRUS_THRES = &
A1(index1) + &
B1(index1)*imager_measurements%DATA(i,j,ch5) + &
C1(index1)*imager_measurements%DATA(i,j,ch5)**2 + &
D1(index1)*imager_measurements%DATA(i,j,ch5)**3 + &
E1(index1)*imager_measurements%DATA(i,j,ch5)**4

BTD1112_CIRRUS_THRES = max( 1.0,min(4.0,BTD1112_CIRRUS_THRES) )

desertflag = .false.
if (imager_pavolonis%sfctype(i,j) == DESERT_FLAG) desertflag = .true.

Expand Down Expand Up @@ -1009,11 +1041,23 @@ subroutine cloud_type_pixel(cview, i, j, ch1, ch2, ch3, ch4, ch5, ch6, &
verbose)

! Return if clear, as no need to define cloud type
if (imager_pavolonis%cldmask(i,j,cview) == CLEAR) then
imager_pavolonis%cldtype(i,j,cview) = CLEAR_TYPE
imager_pavolonis%ANN_PHASE(i,j,cview) = CLEAR_TYPE
if (trim(adjustl(sensor)) .ne. 'AATSR' .and. &
trim(adjustl(sensor)) .ne. 'ATSR2') return
if ( imager_pavolonis%cldmask(i,j,cview) == CLEAR) then
if ( ( BTD_Ch4_Ch5 > (BTD1112_CIRRUS_THRES-0.2) ) .and. &
( imager_measurements%DATA(i,j,ch5) < 295.0 ) .and. &
( snow_ice_mask(i,j) .eq. NO ) ) then
imager_pavolonis%CLDMASK(i,j,cview) = CLOUDY
imager_pavolonis%CLDMASK_UNCERTAINTY(i,j,cview) = 99 !100. - imager_pavolonis%CLDMASK_UNCERTAINTY(i,j,cview)
! imager_pavolonis%CLDTYPE(i,j,cview) = CIRRUS_TYPE
! imager_pavolonis%cirrus_quality(i,j,cview) = 1
! imager_pavolonis%ANN_PHASE(i,j,cview) = ICE
! imager_pavolonis%ANN_PHASE_UNCERTAINTY(i,j,cview) = 99
! cycle
else
imager_pavolonis%cldtype(i,j,cview) = CLEAR_TYPE
imager_pavolonis%ANN_PHASE(i,j,cview) = CLEAR_TYPE
if (trim(adjustl(sensor)) .ne. 'AATSR' .and. &
trim(adjustl(sensor)) .ne. 'ATSR2') return
end if
end if

! Implement extra tests for AATSR
Expand Down Expand Up @@ -1072,6 +1116,18 @@ subroutine cloud_type_pixel(cview, i, j, ch1, ch2, ch3, ch4, ch5, ch6, &
end if
end if

! introduce 2nd glint test / also possible dust using spatial
! variabilty in channel5
if ( ( BTD_Ch4_Ch5 .ge. 0. ) .and. ( BTD_Ch4_Ch5 .le. 3. ) .and. &
( ch2v/max(ch1v,0.01) .ge. 0.6 ) .and. (ch2v/max(ch1v,0.01) .le. 1. ) .and. &
( imager_measurements%DATA(i,j,ch5) .gt. 290.0 ) .and. &
( SD_BT11 .lt. 0.25 ) ) then
imager_pavolonis%CLDMASK(i,j,cview) = CLEAR
imager_pavolonis%CLDMASK_UNCERTAINTY(i,j,cview) = 99 !100. - imager_pavolonis%CLDMASK_UNCERTAINTY(i,j,cview)
imager_pavolonis%CLDTYPE(i,j,cview) = CLEAR_TYPE
return
end if

! From here all sensors have their decisions made only when cloudy is allowed

! Start ANN phase
Expand Down Expand Up @@ -1132,25 +1188,6 @@ subroutine cloud_type_pixel(cview, i, j, ch1, ch2, ch3, ch4, ch5, ch6, &
end if
end if

! Determine the viewing zenith angle bin
index1 = min(7,max(1,int(imager_angles%satzen(i,j,cview)/10.0) + 1))

! Determine the solar zenith angle bin
index2 = min(8,max(1,int(imager_angles%solzen(i,j,cview)/10.0) + 1))

! Set 11um - 12um cirrus thresholds.
! Absorption of radiation by water vapor and ice crystals in
! semitransparent cirrus clouds is greater at 12 than 11 micron.

BTD1112_CIRRUS_THRES = &
A1(index1) + &
B1(index1)*imager_measurements%data(i,j,ch5) + &
C1(index1)*imager_measurements%data(i,j,ch5)**2 + &
D1(index1)*imager_measurements%data(i,j,ch5)**3 + &
E1(index1)*imager_measurements%data(i,j,ch5)**4

BTD1112_CIRRUS_THRES = max(1.0, min(4.0,BTD1112_CIRRUS_THRES))

! Initial cirrus quality
imager_pavolonis%cirrus_quality(i,j,cview) = 0

Expand Down
Loading