19#define AERO_REP_SINGLE_PARTICLE 1
20#define AERO_REP_MODAL_BINNED_MASS 2
34 int aero_phase_idx,
bool *jac_struct) {
35 int num_flagged_elem = 0;
38 int *aero_rep_int_data = &(
41 double *aero_rep_float_data =
46 int aero_rep_type = *(aero_rep_int_data++);
49 switch (aero_rep_type) {
52 model_data, aero_phase_idx, aero_rep_int_data, aero_rep_float_data,
57 model_data, aero_phase_idx, aero_rep_int_data, aero_rep_float_data,
62 return num_flagged_elem;
76 for (
int i_aero_rep = 0; i_aero_rep < n_aero_rep; i_aero_rep++) {
78 int *aero_rep_int_data = &(
81 double *aero_rep_float_data =
86 int aero_rep_type = *(aero_rep_int_data++);
89 switch (aero_rep_type) {
92 aero_rep_int_data, aero_rep_float_data, state_flags);
96 aero_rep_int_data, aero_rep_float_data, state_flags);
112 for (
int i_aero_rep = 0; i_aero_rep < n_aero_rep; i_aero_rep++) {
114 int *aero_rep_int_data = &(
117 double *aero_rep_float_data =
120 double *aero_rep_env_data =
125 int aero_rep_type = *(aero_rep_int_data++);
128 switch (aero_rep_type) {
131 model_data, aero_rep_int_data, aero_rep_float_data,
153 for (
int i_aero_rep = 0; i_aero_rep < n_aero_rep; i_aero_rep++) {
155 int *aero_rep_int_data = &(
158 double *aero_rep_float_data =
161 double *aero_rep_env_data =
166 int aero_rep_type = *(aero_rep_int_data++);
169 switch (aero_rep_type) {
200 int aero_phase_idx,
double *radius,
201 double *partial_deriv) {
203 int *aero_rep_int_data = &(
206 double *aero_rep_float_data =
209 double *aero_rep_env_data =
214 int aero_rep_type = *(aero_rep_int_data++);
217 switch (aero_rep_type) {
220 model_data, aero_phase_idx, radius, partial_deriv, aero_rep_int_data,
221 aero_rep_float_data, aero_rep_env_data);
225 model_data, aero_phase_idx, radius, partial_deriv, aero_rep_int_data,
226 aero_rep_float_data, aero_rep_env_data);
251 int aero_phase_idx,
double *number_conc,
252 double *partial_deriv) {
254 int *aero_rep_int_data = &(
257 double *aero_rep_float_data =
260 double *aero_rep_env_data =
265 int aero_rep_type = *(aero_rep_int_data++);
268 switch (aero_rep_type) {
271 model_data, aero_phase_idx, number_conc, partial_deriv,
272 aero_rep_int_data, aero_rep_float_data, aero_rep_env_data);
276 model_data, aero_phase_idx, number_conc, partial_deriv,
277 aero_rep_int_data, aero_rep_float_data, aero_rep_env_data);
293 int aero_phase_idx) {
295 int aero_conc_type = 0;
298 int *aero_rep_int_data = &(
301 double *aero_rep_float_data =
304 double *aero_rep_env_data =
309 int aero_rep_type = *(aero_rep_int_data++);
312 switch (aero_rep_type) {
315 aero_phase_idx, &aero_conc_type, aero_rep_int_data,
316 aero_rep_float_data, aero_rep_env_data);
320 aero_phase_idx, &aero_conc_type, aero_rep_int_data,
321 aero_rep_float_data, aero_rep_env_data);
324 return aero_conc_type;
347 int aero_rep_idx,
int aero_phase_idx,
348 double *aero_phase_mass,
349 double *partial_deriv) {
351 int *aero_rep_int_data = &(
354 double *aero_rep_float_data =
357 double *aero_rep_env_data =
362 int aero_rep_type = *(aero_rep_int_data++);
365 switch (aero_rep_type) {
368 model_data, aero_phase_idx, aero_phase_mass, partial_deriv,
369 aero_rep_int_data, aero_rep_float_data, aero_rep_env_data);
373 model_data, aero_phase_idx, aero_phase_mass, partial_deriv,
374 aero_rep_int_data, aero_rep_float_data, aero_rep_env_data);
401 double *aero_phase_avg_MW,
402 double *partial_deriv) {
404 int *aero_rep_int_data = &(
407 double *aero_rep_float_data =
410 double *aero_rep_env_data =
415 int aero_rep_type = *(aero_rep_int_data++);
418 switch (aero_rep_type) {
421 model_data, aero_phase_idx, aero_phase_avg_MW, partial_deriv,
422 aero_rep_int_data, aero_rep_float_data, aero_rep_env_data);
426 model_data, aero_phase_idx, aero_phase_avg_MW, partial_deriv,
427 aero_rep_int_data, aero_rep_float_data, aero_rep_env_data);
444 int n_float_param,
int n_env_param,
445 int *int_param,
double *float_param,
451 int *aero_rep_int_data =
454 double *aero_rep_float_data = &(
471 *(aero_rep_int_data++) = aero_rep_type;
474 for (; n_int_param > 0; --n_int_param)
475 *(aero_rep_int_data++) = *(int_param++);
478 for (; n_float_param > 0; --n_float_param)
479 *(aero_rep_float_data++) = (double)*(float_param++);
493 int update_aero_rep_type,
void *update_data,
506 for (; (*aero_rep_id) < n_aero_rep; (*aero_rep_id)++) {
508 int *aero_rep_int_data =
511 double *aero_rep_float_data =
514 double *aero_rep_env_data =
519 int aero_rep_type = *(aero_rep_int_data++);
524 if (aero_rep_type == update_aero_rep_type) {
525 switch (aero_rep_type) {
528 (
void *)update_data, aero_rep_int_data, aero_rep_float_data,
533 (
void *)update_data, aero_rep_int_data, aero_rep_float_data,
554 "\n\nAerosol representation data\n\nnumber of aerosol "
555 "representations: %d\n\n",
559 for (
int i_aero_rep = 0; i_aero_rep < n_aero_rep; i_aero_rep++) {
561 int *aero_rep_int_data = &(
564 double *aero_rep_float_data =
569 int aero_rep_type = *(aero_rep_int_data++);
572 switch (aero_rep_type) {
575 aero_rep_float_data);
int aero_rep_get_aero_conc_type(ModelData *model_data, int aero_rep_idx, int aero_phase_idx)
Check whether aerosol concentrations are per-particle or total for each phase.
int aero_rep_get_used_jac_elem(ModelData *model_data, int aero_rep_idx, int aero_phase_idx, bool *jac_struct)
Flag Jacobian elements used to calculated mass, volume, etc.
void aero_rep_add_condensed_data(int aero_rep_type, int n_int_param, int n_float_param, int n_env_param, int *int_param, double *float_param, void *solver_data)
Add condensed data to the condensed data block for aerosol representations.
void aero_rep_free_update_data(void *update_data)
Free an update data object.
void aero_rep_get_aero_phase_mass__kg_m3(ModelData *model_data, int aero_rep_idx, int aero_phase_idx, double *aero_phase_mass, double *partial_deriv)
Get the total mass of an aerosol phase in this representation ( )
void aero_rep_update_env_state(ModelData *model_data)
Update the aerosol representations for new environmental conditions.
#define AERO_REP_MODAL_BINNED_MASS
void aero_rep_print_data(void *solver_data)
Print the aerosol representation data.
void aero_rep_update_state(ModelData *model_data)
Update the aerosol representations for a new state.
void aero_rep_get_aero_phase_avg_MW__kg_mol(ModelData *model_data, int aero_rep_idx, int aero_phase_idx, double *aero_phase_avg_MW, double *partial_deriv)
Get the average molecular weight of an aerosol phase in this representation ( )
void aero_rep_update_data(int cell_id, int *aero_rep_id, int update_aero_rep_type, void *update_data, void *solver_data)
Update aerosol representation data.
void aero_rep_get_number_conc__n_m3(ModelData *model_data, int aero_rep_idx, int aero_phase_idx, double *number_conc, double *partial_deriv)
Get the particle number concentration ( )
void aero_rep_get_effective_radius__m(ModelData *model_data, int aero_rep_idx, int aero_phase_idx, double *radius, double *partial_deriv)
Get the effective particle radius, (m)
#define AERO_REP_SINGLE_PARTICLE
void aero_rep_get_dependencies(ModelData *model_data, bool *state_flags)
Get state array elements used by aerosol representation functions.
Header file for abstract aerosol representation functions.
Header file for aerosol representations functions.
int aero_rep_single_particle_get_used_jac_elem(ModelData *model_data, int aero_phase_idx, int *aero_rep_int_data, double *aero_rep_float_data, bool *jac_struct)
Flag Jacobian elements used in calcualtions of mass and volume.
bool aero_rep_modal_binned_mass_update_data(void *update_data, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data)
Update the aerosol representation data.
void aero_rep_single_particle_get_aero_phase_avg_MW__kg_mol(ModelData *model_data, int aero_phase_idx, double *aero_phase_avg_MW, double *partial_deriv, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data)
Get the average molecular weight in an aerosol phase ( )
void aero_rep_modal_binned_mass_get_aero_phase_avg_MW__kg_mol(ModelData *model_data, int aero_phase_idx, double *aero_phase_avg_MW, double *partial_deriv, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data)
Get the average molecular weight in an aerosol phase ( )
void aero_rep_modal_binned_mass_get_number_conc__n_m3(ModelData *model_data, int aero_phase_idx, double *number_conc, double *partial_deriv, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data)
Get the particle number concentration ( )
void aero_rep_single_particle_get_effective_radius__m(ModelData *model_data, int aero_phase_idx, double *radius, double *partial_deriv, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data)
Get the effective particle radius (m)
void aero_rep_modal_binned_mass_update_state(ModelData *model_data, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data)
Update aerosol representation data for a new state.
void aero_rep_modal_binned_mass_get_aero_conc_type(int aero_phase_idx, int *aero_conc_type, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data)
Get the type of aerosol concentration used.
void aero_rep_single_particle_get_aero_conc_type(int aero_phase_idx, int *aero_conc_type, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data)
Get the type of aerosol concentration used.
void aero_rep_modal_binned_mass_update_env_state(ModelData *model_data, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data)
Update aerosol representation data for new environmental conditions.
void aero_rep_modal_binned_mass_print(int *aero_rep_int_data, double *aero_rep_float_data)
Print the mass-only modal/binned reaction parameters.
void aero_rep_modal_binned_mass_get_effective_radius__m(ModelData *model_data, int aero_phase_idx, double *radius, double *partial_deriv, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data)
Get the effective particle radius (m)
void aero_rep_modal_binned_mass_get_dependencies(int *aero_rep_int_data, double *aero_rep_float_data, bool *state_flags)
Flag elements on the state array used by this aerosol representation.
void aero_rep_single_particle_print(int *aero_rep_int_data, double *aero_rep_float_data)
Print the Single Particle reaction parameters.
void aero_rep_modal_binned_mass_get_aero_phase_mass__kg_m3(ModelData *model_data, int aero_phase_idx, double *aero_phase_mass, double *partial_deriv, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data)
Get the total mass in an aerosol phase ( )
void aero_rep_single_particle_update_env_state(ModelData *model_data, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data)
Update aerosol representation data for new environmental conditions.
bool aero_rep_single_particle_update_data(void *update_data, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data)
Update aerosol representation data.
void aero_rep_single_particle_get_dependencies(int *aero_rep_int_data, double *aero_rep_float_data, bool *state_flags)
Flag elements on the state array used by this aerosol representation.
int aero_rep_modal_binned_mass_get_used_jac_elem(ModelData *model_data, int aero_phase_idx, int *aero_rep_int_data, double *aero_rep_float_data, bool *jac_struct)
Flag Jacobian elements used in calcualtions of mass and volume.
void aero_rep_single_particle_get_aero_phase_mass__kg_m3(ModelData *model_data, int aero_phase_idx, double *aero_phase_mass, double *partial_deriv, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data)
Get the total mass in an aerosol phase ( )
void aero_rep_single_particle_get_number_conc__n_m3(ModelData *model_data, int aero_phase_idx, double *number_conc, double *partial_deriv, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data)
Get the particle number concentration ( )
void aero_rep_single_particle_update_state(ModelData *model_data, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data)
Update aerosol representation data for a new state.
int * aero_rep_int_indices
double * aero_rep_env_data
double * aero_rep_float_data
int * aero_rep_float_indices
double * grid_cell_aero_rep_env_data