Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the capability for assimilating GOES-ABI radiance data #1

Open
wants to merge 109 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
eb228ce
Updated WRFDA RTTOV interface to version 12.1
Mar 28, 2018
86c8b8f
Added GOES-16 observation I/O
May 1, 2018
e26888d
More sophisticated MPI implementation for GOES ABI reading/processing…
May 15, 2018
6ad8fcc
Significant modifications to improve flow in GOES-ABI reading
May 17, 2018
f9a1f6b
Further advance in GOES-ABI reading of obs locations
May 17, 2018
cbb1d6a
More linked list modifications. Very tricky to communicate model_loc…
May 18, 2018
e8b1a1e
Load balancing in loop over processors. Increases memory requirement.
May 21, 2018
344a284
Removing patch linked list of locations in favor of a post-allocataed…
May 21, 2018
ce46bdd
Added vectorized versions several ABI subroutine calls
May 21, 2018
65765de
Added more vectorized code for speedup
May 23, 2018
4da22ed
Added more accurate total obs counts for GOES-ABI on all processors
Jun 11, 2018
0f48f84
Merge branch 'master' into WRFDA_RTTOVv12_GOESR
Jun 13, 2018
97e91bf
Minor fixes for serial compile
Jun 21, 2018
cba75d6
Added Zhuge and Zou cloud detection option for GOES ABI
Aug 3, 2018
cec7099
Added qualifying limits for three Zhuge and Zou cloud detection tests…
Aug 22, 2018
775c01e
Significant reorganization of abi qc subroutine.
Aug 23, 2018
492f770
CRTM debugging
Aug 28, 2018
a53e27a
Modifying channel numbers in goes abi info files for RTTOV
Aug 29, 2018
a61792d
Clean up qc for goesabi
Sep 5, 2018
7d8dd00
First steps toward cloudy radiance handling for GOES-ABI
Sep 5, 2018
78a735a
Merge branch 'develop' into WRFDA_GOES
Oct 1, 2018
c5ee3fc
Bug fixes for cloudy radiances from GOESABI
Oct 1, 2018
e936027
Merge branch 'develop' into WRFDA_GOES
Oct 3, 2018
c481474
Fix for GOES meta/grid initialization with multiple fgat times
Oct 3, 2018
401260c
Fix for GOES file counting
Oct 4, 2018
914e610
Added GOES-16 to VARBC.in and turned on all channels in goes-16-abi.info
Oct 5, 2018
162c291
Bug fix for GOES ABI readmask to make generalizable to cases when DQF…
Oct 9, 2018
87911b7
Merge branch 'develop' into feature/wrfda_goes16
Oct 9, 2018
d29a128
Bugfixes for GOES ABI:
Oct 9, 2018
37ba994
Merge branch 'develop' into feature/wrfda_goes16
Oct 12, 2018
116cccd
Bug fix on find for files of GOESABI
Oct 12, 2018
4b6d3b4
Corrected initial values for mean and std of VARBC parameters of G16
Oct 30, 2018
af284f4
Merge branch 'develop' into feature/wrfda_goes16
Oct 30, 2018
6a715de
Add 1D domain check to reduce time for processing prepbufr files in i…
Nov 8, 2018
548ee4a
Bug fixing and cleanup for llxy_1d in da_read_obs_bufr.inc
Nov 19, 2018
1fed12e
Turn off ABI cloud debug printing
Nov 21, 2018
ba426cd
Cleanup of da_read_obs_bufr.inc
Nov 21, 2018
b908ce0
Vectorized the llxy test for several radiance instruments
Nov 26, 2018
fe1f92b
Update VARBC.in for GOES-16 ABI based on 15-23 APR 2018 spinup
Dec 17, 2018
61cb88a
Merge branch 'develop' into feature/wrfda_goes16
Dec 17, 2018
8a20078
Small bugfixes to airs/atms 1d reading
Jan 29, 2019
cf0fdbb
Merge branch 'develop' into feature/wrfda_goes16
Feb 13, 2019
3d282ec
Cleanup of atms and seviri, add amsr2 1d llxy
Feb 14, 2019
28d1d00
Cleanup commented code in abi reading routines
Feb 14, 2019
d645144
Refactor for lower memory overhead before execute_command_line
Apr 16, 2019
3765866
Merge branch 'develop' into feature/wrfda_goes16
Apr 18, 2019
42c7a35
Clean up execute_command_line interface
Apr 18, 2019
84b4354
Reduce ABI printouts and change ptotal to account for thinning
Apr 30, 2019
ca430cf
Revert 1d_llxy for non-ABI observations
May 1, 2019
d96c28c
Fix dependencies on wrf_dm_bcast_integer/real/string/bytes
May 2, 2019
97ebd4b
Merge branch 'bugfix/dm_bcast' into feature/wrfda_goes16
May 2, 2019
99ec57b
Series of fixes/updates to goes-abi metadata generation
May 13, 2019
5c0b29e
Merge branch 'develop' into feature/wrfda_goes16
May 14, 2019
d52a9c3
Merge branch 'develop' into feature/wrfda_goes16
May 22, 2019
105a525
Small fix to depend.txt, include da_togrid_1d.inc
May 23, 2019
ea59aaa
Updating all-sky statistics and code
Jun 4, 2019
38ed46b
Better cloud info in diagnostic outputs
Jun 8, 2019
2cc06cc
Merge branch 'develop' into feature/wrfda_goes16
Jun 17, 2019
81a339e
Small bugfix for efficiency in da_rad_diags.f90
Jun 17, 2019
95d99a4
Extra tuning of abi qc
Jun 17, 2019
7de0c33
Merge branch 'develop' into feature/wrfda_goes16
Jul 12, 2019
a037122
Bugfix to where statement
Jul 12, 2019
1179473
Allow crtm_cloud different in each outer iteration
Jul 17, 2019
32ca9a3
Merge branch 'feature/crtm_cloud_outer_it' into feature/wrfda_goes16_…
Jul 26, 2019
885cdfd
Allow ABI tb_err to change each outer iteration
Jul 26, 2019
d67a895
Merge branch 'develop' into feature/wrfda_goes16_cloudit
Aug 8, 2019
42bd5ec
Update goes-16-abi.info
Sep 4, 2019
48a1f47
Merge branch 'develop' into feature/wrfda_goes16_cloudit
Oct 9, 2019
7cc33d3
Divide ca_mean diagnostic into model and obs components
Nov 8, 2019
490f40f
Add super-obbing for ABI
Nov 18, 2019
19fdc37
Re-add some log prints, reduce count when abi_superob_halfwidth > 0
Jan 9, 2020
45f1e94
Fully implemented super-obbing and refactoring of cloud detection
Jan 10, 2020
cd663b3
Add solzen+solazi to rad diags
Jan 15, 2020
8d386b5
Remove pixels with all missing tb_obs
Jan 15, 2020
d0227ad
Enable GOES-17
Jan 16, 2020
9201514
Merge branch 'develop' into feature/wrfda_goesabi
Mar 3, 2020
fb67cf7
Add terrain grid debug prints
Mar 30, 2020
19131cd
Merge branch 'develop' into goesabi
liujake Dec 27, 2023
e74774f
modified: Registry/registry.var
liujake Dec 28, 2023
93e5f90
modified: Registry/registry.var
liujake Dec 28, 2023
c4b29d4
modified: var/da/da_control/da_control.f90
liujake Dec 28, 2023
0e29322
modified: var/da/da_main/da_solve.inc
liujake Dec 28, 2023
314977f
modified: var/da/da_minimisation/da_calculate_gradj.inc
liujake Dec 28, 2023
c440acc
modified: var/da/da_obs/da_transform_xtoy.inc
liujake Dec 28, 2023
e5c3603
modified: var/da/da_obs/da_transform_xtoy.inc
liujake Dec 28, 2023
5e7ef0c
modified: var/da/da_obs/da_transform_xtoy.inc
liujake Dec 28, 2023
1032f45
modified: var/da/da_obs/da_transform_xtoy.inc
liujake Dec 28, 2023
80df487
modified: var/da/da_setup_structures/da_setup_be_nmm_regional.inc
liujake Dec 28, 2023
773190e
modified: var/da/da_test/da_check_vptox_adjoint.inc
liujake Dec 28, 2023
f6766cc
modified: var/run/radiance_info/gcom-w-1-amsr2.info
liujake Dec 28, 2023
c9c93d5
modified: var/da/da_tools/da_get_julian_time.inc
liujake Dec 28, 2023
703b031
modified: var/da/da_radiance/da_initialize_rad_iv.inc
liujake Dec 28, 2023
8d8214a
modified: var/da/da_radiance/da_qc_rad.inc
liujake Dec 28, 2023
9cb56da
modified: var/da/da_radiance/da_qc_goesabi.inc
liujake Dec 28, 2023
af22f5a
Merge branch 'develop' into goesabi
liujake Dec 29, 2023
a263f43
modified: var/da/da_define_structures/da_define_structures.f90
liujake Dec 29, 2023
bd8d176
modified: var/da/da_define_structures/da_define_structures.f90
liujake Dec 29, 2023
79b625a
This commit allows to build WRFDA-3DVar on derecho
liujake Dec 29, 2023
d1aba08
Merge branch 'develop' into goesabi
liujake Jan 5, 2024
7513457
More clear up
liujake Jan 7, 2024
498675e
modified: var/da/da_monitor/da_rad_diags.f90
liujake Jan 8, 2024
1534259
modified: var/da/da_monitor/da_rad_diags.f90
liujake Jan 8, 2024
877acff
modified: var/da/da_radiance/da_deallocate_radiance.inc
liujake Jan 8, 2024
9d62429
modified: var/da/da_obs/da_fill_obs_structures.inc
liujake Jan 8, 2024
3121376
Merge branch 'develop' into goesabi
liujake Jan 10, 2024
7a04ace
modified: var/da/da_radiance/da_allocate_rad_iv.inc
liujake Jan 15, 2024
718e5ae
modified: var/da/da_radiance/da_read_obs_ncgoesabi.inc
liujake Jan 15, 2024
8257342
modified: var/da/da_define_structures/da_define_structures.f90
liujake Jan 16, 2024
a530e9c
Merge branch 'develop' into goesabi
liujake Jan 16, 2024
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
3 changes: 3 additions & 0 deletions Registry/registry.var
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ rconfig logical use_amsr2obs namelist,wrfvar4 1 .false. - "use
rconfig logical use_ahiobs namelist,wrfvar4 1 .false. - "use_ahiobs" "" ""
rconfig logical use_gmiobs namelist,wrfvar4 1 .false. - "use_gmiobs" "" ""
rconfig logical use_goesimgobs namelist,wrfvar4 1 .false. - "use_goesimgobs" "" ""
rconfig logical use_goesabiobs namelist,wrfvar4 1 .false. - "use_goesabiobs" "" ""
rconfig logical use_kma1dvar namelist,wrfvar4 1 .false. - "use_kma1dvar" "" ""
rconfig logical use_filtered_rad namelist,wrfvar4 1 .false. - "use_filtered_rad" "" ""
rconfig logical use_obs_errfac namelist,wrfvar4 1 .false. - "use_obs_errfac" "" ""
Expand Down Expand Up @@ -468,6 +469,7 @@ rconfig integer varbc_nobsmin namelist,wrfvar14 1 10 - "va
rconfig integer use_clddet namelist,wrfvar14 1 2 - "use_clddet" "0: off, 1: mmr, 2: pf, 3: ecmwf" ""
rconfig logical use_clddet_zz namelist,wrfvar14 1 .false. - "use_clddet_zz" "cloud detection scheme from Zhuge X. and Zou X. JAMC, 2016." ""
rconfig integer ahi_superob_halfwidth namelist,wrfvar14 1 0 - "ahi_superob_halfwidth" "" ""
rconfig integer abi_superob_halfwidth namelist,wrfvar14 1 0 - "abi_superob_halfwidth" "" ""
rconfig logical airs_warmest_fov namelist,wrfvar14 1 .false. - "airs_warmest_fov" "" ""
rconfig logical use_satcv namelist,wrfvar14 2 .false. - "use_satcv" "" ""
rconfig logical use_blacklist_rad namelist,wrfvar14 1 .true. - "use_blacklist_rad" "" ""
Expand All @@ -477,6 +479,7 @@ rconfig character crtm_irwater_coef namelist,wrfvar14 1 "Nalli.IRwater
rconfig character crtm_mwwater_coef namelist,wrfvar14 1 "FASTEM5.MWwater.EmisCoeff.bin" - "crtm_mwwater_coef" "" ""
rconfig character crtm_irland_coef namelist,wrfvar14 1 "USGS.IRland.EmisCoeff.bin" - "crtm_irland_coef" "" ""
rconfig character crtm_visland_coef namelist,wrfvar14 1 "USGS.VISland.EmisCoeff.bin" - "crtm_visland_coef" "" ""
rconfig logical abi_use_symm_obs_err namelist,wrfvar14 1 .false. - "abi_use_symm_obs_err" "" ""
rconfig logical ahi_use_symm_obs_err namelist,wrfvar14 1 .false. - "ahi_use_symm_obs_err" "" ""
rconfig logical ahi_apply_clrsky_bias namelist,wrfvar14 1 .false. - "ahi_apply_clrsky_bias" "" ""
rconfig integer num_pseudo namelist,wrfvar15 1 0 - "num_pseudo" "" ""
Expand Down
12 changes: 6 additions & 6 deletions var/build/depend.txt

Large diffs are not rendered by default.

20 changes: 12 additions & 8 deletions var/da/da_define_structures/da_define_structures.f90
Original file line number Diff line number Diff line change
Expand Up @@ -574,10 +574,12 @@ module da_define_structures
real, pointer :: vtox(:,:)
end type varbc_type
type clddet_geoir_type
real :: RTCT, RFMFT, TEMPIR, terr_hgt
real :: tb_stddev_10, tb_stddev_13,tb_stddev_14
real :: CIRH2O
!real, allocatable :: CIRH2O(:,:,:)
real :: RTCT, RFMFT, TEMPIR, terr_hgt ! for both ABI and AHI
real :: tb_stddev_10, tb_stddev_13,tb_stddev_14 ! only for AHI
real :: CIRH2O ! for both ABI and AHI
real, allocatable :: CIRH2O_abi(:,:,:) ! only for ABI
real, allocatable :: tb_stddev_3x3(:) ! only for ABI
integer :: RFMFT_ij(2) ! only for ABI
end type clddet_geoir_type
type superob_type
real, allocatable :: tb_obs(:,:)
Expand Down Expand Up @@ -618,6 +620,8 @@ module da_define_structures
integer, pointer :: cloud_flag(:,:)
integer, pointer :: cloudflag(:)
integer, pointer :: rain_flag(:)
real, pointer :: cloud_mod(:,:) ! only for ABI
real, pointer :: cloud_obs(:,:) ! only for ABI
real, allocatable :: cloud_frac(:)
real, pointer :: satzen(:)
real, pointer :: satazi(:)
Expand All @@ -632,10 +636,10 @@ module da_define_structures
real, pointer :: lod(:,:,:) ! layer_optical_depth
real, pointer :: trans(:,:,:) ! layer transmittance
real, pointer :: der_trans(:,:,:) ! d(transmittance)/dp
real, pointer :: kmin_t(:)
real, pointer :: kmax_p(:)
real, pointer :: sensitivity_ratio(:,:,:)
real, pointer :: p_chan_level(:,:)
real, pointer :: kmin_t(:)
real, pointer :: kmax_p(:)
real, pointer :: sensitivity_ratio(:,:,:)
real, pointer :: p_chan_level(:,:)
real, pointer :: qrn(:,:)
real, pointer :: qcw(:,:)
real, pointer :: qci(:,:)
Expand Down
48 changes: 44 additions & 4 deletions var/da/da_monitor/da_rad_diags.f90
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ program da_rad_diags
integer :: ncid, dimid, varid
integer, dimension(3) :: ishape, istart, icount
!
logical :: amsr2
logical :: amsr2, abi
logical :: isfile, prf_found, jac_found
integer, parameter :: datelen1 = 10
integer, parameter :: datelen2 = 19
Expand All @@ -62,9 +62,9 @@ program da_rad_diags
real*4, dimension(:), allocatable :: smois, tslb, snowh, vegfra, clwp, cloud_frac
real*4, dimension(:), allocatable :: cip ! cloud-ice path
integer, dimension(:), allocatable :: cloudflag ! cloudflag from L2 AHI
integer, dimension(:,:), allocatable :: tb_qc
integer, dimension(:,:), allocatable :: tb_qc, cloud_flag
real*4, dimension(:,:), allocatable :: tb_obs, tb_bak, tb_inv, tb_oma, tb_err, ems, ems_jac
real*4, dimension(:,:), allocatable :: tb_bak_clr ! clear-sky brightness temp
real*4, dimension(:,:), allocatable :: cloud_mod, cloud_obs, tb_bak_clr ! clear-sky brightness temp
real*4, dimension(:,:), allocatable :: weightfunc_peak ! peak of weighting function
real*4, dimension(:,:), allocatable :: prf_pfull, prf_phalf, prf_t, prf_q, prf_water
real*4, dimension(:,:), allocatable :: prf_ice, prf_rain, prf_snow, prf_grau, prf_hail
Expand Down Expand Up @@ -139,6 +139,7 @@ program da_rad_diags
write(0,*) trim(instid(iinst))

amsr2 = index(instid(iinst),'amsr2') > 0
abi = index(instid(iinst),'abi') > 0

nerr = 0
total_npixel = 0
Expand Down Expand Up @@ -263,6 +264,12 @@ program da_rad_diags
allocate ( tb_oma(1:nchan,1:total_npixel) )
allocate ( tb_err(1:nchan,1:total_npixel) )
allocate ( tb_qc(1:nchan,1:total_npixel) )
if ( abi ) then
allocate ( cloud_mod(1:nchan,1:total_npixel) )
allocate ( cloud_obs(1:nchan,1:total_npixel) )
allocate ( cloud_flag(1:nchan,1:total_npixel))
cloud_flag = 0
end if
allocate ( ems(1:nchan,1:total_npixel) )
if ( jac_found ) then
allocate ( ems_jac(1:nchan,1:total_npixel) )
Expand Down Expand Up @@ -333,6 +340,11 @@ program da_rad_diags
tb_inv = missing_r
tb_oma = missing_r
tb_err = missing_r
if ( abi ) then
cloud_mod = missing_r
cloud_obs = missing_r
end if

ncname = 'diags_'//trim(instid(iinst))//"_"//datestr1(itime)//'.nc'
ios = NF_CREATE(trim(ncname), NF_NETCDF4, ncid) ! Change to output netcdf4 files
!ios = NF_CREATE(trim(ncname), NF_CLOBBER, ncid) ! NF_CLOBBER specifies the default behavior of
Expand Down Expand Up @@ -392,7 +404,15 @@ program da_rad_diags
read(unit=iunit(iproc),fmt='(10f11.2)',iostat=ios) tb_err(:,ipixel)
read(unit=iunit(iproc),fmt='(a)',iostat=ios) buf ! QC
read(unit=iunit(iproc),fmt='(10i11)',iostat=ios ) tb_qc(:,ipixel)
read(unit=iunit(iproc),fmt='(a)',iostat=ios) buf
read(unit=iunit(iproc),fmt='(a)',iostat=ios) buf
if ( abi .and. buf(1:4) == "CMOD" ) then ! read cloud_mod, cloud_obs, cloud_flag for abi
read(unit=iunit(iproc),fmt='(10f11.2)',iostat=ios) cloud_mod(:,ipixel)
read(unit=iunit(iproc),fmt='(a)',iostat=ios) buf ! CMOD
read(unit=iunit(iproc),fmt='(10f11.2)',iostat=ios) cloud_obs(:,ipixel)
read(unit=iunit(iproc),fmt='(a)',iostat=ios) buf ! COBS
read(unit=iunit(iproc),fmt='(10i11)',iostat=ios ) cloud_flag(:,ipixel)
read(unit=iunit(iproc),fmt='(a)',iostat=ios) buf ! cloud_flag
end if
if ( buf(1:4) == "INFO" ) then
backspace(iunit(iproc))
cycle npixel_loop
Expand Down Expand Up @@ -523,6 +543,13 @@ program da_rad_diags
end if
ios = NF_DEF_VAR(ncid, 'tb_err', NF_FLOAT, 2, ishape(1:2), varid)
ios = NF_DEF_VAR(ncid, 'tb_qc', NF_INT, 2, ishape(1:2), varid)
if ( abi ) then
ios = NF_DEF_VAR(ncid, 'cloud_mod', NF_FLOAT, 2, ishape(1:2), varid)
ios = NF_PUT_ATT_REAL(ncid, varid, 'missing_value', NF_FLOAT, 1, missing_r)
ios = NF_DEF_VAR(ncid, 'cloud_obs', NF_FLOAT, 2, ishape(1:2), varid)
ios = NF_PUT_ATT_REAL(ncid, varid, 'missing_value', NF_FLOAT, 1, missing_r)
ios = NF_DEF_VAR(ncid, 'cloud_flag', NF_INT, 2, ishape(1:2), varid)
end if
!
! define 2-D array with dimensions nlev * total_npixel
!
Expand Down Expand Up @@ -669,6 +696,14 @@ program da_rad_diags
ios = NF_PUT_VARA_REAL(ncid, varid, istart(1:2), icount(1:2), tb_err)
ios = NF_INQ_VARID (ncid, 'tb_qc', varid)
ios = NF_PUT_VARA_INT(ncid, varid, istart(1:2), icount(1:2), tb_qc)
if ( abi ) then
ios = NF_INQ_VARID (ncid, 'cloud_mod', varid)
ios = NF_PUT_VARA_REAL(ncid, varid, istart(1:2), icount(1:2), cloud_mod)
ios = NF_INQ_VARID (ncid, 'cloud_obs', varid)
ios = NF_PUT_VARA_REAL(ncid, varid, istart(1:2), icount(1:2), cloud_obs)
ios = NF_INQ_VARID (ncid, 'cloud_flag', varid)
ios = NF_PUT_VARA_INT(ncid, varid, istart(1:2), icount(1:2), cloud_flag)
end if
!
! output 2-D array with dimensions nlev * total_npixel
!
Expand Down Expand Up @@ -890,6 +925,11 @@ program da_rad_diags
deallocate ( tb_bak_clr )
deallocate ( weightfunc_peak )
deallocate ( tb_inv )
if ( abi ) then
deallocate ( cloud_mod )
deallocate ( cloud_obs )
deallocate ( cloud_flag )
end if
deallocate ( tb_oma )
deallocate ( ems )
if ( jac_found ) deallocate ( ems_jac )
Expand Down
18 changes: 16 additions & 2 deletions var/da/da_radiance/da_allocate_rad_iv.inc
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ subroutine da_allocate_rad_iv (i, nchan, iv)
end if
if ( index(iv%instid(i)%rttovid_string, 'ahi') > 0 ) then
allocate (iv%instid(i)%cloudflag(iv%instid(i)%num_rad))
end if
if ( index(iv%instid(i)%rttovid_string, 'abi') > 0 ) then
allocate (iv%instid(i)%cloud_mod(nchan,iv%instid(i)%num_rad))
allocate (iv%instid(i)%cloud_obs(nchan,iv%instid(i)%num_rad))
end if
if ( index(iv%instid(i)%rttovid_string, 'gmi') > 0 ) then
allocate (iv%instid(i)%clw(iv%instid(i)%num_rad))
Expand Down Expand Up @@ -112,16 +116,26 @@ subroutine da_allocate_rad_iv (i, nchan, iv)
allocate (iv%instid(i)%gamma_jacobian(nchan,iv%instid(i)%num_rad))
allocate (iv%instid(i)%cloud_frac(iv%instid(i)%num_rad))
if ( use_clddet_zz ) then
iv%instid(i)%superob_width = 2*ahi_superob_halfwidth+1
! here we assume AHI and ABI (they cover different regions) are not used simultaneously
if ( index(iv%instid(i)%rttovid_string, 'ahi') > 0 ) &
iv%instid(i)%superob_width = 2*ahi_superob_halfwidth+1
if ( index(iv%instid(i)%rttovid_string, 'abi') > 0 ) &
iv%instid(i)%superob_width = 2*abi_superob_halfwidth+1

allocate (iv%instid(i)%superob(iv%instid(i)%superob_width, &
iv%instid(i)%superob_width))
do iy = 1, iv%instid(i)%superob_width
do ix = 1, iv%instid(i)%superob_width
allocate (iv%instid(i)%superob(ix,iy)%cld_qc(iv%instid(i)%num_rad))
allocate (iv%instid(i)%superob(ix,iy)%tb_obs(nchan,iv%instid(i)%num_rad))
if ( index(iv%instid(i)%rttovid_string, 'abi') > 0 ) then
do n = 1, iv%instid(i)%num_rad
allocate (iv%instid(i)%superob(ix,iy)%cld_qc(n)%tb_stddev_3x3(nchan))
end do
end if
end do
end do
end if
end if
if ( use_rttov_kmatrix .or. use_crtm_kmatrix ) then
allocate(iv%instid(i)%ts_jacobian(nchan,iv%instid(i)%num_rad))
allocate(iv%instid(i)%ps_jacobian(nchan,iv%instid(i)%num_rad))
Expand Down
23 changes: 21 additions & 2 deletions var/da/da_radiance/da_deallocate_radiance.inc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@
deallocate ( satinfo(i) % clearSkyBias)
endif

! Deallocate extra variables for ABI
if ( index(iv%instid(i)%rttovid_string, 'abi') > 0 ) then
deallocate (satinfo(i) % error_cld_y)
deallocate (satinfo(i) % error_cld_x)
endif


if (use_error_factor_rad) then
deallocate (satinfo(i) % error_factor)
endif
Expand Down Expand Up @@ -115,6 +122,10 @@
end if
if ( index(iv%instid(i)%rttovid_string, 'ahi') > 0 ) then
deallocate (iv%instid(i)%cloudflag)
end if
if ( index(iv%instid(i)%rttovid_string, 'abi') > 0 ) then
deallocate (iv%instid(i)%cloud_mod)
deallocate (iv%instid(i)%cloud_obs)
end if
if ( index(iv%instid(i)%rttovid_string,'gmi') > 0 ) then
deallocate (iv%instid(i)%clw)
Expand Down Expand Up @@ -149,8 +160,16 @@
if ( use_clddet_zz ) then
do iy = 1, iv%instid(i)%superob_width
do ix = 1, iv%instid(i)%superob_width
deallocate (iv%instid(i)%superob(ix,iy)%cld_qc)
deallocate (iv%instid(i)%superob(ix,iy)%tb_obs)
if ( index(iv%instid(i)%rttovid_string, 'abi') > 0 ) then
do n = 1,iv%instid(i)%num_rad
if ( allocated (iv%instid(i)%superob(ix,iy)%cld_qc(n)%tb_stddev_3x3) ) &
deallocate (iv%instid(i)%superob(ix,iy)%cld_qc(n)%tb_stddev_3x3)
if ( allocated (iv%instid(i)%superob(ix,iy)%cld_qc(n)%CIRH2O_abi) ) &
deallocate (iv%instid(i)%superob(ix,iy)%cld_qc(n)%CIRH2O_abi)
end do
end if
deallocate (iv%instid(i)%superob(ix,iy)%cld_qc)
deallocate (iv%instid(i)%superob(ix,iy)%tb_obs)
end do
end do
deallocate (iv%instid(i)%superob)
Expand Down
14 changes: 11 additions & 3 deletions var/da/da_radiance/da_get_innov_vector_crtm.inc
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ subroutine da_get_innov_vector_crtm ( it, grid, ob, iv )
real, allocatable :: hessian(:,:)
real*8, allocatable :: eignvec(:,:), eignval(:)
real :: rad_clr, rad_ovc_ilev, rad_ovc_jlev

integer :: Band_Size(5), Bands(AIRS_Max_Channels,5)
!For Zhuge and Zou cloud detection
real, allocatable :: geoht_full(:,:,:)
Expand Down Expand Up @@ -243,9 +243,10 @@ subroutine da_get_innov_vector_crtm ( it, grid, ob, iv )
calc_tb_clr = .false.
if ( crtm_cloud .and. &
( trim( crtm_sensor_name(rtminit_sensor(inst))) == 'amsr2' .or. &
trim( crtm_sensor_name(rtminit_sensor(inst))) == 'abi' .or. &
trim( crtm_sensor_name(rtminit_sensor(inst))) == 'ahi') ) then
!Tb_clear_sky is only needed for symmetric obs error model
!symmetric obs error model only implemented for amsr2 for now
!symmetric obs error model only implemented for amsr2 & abi/ahi for now
calc_tb_clr = .true.
end if

Expand Down Expand Up @@ -443,7 +444,6 @@ subroutine da_get_innov_vector_crtm ( it, grid, ob, iv )
call da_trop_wmo ( tt_pixel, geoht_pixel, pp_pixel, (min(kte,kme-1)-kts+1), tropt = iv%instid(inst)%tropt(n) )
end if


call da_interp_2d_partial (grid%xb%u10, iv%instid(inst)%info, 1, n, n, model_u10(n:n))
call da_interp_2d_partial (grid%xb%v10, iv%instid(inst)%info, 1, n, n, model_v10(n:n))
call da_interp_2d_partial (grid%xb%psfc, iv%instid(inst)%info, 1, n, n, model_psfc(n:n))
Expand Down Expand Up @@ -476,6 +476,14 @@ subroutine da_get_innov_vector_crtm ( it, grid, ob, iv )
cycle pixel_loop
end if
end do
!if ( all(ob%instid(inst)%tb(1:nchanl,n) < 0.) ) then
! write(message(1),'(a,2i5.0,a)') ' Skipping the pixel at loc ', i, j, &
! ' where all observed BTs are < 0'
! call da_warning(__FILE__,__LINE__,message(1:1))
! iv%instid(inst)%tb_inv(:,n) = missing_r
! iv%instid(inst)%info%proc_domain(:,n) = .false.
! cycle pixel_loop
!end if

! convert cloud content unit from kg/kg to kg/m^2
if (crtm_cloud) then
Expand Down
34 changes: 33 additions & 1 deletion var/da/da_radiance/da_get_innov_vector_rttov.inc
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,30 @@ real,allocatable :: temp(:), temp2(:), temp3(:,:)
real, allocatable :: em_mspps(:) ! emissivity caluclated using MSPPS algorithm
real :: ts_mspps ! surface temperature calcualted using MSPPS algorithm

!For Zhuge and Zou cloud detection
real, allocatable :: geoht_full(:,:,:)
real :: geoht_pixel(kts:min(kte,kme-1))
real :: tt_pixel(kts:min(kte,kme-1))
real :: pp_pixel(kts:min(kte,kme-1))

if (trace_use) call da_trace_entry("da_get_innov_vector_rttov")

!------------------------------------------------------
! [1.0] calculate the background bright temperature
!-------------------------------------------------------

if ( use_clddet_zz ) then
allocate ( geoht_full(ims:ime,jms:jme,kms:kme-1) )
do k = kms, kme-1
do j = jms, jme
do i = ims, ime
geoht_full(i,j,k) = 0.5 * ( grid%ph_2(i,j,k) + grid%phb(i,j,k) + &
grid%ph_2(i,j,k+1) + grid%phb(i,j,k+1) ) / gravity
end do
end do
end do
end if

do inst = 1, iv%num_inst ! loop for sensor
if ( iv%instid(inst)%num_rad < 1 ) cycle
nlevels = iv%instid(inst)%nlevels
Expand Down Expand Up @@ -99,7 +117,6 @@ real,allocatable :: temp(:), temp2(:), temp3(:,:)
call da_interp_lin_3d (grid%xb%t, iv%instid(inst)%info, iv%instid(inst)%t (:,n1:n2))
call da_interp_lin_3d (grid%xb%q, iv%instid(inst)%info, iv%instid(inst)%mr(:,n1:n2))


do n= n1,n2
do k=1, nlevels
if (iv%instid(inst)%info%zk(k,n) <= 0.0) then
Expand Down Expand Up @@ -132,6 +149,19 @@ real,allocatable :: temp(:), temp2(:), temp3(:,:)
iv%instid(inst)%surftype(n) = 0
end if

if ( use_clddet_zz ) then
! Find tropopause temperature for Zhuge and Zou Cloud Detection
do k = kts, min(kte,kme-1)
call da_interp_2d_partial ( grid%xb%t(:,:,k), iv%instid(inst)%info, k, n, n, tt_pixel(k) )
call da_interp_2d_partial ( grid%xb%p(:,:,k), iv%instid(inst)%info, k, n, n, pp_pixel(k) )
call da_interp_2d_partial ( geoht_full(:,:,k), iv%instid(inst)%info, k, n, n, geoht_pixel(k) )

! call da_interp_lin_2d ( grid%xb%t(:,:,k), iv%instid(inst)%info, k, n, n, tt_pixel(k) )
! call da_interp_lin_2d ( grid%xb%p(:,:,k), iv%instid(inst)%info, k, n, n, pp_pixel(k) )
! call da_interp_lin_2d ( geoht_full(:,:,k), iv%instid(inst)%info, k, n, n, geoht_pixel(k) )
end do
call da_trop_wmo ( tt_pixel, geoht_pixel, pp_pixel, (min(kte,kme-1)-kts+1), tropt = iv%instid(inst)%tropt(n) )
end if
end do

call da_interp_lin_2d (grid%xb % u10, iv%instid(inst)%info, 1, iv%instid(inst)%u10(n1:n2))
Expand Down Expand Up @@ -381,6 +411,8 @@ real,allocatable :: temp(:), temp2(:), temp3(:,:)

end do ! end loop for sensor

if ( use_clddet_zz ) deallocate ( geoht_full )

if (trace_use) call da_trace_exit("da_get_innov_vector_rttov")
#else
call da_error(__FILE__,__LINE__, &
Expand Down
Loading