71 const Agenda& opt_prop_part_agenda,
72 const Agenda& propmat_clearsky_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.);
99 Vector ext_vector(Np_cloud);
100 Vector abs_vector(Np_cloud);
104 propmat_clearsky_local = 0.;
107 for(
Index scat_p_index_local = 0; scat_p_index_local < Np_cloud;
108 scat_p_index_local ++)
110 rtp_temperature_local =
111 t_field(scat_p_index_local, 0, 0);
117 scat_p_index_local, 0, 0,
118 rtp_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 ext=.5*(ext_vector[i]+ext_vector[i+1]);
142 abs=.5*(abs_vector[i]+abs_vector[i+1]);
145 ssalb[Np_cloud-2-i]=(ext-
abs)/ext;
147 rtp_pressure_local = 0.5 * (p_grid[i] + p_grid[i+1]);
148 rtp_temperature_local = 0.5 * (t_field(i,0,0) + t_field(i+1,0,0));
152 rtp_vmr_local[j] = 0.5 * (vmr_field(j, i, 0, 0) +
153 vmr_field(j, i+1, 0, 0));
155 const Vector rtp_mag_dummy(3,0);
156 const Vector ppath_los_dummy;
159 propmat_clearsky_local,
161 rtp_mag_dummy,ppath_los_dummy,
163 rtp_temperature_local,
165 propmat_clearsky_agenda);
167 Numeric abs_total = propmat_clearsky_local(
joker,0,0,0).sum();
169 dtauc[Np_cloud-2-i]=(ext+
abs+abs_total)*
170 (z_field(i+1, 0, 0)-z_field(i, 0, 0));
196 scat_data_array_mono[0].za_grid.
nelem(), 0.);
199 for (
Index i_p = 0; i_p < pnd_field.
npages(); i_p++)
202 for (
Index i_t = 0; i_t < scat_data_array_mono[0].za_grid.
nelem(); i_t++)
207 for (
Index j = 0; j < scat_data_array_mono.
nelem(); j++)
208 sca_coeff += pnd_field(j, i_p, 0, 0) *
209 (scat_data_array_mono[j].ext_mat_data(0, 0, 0, 0, 0)-
210 scat_data_array_mono[j].abs_vec_data(0, 0, 0, 0, 0));
213 for (
Index j = 0; j < scat_data_array_mono.
nelem(); j++)
216 phase_function_level(i_p, i_t) +=
217 pnd_field(j, i_p, 0, 0) *
218 scat_data_array_mono[j].pha_mat_data(0, 0, i_t, 0, 0, 0, 0)
227 for (
Index i_l = 0; i_l < pnd_field.
npages()-1; i_l++)
229 for (
Index i_t=0; i_t < phase_function_level.
ncols(); i_t++)
231 if (phase_function_level(i_l, i_t) !=0 &&
232 phase_function_level(i_l+1, i_t) !=0)
233 phase_function(i_l, i_t) = .5*
234 (phase_function_level(i_l, i_t)+
235 phase_function_level(i_l+1, i_t));
260 const Index n_legendre,
264 Numeric p0_1, p0_2, p1_1, p1_2, p2_1, p2_2;
269 for (
Index i = 0; i< 181; i++)
270 za_grid[i] =
double(i);
273 gridpos(gp, scat_angle_grid, za_grid);
279 for (
Index i_l=0; i_l < phase_function.
nrows(); i_l++)
283 u[i] = cos(za_grid[i] *
PI/180.);
285 for (
Index i_l=0; i_l < phase_function.
nrows(); i_l++)
290 pint+=0.5*(phase_int(i_l, i)+phase_int(i_l, i+1))*
294 if (
abs(2.-pint) > 1e-4)
297 out1 <<
"Warning: The phase function is not normalized to 2\n"
298 <<
"The value is:" << pint <<
"\n";
301 pmom(i_l,
joker)= 0.;
308 pmom(phase_function.
nrows()-1-i_l,0)=1.;
317 pmom(phase_function.
nrows()-1-i_l,1)+=0.5*0.5*
318 (p1_1*phase_int(i_l, i)+
319 p1_2*phase_int(i_l, i+1))
322 for (
Index l=2; l<n_legendre; l++)
324 p2_1=(2*(double)l-1)/(double)l*u[i]*p1_1-((
double)l-1)/
326 p2_2=(2*(double)l-1)/(double)l*u[i+1]*p1_2-((
double)l-1)/
329 pmom(phase_function.
nrows()-1-i_l, l)+=0.5*0.5*
330 (p2_1*phase_int(i_l, i)+
331 p2_2*phase_int(i_l, i+1))
375 return a * f*f*f / ( exp( b*f/t ) - 1 );