71 const Agenda& opt_prop_part_agenda,
72 const Agenda& abs_scalar_gas_agenda,
73 const Agenda& spt_calc_agenda,
86 const Index stokes_dim = 1;
88 assert( dtauc.
nelem() == Np_cloud-1);
89 assert( ssalb.
nelem() == Np_cloud-1);
92 Matrix abs_vec_spt_local(N_pt, stokes_dim, 0.);
93 Tensor3 ext_mat_spt_local(N_pt, stokes_dim, stokes_dim, 0.);
98 Matrix abs_scalar_gas_local;
99 Vector ext_vector(Np_cloud);
100 Vector abs_vector(Np_cloud);
104 abs_scalar_gas_local = 0.;
107 for(
Index scat_p_index_local = 0; scat_p_index_local < Np_cloud;
108 scat_p_index_local ++)
110 rte_temperature_local =
111 t_field(scat_p_index_local, 0, 0);
117 scat_p_index_local, 0, 0,
118 rte_temperature_local,
123 ext_mat_local, abs_vec_local,
126 scat_p_index_local, 0, 0,
127 opt_prop_part_agenda);
129 ext_vector[scat_p_index_local] = ext_mat_local(0,0,0);
130 abs_vector[scat_p_index_local] = abs_vec_local(0,0);
136 for (
Index i = 0; i < Np_cloud-1; i++)
141 if ((ext_vector[i] && ext_vector[i+1])!=0 )
143 ext=.5*(ext_vector[i]+ext_vector[i+1]);
144 abs=.5*(abs_vector[i]+abs_vector[i+1]);
148 ssalb[Np_cloud-2-i]=(ext-
abs)/ext;
150 rte_pressure_local = 0.5 * (p_grid[i] + p_grid[i+1]);
151 rte_temperature_local = 0.5 * (t_field(i,0,0) + t_field(i+1,0,0));
155 rte_vmr_list_local[j] = 0.5 * (vmr_field(j, i, 0, 0) +
156 vmr_field(j, i+1, 0, 0));
160 abs_scalar_gas_local,
164 rte_temperature_local,
166 abs_scalar_gas_agenda);
168 Numeric abs_total = abs_scalar_gas_local(0,
joker).sum();
170 dtauc[Np_cloud-2-i]=(ext+
abs+abs_total)*
171 (z_field(i+1, 0, 0)-z_field(i, 0, 0));
197 scat_data_mono[0].za_grid.
nelem(), 0.);
200 for (
Index i_p = 0; i_p < pnd_field.
npages(); i_p++)
203 for (
Index i_t = 0; i_t < scat_data_mono[0].za_grid.
nelem(); i_t++)
208 for (
Index j = 0; j < scat_data_mono.
nelem(); j++)
209 sca_coeff += pnd_field(j, i_p, 0, 0) *
210 (scat_data_mono[j].ext_mat_data(0, 0, 0, 0, 0)-
211 scat_data_mono[j].abs_vec_data(0, 0, 0, 0, 0));
214 for (
Index j = 0; j < scat_data_mono.
nelem(); j++)
217 phase_function_level(i_p, i_t) +=
218 pnd_field(j, i_p, 0, 0) *
219 scat_data_mono[j].pha_mat_data(0, 0, i_t, 0, 0, 0, 0)
228 for (
Index i_l = 0; i_l < pnd_field.
npages()-1; i_l++)
230 for (
Index i_t=0; i_t < phase_function_level.
ncols(); i_t++)
232 if (phase_function_level(i_l, i_t) !=0 &&
233 phase_function_level(i_l+1, i_t) !=0)
234 phase_function(i_l, i_t) = .5*
235 (phase_function_level(i_l, i_t)+
236 phase_function_level(i_l+1, i_t));
261 const Index n_legendre,
265 Numeric p0_1, p0_2, p1_1, p1_2, p2_1, p2_2;
270 for (
Index i = 0; i< 181; i++)
271 za_grid[i] =
double(i);
274 gridpos(gp, scat_angle_grid, za_grid);
280 for (
Index i_l=0; i_l < phase_function.
nrows(); i_l++)
284 u[i] = cos(za_grid[i] *
PI/180.);
286 for (
Index i_l=0; i_l < phase_function.
nrows(); i_l++)
291 pint+=0.5*(phase_int(i_l, i)+phase_int(i_l, i+1))*
295 if (
abs(2.-pint) > 1e-4)
298 out1 <<
"Warning: The phase function is not normalized to 2\n"
299 <<
"The value is:" << pint <<
"\n";
302 pmom(i_l,
joker)= 0.;
309 pmom(phase_function.
nrows()-1-i_l,0)=1.;
318 pmom(phase_function.
nrows()-1-i_l,1)+=0.5*0.5*
319 (p1_1*phase_int(i_l, i)+
320 p1_2*phase_int(i_l, i+1))
323 for (
Index l=2; l<n_legendre; l++)
325 p2_1=(2*(double)l-1)/(double)l*u[i]*p1_1-((
double)l-1)/
327 p2_2=(2*(double)l-1)/(double)l*u[i+1]*p1_2-((
double)l-1)/
330 pmom(phase_function.
nrows()-1-i_l, l)+=0.5*0.5*
331 (p2_1*phase_int(i_l, i)+
332 p2_2*phase_int(i_l, i+1))
376 return a * f*f*f / ( exp( b*f/t ) - 1 );