commit/enzo-dev: gbryan: Merged in brittonsmith/enzo-dev (pull request #432)

2 views
Skip to first unread message

commits...@bitbucket.org

unread,
Feb 19, 2019, 1:12:44 PM2/19/19
to enzo...@googlegroups.com
1 new commit in enzo-dev:

https://bitbucket.org/enzo/enzo-dev/commits/34ea7319c8c2/
Changeset: 34ea7319c8c2
Branch: week-of-code
User: gbryan
Date: 2019-02-19 18:12:37+00:00
Summary: Merged in brittonsmith/enzo-dev (pull request #432)

[bugfix] exit cleanly when use_grackle = 1 but enzo not built with grackle

Approved-by: Brian O'Shea <os...@msu.edu>
Approved-by: Greg Bryan <gbr...@astro.columbia.edu>
Approved-by: John Wise <jw...@physics.gatech.edu>
Affected #: 4 files

diff -r 8a9e85f4229b -r 34ea7319c8c2 src/enzo/ReadParameterFile.C
--- a/src/enzo/ReadParameterFile.C
+++ b/src/enzo/ReadParameterFile.C
@@ -523,9 +523,9 @@
ret += sscanf(line, "DrivenFlowAutoCorrl = %"FSYM"%"FSYM"%"FSYM,
DrivenFlowAutoCorrl, DrivenFlowAutoCorrl+1, DrivenFlowAutoCorrl+2);

+ ret += sscanf(line, "use_grackle = %"ISYM, &use_grackle);
#ifdef USE_GRACKLE
/* Grackle chemistry parameters */
- ret += sscanf(line, "use_grackle = %d", &grackle_data->use_grackle);
ret += sscanf(line, "with_radiative_cooling = %d",
&grackle_data->with_radiative_cooling);
ret += sscanf(line, "use_volumetric_heating_rate = %d",
@@ -1598,14 +1598,14 @@
#ifdef USE_GRACKLE
/* If using Grackle chemistry and cooling library, override all other
cooling machinery and do a translation of some of the parameters. */
- if (grackle_data->use_grackle == TRUE) {
- // grackle_data->use_grackle already set
+ if (use_grackle == TRUE) {
// grackle_data->with_radiative_cooling already set
// grackle_data->grackle_data_file already set
// grackle_data->UVbackground already set
// grackle_data->Compton_xray_heating already set
// grackle_data->LWbackground_intensity already set
// grackle_data->LWbackground_sawtooth_suppression already set
+ grackle_data->use_grackle = (Eint32) use_grackle;
grackle_data->Gamma = (double) Gamma;
grackle_data->primordial_chemistry = (Eint32) MultiSpecies;
grackle_data->metal_cooling = (Eint32) MetalCooling;
@@ -1668,6 +1668,10 @@
} // if (grackle_data->use_grackle == TRUE)

else {
+#else
+ if (use_grackle == TRUE) {
+ ENZO_FAIL("Error: Enzo must be compiled with 'make grackle-yes' to run with use_grackle = 1.\n");
+ }
#endif // USE_GRACKLE

/* If GadgetEquilibriumCooling == TRUE, we don't want MultiSpecies

diff -r 8a9e85f4229b -r 34ea7319c8c2 src/enzo/SetDefaultGlobalValues.C
--- a/src/enzo/SetDefaultGlobalValues.C
+++ b/src/enzo/SetDefaultGlobalValues.C
@@ -481,6 +481,7 @@
CloudyCoolingData.CMBTemperatureFloor = 1; // use CMB floor.
CloudyCoolingData.CloudyElectronFractionFactor = 9.153959e-3; // calculated using Cloudy 07.02 abundances

+ use_grackle = FALSE;
#ifdef USE_GRACKLE
// Grackle chemistry data structure.
chemistry_data *my_chemistry;

diff -r 8a9e85f4229b -r 34ea7319c8c2 src/enzo/WriteParameterFile.C
--- a/src/enzo/WriteParameterFile.C
+++ b/src/enzo/WriteParameterFile.C
@@ -483,9 +483,9 @@
fprintf(fptr, "DrivenFlowProfile = %"ISYM"\n", DrivenFlowProfile);
if (DrivenFlowProfile)
Forcing.WriteParameters(fptr);
+ fprintf(fptr, "use_grackle = %"ISYM"\n", use_grackle);
#ifdef USE_GRACKLE
/* Grackle chemistry parameters */
- fprintf(fptr, "use_grackle = %d\n", grackle_data->use_grackle);
fprintf(fptr, "with_radiative_cooling = %d\n", grackle_data->with_radiative_cooling);
fprintf(fptr, "use_volumetric_heating_rate = %d\n", grackle_data->use_volumetric_heating_rate);
fprintf(fptr, "use_specific_heating_rate = %d\n", grackle_data->use_specific_heating_rate);

diff -r 8a9e85f4229b -r 34ea7319c8c2 src/enzo/global_data.h
--- a/src/enzo/global_data.h
+++ b/src/enzo/global_data.h
@@ -349,6 +349,7 @@
EXTERN int RadiativeCooling;
EXTERN CoolDataType CoolData;
EXTERN int RadiativeCoolingModel;
+EXTERN int use_grackle;

/* Cloudy cooling parameters and data. */

Repository URL: https://bitbucket.org/enzo/enzo-dev/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
Reply all
Reply to author
Forward
0 new messages