1 subroutine da_allocate_rad_iv (i, nchan, iv)
3 !---------------------------------------------------------------------------
4 ! Purpose: allocate radiance innovation structure
5 !---------------------------------------------------------------------------
11 integer , intent (in) :: i, nchan
12 type (iv_type) , intent (inout) :: iv
14 call da_trace_entry("da_allocate_rad_iv")
16 allocate (iv%instid(i)%info%date_char(iv%instid(i)%num_rad))
17 allocate (iv%instid(i)%info%name(iv%instid(i)%num_rad))
18 allocate (iv%instid(i)%info%platform(iv%instid(i)%num_rad))
19 allocate (iv%instid(i)%info%id(iv%instid(i)%num_rad))
20 allocate (iv%instid(i)%info%levels(iv%instid(i)%num_rad))
21 allocate (iv%instid(i)%info%lat(kts:kte,iv%instid(i)%num_rad))
22 allocate (iv%instid(i)%info%lon(kts:kte,iv%instid(i)%num_rad))
23 allocate (iv%instid(i)%info%elv(iv%instid(i)%num_rad))
24 allocate (iv%instid(i)%info%pstar(iv%instid(i)%num_rad))
25 allocate (iv%instid(i)%info%i (kts:kte,iv%instid(i)%num_rad))
26 allocate (iv%instid(i)%info%j (kts:kte,iv%instid(i)%num_rad))
27 allocate (iv%instid(i)%info%dx (kts:kte,iv%instid(i)%num_rad))
28 allocate (iv%instid(i)%info%dy (kts:kte,iv%instid(i)%num_rad))
29 allocate (iv%instid(i)%info%dxm(kts:kte,iv%instid(i)%num_rad))
30 allocate (iv%instid(i)%info%dym(kts:kte,iv%instid(i)%num_rad))
31 allocate (iv%instid(i)%info%k (iv%instid(i)%nlevels,iv%instid(i)%num_rad))
32 allocate (iv%instid(i)%info%dz (iv%instid(i)%nlevels,iv%instid(i)%num_rad))
33 allocate (iv%instid(i)%info%dzm(iv%instid(i)%nlevels,iv%instid(i)%num_rad))
34 allocate (iv%instid(i)%info%zk (iv%instid(i)%nlevels,iv%instid(i)%num_rad))
35 allocate (iv%instid(i)%info%proc_domain(iv%instid(i)%nlevels,iv%instid(i)%num_rad))
37 allocate (iv%instid(i)%t (iv%instid(i)%nlevels,iv%instid(i)%num_rad))
38 allocate (iv%instid(i)%mr (iv%instid(i)%nlevels,iv%instid(i)%num_rad))
39 allocate (iv%instid(i)%tm (kms:kme,iv%instid(i)%num_rad))
40 allocate (iv%instid(i)%qm (kms:kme,iv%instid(i)%num_rad))
41 allocate (iv%instid(i)%qrn(kms:kme,iv%instid(i)%num_rad))
42 allocate (iv%instid(i)%qcw(kms:kme,iv%instid(i)%num_rad))
43 if ( crtm_cloud ) then
44 allocate (iv%instid(i)%qci(kms:kme,iv%instid(i)%num_rad))
45 allocate (iv%instid(i)%qsn(kms:kme,iv%instid(i)%num_rad))
46 allocate (iv%instid(i)%qgr(kms:kme,iv%instid(i)%num_rad))
47 allocate (iv%instid(i)%qhl(kms:kme,iv%instid(i)%num_rad))
48 allocate (iv%instid(i)%rcw(kms:kme,iv%instid(i)%num_rad))
49 allocate (iv%instid(i)%rci(kms:kme,iv%instid(i)%num_rad))
50 allocate (iv%instid(i)%rrn(kms:kme,iv%instid(i)%num_rad))
51 allocate (iv%instid(i)%rsn(kms:kme,iv%instid(i)%num_rad))
52 allocate (iv%instid(i)%rgr(kms:kme,iv%instid(i)%num_rad))
53 allocate (iv%instid(i)%rhl(kms:kme,iv%instid(i)%num_rad))
55 allocate (iv%instid(i)%pm (kms:kme,iv%instid(i)%num_rad))
56 allocate (iv%instid(i)%pf (0:kme,iv%instid(i)%num_rad))
57 allocate (iv%instid(i)%u10(iv%instid(i)%num_rad))
58 allocate (iv%instid(i)%v10(iv%instid(i)%num_rad))
59 allocate (iv%instid(i)%t2m(iv%instid(i)%num_rad))
60 allocate (iv%instid(i)%q2m(iv%instid(i)%num_rad))
61 allocate (iv%instid(i)%mr2m(iv%instid(i)%num_rad))
62 allocate (iv%instid(i)%psfc(iv%instid(i)%num_rad))
63 allocate (iv%instid(i)%ts(iv%instid(i)%num_rad))
64 allocate (iv%instid(i)%smois(iv%instid(i)%num_rad))
65 allocate (iv%instid(i)%tslb(iv%instid(i)%num_rad))
66 allocate (iv%instid(i)%snowh(iv%instid(i)%num_rad))
67 allocate (iv%instid(i)%isflg(iv%instid(i)%num_rad))
68 allocate (iv%instid(i)%landsea_mask(iv%instid(i)%num_rad))
69 if (rtm_option == rtm_option_rttov) then
70 allocate (iv%instid(i)%surftype(iv%instid(i)%num_rad))
71 allocate (iv%instid(i)%snow_frac(iv%instid(i)%num_rad))
73 allocate (iv%instid(i)%elevation(iv%instid(i)%num_rad))
74 allocate (iv%instid(i)%vegfra(iv%instid(i)%num_rad))
75 allocate (iv%instid(i)%vegtyp(iv%instid(i)%num_rad))
76 allocate (iv%instid(i)%soiltyp(iv%instid(i)%num_rad))
77 allocate (iv%instid(i)%clwp(iv%instid(i)%num_rad))
78 if ( index(iv%instid(i)%rttovid_string, 'amsr2') > 0 ) then
79 allocate (iv%instid(i)%clw(iv%instid(i)%num_rad))
81 if ( index(iv%instid(i)%rttovid_string, 'ahi') > 0 ) then
82 allocate (iv%instid(i)%cloudflag(iv%instid(i)%num_rad))
84 if ( index(iv%instid(i)%rttovid_string, 'gmi') > 0 ) then
85 allocate (iv%instid(i)%clw(iv%instid(i)%num_rad))
87 allocate (iv%instid(i)%ps(iv%instid(i)%num_rad))
88 allocate (iv%instid(i)%tb_xb(nchan,iv%instid(i)%num_rad))
89 if ( crtm_cloud ) then
90 allocate (iv%instid(i)%tb_xb_clr(nchan,iv%instid(i)%num_rad))
91 allocate (iv%instid(i)%cip(iv%instid(i)%num_rad))
93 allocate (iv%instid(i)%tb_qc(nchan,iv%instid(i)%num_rad))
94 allocate (iv%instid(i)%tb_inv(nchan,iv%instid(i)%num_rad))
95 allocate (iv%instid(i)%tb_error(nchan,iv%instid(i)%num_rad))
96 allocate (iv%instid(i)%tb_sens(nchan,iv%instid(i)%num_rad))
97 allocate (iv%instid(i)%tb_imp(nchan,iv%instid(i)%num_rad))
98 allocate (iv%instid(i)%rad_xb(nchan,iv%instid(i)%num_rad))
99 allocate (iv%instid(i)%rad_obs(nchan,iv%instid(i)%num_rad))
100 allocate (iv%instid(i)%rad_ovc(nchan,iv%instid(i)%nlevels,iv%instid(i)%num_rad))
101 allocate (iv%instid(i)%emiss(nchan,iv%instid(i)%num_rad))
102 allocate (iv%instid(i)%scanpos(iv%instid(i)%num_rad))
103 allocate (iv%instid(i)%scanline(iv%instid(i)%num_rad))
104 allocate (iv%instid(i)%ifgat(iv%instid(i)%num_rad))
105 allocate (iv%instid(i)%cloud_flag(nchan,iv%instid(i)%num_rad))
106 allocate (iv%instid(i)%rain_flag(iv%instid(i)%num_rad))
107 allocate (iv%instid(i)%satzen(iv%instid(i)%num_rad))
108 allocate (iv%instid(i)%satazi(iv%instid(i)%num_rad))
109 allocate (iv%instid(i)%solzen(iv%instid(i)%num_rad))
110 allocate (iv%instid(i)%solazi(iv%instid(i)%num_rad))
111 allocate (iv%instid(i)%tropt(iv%instid(i)%num_rad))
112 allocate (iv%instid(i)%gamma_jacobian(nchan,iv%instid(i)%num_rad))
113 allocate (iv%instid(i)%cloud_frac(iv%instid(i)%num_rad))
114 if ( use_clddet_zz ) then
115 iv%instid(i)%superob_width = 2*ahi_superob_halfwidth+1
116 allocate (iv%instid(i)%superob(iv%instid(i)%superob_width, &
117 iv%instid(i)%superob_width))
118 do iy = 1, iv%instid(i)%superob_width
119 do ix = 1, iv%instid(i)%superob_width
120 allocate (iv%instid(i)%superob(ix,iy)%cld_qc(iv%instid(i)%num_rad))
121 allocate (iv%instid(i)%superob(ix,iy)%tb_obs(nchan,iv%instid(i)%num_rad))
125 if ( use_rttov_kmatrix .or. use_crtm_kmatrix ) then
126 allocate(iv%instid(i)%ts_jacobian(nchan,iv%instid(i)%num_rad))
127 allocate(iv%instid(i)%ps_jacobian(nchan,iv%instid(i)%num_rad))
128 allocate(iv%instid(i)%emiss_jacobian(nchan,iv%instid(i)%num_rad))
129 allocate(iv%instid(i)%windspeed_jacobian(nchan,iv%instid(i)%num_rad))
130 allocate(iv%instid(i)%t_jacobian(nchan,iv%instid(i)%nlevels,iv%instid(i)%num_rad))
131 allocate(iv%instid(i)%q_jacobian(nchan,iv%instid(i)%nlevels,iv%instid(i)%num_rad))
133 if (rtm_option == rtm_option_crtm) then
134 allocate(iv%instid(i)%crtm_climat(iv%instid(i)%num_rad))
135 allocate(iv%instid(i)%water_coverage(iv%instid(i)%num_rad))
136 allocate(iv%instid(i)%land_coverage(iv%instid(i)%num_rad))
137 allocate(iv%instid(i)%ice_coverage(iv%instid(i)%num_rad))
138 allocate(iv%instid(i)%snow_coverage(iv%instid(i)%num_rad))
139 if (use_crtm_kmatrix) then
140 if ( crtm_cloud ) then
141 allocate(iv%instid(i)%water_jacobian(nchan,kte,iv%instid(i)%num_rad))
142 allocate(iv%instid(i)%ice_jacobian(nchan,kte,iv%instid(i)%num_rad))
143 allocate(iv%instid(i)%rain_jacobian(nchan,kte,iv%instid(i)%num_rad))
144 allocate(iv%instid(i)%snow_jacobian(nchan,kte,iv%instid(i)%num_rad))
145 allocate(iv%instid(i)%graupel_jacobian(nchan,kte,iv%instid(i)%num_rad))
146 allocate(iv%instid(i)%hail_jacobian(nchan,kte,iv%instid(i)%num_rad))
147 allocate(iv%instid(i)%water_r_jacobian(nchan,kte,iv%instid(i)%num_rad))
148 allocate(iv%instid(i)%ice_r_jacobian(nchan,kte,iv%instid(i)%num_rad))
149 allocate(iv%instid(i)%rain_r_jacobian(nchan,kte,iv%instid(i)%num_rad))
150 allocate(iv%instid(i)%snow_r_jacobian(nchan,kte,iv%instid(i)%num_rad))
151 allocate(iv%instid(i)%graupel_r_jacobian(nchan,kte,iv%instid(i)%num_rad))
152 allocate(iv%instid(i)%hail_r_jacobian(nchan,kte,iv%instid(i)%num_rad))
154 if ( calc_weightfunc ) then
155 allocate(iv%instid(i)%lod(nchan,iv%instid(i)%nlevels,iv%instid(i)%num_rad))
156 allocate(iv%instid(i)%lod_jacobian(nchan,iv%instid(i)%nlevels,iv%instid(i)%num_rad))
157 allocate(iv%instid(i)%trans(nchan,iv%instid(i)%nlevels,iv%instid(i)%num_rad))
158 allocate(iv%instid(i)%trans_jacobian(nchan,iv%instid(i)%nlevels,iv%instid(i)%num_rad))
159 allocate(iv%instid(i)%der_trans(nchan,iv%instid(i)%nlevels,iv%instid(i)%num_rad))
162 if (use_clddet==3) then
163 allocate (iv%instid(i)%kmin_t (iv%instid(i)%num_rad))
164 allocate (iv%instid(i)%kmax_p (iv%instid(i)%num_rad))
165 allocate (iv%instid(i)%sensitivity_ratio (nchan,iv%instid(i)%nlevels,iv%instid(i)%num_rad))
166 allocate (iv%instid(i)%p_chan_level (nchan,iv%instid(i)%num_rad))
172 call da_trace_exit("da_allocate_rad_iv")
174 end subroutine da_allocate_rad_iv