diff --git a/src/MINT/MINT_initial_XHc.c b/src/MINT/MINT_initial_XHc.c index 158761bc95fc3858b41c8e472a604422b60b25f0..e83120ee75c2f311f1186baf6c89cee53ee7b36b 100644 --- a/src/MINT/MINT_initial_XHc.c +++ b/src/MINT/MINT_initial_XHc.c @@ -11,27 +11,33 @@ double MINT_initial_XHc(struct stardata_t * const stardata) * Determine the initial central hydrogen abundance * in the MINT models */ - const double MINT_offset = 0.7 - 0.6985; + /* + const double MINT_offset = 0.7 - 0.6985; const double Z = Max(0.0, 0.760 - 3.0 * stardata->common.metallicity - MINT_offset); return Z; + */ - int i=1; + int i = 1; // XHC column const int nperline = stardata->store->MINT_tables[MINT_TABLE_MS]->ndata + stardata->store->MINT_tables[MINT_TABLE_MS]->nparam; - while(*(stardata->store->MINT_tables[MINT_TABLE_MS]->data + - MINT_MS_CENTRAL_HYDROGEN + - i*nperline) > - *(stardata->store->MINT_tables[MINT_TABLE_MS]->data + - MINT_MS_CENTRAL_HYDROGEN + - (i-1)*nperline)) + double * p = stardata->store->MINT_tables[MINT_TABLE_MS]->data + i; + double * const pmin = p; + double * const pmax = p + nperline * stardata->store->MINT_tables[MINT_TABLE_MS]->nlines; + + const double XHC0 = *p; /* first value */ + + /* + * While the abundance is increasing, keep looping through + * lines of data. When it + */ + while(p < pmax && *p >= XHC0) { - i++; + p += nperline; } - return *(stardata->store->MINT_tables[MINT_TABLE_MS]->data + - MINT_MS_CENTRAL_HYDROGEN + - (i-1)*nperline); + p = Max(p - nperline, pmin); + return *p; } #endif //MINT diff --git a/src/binary_c_parameters.h b/src/binary_c_parameters.h index 04660e8e891b4cf2015af47e834dc0051a3d629c..dcf45b9e92efd776ae8ebf2d805b5bfc06621f3a 100644 --- a/src/binary_c_parameters.h +++ b/src/binary_c_parameters.h @@ -64,7 +64,7 @@ * * Post-MS evolution has not yet been implemented. */ -//#define MINT +#define MINT /************************************************************ diff --git a/src/timestep/timestep_CHeB.c b/src/timestep/timestep_CHeB.c index bb7319eae37a07fb657d0ddbf9d190376231b7e3..d3afe5e9686542206ac4052cff3323e322269ea2 100644 --- a/src/timestep/timestep_CHeB.c +++ b/src/timestep/timestep_CHeB.c @@ -5,8 +5,12 @@ No_empty_translation_unit_warning; void timestep_CHeB(Timestep_prototype_args) { - if(stardata->preferences->stellar_structure_algorithm == STELLAR_STRUCTURE_ALGORITHM_MINT && - MINT_has_table(MINT_TABLE_CHeB_TA)) + if(stardata->preferences->stellar_structure_algorithm == STELLAR_STRUCTURE_ALGORITHM_MINT +#ifdef MINT + && + MINT_has_table(MINT_TABLE_CHeB_TA) +#endif//MINT + ) { #ifdef MINT double phase_lifetime;