CAMP 1.0.0
Chemistry Across Multiple Phases
|
ZSR Aerosol Water sub model solver functions. More...
Go to the source code of this file.
Macros | |
#define | TEMPERATURE_K_ env_data[0] |
#define | PRESSURE_PA_ env_data[1] |
#define | MINIMUM_WATER_MASS_ 1.0e-30L |
#define | ALPHA_ (-100.0) |
#define | ACT_TYPE_JACOBSON 1 |
#define | ACT_TYPE_EQSAM 2 |
#define | NUM_PHASE_ (int_data[0]) |
#define | GAS_WATER_ID_ (int_data[1] - 1) |
#define | NUM_ION_PAIR_ (int_data[2]) |
#define | INT_DATA_SIZE_ (int_data[3]) |
#define | FLOAT_DATA_SIZE_ (int_data[4]) |
#define | PPM_TO_RH_ (sub_model_env_data[0]) |
#define | NUM_INT_PROP_ 5 |
#define | NUM_REAL_PROP_ 0 |
#define | NUM_ENV_PARAM_ 1 |
#define | PHASE_ID_(p) (int_data[NUM_INT_PROP_ + p] - 1) |
#define | PAIR_INT_PARAM_LOC_(x) (int_data[NUM_INT_PROP_ + NUM_PHASE_ + x] - 1) |
#define | PAIR_FLOAT_PARAM_LOC_(x) (int_data[NUM_INT_PROP_ + NUM_PHASE_ + NUM_ION_PAIR_ + x] - 1) |
#define | TYPE_(x) (int_data[PAIR_INT_PARAM_LOC_(x)]) |
#define | JACOB_NUM_CATION_(x) (int_data[PAIR_INT_PARAM_LOC_(x) + 1]) |
#define | JACOB_NUM_ANION_(x) (int_data[PAIR_INT_PARAM_LOC_(x) + 2]) |
#define | JACOB_CATION_ID_(x) (int_data[PAIR_INT_PARAM_LOC_(x) + 3]) |
#define | JACOB_ANION_ID_(x) (int_data[PAIR_INT_PARAM_LOC_(x) + 4]) |
#define | JACOB_NUM_Y_(x) (int_data[PAIR_INT_PARAM_LOC_(x) + 5]) |
#define | JACOB_GAS_WATER_JAC_ID_(p, x) int_data[PAIR_INT_PARAM_LOC_(x) + 6 + p] |
#define | JACOB_CATION_JAC_ID_(p, x) int_data[PAIR_INT_PARAM_LOC_(x) + 6 + NUM_PHASE_ + p] |
#define | JACOB_ANION_JAC_ID_(p, x) int_data[PAIR_INT_PARAM_LOC_(x) + 6 + 2 * NUM_PHASE_ + p] |
#define | EQSAM_NUM_ION_(x) (int_data[PAIR_INT_PARAM_LOC_(x) + 1]) |
#define | EQSAM_GAS_WATER_JAC_ID_(p, x) (int_data[PAIR_INT_PARAM_LOC_(x) + 2 + p]) |
#define | EQSAM_ION_ID_(x, y) (int_data[PAIR_INT_PARAM_LOC_(x) + 2 + NUM_PHASE_ + y]) |
#define | EQSAM_ION_JAC_ID_(p, x, y) |
#define | JACOB_low_RH_(x) (float_data[PAIR_FLOAT_PARAM_LOC_(x)]) |
#define | JACOB_CATION_MW_(x) (float_data[PAIR_FLOAT_PARAM_LOC_(x) + 1]) |
#define | JACOB_ANION_MW_(x) (float_data[PAIR_FLOAT_PARAM_LOC_(x) + 2]) |
#define | JACOB_Y_(x, y) (float_data[PAIR_FLOAT_PARAM_LOC_(x) + 3 + y]) |
#define | EQSAM_NW_(x) (float_data[PAIR_FLOAT_PARAM_LOC_(x)]) |
#define | EQSAM_ZW_(x) (float_data[PAIR_FLOAT_PARAM_LOC_(x) + 1]) |
#define | EQSAM_ION_PAIR_MW_(x) (float_data[PAIR_FLOAT_PARAM_LOC_(x) + 2]) |
#define | EQSAM_ION_MW_(x, y) (float_data[PAIR_FLOAT_PARAM_LOC_(x) + 3 + y]) |
Functions | |
void | sub_model_ZSR_aerosol_water_get_used_jac_elem (int *sub_model_int_data, double *sub_model_float_data, Jacobian *jac) |
Flag Jacobian elements used by this sub model. | |
void | sub_model_ZSR_aerosol_water_update_ids (int *sub_model_int_data, double *sub_model_float_data, int *deriv_ids, Jacobian jac) |
Update the time derivative and Jacbobian array indices. | |
void | sub_model_ZSR_aerosol_water_update_env_state (int *sub_model_int_data, double *sub_model_float_data, double *sub_model_env_data, ModelData *model_data) |
Update sub model data for new environmental conditions. | |
void | sub_model_ZSR_aerosol_water_calculate (int *sub_model_int_data, double *sub_model_float_data, double *sub_model_env_data, ModelData *model_data) |
Do pre-derivative calculations. | |
void | sub_model_ZSR_aerosol_water_get_jac_contrib (int *sub_model_int_data, double *sub_model_float_data, double *sub_model_env_data, ModelData *model_data, realtype *J, double time_step) |
Add contributions to the Jacobian from derivates calculated using the output of this sub model. | |
void | sub_model_ZSR_aerosol_water_print (int *sub_model_int_data, double *sub_model_float_data) |
Print the ZSR Aerosol Water sub model parameters. | |
ZSR Aerosol Water sub model solver functions.
Definition in file sub_model_ZSR_aerosol_water.c.
#define ACT_TYPE_EQSAM 2 |
Definition at line 28 of file sub_model_ZSR_aerosol_water.c.
#define ACT_TYPE_JACOBSON 1 |
Definition at line 27 of file sub_model_ZSR_aerosol_water.c.
#define ALPHA_ (-100.0) |
Definition at line 25 of file sub_model_ZSR_aerosol_water.c.
#define EQSAM_GAS_WATER_JAC_ID_ | ( | p, | |
x | |||
) | (int_data[PAIR_INT_PARAM_LOC_(x) + 2 + p]) |
Definition at line 55 of file sub_model_ZSR_aerosol_water.c.
#define EQSAM_ION_ID_ | ( | x, | |
y | |||
) | (int_data[PAIR_INT_PARAM_LOC_(x) + 2 + NUM_PHASE_ + y]) |
Definition at line 56 of file sub_model_ZSR_aerosol_water.c.
#define EQSAM_ION_JAC_ID_ | ( | p, | |
x, | |||
y | |||
) |
Definition at line 58 of file sub_model_ZSR_aerosol_water.c.
#define EQSAM_ION_MW_ | ( | x, | |
y | |||
) | (float_data[PAIR_FLOAT_PARAM_LOC_(x) + 3 + y]) |
Definition at line 68 of file sub_model_ZSR_aerosol_water.c.
#define EQSAM_ION_PAIR_MW_ | ( | x | ) | (float_data[PAIR_FLOAT_PARAM_LOC_(x) + 2]) |
Definition at line 67 of file sub_model_ZSR_aerosol_water.c.
#define EQSAM_NUM_ION_ | ( | x | ) | (int_data[PAIR_INT_PARAM_LOC_(x) + 1]) |
Definition at line 54 of file sub_model_ZSR_aerosol_water.c.
#define EQSAM_NW_ | ( | x | ) | (float_data[PAIR_FLOAT_PARAM_LOC_(x)]) |
Definition at line 65 of file sub_model_ZSR_aerosol_water.c.
#define EQSAM_ZW_ | ( | x | ) | (float_data[PAIR_FLOAT_PARAM_LOC_(x) + 1]) |
Definition at line 66 of file sub_model_ZSR_aerosol_water.c.
#define FLOAT_DATA_SIZE_ (int_data[4]) |
Definition at line 34 of file sub_model_ZSR_aerosol_water.c.
#define GAS_WATER_ID_ (int_data[1] - 1) |
Definition at line 31 of file sub_model_ZSR_aerosol_water.c.
#define INT_DATA_SIZE_ (int_data[3]) |
Definition at line 33 of file sub_model_ZSR_aerosol_water.c.
#define JACOB_ANION_ID_ | ( | x | ) | (int_data[PAIR_INT_PARAM_LOC_(x) + 4]) |
Definition at line 47 of file sub_model_ZSR_aerosol_water.c.
#define JACOB_ANION_JAC_ID_ | ( | p, | |
x | |||
) | int_data[PAIR_INT_PARAM_LOC_(x) + 6 + 2 * NUM_PHASE_ + p] |
Definition at line 52 of file sub_model_ZSR_aerosol_water.c.
#define JACOB_ANION_MW_ | ( | x | ) | (float_data[PAIR_FLOAT_PARAM_LOC_(x) + 2]) |
Definition at line 63 of file sub_model_ZSR_aerosol_water.c.
#define JACOB_CATION_ID_ | ( | x | ) | (int_data[PAIR_INT_PARAM_LOC_(x) + 3]) |
Definition at line 46 of file sub_model_ZSR_aerosol_water.c.
#define JACOB_CATION_JAC_ID_ | ( | p, | |
x | |||
) | int_data[PAIR_INT_PARAM_LOC_(x) + 6 + NUM_PHASE_ + p] |
Definition at line 50 of file sub_model_ZSR_aerosol_water.c.
#define JACOB_CATION_MW_ | ( | x | ) | (float_data[PAIR_FLOAT_PARAM_LOC_(x) + 1]) |
Definition at line 62 of file sub_model_ZSR_aerosol_water.c.
#define JACOB_GAS_WATER_JAC_ID_ | ( | p, | |
x | |||
) | int_data[PAIR_INT_PARAM_LOC_(x) + 6 + p] |
Definition at line 49 of file sub_model_ZSR_aerosol_water.c.
#define JACOB_low_RH_ | ( | x | ) | (float_data[PAIR_FLOAT_PARAM_LOC_(x)]) |
Definition at line 61 of file sub_model_ZSR_aerosol_water.c.
#define JACOB_NUM_ANION_ | ( | x | ) | (int_data[PAIR_INT_PARAM_LOC_(x) + 2]) |
Definition at line 45 of file sub_model_ZSR_aerosol_water.c.
#define JACOB_NUM_CATION_ | ( | x | ) | (int_data[PAIR_INT_PARAM_LOC_(x) + 1]) |
Definition at line 44 of file sub_model_ZSR_aerosol_water.c.
#define JACOB_NUM_Y_ | ( | x | ) | (int_data[PAIR_INT_PARAM_LOC_(x) + 5]) |
Definition at line 48 of file sub_model_ZSR_aerosol_water.c.
#define JACOB_Y_ | ( | x, | |
y | |||
) | (float_data[PAIR_FLOAT_PARAM_LOC_(x) + 3 + y]) |
Definition at line 64 of file sub_model_ZSR_aerosol_water.c.
#define MINIMUM_WATER_MASS_ 1.0e-30L |
Definition at line 22 of file sub_model_ZSR_aerosol_water.c.
#define NUM_ENV_PARAM_ 1 |
Definition at line 38 of file sub_model_ZSR_aerosol_water.c.
#define NUM_INT_PROP_ 5 |
Definition at line 36 of file sub_model_ZSR_aerosol_water.c.
#define NUM_ION_PAIR_ (int_data[2]) |
Definition at line 32 of file sub_model_ZSR_aerosol_water.c.
#define NUM_PHASE_ (int_data[0]) |
Definition at line 30 of file sub_model_ZSR_aerosol_water.c.
#define NUM_REAL_PROP_ 0 |
Definition at line 37 of file sub_model_ZSR_aerosol_water.c.
#define PAIR_FLOAT_PARAM_LOC_ | ( | x | ) | (int_data[NUM_INT_PROP_ + NUM_PHASE_ + NUM_ION_PAIR_ + x] - 1) |
Definition at line 41 of file sub_model_ZSR_aerosol_water.c.
#define PAIR_INT_PARAM_LOC_ | ( | x | ) | (int_data[NUM_INT_PROP_ + NUM_PHASE_ + x] - 1) |
Definition at line 40 of file sub_model_ZSR_aerosol_water.c.
#define PHASE_ID_ | ( | p | ) | (int_data[NUM_INT_PROP_ + p] - 1) |
Definition at line 39 of file sub_model_ZSR_aerosol_water.c.
#define PPM_TO_RH_ (sub_model_env_data[0]) |
Definition at line 35 of file sub_model_ZSR_aerosol_water.c.
#define PRESSURE_PA_ env_data[1] |
Definition at line 19 of file sub_model_ZSR_aerosol_water.c.
#define TEMPERATURE_K_ env_data[0] |
Definition at line 18 of file sub_model_ZSR_aerosol_water.c.
#define TYPE_ | ( | x | ) | (int_data[PAIR_INT_PARAM_LOC_(x)]) |
Definition at line 43 of file sub_model_ZSR_aerosol_water.c.
void sub_model_ZSR_aerosol_water_calculate | ( | int * | sub_model_int_data, |
double * | sub_model_float_data, | ||
double * | sub_model_env_data, | ||
ModelData * | model_data | ||
) |
Do pre-derivative calculations.
sub_model_int_data | Pointer to the sub model integer data |
sub_model_float_data | Pointer to the sub model floating-point data |
sub_model_env_data | Pointer to the sub model environment-dependent data |
model_data | Pointer to the model data, including the state array |
Definition at line 216 of file sub_model_ZSR_aerosol_water.c.
void sub_model_ZSR_aerosol_water_get_jac_contrib | ( | int * | sub_model_int_data, |
double * | sub_model_float_data, | ||
double * | sub_model_env_data, | ||
ModelData * | model_data, | ||
realtype * | J, | ||
double | time_step | ||
) |
Add contributions to the Jacobian from derivates calculated using the output of this sub model.
sub_model_int_data | Pointer to the sub model integer data |
sub_model_float_data | Pointer to the sub model floating-point data |
sub_model_env_data | Pointer to the sub model environment-dependent data |
model_data | Pointer to the model data |
J | Jacobian to be calculated |
time_step | Current time step [s] |
Definition at line 314 of file sub_model_ZSR_aerosol_water.c.
void sub_model_ZSR_aerosol_water_get_used_jac_elem | ( | int * | sub_model_int_data, |
double * | sub_model_float_data, | ||
Jacobian * | jac | ||
) |
Flag Jacobian elements used by this sub model.
ZSR aerosol water sub models are assumed to be at equilibrium
sub_model_int_data | Pointer to the sub model integer data |
sub_model_float_data | Pointer to the sub model floating-point data |
jac | Jacobian |
Definition at line 81 of file sub_model_ZSR_aerosol_water.c.
void sub_model_ZSR_aerosol_water_print | ( | int * | sub_model_int_data, |
double * | sub_model_float_data | ||
) |
Print the ZSR Aerosol Water sub model parameters.
sub_model_int_data | Pointer to the sub model integer data |
sub_model_float_data | Pointer to the sub model floating-point data |
Definition at line 445 of file sub_model_ZSR_aerosol_water.c.
void sub_model_ZSR_aerosol_water_update_env_state | ( | int * | sub_model_int_data, |
double * | sub_model_float_data, | ||
double * | sub_model_env_data, | ||
ModelData * | model_data | ||
) |
Update sub model data for new environmental conditions.
sub_model_int_data | Pointer to the sub model integer data |
sub_model_float_data | Pointer to the sub model floating-point data |
sub_model_env_data | Pointer to the sub model environment-dependent data |
model_data | Pointer to the model data |
Definition at line 189 of file sub_model_ZSR_aerosol_water.c.
void sub_model_ZSR_aerosol_water_update_ids | ( | int * | sub_model_int_data, |
double * | sub_model_float_data, | ||
int * | deriv_ids, | ||
Jacobian | jac | ||
) |
Update the time derivative and Jacbobian array indices.
ZSR aerosol water sub models are assumed to be at equilibrium
sub_model_int_data | Pointer to the sub model integer data |
sub_model_float_data | Pointer to the sub model floating-point data |
deriv_ids | Indices for state array variables on the solver state array |
jac | Jacobian |
Definition at line 133 of file sub_model_ZSR_aerosol_water.c.