Commits

gsiisg committed 55b6917 Merge

merged

  • Participants
  • Parent commits be4a2b0, 8849c95
  • Branches new-config

Comments (0)

Files changed (14)

File src/enzo/DoubleMachInitialize.C

 // This routine intializes a new simulation based on the parameter file.
 //
  
+#include "ParameterControl/ParameterControl.h"
+extern Configuration Param;
+
 #include <string.h>
 #include <stdio.h>
 #include <math.h>
 #include "Hierarchy.h"
 #include "TopGridData.h"
  
+const char config_double_mach_defaults[]= 
+"### DOUBLE MACH DEFAULTS ###\n"
+"\n"
+"Problem: {\n"
+"       DoubleMach: {\n"
+"               SubgridLeft     = 0.0;\n"
+"               SubgridRight    = 0.0;\n"
+"    };\n"
+"};\n";
+
 int DoubleMachInitialize(FILE *fptr, FILE *Outfptr, HierarchyEntry &TopGrid,
 			 TopGridData &MetaData, ExternalBoundary &Exterior)
 {
  
   float d0 = 8.0, e0 = 291.25, u0 = 8.25*sqrt(3.0)/2.0, v0 = -8.25*0.5, w0 = 0;
   FLOAT DoubleMachSubgridLeft   = 0.0;    // start of subgrid
-  FLOAT DoubleMachSubgridRight  = 0.0;    // end of subgrid
- 
+  FLOAT DoubleMachSubgridRight  = 0.0;    // end of subgrid 
+
   /* read input from file */
  
   while (fgets(line, MAX_LINE_LENGTH, fptr) != NULL) {
  
     /* read parameters */
  
-    ret += sscanf(line, "DoubleMachSubgridLeft = %"PSYM,
-		  &DoubleMachSubgridLeft);
-    ret += sscanf(line, "DoubleMachSubgridRight = %"PSYM,
-		  &DoubleMachSubgridRight);
+    Param.GetScalar(DoubleMachSubgridLeft,"Problem.DoubleMach.SubgridLeft");
+
+    Param.GetScalar(DoubleMachSubgridRight,"Problem.DoubleMach.SubgridRight");
  
     /* if the line is suspicious, issue a warning */
  

File src/enzo/FSProb_Initialize.C

 #include "FSProb.h"
 #include "CosmologyParameters.h"
 
+
+const char config_shock_in_a_box_defaults[] = 
+"### FSRADIATION PROBLEM  DEFAULTS ###\n"
+"\n"
+"Problem: {\n"
+"    FSRADIATION: {\n"
+"      Scaling = 1.0;\n"
+"      Theta = 1.0;\n"
+"      Opacity = 1.0e-31;\n"
+"      H2OpacityOn = 0;\n" 
+"      NGammaDot = 0.0;\n"
+"      EtaRadius = 0.0;\n"
+"      EtaCenter = [0];\n" 
+"      LimiterType = ;\n"
+"      BoundaryXoFaces = [0,0];\n"
+"      BoundaryX1Faces = [0,0];\n" 
+"      BoundaryX2Faces = [0,0];\n" 
+"      MaxDt = 0.0;\n"
+"      InitialGuess = 0.0;\n"
+"      Tolerance = 1e-5;\n"
+"      MaxMGIters = 50;\n"
+"      MGRelaxTypei = 2;\n"
+"      MGPreRelax = 5;\n"
+"      MGPostRelax = 5;\n"
+"\n"
+"    };\n"
+"};\n";
+
 // character strings
 EXTERN char outfilename[];
 
   kappa0  = 1.0e-31;    // negligible opacity
   kappa_h2on = 0;       // no spatially dependent (use background) opacity
   for (dim=0; dim<rank; dim++)       // set default radiation boundaries to 
-    for (face=0; face<2; face++)     // periodic in each direction
+z    for (face=0; face<2; face++)     // periodic in each direction
       BdryType[dim][face] = 0;
 
   // set default solver parameters
+  maxdt=0.0;
   initial_guess      = 0;         // previous time step
   sol_tolerance      = 1e-5;      // solver tolerance
   sol_printl         = 0;         // HYPRE print level
   int ret;
   char *dummy = new char[MAX_LINE_LENGTH];
   dummy[0] = 0;
-
+  // Update the parameter config to include the local defaults. Note
+  // that this does not overwrite values previously specified.
+  Param.Update(config_adiabatic_expansion_defaults);
+  
 
   Param.GetScalar(EScale,"Problem.FSRadiation.Scaling");
   Param.GetScalar(theta,"Problem.FSRadiation.Theta");
   Param.GetScalar(NGammaDot,"Problem.FSRadiation.NGammaDot");
   Param.GetScalar(EtaRadius,"Problem.FSRadiation.EtaRadius");
 
+  Param.GetArray(EtaCenter,"Problem.FSRadiation.EtaCenter");
+  Param.GetScalar(LimType,"Problem.FSRadiation.LimiterType");
 
-  ret += sscanf(line, "FSRadiationEtaCenter = %"FSYM" %"FSYM" %"FSYM, 
-		&(EtaCenter[0]), &(EtaCenter[1]), &(EtaCenter[2]));
-  
-  ret += sscanf(line, "FSRadiationLimiterType = %"ISYM, &LimType);
-  
-  ret += sscanf(line, "FSRadiationBoundaryX0Faces = %"ISYM" %"ISYM, 
-		BdryType[0], BdryType[0]+1);
-  if (rank > 1) {
-    ret += sscanf(line, "FSRadiationBoundaryX1Faces = %"ISYM" %"ISYM,
-		  BdryType[1], BdryType[1]+1);
-    if (rank > 2) {
-      ret += sscanf(line, "FSRadiationBoundaryX2Faces = %"ISYM" %"ISYM,
-		    BdryType[2], BdryType[2]+1);
+  Param.GetArray(BdryType[0],"Problem.FSRadiation.BoundaryX0Faces");
+  if (rank >1){
+    Param.GetArray(BdryType[1],"Problem.FSRadiation.BoundaryX1Faces");
+    if (rank >2){
+      Param.GetArray(BdryType[2],"Problem.FSRadiation.BoundaryX2Faces");
     }
   }
   

File src/enzo/GalaxySimulationInitialize.C

 ************************************************************************/
 
 // This routine intializes a new simulation based on the parameter file.
-//
+
+#include "ParameterControl/ParameterControl.h"
+extern Configuration Param;
 
 #ifdef USE_MPI
 #include "mpi.h"
 #include "LevelHierarchy.h"
 #include "TopGridData.h"
 
+const char config_galaxy_simulation_defaults[] =
+"### GALAXY SIMULATION DEFAULTS ###\n"
+"\n"
+"Problem: {\n"
+"    GalaxySimulation: {\n"
+"        RefineAtStart 		= TRUE;\n"
+"        InitialRefinementLevel	= 0;\n"
+"        UseMetallicityField  	= FALSE;\n"
+"        InitialTemperature 	= 1000.0;\n"
+"        Disk: {\n"
+"            Position		= [0.5,0.5,0.5];\n"
+"            Radius 		= 0.2;     # [Mpc]\n"
+"            Temperature 	= 1.e4;    # [K]\n"
+"            ScaleHeightz   	= 325e-6;\n"
+"            ScaleHeightR   	= 3500e-6;\n"
+"            GasMass		= 4.0e10;\n"
+"            GalaxyMass		= 1.0e12;\n"
+"        };\n"
+"        DarkMatterConcentrationParameter = 12;\n"
+"        InflowTime 		= -1;\n"
+"        InflowDensity		= 0;\n"
+"        AngularMomentum	= [0.0,0.0,0.0];\n"
+"        UniformVelocity        = [0.0,0.0,0.0];\n"
+"        UniformDensity		= 1.0;\n"
+"        UniformEnergy		= 1.0;\n"
+"        SubgridLeft		= 0.0;    # start of subgrid(s)\n"
+"        SubgridRight		= 0.0;    # end of subgrid(s)\n"
+"        
+"    };\n"
+"};\n";
+
+
+// Function Prototypes
+
 void WriteListOfFloats(FILE *fptr, int N, float floats[]);
 void WriteListOfFloats(FILE *fptr, int N, FLOAT floats[]);
 void AddLevel(LevelHierarchyEntry *Array[], HierarchyEntry *Grid, int level);
   /* declarations */
 
   char  line[MAX_LINE_LENGTH];
-  int   dim, ret, level, disk, i;
+  int   dim, level, disk, i;
 
   /* make sure it is 3D */
   
   int NumberOfSubgridZones[MAX_DIMENSION],
     SubgridDims[MAX_DIMENSION];
 
-  /* Default Values */
+  // Update the parameter config to include the local defaults. Note
+  // that this does not overwrite values previously specified.
+  Param.Update(config_galaxy_simulation_defaults);
 
-  GalaxySimulationRefineAtStart      = TRUE;
-  GalaxySimulationInitialRefinementLevel = 0;
-  GalaxySimulationUseMetallicityField  = FALSE;
-  GalaxySimulationInitialTemperature = 1000.0;
-  GalaxySimulationDiskRadius         = 0.2;      // [Mpc]
-  GalaxySimulationDiskTemperature    = 1.e4;     // [K]
-  GalaxySimulationDiskScaleHeightz   = 325e-6;
-  GalaxySimulationDiskScaleHeightR   = 3500e-6;
-  GalaxySimulationDarkMatterConcentrationParameter = 12;
-  GalaxySimulationGasMass            = 4.0e10;
-  GalaxySimulationGalaxyMass         = 1.0e12;
-  GalaxySimulationDiskTemperature    = 1000.0;
-  GalaxySimulationInflowTime         = -1;
-  GalaxySimulationInflowDensity      = 0;
-  for (dim = 0; dim < MAX_DIMENSION; dim++) {
-    GalaxySimulationDiskPosition[dim] = 0.5*(DomainLeftEdge[dim] +
-					     DomainRightEdge[dim]);
-    GalaxySimulationAngularMomentum[dim] = 0;
-    GalaxySimulationUniformVelocity[dim] = 0;
-  }
-  GalaxySimulationUniformDensity = 1.0;
-  GalaxySimulationUniformEnergy = 1.0;
-  
-  /* set no subgrids by default. */
-  
-  GalaxySimulationSubgridLeft         = 0.0;    // start of subgrid(s)
-  GalaxySimulationSubgridRight        = 0.0;    // end of subgrid(s)
 
-  /* read input from file */
+    /* read input from file */
 
-  while (fgets(line, MAX_LINE_LENGTH, fptr) != NULL) {
     
-    ret = 0;
-   
-    ret += sscanf(line, "GalaxySimulationRefineAtStart = %"ISYM,
-		  &GalaxySimulationRefineAtStart);
-    ret += sscanf(line, "GalaxySimulationInitialRefinementLevel = %"ISYM,
-		  &GalaxySimulationInitialRefinementLevel);
-    ret += sscanf(line, "GalaxySimulationUseMetallicityField = %"ISYM,
-		  &GalaxySimulationUseMetallicityField);
-    ret += sscanf(line, "GalaxySimulationInitialTemperature = %"FSYM,
-		  &GalaxySimulationInitialTemperature);
-    ret += sscanf(line, "GalaxySimulationUniformVelocity = %"FSYM" %"FSYM" %"FSYM,
-                  &GalaxySimulationUniformVelocity[0], &GalaxySimulationUniformVelocity[1],
-                  &GalaxySimulationUniformVelocity[2]);
-    ret += sscanf(line, "GalaxySimulationDiskRadius = %"PSYM,
-		  &GalaxySimulationDiskRadius);
-    ret += sscanf(line, "GalaxySimulationGalaxyMass = %"FSYM,
-		  &GalaxySimulationGalaxyMass);
-    ret += sscanf(line, "GalaxySimulationGasMass = %"FSYM,
-		  &GalaxySimulationGasMass);
-    ret += sscanf(line, "GalaxySimulationDiskPosition = %"PSYM" %"PSYM" %"PSYM, 
-		  &GalaxySimulationDiskPosition[0],
-		  &GalaxySimulationDiskPosition[1],
-		  &GalaxySimulationDiskPosition[2]);
-    ret += sscanf(line, "GalaxySimulationDiskScaleHeightz = %"PSYM,
-		  &GalaxySimulationDiskScaleHeightz);
-    ret += sscanf(line, "GalaxySimulationDiskScaleHeightR = %"PSYM,
-		  &GalaxySimulationDiskScaleHeightR);
-    ret += sscanf(line, "GalaxySimulationDarkMatterConcentrationParameter = %"FSYM,
-		  &GalaxySimulationDarkMatterConcentrationParameter);
-    ret += sscanf(line, "GalaxySimulationDiskTemperature = %"FSYM,
-		  &GalaxySimulationDiskTemperature);
-    ret += sscanf(line, "GalaxySimulationInflowTime = %"FSYM,
-		  &GalaxySimulationInflowTime);
-    ret += sscanf(line, "GalaxySimulationInflowDensity = %"FSYM,
-		  &GalaxySimulationInflowDensity);
-    ret += sscanf(line, "GalaxySimulationAngularMomentum = %"FSYM" %"FSYM" %"FSYM,
-		  &GalaxySimulationAngularMomentum[0],
-		  &GalaxySimulationAngularMomentum[1],
-		  &GalaxySimulationAngularMomentum[2]);
-    ret += sscanf(line, "GalaxySimulationSubgridLeft = %"PSYM,
-		  &GalaxySimulationSubgridLeft);
-    ret += sscanf(line, "GalaxySimulationSubgridRight = %"PSYM,
-		  &GalaxySimulationSubgridRight);
+    Param.GetScalar(GalaxySimulationRefineAtStart, "Problem.GalaxySimulation.RefineAtStart");
+    Param.GetScalar(GalaxySimulationInitialRefinementLevel, "Problem.GalaxySimulation.RefinementLevel");
+
+    Param.GetScalar(GaxySimulationUseMetallicityField, "Problem.GalaxySimulation.UseMetallicityField");
+    Param.GetScalar(GalaxySimulationInitialTemperature, "Problem.GalaxySimulation.Temperature");
+    Param.GetArray(GalaxySimulationUniformVelocity, "Problem.GalaxySimulation.UniformVelocity");
+
+    // Disk Parameters
+    Param.GetScalar(GalaxySimulationDiskRadius, "Problem.GalaxySimulation.Disk.Radius");
+    Param.GetScalar(GalaxySimulationGalaxyMass, "Problem.GalaxySimulation.Disk.Mass");
+    Param.GetScalar(GalaxySimulationGasMass, "Problem.GalaxySimulation.Disk.GasMass");
+    Param.GetArray(GalaxySimulationDiskPosition, "Problem.GalaxySimulation.Disk.Position");
+    Param.GetScalar(GalaxySimulationDiskScaleHeightz, "Problem.GalaxySimulation.Disk.ScaleHeightz");
+    Param.GetScalar(GalaxySimulationDiskScaleHeightR, "Problem.GalaxySimulation.Disk.ScaleHeightR");
+    Param.GetScalar(GalaxySimulationDiskTemperature, "Problem.GalaxySimulation.Disk.Temperature");
+
+    Param.GetScalar(GalaxySimulationDarkMatterConcentrationParameter,
+					"Problem.GalaxySimulation.DarkMatterConcentrationParameter");
+    Param.GetScalar(GalaxySimulationInflowTime, "Problem.GalaxySimulation.InflowTime");
+    Param.GetScalar(GalaxySimulationInflowDensity, "Problem.GalaxySimulation.InflowDensity");
+    Param.GetArray(GalaxySimulationAngularMomentum, "Problem.GalaxySimulation.AngularMomentum");
+
+    Param.GetScalar(GalaxySimulationSubgridLeft, "Problem.GalaxySimulation.SubgridLeft");
+    Param.GetScalar(GalaxySimulationSubgridRight, "Problem.GalaxySimulation.SubgridRight");
     
-    /* if the line is suspicious, issue a warning */
-    
-    if (ret == 0 && strstr(line, "=") && strstr(line, "GalaxySimulation") 
-	&& line[0] != '#')
-      fprintf(stderr, "warning: the following parameter line was not interpreted:\n%s\n", line);
-
-  } // end input from parameter file
 
 
   // do a couple of quick error checks

File src/enzo/HydroShockTubesInitialize.C

+#include "ParameterControl/ParameterControl.h"
+extern Configuration Param;
+
+
 #include <string.h>
 #include <stdio.h>
 #include <math.h>
 #include "LevelHierarchy.h"
 #include "TopGridData.h"
 
+/* Set default parameter values. */
+
+const char config_hydro_shocktubes_defaults[] =
+"### HYDRO SHOCKTUBES DEFAULTS ###\n"
+"\n"
+"Problem: {\n"
+"    HydroShocktubes: {\n"
+"        RefineAtStart		= FALSE;\n"
+"        InitialDiscontinuity 	= 0.5;\n"
+"        SecondDiscontinuity 	= 0.5;\n"
+"\n"
+"        LeftDensity 		= 1.0;\n"
+"	 RightDensity 		= 1.0;\n"
+"        CenterDensity 		= 1.0;\n"
+"\n"
+"        LeftPressure 		= 1.0;\n" 
+"        RightPressure 		= 1.0;\n"
+"        CenterPressure 	= 1.0;\n"
+"\n"
+"        LeftVelocity   = [0.0,0.0,0.0];\n"
+"        RightVelocity  = [0.0,0.0,0.0];\n"
+"        CenterVelocity = [1.0,1.0,1.0];\n"
+"    };\n"
+"};\n";
+
+
+
 int WriteAllData(char *basename, int filenumber,
 		 HierarchyEntry *TopGrid, TopGridData &MetaData, 
 		 ExternalBoundary *Exterior, FLOAT WriteTime);
   /* set default parameters */
 
   int RefineAtStart   = FALSE;
-  float  InitialDiscontinuity = 0.5, SecondDiscontinuity = 0.5,
-    LeftDensity = 1.0, RightDensity = 1.0, CenterDensity = 1.0, 
-    LeftVelocityX = 0.0, RightVelocityX = 0.0, CenterVelocityX = 1.0,
-    LeftVelocityY = 0.0, RightVelocityY = 0.0, CenterVelocityY = 1.0,
-    LeftVelocityZ = 0.0, RightVelocityZ = 0.0, CenterVelocityZ = 1.0,
-    LeftPressure = 1.0, RightPressure = 1.0, CenterPressure = 1.0;
+  float  InitialDiscontinuity, SecondDiscontinuity,
+    LeftDensity, RightDensity, CenterDensity, 
+    LeftPressure, RightPressure, CenterPressure;
+  float LeftVelocity[3];
+  float CenterVelocity[3];
+  float RightVelocity[3];
+ 
+  // Update the parameter config to include the local defaults. Note
+  // that this does not overwrite values previously specified.
+  Param.Update(config_hydro_shocktubes_defaults);
+ 
+
+  /* read parameters */
   
-  /* read input from file */
+  Param.GetScalar(HydroShockTubesRefineAtStart,
+		"Problem.HydroShocktube.RefineAtStart");
+  Param.GetScalar(HydroShockTubesInitialDiscontinuity,
+		"Problem.HydroShocktube.InitialDiscontinuity");
+  Param.GetScalar(HydroShockTubesSecondDiscontinuity,
+		"Problem.HydroShocktube.SecondDiscontinuity");
 
+  Param.GetArray(HydroShockTubesLeftVelocity,
+		"Problem.HydroShocktube.LeftVelocity");
+  Param.GetScalar(HydroShockTubesLeftPressure,
+		"Problem.HydroShocktube.LeftPressure");
+  Param.GetScalar(HydroShockTubesLeftDensity,
+		"Problem.HydroShocktube.LeftDensity");
 
-  while (fgets(line, MAX_LINE_LENGTH, fptr) != NULL) {
+  Param.GetArray(HydroShockTubesRightVelocity, 
+		"Probem.HydroShocktube.RightVelocity");
+  Param.GetScalar(HydroShockTubesRightPressure,
+		"Probem.HydroShocktube.RightPressure");
+  Param.GetScalar(HydroShockTubesRightDensity,
+		"Probem.HydroShocktube.RightDensity");
 
-    ret = 0;
+  Param.GetArray(HydroShockTubesCenterVelocity,
+		"Probem.HydroShocktube.CenterVelocity");
+  Param.GetScalar(HydroShockTubesCenterPressure, 
+		"Probem.HydroShocktube.CenterPressure");
+  Param.GetScalar(HydroShockTubesCenterDensity,
+                "Probem.HydroShocktube.CenterDensity");
 
-    /* read parameters */
-    ret += sscanf(line, "HydroShockTubesRefineAtStart = %"ISYM, 
-		  &RefineAtStart);
-    ret += sscanf(line, "HydroShockTubesInitialDiscontinuity = %"FSYM, 
-		  &InitialDiscontinuity);
-    ret += sscanf(line, "HydroShockTubesSecondDiscontinuity = %"FSYM, 
-		  &SecondDiscontinuity);
-    ret += sscanf(line, "HydroShockTubesLeftVelocityX = %"FSYM,
-		  &LeftVelocityX);
-    ret += sscanf(line, "HydroShockTubesLeftVelocityY = %"FSYM,
-		  &LeftVelocityY);
-    ret += sscanf(line, "HydroShockTubesLeftVelocityZ = %"FSYM,
-		  &LeftVelocityZ);
-    ret += sscanf(line, "HydroShockTubesLeftPressure = %"FSYM, 
-		  &LeftPressure);
-    ret += sscanf(line, "HydroShockTubesLeftDensity = %"FSYM, 
-		  &LeftDensity);
-    ret += sscanf(line, "HydroShockTubesRightVelocityX = %"FSYM, 
-		  &RightVelocityX);
-    ret += sscanf(line, "HydroShockTubesRightVelocityY = %"FSYM, 
-		  &RightVelocityY);
-    ret += sscanf(line, "HydroShockTubesRightVelocityZ = %"FSYM, 
-		  &RightVelocityZ);
-    ret += sscanf(line, "HydroShockTubesRightPressure = %"FSYM, 
-		  &RightPressure);
-    ret += sscanf(line, "HydroShockTubesRightDensity = %"FSYM,
-                  &RightDensity);
-    ret += sscanf(line, "HydroShockTubesCenterVelocityX = %"FSYM, 
-		  &CenterVelocityX);
-    ret += sscanf(line, "HydroShockTubesCenterVelocityY = %"FSYM, 
-		  &CenterVelocityY);
-    ret += sscanf(line, "HydroShockTubesCenterVelocityZ = %"FSYM, 
-		  &CenterVelocityZ);
-    ret += sscanf(line, "HydroShockTubesCenterPressure = %"FSYM, 
-		  &CenterPressure);
-    ret += sscanf(line, "HydroShockTubesCenterDensity = %"FSYM,
-                  &CenterDensity);
-
-    /* if the line is suspicious, issue a warning */
-
-    if (ret == 0 && strstr(line, "=") && strstr(line, "HydroShockTubes") 
-	&& line[0] != '#')
-      fprintf(stderr, "warning: the following parameter line was not interpreted:\n%s\n", line);
-
-  } // end input from parameter file
-  
   float DensityUnits = 1, LengthUnits = 1,
     TemperatureUnits = 1, TimeUnits = 1, VelocityUnits = 1;
   if (GetUnits(&DensityUnits, &LengthUnits, &TemperatureUnits,
     HydroShockTubesInitializeGrid(InitialDiscontinuity, 
 				  SecondDiscontinuity,
 				  LeftDensity, RightDensity, CenterDensity,
-				  LeftVelocityX,  RightVelocityX, CenterVelocityX,
-				  LeftVelocityY,  RightVelocityY, CenterVelocityY,
-				  LeftVelocityZ,  RightVelocityZ, CenterVelocityZ,
+				  LeftVelocity[0],  RightVelocity[0], CenterVelocity[0],
+				  LeftVelocity[1],  RightVelocity[1], CenterVelocity[1],
+				  LeftVelocity[2],  RightVelocity[2], CenterVelocity[2],
 				  LeftPressure,   RightPressure,  CenterPressure);
 
   /* Convert minimum initial overdensity for refinement to mass
 	  HydroShockTubesInitializeGrid
 	  (InitialDiscontinuity, SecondDiscontinuity,
 	   LeftDensity, RightDensity, CenterDensity,
-	   LeftVelocityX,  RightVelocityX, CenterVelocityX,
-	   LeftVelocityY,  RightVelocityY, CenterVelocityY,
-	   LeftVelocityZ,  RightVelocityZ, CenterVelocityZ,
+	   LeftVelocity[0],  RightVelocity[0], CenterVelocity[0],
+	   LeftVelocity[1],  RightVelocity[1], CenterVelocity[1],
+	   LeftVelocity[2],  RightVelocity[2], CenterVelocity[2],
 	   LeftPressure,   RightPressure,  CenterPressure);
 	Temp = Temp->NextGridThisLevel;
       }
     fprintf(Outfptr, "HydroShockTubesRightDensity         = %"FSYM"\n",
 	    RightDensity);
     fprintf(Outfptr, "HydroShockTubesLeftVelocityX        = %"FSYM"\n",
-	    LeftVelocityX);
+	    LeftVelocity[0]);
     fprintf(Outfptr, "HydroShockTubesRightVelocityX       = %"FSYM"\n",
-            RightVelocityX);
+            RightVelocity[0]);
     fprintf(Outfptr, "HydroShockTubesLeftVelocityY        = %"FSYM"\n",
-	    LeftVelocityY);
+	    LeftVelocity[1]);
     fprintf(Outfptr, "HydroShockTubesRightVelocityY       = %"FSYM"\n",
-            RightVelocityY);
+            RightVelocity[1]);
     fprintf(Outfptr, "HydroShockTubesLeftVelocityZ        = %"FSYM"\n",
-	    LeftVelocityZ);
+	    LeftVelocity[2]);
     fprintf(Outfptr, "HydroShockTubesRightVelocityZ       = %"FSYM"\n",
-            RightVelocityZ);
+            RightVelocity[2]);
     fprintf(Outfptr, "HydroShockTubesLeftPressure         = %"FSYM"\n",
             LeftPressure);
     fprintf(Outfptr, "HydroShockTubesRightPressure        = %"FSYM"\n",
     fprintf(Outfptr, "HydroShockTubesCenterDensity       = %"FSYM"\n",
 	    CenterDensity);
     fprintf(Outfptr, "HydroShockTubesCenterVelocityX     = %"FSYM"\n",
-	    CenterVelocityX);
+	    CenterVelocity[0]);
     fprintf(Outfptr, "HydroShockTubesCenterVelocityY     = %"FSYM"\n",
-	    CenterVelocityY);
+	    CenterVelocity[1]);
     fprintf(Outfptr, "HydroShockTubesCenterVelocityZ     = %"FSYM"\n",
-	    CenterVelocityZ);
+	    CenterVelocity[2]);
     fprintf(Outfptr, "HydroShockTubesCenterPressure      = %"FSYM"\n",
 	    CenterPressure);
 

File src/enzo/ImplosionInitialize.C

  
 // This routine intializes a new simulation based on the parameter file.
 //
+
+#include "ParameterControl/ParameterControl.h"
+extern Configuration Param;
+
  
 #include <string.h>
 #include <stdio.h>
 #define DEFINE_STORAGE
 #include "ImplosionGlobalData.h"
 #undef DEFINE_STORAGE
+
+
+/* Set default parameter values. */
+
+const char config_implosion_defaults[] =
+"### IMPLOSION DEFAULTS ###\n"
+"\n"
+"Problem: {\n"
+"    Implosion: {\n"
+"        Velocity 	= [0.0,0.0,0.0];  # gas initally at rest\n"
+"        BField   	= [0.0,0.0,0.0];  # no magnetic field\n"
+"        Pressure 	= 1.0;\n"
+"        Density	= 1.0;\n"
+"        DiamondPressure= 0.14;\n"
+"        DiamondDensity	= 0.125;\n"
+"        SubgridLeft	= 0.0;      	# start of subgrid(s)\n"
+"        SubgridRight	= 0.0;      	# end of subgrid(s)\n"
+"    };\n"
+"};\n";
+
+
+
  
 int ImplosionInitialize(FILE *fptr, FILE *Outfptr, HierarchyEntry &TopGrid,
 		       TopGridData &MetaData)
   /* local declarations */
  
   char line[MAX_LINE_LENGTH];
-  int  dim, ret, NumberOfSubgridZones[MAX_DIMENSION],
+  int  dim, NumberOfSubgridZones[MAX_DIMENSION],
                           SubgridDims[MAX_DIMENSION];
  
-  /* set default parameters */
- 
-  float ImplosionVelocity[3]     = {0.0, 0.0, 0.0};   // gas initally at rest
-  float ImplosionBField[3]      = {0.0, 0.0, 0.0};   // no magnetic field
-  float ImplosionPressure        = 1.0;
-  float ImplosionDiamondPressure = 0.14;
-  ImplosionDensity               = 1.0;
-  ImplosionDiamondDensity        = 0.125;
-  ImplosionSubgridLeft           = 0.0;    // start of subgrid(s)
-  ImplosionSubgridRight          = 0.0;    // end of subgrid(s)
- 
-  /* read input from file */
- 
-  while (fgets(line, MAX_LINE_LENGTH, fptr) != NULL) {
- 
-    ret = 0;
- 
-    /* read parameters */
- 
-    ret += sscanf(line, "ImplosionDensity  = %"FSYM, &ImplosionDensity);
-    ret += sscanf(line, "ImplosionPressure = %"FSYM, &ImplosionPressure);
-    ret += sscanf(line, "ImplosionDiamondDensity  = %"FSYM,
-		        &ImplosionDiamondDensity);
-    ret += sscanf(line, "ImplosionDiamondPressure = %"FSYM,
-		        &ImplosionDiamondPressure);
-    ret += sscanf(line, "ImplosionSubgridLeft = %"FSYM,
-		        &ImplosionSubgridLeft);
-    ret += sscanf(line, "ImplosionSubgridRight = %"FSYM,
-		        &ImplosionSubgridRight);
- 
-    /* if the line is suspicious, issue a warning */
- 
-    if (ret == 0 && strstr(line, "=") && strstr(line, "Implosion") &&
-	line[0] != '#' && MyProcessorNumber == ROOT_PROCESSOR)
-      fprintf(stderr,
-	 "warning: the following parameter line was not interpreted:\n%s\n",
-	      line);
- 
-  } // end input from parameter file
+  float ImplosionVelocity[3];
+  float ImplosionBField[3];
+  float ImplosionPressure;   
+  float ImplosionDiamondPressure;
+    
+  // Update the parameter config to include the local defaults. Note
+  // that this does not overwrite values previously specified.
+  Param.Update(config_implosion_defaults);
+
+
+  /* read parameters */
+
+  Param.GetScalar(ImplosionDensity,"Problem.Implosion.Density");
+  Param.GetScalar(ImplosionPressure, "Problem.Implosion.Pressure");
+
+  Param.GetScalar(ImplosionDiamondDensity,"Problem.Implosion.DiamondDensity");
+  Param.GetScalar(ImplosionDiamondPressure,"Problem.Implosion.DiamondPressure");
+
+  Param.GetScalar(ImplosionSubgridLeft,"Problem.Implosion.SubgridLeft");
+  Param.GetScalar(ImplosionSubgridRight, "Problem.Implosion.SubgridRight");
  
  
   /* Compute total energies */
  
   ImplosionTotalEnergy = ImplosionPressure/((Gamma - 1.0)*ImplosionDensity);
-  ImplosionDiamondTotalEnergy = ImplosionDiamondPressure/((Gamma - 1.0)*
-						   ImplosionDiamondDensity);
+  ImplosionDiamondTotalEnergy = ImplosionDiamondPressure/((Gamma-1.0)*ImplosionDiamondDensity);
  
   /* set the reflecting boundaries */
  

File src/enzo/KHInitialize.C

 
 // This routine intializes a new simulation based on the parameter file.
 //
+#include "ParameterControl/ParameterControl.h"
+extern Configuration Param;
 
 #include <string.h>
 #include <stdio.h>
 #include "Hierarchy.h"
 #include "TopGridData.h"
 
+const char config_cosmology_simulation_defaults[] = 
+"### KH DEFAULTS ###\n"
+"\n"
+"Problem: {\n"
+"    KH: {\n"
+"       KHInnerPressure         = 2.5;\n"
+"       KHOuterPressure         = 2.5;\n"
+"       KHVelocityJump          = 1.0;\n"
+"       KHPerturbationAmplitude = 0.01;\n"
+"       KHInnerDensity          = 2.0;\n"
+"       KHOuterDensity          = 1.0;\n"
+"    };\n"
+"};\n";
+
 int KHInitialize(FILE *fptr, FILE *Outfptr, HierarchyEntry &TopGrid,
 		       TopGridData &MetaData)
 {
 
     /* read parameters */
 
-    ret += sscanf(line, "KHInnerDensity  = %"FSYM, &KHInnerDensity);
-    ret += sscanf(line, "KHOuterDensity  = %"FSYM, &KHOuterDensity);
-    ret += sscanf(line, "KHInnerPressure = %"FSYM, &KHInnerPressure);
-    ret += sscanf(line, "KHOuterPressure = %"FSYM, &KHOuterPressure);
-    ret += sscanf(line, "KHVelocityJump  = %"FSYM, &KHVelocityJump);
-    ret += sscanf(line, "KHPerturbationAmplitude = %"FSYM, 
-		                                   &KHPerturbationAmplitude);
+    Param.GetScalar(KHInnerDensity,"Problem.KH.KHInnerDensity");
+    Param.GetScalar(KHOuterDensity,"Problem.KH.KHOuterDensity");
+    Param.GetScalar(KHInnerPressure,"Problem.KH.KHInnerPressure");
+    Param.GetScalar(KHOuterPressure,"Problem.KH.KHOuterPressure");
+    Param.GetScalar(KHVelocityJump,"Problem.KH.KHVelocityJump");
+    Param.GetScalar(KHPerturbationAmplitude,"Problem.KH.KHPerturbationAmplitude");                                   
     /* if the line is suspicious, issue a warning */
 
     if (ret == 0 && strstr(line, "=") && strstr(line, "KH") && 

File src/enzo/OneZoneFreefallTestInitialize.C

  
 // This routine intializes a new simulation based on the parameter file.
 //
+
+#include "ParameterControl/ParameterControl.h"
+extern Configuration Param;
  
 #include <string.h>
 #include <stdio.h>
 #include "Hierarchy.h"
 #include "TopGridData.h"
 
+/* Set default parameter values. */
+
+const char config_one_zone_freefall_test_defaults[] =
+"### ONE ZONE FREEFALL TEST DEFAULTS ###\n"
+"\n"
+"Problem: {\n"
+"    OneZoneFreefallTest: {\n"
+"        InitialDensity 	= 1.0;\n"
+"        MinimumEnergy 		= 10.0;\n"
+"        MaximumEnergy 		= 1000.0;\n"
+"        MinimumMetallicity 	= 1e-6;\n"
+"        MaximumMetallicity 	= 1e-2;\n"
+"        ConstantDensityVelocity	= [0.0,0.0,0.0];\n"
+"        MaximumRefinementLevel = 0;\n"
+"\n"
+"        InitialHIFraction 	= -99999.9;\n"
+"        InitialHIIFraction	= -99999.9;\n" 
+"        InitialHeIFraction	= -99999.9;\n"
+"        InitialHeIIFraction	= -99999.9;\n"
+"        InitialHeIIIFraction 	= -99999.9;\n"
+"        InitialHMFraction 	= -99999.9;\n"
+"        InitialH2IFraction	= -99999.9;\n"
+"        InitialH2IIFraction 	= -99999.9;\n"
+"        InitialDIFraction 	= -99999.9;\n"
+"        InitialDIIFraction 	= -99999.9;\n"
+"        InitialHDIFraction 	= -99999.9;\n"
+"        UseMetallicityField 	= FALSE;\n"
+"        MetallicityNormalization  = 1.0\n"
+"        \n"
+"    };\n"
+"};\n";
+
+
 int GetUnits(float *DensityUnits, float *LengthUnits,
 	     float *TemperatureUnits, float *TimeUnits,
 	     float *VelocityUnits, FLOAT Time);
   FLOAT ConstantDensitySubgridLeft, ConstantDensitySubgridRight;
   FLOAT LeftEdge[MAX_DIMENSION], RightEdge[MAX_DIMENSION];
 
-  float ConstantDensityVelocity[3]   = {0.0, 0.0, 0.0};
+  float ConstantDensityVelocity[3];
 
   /* local declarations */
  
 
   MaximumRefinementLevel = 0;
 
-  float dx = (DomainRightEdge[0] - DomainLeftEdge[0])/
-     MetaData.TopGridDims[0];
-
-  float OneZoneFreefallTestInitialDensity = 1.0;
-  float OneZoneFreefallTestMinimumEnergy = 10.0;
-  float OneZoneFreefallTestMaximumEnergy = 1000.0;
-  float OneZoneFreefallTestMinimumMetallicity = 1e-6;
-  float OneZoneFreefallTestMaximumMetallicity = 1e-2;
-  TestProblemData.OneZoneFreefallTimestepFraction = 1e-3;
+  float OneZoneFreefallTestInitialDensity;
+  float OneZoneFreefallTestMinimumEnergy;
+  float OneZoneFreefallTestMaximumEnergy;
+  float OneZoneFreefallTestMinimumMetallicity;
+  float OneZoneFreefallTestMaximumMetallicity;
+  TestProblemData.OneZoneFreefallTimestepFraction;
 
 //   /* set no subgrids by default. */
  
 
   TestProblemData.MultiSpecies = MultiSpecies;  // set this from global data (kind of a hack, but necessary)
 
-  /* read input from file */
+  // Update the parameter config to include the local defaults. Note
+  // that this does not overwrite values previously specified.
+  Param.Update(config_one_zone_freefall_test_defaults);
 
-  int comment_count = 0;
- 
-  while ((fgets(line, MAX_LINE_LENGTH, fptr) != NULL) 
-      && (comment_count < 2)) {
- 
-    ret = 0;
- 
-    /* read parameters specifically for constant density problem */
 
-    /* read in more general test parameters to set species, turn on color fields, etc. */
-    ret += sscanf(line, "OneZoneFreefallTestInitialDensity = %"FSYM, &OneZoneFreefallTestInitialDensity);
-    ret += sscanf(line, "OneZoneFreefallTestMinimumEnergy = %"FSYM, &OneZoneFreefallTestMinimumEnergy);
-    ret += sscanf(line, "OneZoneFreefallTestMaximumEnergy = %"FSYM, &OneZoneFreefallTestMaximumEnergy);
-    ret += sscanf(line, "OneZoneFreefallTestMinimumMetallicity = %"FSYM, &OneZoneFreefallTestMinimumMetallicity);
-    ret += sscanf(line, "OneZoneFreefallTestMaximumMetallicity = %"FSYM, &OneZoneFreefallTestMaximumMetallicity);
-    ret += sscanf(line, "OneZoneFreefallTimestepFraction = %"FSYM, 
-		  &TestProblemData.OneZoneFreefallTimestepFraction);
+  /* read parameters */
 
-    ret += sscanf(line, "TestProblemHydrogenFractionByMass = %"FSYM, &TestProblemData.HydrogenFractionByMass);
-    ret += sscanf(line, "TestProblemDeuteriumToHydrogenRatio = %"FSYM, &TestProblemData.DeuteriumToHydrogenRatio);
-    ret += sscanf(line, "TestProblemInitialHIFraction  = %"FSYM, &TestProblemData.HI_Fraction);
-    ret += sscanf(line, "TestProblemInitialHIIFraction  = %"FSYM, &TestProblemData.HII_Fraction);
-    ret += sscanf(line, "TestProblemInitialHeIFraction  = %"FSYM, &TestProblemData.HeI_Fraction);
-    ret += sscanf(line, "TestProblemInitialHeIIFraction  = %"FSYM, &TestProblemData.HeII_Fraction);
-    ret += sscanf(line, "TestProblemInitialHeIIIIFraction  = %"FSYM, &TestProblemData.HeIII_Fraction);
-    ret += sscanf(line, "TestProblemInitialHMFraction  = %"FSYM, &TestProblemData.HM_Fraction);
-    ret += sscanf(line, "TestProblemInitialH2IFraction  = %"FSYM, &TestProblemData.H2I_Fraction);
-    ret += sscanf(line, "TestProblemInitialH2IIFraction  = %"FSYM, &TestProblemData.H2II_Fraction);
-    ret += sscanf(line, "TestProblemInitialDIFraction  = %"FSYM, &TestProblemData.DI_Fraction);
-    ret += sscanf(line, "TestProblemInitialDIIFraction  = %"FSYM, &TestProblemData.DII_Fraction);
-    ret += sscanf(line, "TestProblemInitialHDIFraction  = %"FSYM, &TestProblemData.HDI_Fraction);
-    ret += sscanf(line, "TestProblemUseMetallicityField  = %"ISYM, &TestProblemData.UseMetallicityField);
-    ret += sscanf(line, "TestProblemMetallicityNormalization  = %"FSYM, &TestProblemData.MetallicityNormalization);
+  /* read in more general test parameters to set species, turn on color fields, etc. */
+  Param.GetScalar(OneZoneFreefallTestInitialDensity,
+		"Problem.OneZoneFreefallTest.InitialDensity");
+  Param.GetScalar(OneZoneFreefallTestMinimumEnergy,
+		"Problem.OneZoneFreefallTest.MinimumEnergy");
+  Param.GetScalar(OneZoneFreefallTestMaximumEnergy,
+		"Problem.OneZoneFreefallTest.MaximumEnergy");
+  Param.GetScalar(OneZoneFreefallTestMinimumMetallicity,
+		"Problem.OneZoneFreefallTest.MinimumMetallicity");
+  Param.GetScalar(OneZoneFreefallTestMaximumMetallicity,
+		"Problem.OneZoneFreefallTest.MaximumMetallicity");
+  Param.GetScalar(OneZoneFreefallTimestepFraction,
+		"Problem.OneZoneFreefall.TimestepFraction");
 
-    if (strstr(line, "\"\"\"")              ) comment_count++;
-
-    /* if the line is suspicious, issue a warning */
- 
-    if (ret == 0 && strstr(line, "=") && (strstr(line, "CoolingDensity") || strstr(line, "TestProblem")) &&
-	line[0] != '#' && MyProcessorNumber == ROOT_PROCESSOR)
-      fprintf(stderr,
-	      "*** warning: the following parameter line was not interpreted:\n%s\n",
-	      line);
- 
-  } // end input from parameter file
+  Param.GetScalar(TestProblemHydrogenFractionByMass,
+		"Problem.OneZoneFreefall.HydrogenFractionByMass");
+  Param.GetScalar(TestProblemDeuteriumToHydrogenRatio,
+		"Problem.OneZoneFreefall.DeuteriumToHydrogenRatio");
+  Param.GetScalar(TestProblemInitialHIFraction,
+		"Problem.OneZoneFreefall.HI_Fraction");
+  Param.GetScalar(TestProblemInitialHIIFraction, 
+		"Problem.OneZoneFreefall.HII_Fraction");
+  Param.GetScalar(TestProblemInitialHeIFraction, 
+		"Problem.OneZoneFreefall.HeI_Fraction");
+  Param.GetScalar(TestProblemInitialHeIIFraction, 
+		"Problem.OneZoneFreefall.HeII_Fraction");
+  Param.GetScalar(TestProblemInitialHeIIIIFraction, 
+		"Problem.OneZoneFreefall.HeIII_Fraction");
+  Param.GetScalar(TestProblemInitialHMFraction, 
+		"Problem.OneZoneFreefall.HM_Fraction");
+  Param.GetScalar(TestProblemInitialH2IFraction, 
+		"Problem.OneZoneFreefall.H2I_Fraction");
+  Param.GetScalar(TestProblemInitialH2IIFraction, 
+		"Problem.OneZoneFreefall.H2II_Fraction");
+  Param.GetScalar(TestProblemInitialDIFraction, 
+		"Problem.OneZoneFreefall.DI_Fraction");
+  Param.GetScalar(TestProblemInitialDIIFraction, 
+		"Problem.OneZoneFreefall.DII_Fraction");
+  Param.GetScalar(TestProblemInitialHDIFraction, 
+		"Problem.OneZoneFreefall.HDI_Fraction");
+  Param.GetScalar(TestProblemUseMetallicityField,
+		"Problem.OneZoneFreefall.UseMetallicityField");
+  Param.GetScalar(TestProblemMetallicityNormalization, 
+		"Problem.OneZoneFreefall.MetallicityNormalization");
 
   /* Set constant for analytical free-fall collapse. */
   TestProblemData.OneZoneFreefallConstant = pow(OneZoneFreefallTestInitialDensity, -0.5);

File src/enzo/ProtostellarCollapseInitialize.C

 
 // This routine intializes a new simulation based on the parameter file.
 
+#include "ParameterControl/ParameterControl.h"
+extern Configuration Param;
+
 #include <string.h>
 #include <stdio.h>
 #include <math.h>
 #define DEFINE_STORAGE
 #undef DEFINE_STORAGE
 
+
+/* Set default parameter values. */
+
+const char config_protostellar_collapse_defaults[] =
+"### PROTOSTELLAR COLLAPSE DEFAULTS ###\n"
+"\n"
+"Problem: {\n"
+"    ProtostellarCollapse: {\n"
+"        Velocity	= [0.0, 0.0, 0.0];   # ambient gas initally at rest\n"
+"        BField		= [0.0, 0.0, 0.0];   # ambient gas initally at rest\n"
+"        CoreDensity    = 2000.0; 	     # 10^6/500\n"
+"        OuterDensity 	= 1.0;\n"
+"        OuterEnergy	= 1e3;\n"
+"        CoreRadius	= 0.005;\n"
+"        AngularVelocity = 0.0;\n"
+"        
+"    };\n"
+"};\n";
+
 int ProtostellarCollapseInitialize(FILE *fptr, FILE *Outfptr, 
 				   HierarchyEntry &TopGrid,
 				   TopGridData &MetaData)
 
   */
 
-  float ProtostellarCollapseVelocity[3]     = {0.0, 0.0, 0.0}; // ambient gas initally at rest
-  float ProtostellarCollapseBField[3]     = {0.0, 0.0, 0.0}; // ambient gas initally at rest
-  float ProtostellarCollapseCoreDensity     = 2000.0; // 10^6/500
-  float ProtostellarCollapseCoreEnergy      = 1e3;  // thermal energy, assumes Gamma = 1.001, p=1, d=1
-  float ProtostellarCollapseOuterDensity    = 1.0;
-  float ProtostellarCollapseOuterEnergy     = 1e3;
-  float ProtostellarCollapseCoreRadius      = 0.005;
-  float ProtostellarCollapseAngularVelocity = 0.0;
-  float dx = (DomainRightEdge[0] - DomainLeftEdge[0])/
-                                                   MetaData.TopGridDims[0];
+  float ProtostellarCollapseVelocity[3]; 	// ambient gas initally at rest
+  float ProtostellarCollapseBField[3]; 		// ambient gas initally at rest
+  float ProtostellarCollapseCoreDensity; 	// 10^6/500
+  float ProtostellarCollapseCoreEnergy;		// thermal energy, assumes Gamma = 1.001, p=1, d=1
+  float ProtostellarCollapseOuterDensity;	
+  float ProtostellarCollapseOuterEnergy;
+  float ProtostellarCollapseCoreRadius;
+  float ProtostellarCollapseAngularVelocity;
+
 
   /* set no subgrids by default. */
 
   ProtostellarCollapseSubgridLeft           = 0.0;    // start of subgrid(s)
   ProtostellarCollapseSubgridRight          = 0.0;    // end of subgrid(s)
 
-  /* read input from file */
+  // Update the parameter config to include the local defaults. Note
+  // that this does not overwrite values previously specified.
+  Param.Update(config_protostellar_collapse_defaults);
 
-  while (fgets(line, MAX_LINE_LENGTH, fptr) != NULL) {
+  /* read parameters */
 
-    ret = 0;
-
-    /* read parameters */
-
-    ret += sscanf(line, "ProtostellarCollapseCoreRadius      = %"FSYM, 
-		  &ProtostellarCollapseCoreRadius);
-    ret += sscanf(line, "ProtostellarCollapseOuterDensity    = %"FSYM, 
-		  &ProtostellarCollapseOuterDensity);
-    ret += sscanf(line, "ProtostellarCollapseAngularVelocity = %"FSYM, 
-		  &ProtostellarCollapseAngularVelocity);
-    ret += sscanf(line, "ProtostellarCollapseSubgridLeft     = %"FSYM, 
-		  &ProtostellarCollapseSubgridLeft);
-    ret += sscanf(line, "ProtostellarCollapseSubgridRight    = %"FSYM, 
-		  &ProtostellarCollapseSubgridRight);
-
-    /* if the line is suspicious, issue a warning */
-
-    if (ret == 0 && strstr(line, "=") && strstr(line, "ProtostellarCollapse") && 
-	line[0] != '#' && MyProcessorNumber == ROOT_PROCESSOR)
-      fprintf(stderr, 
-	 "warning: the following parameter line was not interpreted:\n%s\n", 
-	      line);
-
-  } // end input from parameter file
+  Param.GetScalar(ProtostellarCollapseCoreRadius,
+		"Problem.ProtostellarCollapse.CoreRadius");
+  Param.GetScalar(ProtostellarCollapseOuterDensity,
+		"Problem.ProtostellarCollapse.OuterDensity");
+  Param.GetScalar(ProtostellarCollapseAngularVelocity,
+		"Problem.ProtostellarCollapse.AngularVelocity");
+  Param.GetScalar(ProtostellarCollapseSubgridLeft,
+		"Problem.ProtostellarCollapse.SubgridLeft");
+  Param.GetScalar(ProtostellarCollapseSubgridRight,
+		"Problem.ProtostellarCollapse.SubgridRight");
 
 
   /* set the periodic boundaries */

File src/enzo/RadiatingShockInitialize.C

  
 // This routine intializes a new simulation based on the parameter file.
 //
- 
+#include "ParameterControl/ParameterControl.h"
+extern Configuration Param; 
+
 #include <string.h>
 #include <stdio.h>
 #include <math.h>
 #include "RadiatingShockGlobalData.h"
 #undef DEFINE_STORAGE
 
+/* Set default parameter values. */
+
+const char config_cosmology_simulation_defaults[] = 
+"### COSMOLOGY SIMULATION DEFAULTS ###\n"
+"\n"
+"Problem: {\n"
+"    RadiatingShock: {\n"
+"       RadiatingShockInnerDensity  =1.0;\n"
+"       RadiatingShockOuterDensity  =1.0;\n"
+"       RadiatingShockPressure  =1e-5;\n"
+"       RadiatingShockEnergy  =1.0;\n"
+"       RadiatingShockSubgridLeft =;\n"
+"       RadiatingShockSubgridRight  =;\n"
+"       RadiatingShockUseDensityFluctuations  =0;\n"
+"       RadiatingShockRandomSeed  =123456789;\n"
+"       RadiatingShockDensityFluctuationLevel =0.1;\n"
+"       RadiatingShockInitializeWithKE  =0;\n"
+"       RadiatingShockSedovBlastRadius  =0.05;\n"
+"       RadiatingShockUseSedovProfile =0.05;\n"
+"       RadiatingShockKineticEnergyFraction =0.0;\n"
+"       RadiatingShockCenterPosition  =[0.5,0.5,0.5];\n"
+"       RadiatingShockSpreadOverNumZones  =3.5;\n"
+"       HydrogenFractionByMass  =;\n"
+"       DeuteriumToHydrogenRatio  =;\n"
+"       HI_Fraction_Inner =;\n"
+"       HII_Fraction_Inner  =;\n"
+"       HeI_Fraction_Inner  =;\n"
+"       HeII_Fraction_Inner =;\n"
+"       HeIII_Fraction_Inner  =;\n"
+"       HM_Fraction_Inner =;\n"
+"       H2I_Fraction_Inner  =;\n"
+"       H2II_Fraction_Inner =;\n"
+"       DI_Fraction_Inner =;\n"
+"       DII_Fraction_Inner  =;\n"
+"       HDI_Fraction_Inner  =;\n"
+"       COI_Fraction_Inner  =;\n"
+"       CI_Fraction_Inner =;\n"
+"       CII_Fraction_Inner  =;\n"
+"       OI_Fraction_Inner =;\n"
+"       OII_Fraction_Inner  =;\n"
+"       SiI_Fraction_Inner  =;\n"
+"       SiII_Fraction_Inner =;\n"
+"       SiIII_Fraction_Inner  =;\n"
+"       CHI_Fraction_Inner  =;\n"
+"       CH2I_Fraction_Inner =;\n"
+"       CH3II_Fraction_Inner  =;\n"
+"       C2I_Fraction_Inner  =;\n"
+"       HCOII_Fraction_Inner  =;\n"
+"       OHI_Fraction_Inner  =;\n"
+"       H2OI_Fraction_Inner =;\n"
+"       O2I_Fraction_Inner  =;\n"
+"       HI_Fraction =;\n"
+"       HII_Fraction  =;\n"
+"       HeI_Fraction  =;\n"
+"       HeII_Fraction =;\n"
+"       HeIII_Fraction  =;\n"
+"       HM_Fraction =;\n"
+"       H2I_Fraction  =;\n"
+"       H2II_Fraction =;\n"
+"       DI_Fraction =;\n"
+"       DII_Fraction  =;\n"
+"       HDI_Fraction  =;\n"
+"       COI_Fraction  =;\n"
+"       CI_Fraction =;\n"
+"       CII_Fraction  =;\n"
+"       OI_Fraction =;\n"
+"       OII_Fraction  =;\n"
+"       SiI_Fraction  =;\n"
+"       SiII_Fraction =;\n"
+"       SiIII_Fraction  =;\n"
+"       CHI_Fraction  =;\n"
+"       CH2I_Fraction =;\n"
+"       CH3II_Fraction  =;\n"
+"       C2I_Fraction  =;\n"
+"       HCOII_Fraction  =;\n"
+"       OHI_Fraction  =;\n"
+"       H2OI_Fraction =;\n"
+"       O2I_Fraction  =;\n"
+"       UseMetallicityField =;\n"
+"       MetallicityField_Fraction =;\n"
+"       UseMassInjection  =;\n"
+"       InitialHydrogenMass =;\n"
+"       InitialDeuteriumMass  =;\n"
+"       InitialHeliumMass =;\n"
+"       InitialMetalMass  =;\n"
+"       MultiMetals =;\n"
+"       MultiMetalsField1_Fraction  =;\n"
+"       MultiMetalsField2_Fraction  =;\n"
+"    };\n"
+"};\n";
+
 int GetUnits(float *DensityUnits, float *LengthUnits,
 	     float *TemperatureUnits, float *TimeUnits,
 	     float *VelocityUnits, double *MassUnits, FLOAT Time);
  
     /* read parameters specifically for radiating shock problem*/
  
-    ret += sscanf(line, "RadiatingShockInnerDensity  = %"FSYM, &RadiatingShockInnerDensity); // density inside heated region
-    ret += sscanf(line, "RadiatingShockOuterDensity  = %"FSYM, &RadiatingShockOuterDensity); // ambient density
-    ret += sscanf(line, "RadiatingShockPressure = %"FSYM, &RadiatingShockPressure);  // ambient pressure
-    ret += sscanf(line, "RadiatingShockEnergy   = %"FSYM, &RadiatingShockEnergy);  // supernova explosion energy
-    ret += sscanf(line, "RadiatingShockSubgridLeft = %"PSYM,
-		        &RadiatingShockSubgridLeft);
-    ret += sscanf(line, "RadiatingShockSubgridRight = %"PSYM,
-		        &RadiatingShockSubgridRight);
-    ret += sscanf(line, "RadiatingShockUseDensityFluctuations   = %"ISYM, &RadiatingShockUseDensityFluctuations);
-    ret += sscanf(line, "RadiatingShockRandomSeed   = %"ISYM, &RadiatingShockRandomSeed);
-    ret += sscanf(line, "RadiatingShockDensityFluctuationLevel   = %"FSYM, &RadiatingShockDensityFluctuationLevel);
-    ret += sscanf(line, "RadiatingShockInitializeWithKE = %"ISYM, &RadiatingShockInitializeWithKE);
-    ret += sscanf(line, "RadiatingShockUseSedovProfile = %"ISYM, &RadiatingShockUseSedovProfile);
-    ret += sscanf(line, "RadiatingShockSedovBlastRadius = %"PSYM, &RadiatingShockSedovBlastRadius);
-    ret += sscanf(line, "RadiatingShockUseSedovProfile = %"ISYM, &RadiatingShockUseSedovProfile);
+    Param.GetScalar(RadiatingShockInnerDensity,"Problem.RadiatingShockInnerDensity");
+    Param.GetScalar(RadiatingShockOuterDensity,"Problem.RadiatingShockOuterDensity");
+    Param.GetScalar(RadiatingShockPressure,"Problem.RadiatingShockPressure");
+    Param.GetScalar(RadiatingShockEnergy,"Problem.RadiatingShockEnergy");
+    Param.GetScalar(RadiatingShockSubgridLeft,"Problem.RadiatingShockSubgridLeft");
+    Param.GetScalar(RadiatingShockSubgridRight,"Problem.RadiatingShockSubgridRight");
+    Param.GetScalar(RadiatingShockUseDensityFluctuations,"Problem.RadiatingShockUseDensityFluctuations");
+    Param.GetScalar(RadiatingShockRandomSeed,"Problem.RadiatingShockRandomSeed");
+    Param.GetScalar(RadiatingShockDensityFluctuationLevel,"Problem.RadiatingShockDensityFluctuationLevel");
+    Param.GetScalar(RadiatingShockInitializeWithKE,"Problem.RadiatingShockInitializeWithKE");
+    Param.GetScalar(RadiatingShockUseSedovProfile,"Problem.RadiatingShockUseSedovProfile");
+    Param.GetScalar(RadiatingShockSedovBlastRadius,"Problem.RadiatingShockSedovBlastRadius");
 
-    ret += sscanf(line, "RadiatingShockKineticEnergyFraction = %"FSYM, &RadiatingShockKineticEnergyFraction);
+    Param.GetScalar(RadiatingShockKineticEnergyFraction,"Problem.RadiatingShockKineticEnergyFraction");
 
-    ret += sscanf(line, "RadiatingShockCenterPosition = %"PSYM" %"PSYM" %"PSYM,
-		  RadiatingShockCenterPosition, RadiatingShockCenterPosition+1,
-		  RadiatingShockCenterPosition+2);
+    for (i=0; i<MAX_DIMENSION; i++){
+        Param.GetArray(RadiatingShockCenterPosition[i],"Problem.RadiatingShockCenterPosition%s",i)}
 
-    ret += sscanf(line, "RadiatingShockSpreadOverNumZones  = %"PSYM, &RadiatingShockSpreadOverNumZones);
-
+    Param.GetScalar(RadiatingShockSpreadOverNumZones,"Problem.RadiatingShockSpreadOverNumZones");
 
     /* read in more general test parameters to set species, turn on color fields, etc. */
-    ret += sscanf(line, "TestProblemHydrogenFractionByMass = %"FSYM, &TestProblemData.HydrogenFractionByMass);
-    ret += sscanf(line, "TestProblemDeuteriumToHydrogenRatio = %"FSYM, &TestProblemData.DeuteriumToHydrogenRatio);
+    Param.GetScalar(HydrogenFractionByMass,"Problem.HydrogenFractionByMass");
+    Param.GetScalar(DeuteriumToHydrogenRatio,"Problem.DeuteriumToHydrogenRatio");
 
-    ret += sscanf(line, "TestProblemInitialHIFractionInner  = %"FSYM, &TestProblemData.HI_Fraction_Inner);
-    ret += sscanf(line, "TestProblemInitialHIIFractionInner  = %"FSYM, &TestProblemData.HII_Fraction_Inner);
-    ret += sscanf(line, "TestProblemInitialHeIFractionInner  = %"FSYM, &TestProblemData.HeI_Fraction_Inner);
-    ret += sscanf(line, "TestProblemInitialHeIIFractionInner  = %"FSYM, &TestProblemData.HeII_Fraction_Inner);
-    ret += sscanf(line, "TestProblemInitialHeIIIFractionInner  = %"FSYM, &TestProblemData.HeIII_Fraction_Inner);
-    ret += sscanf(line, "TestProblemInitialHMFractionInner  = %"FSYM, &TestProblemData.HM_Fraction_Inner);
-    ret += sscanf(line, "TestProblemInitialH2IFractionInner  = %"FSYM, &TestProblemData.H2I_Fraction_Inner);
-    ret += sscanf(line, "TestProblemInitialH2IIFractionInner  = %"FSYM, &TestProblemData.H2II_Fraction_Inner);
+    Param.GetScalar(HI_Fraction_Inner,"Problem.HI_Fraction_Inner");
+    Param.GetScalar(HII_Fraction_Inner,"Problem.HII_Fraction_Inner");
+    Param.GetScalar(HeI_Fraction_Inner,"Problem.HeI_Fraction_Inner");
+    Param.GetScalar(HeII_Fraction_Inner,"Problem.HeII_Fraction_Inner");
+    Param.GetScalar(HeIII_Fraction_Inner,"Problem.HeIII_Fraction_Inner");
+    Param.GetScalar(HM_Fraction_Inner,"Problem.HM_Fraction_Inner");
+    Param.GetScalar(H2I_Fraction_Inner,"Problem.H2I_Fraction_Inner");
+    Param.GetScalar(H2II_Fraction_Inner,"Problem.H2II_Fraction_Inner");
 
-    ret += sscanf(line, "TestProblemInitialDIFractionInner  = %"FSYM, &TestProblemData.DI_Fraction_Inner);
-    ret += sscanf(line, "TestProblemInitialDIIFractionInner  = %"FSYM, &TestProblemData.DII_Fraction_Inner);
-    ret += sscanf(line, "TestProblemInitialHDIFractionInner  = %"FSYM, &TestProblemData.HDI_Fraction_Inner);
+    Param.GetScalar(DI_Fraction_Inner,"Problem.DI_Fraction_Inner");
+    Param.GetScalar(DII_Fraction_Inner,"Problem.DII_Fraction_Inner");
+    Param.GetScalar(HDI_Fraction_Inner,"Problem.HDI_Fraction_Inner");
 
-    ret += sscanf(line, "TestProblemInitialCOIFractionInner  = %"FSYM, &TestProblemData.COI_Fraction_Inner);
-    ret += sscanf(line, "TestProblemInitialCIFractionInner  = %"FSYM, &TestProblemData.CI_Fraction_Inner);
-    ret += sscanf(line, "TestProblemInitialCIIFractionInner  = %"FSYM, &TestProblemData.CII_Fraction_Inner);
-    ret += sscanf(line, "TestProblemInitialOIFractionInner  = %"FSYM, &TestProblemData.OI_Fraction_Inner);
-    ret += sscanf(line, "TestProblemInitialOIIFractionInner  = %"FSYM, &TestProblemData.OII_Fraction_Inner);
-    ret += sscanf(line, "TestProblemInitialSiIFractionInner  = %"FSYM, &TestProblemData.SiI_Fraction_Inner);
-    ret += sscanf(line, "TestProblemInitialSiIIFractionInner  = %"FSYM, &TestProblemData.SiII_Fraction_Inner);
-    ret += sscanf(line, "TestProblemInitialSiIIIFractionInner  = %"FSYM, &TestProblemData.SiIII_Fraction_Inner);
-    ret += sscanf(line, "TestProblemInitialCHIFractionInner  = %"FSYM, &TestProblemData.CHI_Fraction_Inner);
-    ret += sscanf(line, "TestProblemInitialCH2IFractionInner  = %"FSYM, &TestProblemData.CH2I_Fraction_Inner);
-    ret += sscanf(line, "TestProblemInitialCH3IIFractionInner  = %"FSYM, &TestProblemData.CH3II_Fraction_Inner);
-    ret += sscanf(line, "TestProblemInitialC2IFractionInner  = %"FSYM, &TestProblemData.C2I_Fraction_Inner);
-    ret += sscanf(line, "TestProblemInitialHCOIIFractionInner  = %"FSYM, &TestProblemData.HCOII_Fraction_Inner);
-    ret += sscanf(line, "TestProblemInitialOHIFractionInner  = %"FSYM, &TestProblemData.OHI_Fraction_Inner);
-    ret += sscanf(line, "TestProblemInitialH2OIFractionInner  = %"FSYM, &TestProblemData.H2OI_Fraction_Inner);
-    ret += sscanf(line, "TestProblemInitialO2IFractionInner  = %"FSYM, &TestProblemData.O2I_Fraction_Inner);
+    Param.GetScalar(COI_Fraction_Inner,"Problem.COI_Fraction_Inner");
+    Param.GetScalar(CI_Fraction_Inner,"Problem.CI_Fraction_Inner");
+    Param.GetScalar(CII_Fraction_Inner,"Problem.CII_Fraction_Inner");
+    Param.GetScalar(OI_Fraction_Inner,"Problem.OI_Fraction_Inner");
+    Param.GetScalar(OII_Fraction_Inner,"Problem.OII_Fraction_Inner");
+    Param.GetScalar(SiI_Fraction_Inner,"Problem.iI_Fraction_Inner");
+    Param.GetScalar(SiII_Fraction_Inner,"Problem.SiII_Fraction_Inner");
+    Param.GetScalar(SiIII_Fraction_Inner,"Problem.SiIII_Fraction_Inner");
+    Param.GetScalar(CHI_Fraction_Inner,"Problem.CHI_Fraction_Inner");
+    Param.GetScalar(CH2I_Fraction_Inner,"Problem.CH2I_Fraction_Inner");
+    Param.GetScalar(CH3II_Fraction_Inner,"Problem.CH3II_Fraction_Inner");
+    Param.GetScalar(C2I_Fraction_Inner,"Problem.C2I_Fraction_Inner");
+    Param.GetScalar(HCOII_Fraction_Inner,"Problem.HCOII_Fraction_Inner");
+    Param.GetScalar(OHI_Fraction_Inner,"Problem.OHI_Fraction_Inner");
+    Param.GetScalar(H2OI_Fraction_Inner,"Problem.H2OI_Fraction_Inner");
+    Param.GetScalar(O2I_Fraction_Inner,"Problem.O2I_Fraction_Inner");
 
-    ret += sscanf(line, "TestProblemInitialHIFraction  = %"FSYM, &TestProblemData.HI_Fraction);
-    ret += sscanf(line, "TestProblemInitialHIIFraction  = %"FSYM, &TestProblemData.HII_Fraction);
-    ret += sscanf(line, "TestProblemInitialHeIFraction  = %"FSYM, &TestProblemData.HeI_Fraction);
-    ret += sscanf(line, "TestProblemInitialHeIIFraction  = %"FSYM, &TestProblemData.HeII_Fraction);
-    ret += sscanf(line, "TestProblemInitialHeIIIFraction  = %"FSYM, &TestProblemData.HeIII_Fraction);
-    ret += sscanf(line, "TestProblemInitialHMFraction  = %"FSYM, &TestProblemData.HM_Fraction);
-    ret += sscanf(line, "TestProblemInitialH2IFraction  = %"FSYM, &TestProblemData.H2I_Fraction);
-    ret += sscanf(line, "TestProblemInitialH2IIFraction  = %"FSYM, &TestProblemData.H2II_Fraction);
+    Param.GetScalar(HI_Fraction,"Problem.HI_Fraction");
+    Param.GetScalar(HII_Fraction,"Problem.HII_Fraction");
+    Param.GetScalar(HeI_Fraction,"Problem.HeI_Fraction");
+    Param.GetScalar(HeII_Fraction,"Problem.HeII_Fraction");
+    Param.GetScalar(HeIII_Fraction,"Problem.HeIII_Fraction");
+    Param.GetScalar(HM_Fraction,"Problem.HM_Fraction");
+    Param.GetScalar(H2I_Fraction,"Problem.H2I_Fraction");
+    Param.GetScalar(H2II_Fraction,"Problem.H2II_Fraction");
 
-    ret += sscanf(line, "TestProblemInitialDIFraction  = %"FSYM, &TestProblemData.DI_Fraction);
-    ret += sscanf(line, "TestProblemInitialDIIFraction  = %"FSYM, &TestProblemData.DII_Fraction);
-    ret += sscanf(line, "TestProblemInitialHDIFraction  = %"FSYM, &TestProblemData.HDI_Fraction);
+    Param.GetScalar(DI_Fraction,"Problem.DI_Fraction");
+    Param.GetScalar(DII_Fraction,"Problem.DII_Fraction");
+    Param.GetScalar(HDI_Fraction,"Problem.HDI_Fraction");
 
-    ret += sscanf(line, "TestProblemInitialCOIFraction  = %"FSYM, &TestProblemData.COI_Fraction);
-    ret += sscanf(line, "TestProblemInitialCIFraction  = %"FSYM, &TestProblemData.CI_Fraction);
-    ret += sscanf(line, "TestProblemInitialCIIFraction  = %"FSYM, &TestProblemData.CII_Fraction);
-    ret += sscanf(line, "TestProblemInitialOIFraction  = %"FSYM, &TestProblemData.OI_Fraction);
-    ret += sscanf(line, "TestProblemInitialOIIFraction  = %"FSYM, &TestProblemData.OII_Fraction);
-    ret += sscanf(line, "TestProblemInitialSiIFraction  = %"FSYM, &TestProblemData.SiI_Fraction);
-    ret += sscanf(line, "TestProblemInitialSiIIFraction  = %"FSYM, &TestProblemData.SiII_Fraction);
-    ret += sscanf(line, "TestProblemInitialSiIIIFraction  = %"FSYM, &TestProblemData.SiIII_Fraction);
-    ret += sscanf(line, "TestProblemInitialCHIFraction  = %"FSYM, &TestProblemData.CHI_Fraction);
-    ret += sscanf(line, "TestProblemInitialCH2IFraction  = %"FSYM, &TestProblemData.CH2I_Fraction);
-    ret += sscanf(line, "TestProblemInitialCH3IIFraction  = %"FSYM, &TestProblemData.CH3II_Fraction);
-    ret += sscanf(line, "TestProblemInitialC2IFraction  = %"FSYM, &TestProblemData.C2I_Fraction);
-    ret += sscanf(line, "TestProblemInitialHCOIIFraction  = %"FSYM, &TestProblemData.HCOII_Fraction);
-    ret += sscanf(line, "TestProblemInitialOHIFraction  = %"FSYM, &TestProblemData.OHI_Fraction);
-    ret += sscanf(line, "TestProblemInitialH2OIFraction  = %"FSYM, &TestProblemData.H2OI_Fraction);
-    ret += sscanf(line, "TestProblemInitialO2IFraction  = %"FSYM, &TestProblemData.O2I_Fraction);
+    Param.GetScalar(COI_Fraction,"Problem.COI_Fraction");
+    Param.GetScalar(CI_Fraction,"Problem.CI_Fraction");
+    Param.GetScalar(CII_Fraction,"Problem.CII_Fraction");
+    Param.GetScalar(OI_Fraction,"Problem.OI_Fraction");
+    Param.GetScalar(OII_Fraction,"Problem.OII_Fraction");
+    Param.GetScalar(SiI_Fraction,"Problem.SiI_Fraction");
+    Param.GetScalar(SiII_Fraction,"Problem.SiII_Fraction");
+    Param.GetScalar(SiIII_Fraction,"Problem.SiIII_Fraction");
+    Param.GetScalar(CHI_Fraction,"Problem.CHI_Fraction");
+    Param.GetScalar(CH2I_Fraction,"Problem.CH2I_Fraction");
+    Param.GetScalar(CH3II_Fraction,"Problem.CH3II_Fraction");
+    Param.GetScalar(C2I_Fraction,"Problem.C2I_Fraction");
+    Param.GetScalar(HCOII_Fraction,"Problem.HCOII_Fraction");
+    Param.GetScalar(OHI_Fraction,"Problem.OHI_Fraction");
+    Param.GetScalar(H2OI_Fraction,"Problem.H2OI_Fraction");
+    Param.GetScalar(O2I_Fraction,"Problem.O2I_Fraction");
 
-    ret += sscanf(line, "TestProblemUseMetallicityField  = %"ISYM, &TestProblemData.UseMetallicityField);
-    ret += sscanf(line, "TestProblemInitialMetallicityFraction  = %"FSYM, &TestProblemData.MetallicityField_Fraction);
+    Param.GetScalar(UseMetallicityField,"Problem.UseMetallicityField");
+    Param.GetScalar(MetallicityField_Fraction,"Problem.MetallicityField_Fraction");
 
-    ret += sscanf(line, "TestProblemUseMassInjection  = %"ISYM, &TestProblemData.UseMassInjection);
-    ret += sscanf(line, "TestProblemInitialHydrogenMass  = %"FSYM, &TestProblemData.InitialHydrogenMass);
-    ret += sscanf(line, "TestProblemInitialDeuteriumMass  = %"FSYM, &TestProblemData.InitialDeuteriumMass);
-    ret += sscanf(line, "TestProblemInitialHeliumMass  = %"FSYM, &TestProblemData.InitialHeliumMass);
-    ret += sscanf(line, "TestProblemInitialMetalMass  = %"FSYM, &TestProblemData.InitialMetalMass);
+    Param.GetScalar(UseMassInjection,"Problem.UseMassInjection");
+    Param.GetScalar(InitialHydrogenMass,"Problem.InitialHydrogenMass");
+    Param.GetScalar(InitialDeuteriumMass,"Problem.InitialDeuteriumMass");
+    Param.GetScalar(InitialHeliumMass,"Problem.InitialHeliumMass");
+    Param.GetScalar(InitialMetalMass,"Problem.InitialMetalMass");
 
-    ret += sscanf(line, "TestProblemMultiMetals  = %"ISYM, &TestProblemData.MultiMetals);
-    ret += sscanf(line, "TestProblemInitialMultiMetalsField1Fraction  = %"FSYM, &TestProblemData.MultiMetalsField1_Fraction);
-    ret += sscanf(line, "TestProblemInitialMultiMetalsField2Fraction  = %"FSYM, &TestProblemData.MultiMetalsField2_Fraction);
+    Param.GetScalar(MultiMetals,"Problem.MultiMetals");
+    Param.GetScalar(MultiMetalsField1_Fraction,"Problem.MultiMetalsField1_Fraction");
+    Param.GetScalar(MultiMetalsField2_Fraction,"Problem.MultiMetalsField2_Fraction");
 
     /* if the line is suspicious, issue a warning */
  

File src/enzo/ShearingBoxInitialize.C

 /
 ************************************************************************/
 
+#include "ParameterControl/ParameterControl.h"
+extern Configuration Param;
 
 
 #include <stdlib.h>
 #include "LevelHierarchy.h"
 #include "TopGridData.h"
 
+/* Set default parameter values. */
+
+const char config_shearing_box_defaults[] =
+"### SHEARING BOX DEFAULTS ###\n"
+"\n"
+"Problem: {\n"
+"    ShearingBox: {\n"
+"         ThermalMagneticRatio		= 400;\n"
+"         FluctuationAmplitudeFraction	= 0.1;\n"
+"         ShearingBoxRefineAtStart   	= FALSE;\n"
+"         ShearingGeometry		= 2.0;\n"
+"         InitialMagneticFieldConfiguration = 0;\n"
+"         RefineAtStart			= 1;\n"
+"    };\n"
+"};\n";
+
+
+
+
 // void WriteListOfFloats(FILE *fptr, int N, float floats[]);
 // void WriteListOfFloats(FILE *fptr, int N, FLOAT floats[]);
 // void AddLevel(LevelHierarchyEntry *Array[], HierarchyEntry *Grid, int level);
   /* read input from file */
  
 
-  float ThermalMagneticRatio=400; 
-  float FluctuationAmplitudeFraction=0.1;
-  int ShearingBoxRefineAtStart   = FALSE;
-  float ShearingGeometry=2.0;
-  int InitialMagneticFieldConfiguration=0;
-  int RefineAtStart=1;
+  float ThermalMagneticRatio; 
+  float FluctuationAmplitudeFraction;
+  int ShearingBoxRefineAtStart;
+  float ShearingGeometry;
+  int InitialMagneticFieldConfiguration;
+  int RefineAtStart;
 
-  int ret;
+  // Update the parameter config to include the local defaults. Note
+  // that this does not overwrite values previously specified.
+  Param.Update(config_shearing_box_defaults);
 
-  
 
-  while (fgets(line, MAX_LINE_LENGTH, fptr) != NULL) {
-
-    ret = 0;
 
 /* read parameters */
-    ret += sscanf(line, "ShearingBoxRefineAtStart = %"ISYM, &RefineAtStart); 
-    ret += sscanf(line, "ShearingBoxThermalMagneticRatio= %"FSYM, &ThermalMagneticRatio);
-    ret += sscanf(line, "ShearingBoxFluctuationAmplitudeFraction = %"FSYM, &FluctuationAmplitudeFraction);
-    ret += sscanf(line, "ShearingBoxGeometry = %"FSYM, &ShearingGeometry);  
-    ret += sscanf(line, "ShearingBoxInitialMagneticFieldConfiguration = %"ISYM, &InitialMagneticFieldConfiguration);  
- 
-  } 
+    Param.GetScalar(ShearingBoxRefineAtStart, 
+		"Problem.ShearingBox.RefineAtStart"); 
+    Param.GetScalar(ShearingBoxThermalMagneticRatio, 
+		"Problem.ShearingBox.ThermalMagneticRatio");
+    Param.GetScalar(ShearingBoxFluctuationAmplitudeFraction,
+		"Problem.ShearingBox.FluctuationAmplitudeFraction");
+    Param.GetScalar(ShearingBoxGeometry,
+		"Problem.ShearingBox.ShearingGeometry");
+    Param.GetScalar(BoxInitialMagneticFieldConfiguration,
+		"Problem.ShearingBox.InitialMagneticFieldConfiguration");  
  
 
 

File src/enzo/StratifiedMediumExplosionInitialize.C

 //  RETURNS: SUCCESS or FAIL
 //
 ////////////////////////////////////////////////////////////////////////////////
+
+#include "ParameterControl/ParameterControl.h"
+extern Configuration Param;
  
 #include <string.h>
 #include <stdio.h>
 #include "Hierarchy.h"
 #include "TopGridData.h"
 
+/* Set default parameter values. */
+
+const char config_stratified_medium_explosion_defaults[] =
+"### STRATIFIED MEDIUM EXPLOSION DEFAULTS ###\n"
+"\n"
+"Problem: {\n"
+"    StratifiedMediumExplosion: {\n"
+"        Density = 1.0;\n"
+"        TotalEnergy = 1.0;\n"
+"        GasEnergy = 1.0;\n"
+"        Energy = 1.0;\n"
+"        Velocity = [0.0,0.0,0.0]\n"
+"        InitialUniformBField = [0.0,0.0,0.0];  # in Gauss\n"
+"        RadiusOfBubble = 0.1;  		# units of box size\n"
+"        PulseType = 1;  			# pulse type\n"
+"        Center = [0.5,0.5,0.5];\n"
+"        SubgridLeft = [0.0,0.0,0.0]\n"
+"        SubgridRight = [0.0,0.0,0.0]\n"
+"    };\n"
+"};\n";
+
+
+
 int GetUnits(float *DensityUnits, float *LengthUnits,
 	     float *TemperatureUnits, float *TimeUnits,
 	     float *VelocityUnits, double *MassUnits, FLOAT Time);
   FLOAT StratifiedMediumExplosionSubgridLeft[3]={0.0,0.0,0.0}; 
   FLOAT StratifiedMediumExplosionSubgridRight[3]={0.0,0.0,0.0};
 
+  // Update the parameter config to include the local defaults. Note
+  // that this does not overwrite values previously specified.
+  Param.Update(config_stratified_medium_explosion_defaults);
+
+
   // Read parameters
 
-  while (fgets(line, MAX_LINE_LENGTH, fptr) != NULL) {
-    ret = 0;
-    ret += sscanf(line, "StratifiedMediumExplosionRadiusOfBubble = %"PSYM, &StratifiedMediumExplosionRadiusOfBubble);
-    ret += sscanf(line, "StratifiedMediumExplosionEnergy = %"FSYM, &StratifiedMediumExplosionEnergy);
-    ret += sscanf(line, "StratifiedMediumExplosionPulseType = %"ISYM, &StratifiedMediumExplosionPulseType);
-    ret += sscanf(line, "StratifiedMediumExplosionCenter = %"PSYM" %"PSYM" %"PSYM, &StratifiedMediumExplosionCenter[0],
-		  &StratifiedMediumExplosionCenter[1],&StratifiedMediumExplosionCenter[2]);
-    ret += sscanf(line, "StratifiedMediumExplosionSubgridLeft = %"PSYM" %"PSYM" %"PSYM,
-		  StratifiedMediumExplosionSubgridLeft,StratifiedMediumExplosionSubgridLeft+1,
-		  StratifiedMediumExplosionSubgridLeft+2);
-    ret += sscanf(line, "StratifiedMediumExplosionSubgridRight = %"PSYM" %"PSYM" %"PSYM,
-		  StratifiedMediumExplosionSubgridRight,StratifiedMediumExplosionSubgridRight+1,
-		  StratifiedMediumExplosionSubgridRight+2);
+  Param.GetScalar(StratifiedMediumExplosionRadiusOfBubble, 
+  		"Problem.StratifiedMediumExplosion.RadiusOfBubble");
+  Param.GetScalar(StratifiedMediumExplosionEnergy,
+		"Problem.StratifiedMediumExplosion.Energy");
+  Param.GetScalar(StratifiedMediumExplosionPulseType,
+  		"Problem.StratifiedMediumExplosion.PulseType");
+  Param.GetArray(StratifiedMediumExplosionCenter, 
+  		"Problem.StratifiedMediumExplosion.Center");
+  Param.GetArray(StratifiedMediumExplosionSubgridLeft,
+		"StratifiedMediumExplosionSubgridLeft");
+  Param.GetArray(StratifiedMediumExplosionSubgridRight,
+		"StratifiedMediumExplosionSubgridRight");
+  Param.GetScalar(TestProblemUseMetallicityField,"TestProblemData.UseMetallicityField");
+  Param.GetScalar(TestProblemInitialMetallicityFraction, "TestProblemData.MetallicityField_Fraction");
 
-    ret += sscanf(line, "TestProblemUseMetallicityField  = %"ISYM, &TestProblemData.UseMetallicityField);
-    ret += sscanf(line, "TestProblemInitialMetallicityFraction  = %"FSYM, &TestProblemData.MetallicityField_Fraction);
-
-    if (ret == 0 && 
-	strstr(line, "=") && strstr(line, "StratifiedMediumExplosion") &&
-	line[0] != '#' && MyProcessorNumber == ROOT_PROCESSOR) {
-      fprintf(stderr, "*** warning: the following parameter line was not interpreted:\n%s\n", line);
-    }
-  }
 
   StratifiedMediumExplosionGasEnergy = StratifiedMediumExplosionTotalEnergy;
 

File src/enzo/TestOrbitInitialize.C

 // This routine intializes a new simulation based on the parameter file.
 //
 
+#include "ParameterControl/ParameterControl.h"
+extern Configuration Param;
+
 #include <string.h>
 #include <stdio.h>
 #include <math.h>
 #include "Hierarchy.h"
 #include "TopGridData.h"
 
+/* Set default parameter values. */
+
+const char config_test_orbit_defaults[] =
+"### TEST ORBIT DEFAULTS ###\n"
+"\n"
+"Problem: {\n"
+"    TestOrbit: {\n"
+"        NumberOfParticles 	= 1;		# number of test particles\n"
+"        Radius			= 0.2;\n"
+"        CentralMass		= 1.0;\n"
+"        TestMass		= 1.0e-6;\n"
+"        UseBaryons		= FALSE; 	# not implemented
+"    };\n"
+"};\n";
+
+
 int TestOrbitInitialize(FILE *fptr, FILE *Outfptr, HierarchyEntry &TopGrid,
 			TopGridData &MetaData)
 {
   float TestOrbitTestMass          = 1.0e-6;
   int   TestOrbitUseBaryons        = FALSE; // not implemented 
 
-  /* read input from file */
+  // Update the parameter config to include the local defaults. Note
+  // that this does not overwrite values previously specified.
+  Param.Update(config_test_orbit_defaults);
 
-  while (fgets(line, MAX_LINE_LENGTH, fptr) != NULL) {
+  /* read parameters */
 
-    ret = 0;
+  Param.GetScalar(TestOrbitNumberOfParticles,
+		"Problem.TestOrbit.NumberOfParticles");
+  Param.GetScalar(TestOrbitRadius,
+		"Problem.TestOrbit.Radius");
+  Param.GetScalar(TestOrbitCentralMass,
+		"Problem.TestOrbit.CentralMass");
+  Param.GetScalar(TestOrbitTestMass,
+		"Problem.TestOrbit.TestMass");
+  Param.GetScalar(TestOrbitUseBaryons,
+		"Problem.TestOrbitUseBaryons");
 
-    /* read parameters */
-
-    ret += sscanf(line, "TestOrbitNumberOfParticles = %"ISYM,
-		  &TestOrbitNumberOfParticles);
-    ret += sscanf(line, "TestOrbitRadius = %"PSYM,
-		  &TestOrbitRadius);
-    ret += sscanf(line, "TestOrbitCentralMass = %"FSYM,
-		  &TestOrbitCentralMass);
-    ret += sscanf(line, "TestOrbitTestMass = %"FSYM,
-		  &TestOrbitTestMass);
-    ret += sscanf(line, "TestOrbitUseBaryons = %"ISYM,
-		  &TestOrbitUseBaryons);
-
-    /* if the line is suspicious, issue a warning */
-
-    if (ret == 0 && strstr(line, "=") && strstr(line, "TestOrbit") 
-	&& line[0] != '#')
-      fprintf(stderr, "warning: the following parameter line was not interpreted:\n%s\n", line);
-
-  } // end input from parameter file
 
   /* set up grid */
 

File src/enzo/TurbulenceSimulationInitialize.C

  
 // This routine intializes a new simulation based on the parameter file.
 //
+
+#include "ParameterControl/ParameterControl.h"
+extern Configuration Param;
+
  
 #ifdef USE_MPI
 #include "mpi.h"
 #include "fortran.def"
 #include "error.h"
 #include "message.h"
+
+const char config_turbulence_simulation_defaults[] =
+"### TURBULENCE SIMULATION DEFAULTS ###\n"
+"\n"
+"Problem: {\n"
+"    TurbulenceSimulation: {\n"
+"        InitialDensity				= -99999.0;\n"
+"        InitialDensityPerturbationAmplitude 	= -99999.0;\n"
+"        InitialTemperature			= -99999.0;\n"
+"        InitialPressure			= -99999.0;\n"
+"        InitialMagneticField[3] 		= [5.0,5.0,5.0];\n"
+"\n"
+"        DensityName		= \"\";\n"
+"        TotalEnergyName	= \"\";\n"
+"        GasPressureName	= \"\";\n"
+"        GasEnergyName		= \"\";\n"
+"        VelocityNames		= \"\";\n"
+"        RandomForcingNames	= \"\";\n"
+"        MagneticNames		= \"\";\n"
+"        SubgridsAreStatic	= TRUE;
+"        NumberofInitialSubgrids= 1;
+"    };\n"
+"};\n";
+
  
 /* function prototypes */
  
  
 /* Turbulence Parameters (that need to be shared) */
  
-static float TurbulenceSimulationInitialDensity       = FLOAT_UNDEFINED;
-static float TurbulenceSimulationInitialDensityPerturbationAmplitude    = FLOAT_UNDEFINED;
-static float TurbulenceSimulationInitialTemperature   = FLOAT_UNDEFINED;
-static float TurbulenceSimulationInitialPressure   = FLOAT_UNDEFINED;
-static float TurbulenceSimulationInitialMagneticField[3] = {5.0,5.0,5.0};
+static float TurbulenceSimulationInitialDensityPerturbationAmplitude;
+static float TurbulenceSimulationInitialTemperature;
+static float TurbulenceSimulationInitialPressure;
+static float TurbulenceSimulationInitialMagneticField[3];
  
-static char *TurbulenceSimulationDensityName          = NULL;
-static char *TurbulenceSimulationTotalEnergyName      = NULL;
-static char *TurbulenceSimulationGasPressureName      = NULL;
-static char *TurbulenceSimulationGasEnergyName        = NULL;
+static char *TurbulenceSimulationDensityName;
+static char *TurbulenceSimulationTotalEnergyName;
+static char *TurbulenceSimulationGasPressureName;
+static char *TurbulenceSimulationGasEnergyName;
 static char *TurbulenceSimulationVelocityNames[MAX_DIMENSION];
 static char *TurbulenceSimulationRandomForcingNames[MAX_DIMENSION];
 static char *TurbulenceSimulationMagneticNames[MAX_DIMENSION];
-static int   TurbulenceSimulationSubgridsAreStatic    = TRUE;
-static int   TurbulenceSimulationNumberOfInitialGrids = 1;
+static int   TurbulenceSimulationSubgridsAreStatic;
+static int   TurbulenceSimulationNumberOfInitialGrids;
  
  
 #define MAX_INITIAL_GRIDS 10
  
   char *dummy = new char[MAX_LINE_LENGTH];
   dummy[0] = 0;
-  while (fgets(line, MAX_LINE_LENGTH, fptr) != NULL) {
- 
-    ret = 0;
+  char dummy_arr[MAX_DIMENSION][MAX_LINE_LENGTH];
+
+
+  // Update the parameter config to include the local defaults. Note
+  // that this does not overwrite values previously specified.
+  Param.Update(config_turbulence_simulation_defaults);
+
  
     /* Read parameters */
- 
-    if (sscanf(line, "TurbulenceSimulationDensityName = %s", dummy) == 1)
-      TurbulenceSimulationDensityName = dummy;
-    if (sscanf(line, "TurbulenceSimulationTotalEnergyName = %s", dummy) == 1)
-      TurbulenceSimulationTotalEnergyName = dummy;
-    if (sscanf(line, "TurbulenceSimulationGasPressureName = %s", dummy) == 1)
-      TurbulenceSimulationGasPressureName = dummy;
-    if (sscanf(line, "TurbulenceSimulationGasEnergyName = %s", dummy) == 1)
-      TurbulenceSimulationGasEnergyName = dummy;
-    if (sscanf(line, "TurbulenceSimulationVelocity1Name = %s", dummy) == 1)
-      TurbulenceSimulationVelocityNames[0] = dummy;
-    if (sscanf(line, "TurbulenceSimulationVelocity2Name = %s", dummy) == 1)
-      TurbulenceSimulationVelocityNames[1] = dummy;
-    if (sscanf(line, "TurbulenceSimulationVelocity3Name = %s", dummy) == 1)
-      TurbulenceSimulationVelocityNames[2] = dummy;
-    if (sscanf(line, "TurbulenceSimulationRandomForcing1Name = %s", dummy) ==1)
-      TurbulenceSimulationRandomForcingNames[0] = dummy;
-    if (sscanf(line, "TurbulenceSimulationRandomForcing2Name = %s", dummy) ==1)
-      TurbulenceSimulationRandomForcingNames[1] = dummy;
-    if (sscanf(line, "TurbulenceSimulationRandomForcing3Name = %s", dummy) ==1)
-      TurbulenceSimulationRandomForcingNames[2] = dummy;
-    if (sscanf(line, "TurbulenceSimulationMagnetic1Name = %s", dummy) ==1)
-      TurbulenceSimulationMagneticNames[0] = dummy;
-    if (sscanf(line, "TurbulenceSimulationMagnetic2Name = %s", dummy) ==1)
-      TurbulenceSimulationMagneticNames[1] = dummy;
-    if (sscanf(line, "TurbulenceSimulationMagnetic3Name = %s", dummy) ==1)
-      TurbulenceSimulationMagneticNames[2] = dummy;
 
-    ret += sscanf(line, "TurbulenceSimulationInitialTemperature = %"FSYM,
-                  &TurbulenceSimulationInitialTemperature);
-    ret += sscanf(line, "TurbulenceSimulationInitialDensity = %"FSYM,
-                  &TurbulenceSimulationInitialDensity);
-    ret += sscanf(line, "TurbulenceSimulationSoundSpeed = %"FSYM,
-                  &TurbulenceSimulationSoundSpeed);
-    ret += sscanf(line, "TurbulenceSimulationInitialPressure = %"FSYM,
-                  &TurbulenceSimulationInitialPressure);
-    ret += sscanf(line, "TurbulenceSimulationInitialDensityPerturbationAmplitude = %"FSYM,
-                  &TurbulenceSimulationInitialDensityPerturbationAmplitude);
-    ret += sscanf(line, "TurbulenceSimulationNumberOfInitialGrids = %"ISYM,
-                  &TurbulenceSimulationNumberOfInitialGrids);
-    ret += sscanf(line, "TurbulenceSimulationSubgridsAreStatic = %"ISYM,
-                  &TurbulenceSimulationSubgridsAreStatic);
- 
-    if (sscanf(line, "TurbulenceSimulationGridLeftEdge[%"ISYM"]", &gridnum) > 0)
-      ret += sscanf(line, "TurbulenceSimulationGridLeftEdge[%"ISYM"] = %"PSYM" %"PSYM" %"PSYM,
-                    &gridnum, &TurbulenceSimulationGridLeftEdge[gridnum][0],
-                    &TurbulenceSimulationGridLeftEdge[gridnum][1],
-                    &TurbulenceSimulationGridLeftEdge[gridnum][2]);
-    if (sscanf(line, "TurbulenceSimulationGridRightEdge[%"ISYM"]", &gridnum) > 0)
-      ret += sscanf(line, "TurbulenceSimulationGridRightEdge[%"ISYM"] = %"PSYM" %"PSYM" %"PSYM,
-                    &gridnum,
-		    &TurbulenceSimulationGridRightEdge[gridnum][0],
-                    &TurbulenceSimulationGridRightEdge[gridnum][1],
-                    &TurbulenceSimulationGridRightEdge[gridnum][2]);
-    if (sscanf(line, "TurbulenceSimulationGridDimension[%"ISYM"]", &gridnum) > 0)
-      ret += sscanf(line, "TurbulenceSimulationGridDimension[%"ISYM"] = %"ISYM" %"ISYM" %"ISYM,
-                    &gridnum,
-		    &TurbulenceSimulationGridDimension[gridnum][0],
-                    &TurbulenceSimulationGridDimension[gridnum][1],
-                    &TurbulenceSimulationGridDimension[gridnum][2]);
-    if (sscanf(line, "TurbulenceSimulationGridLevel[%"ISYM"]", &gridnum) > 0)
-      ret += sscanf(line, "TurbulenceSimulationGridLevel[%"ISYM"] = %"ISYM,
-                    &gridnum, &TurbulenceSimulationGridLevel[gridnum]);
-                                                                                
-    if( sscanf(line, "TurbulenceSimulationInitialMagneticField = %"PSYM" %"PSYM" %"PSYM,
-		  TurbulenceSimulationInitialMagneticField,
-		  TurbulenceSimulationInitialMagneticField+1,
-	       TurbulenceSimulationInitialMagneticField+2) > 0){
-      ret++;
-      InitialMagneticFieldDefined = TRUE;
+     
+    Param.GetScalar(dummy, "Problem.TurbulenceSimulation.DensityName");
+    if( strlen(dummy) > 0 ) {
+      TurbulenceSimulationDensityName = new char[MAX_LINE_LENGTH];
+      strcpy(TurbulenceSimulationDensityName,dummy);
     }
 
+    Param.GetScalar(dummy, "Problem.TurbulenceSimulation.TotalEnergyName");
+    if( strlen(dummy) > 0 ) {
+      TurbulenceSimulationTotalEnergyName = new char[MAX_LINE_LENGTH];
+      strcpy(TurbulenceSimulationTotalEnergyName,dummy);
+    }
+
+    Param.GetScalar(dummy, "Problem.TurbulenceSimulation.GasPressureName");
+    if( strlen(dummy) > 0 ) {
+      TurbulenceSimulationGasPressureName = new char[MAX_LINE_LENGTH];
+      strcpy(TurbulenceSimulationGasPressureName,dummy);
+    }
+
+    Param.GetScalar(dummy, "Problem.TurbulenceSimulation.GasEnergyName");
+    if( strlen(dummy) > 0 ) {
+      TurbulenceSimulationGasEnergyName = new char[MAX_LINE_LENGTH];
+      strcpy(TurbulenceSimulationGasEnergyName,dummy);
+    }
+
+    Param.GetArray(dummy_arr, "Problem.TurbulenceSimulation.VelocityNames");
+    for( i=0; i<MAX_DIMENSION; i++) {
+      if( strlen(dummy_arr[i]) > 0 ) {
+        TurbulenceSimulationVelocityNames[i] = new char[MAX_LINE_LENGTH];
+        strcpy(TurbulenceSimulationVelocityNames[i], dummy_arr[i]);
+      }
+    }
+
+    Param.GetArray(dummy_arr, "Problem.TurbulenceSimulation.RandomForcingNames");
+    for( i=0; i<MAX_DIMENSION; i++) {
+      if( strlen(dummy_arr[i]) > 0 ) {
+        TurbulenceSimulationRandomForcingNames[i] = new char[MAX_LINE_LENGTH];
+        strcpy(TurbulenceSimulationRandomForcingNames[i], dummy_arr[i]);
+      }
+    }
+
+    Param.GetArray(dummy_arr, "Problem.TurbulenceSimulation.MagneticNames");
+    for( i=0; i<MAX_DIMENSION; i++) {
+      if( strlen(dummy_arr[i]) > 0 ) {
+        TurbulenceSimulationMagneticNames[i] = new char[MAX_LINE_LENGTH];
+        strcpy(TurbulenceSimulationMagneticNames[i], dummy_arr[i]);
+      }
+    }
+
+  Param.GetScalar(TurbulenceSimulationInitialTemperature, "Problem.TurbulenceSimulationInitialTemperature");
+  Param.GetScalar(TurbulenceSimulationInitialDensity, "Problem.TurbulenceSimulationInitialDensity");
+  Param.GetScalar(TurbulenceSimulationSoundSpeed, "Problem.TurbulenceSimulationSoundSpeed");
+  Param.GetScalar(TurbulenceSimulationInitialPressure, "Problem.TurbulenceSimulationInitialPressure");
+  Param.GetScalar(TurbulenceSimulationInitialDensityPerturbationAmplitude, 
+		"Problem.TurbulenceSimulation.InitialDensityPerturbationAmplitude");
+  Param.GetScalar(TurbulenceSimulationNumberOfInitialGrids, 
+		"Problem.TurbulenceSimulation.NumberOfInitialGrids");
+  Param.GetScalar(TurbulenceSimulationSubgridsAreStatic,
+		"Problem.TurbulenceSimulation.SubgridsAreStatic");
+
+
+  int NumberOfInitialSubgrids = Param.Size("Problem.TurbulenceSimulation.InitialSubgrids");
+  if (NumberOfInitialSubgrids+1 > MAX_INITIAL_GRIDS) {
+    ENZO_VFAIL("You've exceeded the maximum number of TurbulenceSimulation initial grids (%d)!\n",
+      MAX_INITIAL_GRIDS)
+  }// end if
+
+  TurbulenceSimulationNumberOfInitialGrids = NumberOfInitialSubgrids + 1;  // add 1 for the root grid
+
+  char InitialSubgridNames[MAX_LINE_LENGTH][MAX_INITIAL_GRIDS];
+  Param.GetArray(InitialSubgridNames,"Problem.TurbulenceSimulation.InitialSubgrids");
+
+  for (i = 0; i < NumberOfInitialSubgrids; i++) {
+    Param.GetArray(TurbulenceSimulationGridLeftEdge[i+1], 
+        "Problem.TurbulenceSimulation.%s.LeftEdge",InitialSubgridNames[i]);
+    Param.GetArray(TurbulenceSimulationGridRightEdge[i+1], 
+        "Problem.TurbulenceSimulation.%s.RightEdge",InitialSubgridNames[i]);
+    Param.GetArray(TurbulenceSimulationGridDimension[i+1],
+        "Problem.TurbulenceSimulation.%s.Dimension",InitialSubgridNames[i]);
+    Param.GetScalar(TurbulenceSimulationGridLevel[i+1], 
+        "Problem.TurbulenceSimulation.%s.Level",InitialSubgridNames[i]);
+  }// end i for
+
+  Param.GetArray(TurbulenceSimulationInitialMagneticField,"Problem.TurbulenceSimulation.InitialMagneticField");
+  Param.GetScalar(InitialMagneticFieldDefined,
+  		"Problem.TurbulenceSimulation.MagneticFieldDefined");
+
     /* If the dummy char space was used, then make another. */
  
     if (dummy[0] != 0) {
       ret++;
     }
  
-    /* if the line is suspicious, issue a warning */
- 
-    if (ret == 0 && strstr(line, "=") && strstr(line, "TurbulenceSimulation")
-	&& line[0] != '#')
-      fprintf(stderr,
-   "warning: the following parameter line was not interpreted:\n%s\n", line);
- 
-  }
- 
   /* More error checking. */
   /* dcc removed in favor of in house generation.
   if (TurbulenceSimulationVelocityNames[0] == NULL) {

File src/enzo/gFLDProblem_Initialize.C

 /           stored here.
 /
 ************************************************************************/
+#include "ParameterControl/ParameterControl.h"
+extern Configuration Param;
+
 #ifdef TRANSFER
 #include "gFLDProblem.h"
 #include "CosmologyParameters.h"
 
+const char config_gfld_problem_defaults[] = 
+"### COSMOLOGY SIMULATION DEFAULTS ###\n"
+"\n"
+"Problem: {\n"
+"    gFLD: {\n"
+"         BoundaryX0FaceType = ;\n"
+"         BoundaryX1FaceType = ;\n"
+"         BoundaryX2FaceType = ;\n"
+"         IonizationParms ='\n"
+"         RadHydro: {\n"
+"              approx_jac = 0;\n"
+"              initial_guess = 0;\n"
+"              AnalyticChem = 1;\n"
+"              newt_linesearch = 1;\n"
+"              newt_maxit = 20;\n"
+"              newt_norm = 0;\n"
+"              newt_INconst = 1.0e-8;'\n"
+"              newt_tol = 1.0e-6;\n"
+"              newt_MinLinesearch = 1.0e-12;\n"
+"              sol_maxit = 20;\n"
+"              sol_rlxtype = 1;\n"
+"              sol_npre = 1;\n"
+"              sol_npost = 1;\n"
+"              ESpectrum = 1;\n"
+"              Nchem = 1;\n"
+"              HFraction = 1.0;\n"
+"              Model     = 1;\n"
+"              maxdt     = "
+"              mindt     = "
+"              initdt    = "
+"              dtnorm    = 2.0;\n"
+"         };\n"
+"         PlanckOpacity: {\n"
+"              C0   = 1.0\n"
+"              C1   = 1.0\n"
+"              C2   = 0.0\n"
+"              C3   = 1.0\n"
+"              C4   = 0.0\n"
+"         };\n"
+"         EnergyOpacity: {\n"
+"              C0   = 1.0\n"
+"              C1   = 1.0\n"
+"              C2   = 0.0\n"
+"              C3   = 1.0\n"
+"              C4   = 0.0\n"
+"         };\n"
+"    };\n"
+"};\n";
+
 // character strings
 EXTERN char outfilename[];
 
       // read until out of lines
       while (fgets(line, MAX_LINE_LENGTH, fptr) != NULL) {
 	ret = 0;
-	ret += sscanf(line, "RadHydroESpectrum = %"ISYM, &ESpectrum);
-	ret += sscanf(line, "RadHydroChemistry = %"ISYM, &Nchem);
-	ret += sscanf(line, "RadHydroHFraction = %"FSYM, &HFrac);
-	ret += sscanf(line, "RadHydroModel = %"ISYM, &Model);
-	ret += sscanf(line, "RadHydroMaxDt = %"FSYM, &maxdt);
-	ret += sscanf(line, "RadHydroMinDt = %"FSYM, &mindt);
-	ret += sscanf(line, "RadHydroInitDt = %"FSYM, &initdt);
-	ret += sscanf(line, "RadHydroDtNorm = %"FSYM, &dtnorm);
-	ret += sscanf(line, "RadHydroDtRadFac = %"FSYM, &dtfac[0]);
-	ret += sscanf(line, "RadHydroDtGasFac = %"FSYM, &dtfac[1]);
-	ret += sscanf(line, "RadHydroDtChemFac = %"FSYM, &dtfac[2]);
-	ret += sscanf(line, "RadiationScaling = %"FSYM, &ErScale);
-	ret += sscanf(line, "EnergyCorrectionScaling = %"FSYM, &ecScale);
-	ret += sscanf(line, "ChemistryScaling = %"FSYM, &NiScale);
-	ret += sscanf(line, "RadHydroTheta = %"FSYM, &theta);
-	ret += sscanf(line, "RadHydroLimiterType = %"ISYM, &LimType);
-	ret += sscanf(line, "RadiationBoundaryX0Faces = %"ISYM" %"ISYM, 
-		      BdryType[0], BdryType[0]+1);
-	if (rank > 1) {
-	  ret += sscanf(line, "RadiationBoundaryX1Faces = %"ISYM" %"ISYM,
-			BdryType[1], BdryType[1]+1);
-	  if (rank > 2) {
-	    ret += sscanf(line, "RadiationBoundaryX2Faces = %"ISYM" %"ISYM,
-			  BdryType[2], BdryType[2]+1);
-	  }
-	}
-	ret += sscanf(line, "RadHydroAprxJacobian = %"ISYM, &approx_jac);
-	ret += sscanf(line, "RadHydroInitialGuess = %"ISYM, &initial_guess);
-	ret += sscanf(line, "RadHydroAnalyticChem = %"ISYM, &AnalyticChem);
-	ret += sscanf(line, "RadHydroNewtLinesearch = %"ISYM, &newt_linesearch);
-	ret += sscanf(line, "RadHydroNewtIters = %"ISYM, &newt_maxit);
-	ret += sscanf(line, "RadHydroNewtNorm = %"ISYM, &newt_norm);
-	ret += sscanf(line, "RadHydroINConst = %"FSYM, &newt_INconst);
-	ret += sscanf(line, "RadHydroNewtTolerance = %"FSYM, &newt