68 cloudbox_limits.resize(2);
69 cloudbox_limits[0] = 0;
70 cloudbox_limits[1] = p_grid.
nelem()-1;
83 Tensor4& doit_i_field1D_spectrum,
86 const Index& stokes_dim,
87 const Agenda& opt_prop_part_agenda,
88 const Agenda& abs_scalar_gas_agenda,
89 const Agenda& spt_calc_agenda,
97 const Vector& scat_za_grid,
98 const Matrix& surface_emissivity_field,
102 out1<<
"Start DISORT calculation...\n";
104 if(pnd_field.
ncols() != 1)
106 "*pnd_field* is not 1D! \n"
107 "DISORT can only be used for 1D! \n" );
110 throw runtime_error(
"DISORT can only be used for unpolarized \n"
111 "calculations (i.e., stokes_dim=1),\n" );
125 if(cloudbox_limits.
nelem()!=2 || cloudbox_limits[0] != 0 ||
126 cloudbox_limits[1] != pnd_field.
npages()-1)
127 throw runtime_error(
"The cloudbox is not set correctly for DISORT.\n"
128 "Please use *cloudboxSetDisort*. \n");
131 scat_za_grid.
nelem(), 1, 1);
136 scat_za_grid.
nelem(), 1);
138 doit_i_field1D_spectrum= 0;
140 scat_i_lat.
resize(1,1,1,1,1,1,1);
142 scat_i_lon.
resize(1,1,1,1,1,1,1);
152 Matrix phase_function(nlyr,scat_data_raw[0].za_grid.nelem(), 0.);
155 Vector scat_angle_grid(scat_data_raw[0].za_grid.nelem(), 0.);
156 scat_angle_grid = scat_data_raw[0].za_grid;
160 Index n_legendre=nstr+1;
163 Matrix pmom(nlyr, n_legendre, 0.);
170 for (
Index i = 0; i<numu; i++)
171 umu[i]=cos(scat_za_grid[numu-i-1]*
PI/180);
186 Numeric albedo = 1-surface_emissivity_field(0,0);
191 Numeric btemp = t_field(0,0,0);
192 Numeric ttemp = t_field(cloudbox_limits[1], 0, 0);
222 memset (header, 0, 127);
223 Index header_len = 127;
226 Index maxulv = nlyr+1;
228 Index maxcmu = n_legendre-1;
244 for (
Index i = 0; i < t.nelem(); i++)
246 t[i] = t_field(cloudbox_limits[1]-i,0,0);
254 for (f_index = 0; f_index < f_grid.
nelem(); f_index ++)
264 abs_scalar_gas_agenda, spt_calc_agenda,
266 t_field, z_field, p_grid, vmr_field, f_index);
273 pmomCalc(pmom, phase_function, scat_angle_grid, n_legendre);
288 disort_(&nlyr, dtauc.get_c_array(),
289 ssalb.get_c_array(), pmom.get_c_array(),
290 t.get_c_array(), &wvnmlo, &wvnmhi,
291 &usrtau, &ntau, utau.get_c_array(),
292 &nstr, &usrang, &numu,
293 umu.get_c_array(), &nphi,
296 &umu0, &phi0, &fisot,
298 &albedo, hl.get_c_array(),
299 &btemp, &ttemp, &temis,
301 &plank, &onlyfl, &accur,
305 &maxphi, rfldir.get_c_array(),
307 flup.get_c_array(), dfdt.get_c_array(),
309 uu.get_c_array(), u0u.get_c_array(),
310 albmed.get_c_array(),
311 trnmed.get_c_array(),
317 for(
Index j = 0; j<numu; j++)
319 for(
Index k = 0; k< nlyr; k++)
320 doit_i_field1D_spectrum(f_index, k+1, j, 0) =
323 scat_i_p(f_index, 0, 0, 0, j, 0, 0) =
325 scat_i_p(f_index, 1, 0, 0, j, 0, 0) =
357 throw runtime_error (
"This version of ARTS was compiled without DISORT support.");