Index: src/config.cpp
===================================================================
--- src/config.cpp	(revision d8b94a86944c4679c88bc250bff510f242d63309)
+++ src/config.cpp	(revision 1907a789609146bbdebfeff09de44cb4ba21b808)
@@ -1,6 +1,6 @@
 /** \file config.cpp
- * 
+ *
  * Function implementations for the class config.
- * 
+ *
  */
 
@@ -24,5 +24,5 @@
 	configname[0]='\0';
 	basis = "3-21G";
-	
+
 	FastParsing = false;
 	ProcPEGamma=8;
@@ -42,5 +42,5 @@
 	UseAddGramSch=1;
 	Seed=1;
-	
+
 	MaxOuterStep=0;
 	Deltat=1;
@@ -51,5 +51,5 @@
 	MaxPsiStep=0;
 	EpsWannier=1e-7;
-	
+
 	MaxMinStep=100;
 	RelEpsTotalEnergy=1e-7;
@@ -62,7 +62,7 @@
 	InitMaxMinStopStep=1;
 	InitMaxMinGapStopStep=0;
-	
+
 	//BoxLength[NDIM*NDIM];
-	
+
 	ECut=128.;
 	MaxLevel=5;
@@ -77,5 +77,5 @@
 	PsiMaxNoDown=0;
 	AddPsis=0;
-	
+
 	RCut=20.;
 	StructOpt=0;
@@ -101,8 +101,8 @@
  * for each entry of the config file structure.
  */
-void config::Edit(molecule *mol)
+void config::Edit()
 {
 	char choice;
-	
+
 	do {
 		cout << Verbose(0) << "===========EDIT CONFIGURATION============================" << endl;
@@ -137,5 +137,5 @@
 		cout << Verbose(0) << " g - Relative change in kinetic energy to stop min. iteration during initial level" << endl;
 		cout << Verbose(0) << " h - Check stop conditions every ..th step during min. iteration during initial level" << endl;
-		cout << Verbose(0) << " j - six lower diagonal entries of matrix, defining the unit cell" << endl;
+//		cout << Verbose(0) << " j - six lower diagonal entries of matrix, defining the unit cell" << endl;
 		cout << Verbose(0) << " k - Energy cutoff of plane wave basis in Hartree" << endl;
 		cout << Verbose(0) << " l - Maximum number of levels in multi-level-ansatz" << endl;
@@ -157,5 +157,5 @@
 		cout << Verbose(0) << "INPUT: ";
 		cin >> choice;
-		
+
 		switch (choice) {
 				case 'A': // mainname
@@ -282,13 +282,13 @@
 					cin >> config::InitMaxMinStopStep;
 					break;
-				
-				case 'j': // BoxLength
-					cout << Verbose(0) << "enter lower triadiagonalo form of basis matrix" << endl << endl;
-					for (int i=0;i<6;i++) {
-						cout << Verbose(0) << "Cell size" << i << ": ";
-						cin >> mol->cell_size[i];
-					}
-					break;
-				
+
+//				case 'j': // BoxLength
+//					cout << Verbose(0) << "enter lower triadiagonalo form of basis matrix" << endl << endl;
+//					for (int i=0;i<6;i++) {
+//						cout << Verbose(0) << "Cell size" << i << ": ";
+//						cin >> mol->cell_size[i];
+//					}
+//					break;
+
 				case 'k': // ECut
 					cout << Verbose(0) << "Old: " << config::ECut << "\t new: ";
@@ -364,5 +364,5 @@
  * \param *periode pointer to a periodentafel class with all elements
  * \param *mol pointer to molecule containing all atoms of the molecule
- * \return 0 - old syntax, 1 - new syntax, -1 - unknown syntax 
+ * \return 0 - old syntax, 1 - new syntax, -1 - unknown syntax
  */
 int config::TestSyntax(char *filename, periodentafel *periode, molecule *mol)
@@ -370,5 +370,5 @@
 	int test;
 	ifstream file(filename);
-	
+
 	// search file for keyword: ProcPEGamma (new syntax)
 	if (ParseForParameter(1,&file,"ProcPEGamma", 0, 1, 1, int_type, &test, 1, optional)) {
@@ -441,5 +441,5 @@
  * \param *file input file stream being the opened config file
  * \param *periode pointer to a periodentafel class with all elements
- * \param *mol pointer to molecule containing all atoms of the molecule 
+ * \param *mol pointer to molecule containing all atoms of the molecule
  */
 void config::Load(char *filename, periodentafel *periode, molecule *mol)
@@ -452,5 +452,5 @@
 	RetrieveConfigPathAndName(filename);
 	// ParseParameters
-	
+
 	/* Oeffne Hauptparameterdatei */
 	int di;
@@ -464,5 +464,5 @@
 	int verbose = 0;
 	double value[3];
-	
+
 	/* Namen einlesen */
 
@@ -495,5 +495,5 @@
 		config::DoOutCurrent = 0;
 	if (config::DoOutCurrent < 0) config::DoOutCurrent = 0;
-	if (config::DoOutCurrent > 1) config::DoOutCurrent = 1; 
+	if (config::DoOutCurrent > 1) config::DoOutCurrent = 1;
 	ParseForParameter(verbose,file,"AddGramSch", 0, 1, 1, int_type, &(config::UseAddGramSch), 1, critical);
 	if (config::UseAddGramSch < 0) config::UseAddGramSch = 0;
@@ -517,5 +517,5 @@
 		if (config::SawtoothStart > 1.) config::SawtoothStart = 1.;
 	}
-	
+
 	ParseForParameter(verbose,file,"MaxOuterStep", 0, 1, 1, int_type, &(config::MaxOuterStep), 1, critical);
 	if (!ParseForParameter(verbose,file,"Deltat", 0, 1, 1, double_type, &(config::Deltat), 1, optional))
@@ -527,10 +527,10 @@
 	if (!ParseForParameter(verbose,file,"EpsWannier", 0, 1, 1, double_type, &(config::EpsWannier), 1, optional))
 		config::EpsWannier = 1e-8;
-	
+
 	// stop conditions
 	//if (config::MaxOuterStep <= 0) config::MaxOuterStep = 1;
 	ParseForParameter(verbose,file,"MaxPsiStep", 0, 1, 1, int_type, &(config::MaxPsiStep), 1, critical);
 	if (config::MaxPsiStep <= 0) config::MaxPsiStep = 3;
-	
+
 	ParseForParameter(verbose,file,"MaxMinStep", 0, 1, 1, int_type, &(config::MaxMinStep), 1, critical);
 	ParseForParameter(verbose,file,"RelEpsTotalE", 0, 1, 1, double_type, &(config::RelEpsTotalEnergy), 1, critical);
@@ -541,5 +541,5 @@
 	if (config::MaxMinStopStep < 1) config::MaxMinStopStep = 1;
 	if (config::MaxMinGapStopStep < 1) config::MaxMinGapStopStep = 1;
-	
+
 	ParseForParameter(verbose,file,"MaxInitMinStep", 0, 1, 1, int_type, &(config::MaxInitMinStep), 1, critical);
 	ParseForParameter(verbose,file,"InitRelEpsTotalE", 0, 1, 1, double_type, &(config::InitRelEpsTotalEnergy), 1, critical);
@@ -550,5 +550,5 @@
 	if (config::InitMaxMinStopStep < 1) config::InitMaxMinStopStep = 1;
 	if (config::InitMaxMinGapStopStep < 1) config::InitMaxMinGapStopStep = 1;
-	
+
 	// Unit cell and magnetic field
 	ParseForParameter(verbose,file, "BoxLength", 0, 3, 3, lower_trigrid, BoxLength, 1, critical); /* Lattice->RealBasis */
@@ -566,7 +566,7 @@
 		config::DoFullCurrent = 0;
 	if (config::DoFullCurrent < 0) config::DoFullCurrent = 0;
-	if (config::DoFullCurrent > 2) config::DoFullCurrent = 2; 
+	if (config::DoFullCurrent > 2) config::DoFullCurrent = 2;
 	if (config::DoOutNICS < 0) config::DoOutNICS = 0;
-	if (config::DoOutNICS > 2) config::DoOutNICS = 2; 
+	if (config::DoOutNICS > 2) config::DoOutNICS = 2;
 	if (config::DoPerturbation == 0) {
 		config::DoFullCurrent = 0;
@@ -585,5 +585,5 @@
 	} else {
 		fprintf(stderr, "0 <= RiemanTensor < 2: 0 UseNotRT, 1 UseRT");
-		exit(1); 
+		exit(1);
 	}
 	switch (config::RiemannTensor) {
@@ -602,5 +602,5 @@
 			if (config::RiemannLevel < 2) {
 				config::RiemannLevel = 2;
-			} 
+			}
 			if (config::RiemannLevel > config::MaxLevel-1) {
 				config::RiemannLevel = config::MaxLevel-1;
@@ -609,5 +609,5 @@
 			if (config::LevRFactor < 2) {
 				config::LevRFactor = 2;
-			} 
+			}
 			config::Lev0Factor = 2;
 			config::RTActualUse = 2;
@@ -619,5 +619,5 @@
 	} else {
 		fprintf(stderr, "0 <= PsiType < 2: 0 UseSpinDouble, 1 UseSpinUpDown");
-		exit(1); 
+		exit(1);
 	}
 	switch (config::PsiType) {
@@ -633,7 +633,7 @@
 		break;
 	}
-	
+
 	// IonsInitRead
-	
+
 	ParseForParameter(verbose,file,"RCut", 0, 1, 1, double_type, &(config::RCut), 1, critical);
 	ParseForParameter(verbose,file,"IsAngstroem", 0, 1, 1, int_type, &(config::IsAngstroem), 1, critical);
@@ -653,8 +653,8 @@
 			ParseForParameter(verbose,file, name, 0, 2, 1, int_type, &Z, 1, critical);
 			elementhash[i] = periode->FindElement(Z);
-			cout << Verbose(1) << i << ". Z = " << elementhash[i]->Z << " with " << No[i] << " ions." << endl; 
+			cout << Verbose(1) << i << ". Z = " << elementhash[i]->Z << " with " << No[i] << " ions." << endl;
 		}
 		int repetition = 0; // which repeated keyword shall be read
-	
+
 		map<int, atom *> AtomList[config::MaxTypes];
 		if (!FastParsing) {
@@ -675,5 +675,5 @@
 						} else
 							neues = AtomList[i][j];
-						status = (status && 
+						status = (status &&
 										ParseForParameter(verbose,file, keyword, 0, 1, 1, double_type, &neues->x.x[0], 1, (repetition == 0) ? critical : optional) &&
 										ParseForParameter(verbose,file, keyword, 0, 2, 1, double_type, &neues->x.x[1], 1, (repetition == 0) ? critical : optional) &&
@@ -681,5 +681,5 @@
 										ParseForParameter(verbose,file, keyword, 0, 4, 1, int_type, &neues->FixedIon, 1, (repetition == 0) ? critical : optional));
 						if (!status) break;
-		
+
 						// check size of vectors
 						if (mol->Trajectories[neues].R.size() <= (unsigned int)(repetition)) {
@@ -689,9 +689,9 @@
 							mol->Trajectories[neues].F.resize(repetition+10);
 						}
-					
+
 						// put into trajectories list
 						for (int d=0;d<NDIM;d++)
 							mol->Trajectories[neues].R.at(repetition).x[d] = neues->x.x[d];
-						
+
 						// parse velocities if present
 						if(!ParseForParameter(verbose,file, keyword, 0, 5, 1, double_type, &neues->v.x[0], 1,optional))
@@ -703,5 +703,5 @@
 						for (int d=0;d<NDIM;d++)
 							mol->Trajectories[neues].U.at(repetition).x[d] = neues->v.x[d];
-			
+
 						// parse forces if present
 						if(!ParseForParameter(verbose,file, keyword, 0, 8, 1, double_type, &value[0], 1,optional))
@@ -713,6 +713,6 @@
 						for (int d=0;d<NDIM;d++)
 							mol->Trajectories[neues].F.at(repetition).x[d] = value[d];
-	
-	//						cout << "Parsed position of step " << (repetition) << ": ("; 
+
+	//						cout << "Parsed position of step " << (repetition) << ": (";
 	//						for (int d=0;d<NDIM;d++)
 	//							cout << mol->Trajectories[neues].R.at(repetition).x[d] << " ";					// next step
@@ -770,5 +770,5 @@
  * \param *file input file stream being the opened config file with old pcp syntax
  * \param *periode pointer to a periodentafel class with all elements
- * \param *mol pointer to molecule containing all atoms of the molecule 
+ * \param *mol pointer to molecule containing all atoms of the molecule
  */
 void config::LoadOld(char *filename, periodentafel *periode, molecule *mol)
@@ -781,5 +781,5 @@
 	RetrieveConfigPathAndName(filename);
 	// ParseParameters
-	
+
 	/* Oeffne Hauptparameterdatei */
 	int l, i, di;
@@ -791,5 +791,5 @@
 	int Z, No, AtomNo, found;
 	int verbose = 0;
-	
+
 	/* Namen einlesen */
 
@@ -823,10 +823,10 @@
 	ParseForParameter(verbose,file,"ScaleTempStep", 0, 1, 1, int_type, &(config::ScaleTempStep), 1, optional);
 	config::EpsWannier = 1e-8;
-	
+
 	// stop conditions
 	//if (config::MaxOuterStep <= 0) config::MaxOuterStep = 1;
 	ParseForParameter(verbose,file,"MaxPsiStep", 0, 1, 1, int_type, &(config::MaxPsiStep), 1, critical);
 	if (config::MaxPsiStep <= 0) config::MaxPsiStep = 3;
-	
+
 	ParseForParameter(verbose,file,"MaxMinStep", 0, 1, 1, int_type, &(config::MaxMinStep), 1, critical);
 	ParseForParameter(verbose,file,"MaxMinStep", 0, 2, 1, double_type, &(config::RelEpsTotalEnergy), 1, critical);
@@ -836,5 +836,5 @@
 	if (config::MaxMinStopStep < 1) config::MaxMinStopStep = 1;
 	config::MaxMinGapStopStep = 1;
-	
+
 	ParseForParameter(verbose,file,"MaxInitMinStep", 0, 1, 1, int_type, &(config::MaxInitMinStep), 1, critical);
 	ParseForParameter(verbose,file,"MaxInitMinStep", 0, 2, 1, double_type, &(config::InitRelEpsTotalEnergy), 1, critical);
@@ -867,5 +867,5 @@
 	} else {
 		fprintf(stderr, "0 <= RiemanTensor < 2: 0 UseNotRT, 1 UseRT");
-		exit(1); 
+		exit(1);
 	}
 	switch (config::RiemannTensor) {
@@ -884,5 +884,5 @@
 			if (config::RiemannLevel < 2) {
 				config::RiemannLevel = 2;
-			} 
+			}
 			if (config::RiemannLevel > config::MaxLevel-1) {
 				config::RiemannLevel = config::MaxLevel-1;
@@ -891,5 +891,5 @@
 			if (config::LevRFactor < 2) {
 				config::LevRFactor = 2;
-			} 
+			}
 			config::Lev0Factor = 2;
 			config::RTActualUse = 2;
@@ -901,5 +901,5 @@
 	} else {
 		fprintf(stderr, "0 <= PsiType < 2: 0 UseSpinDouble, 1 UseSpinUpDown");
-		exit(1); 
+		exit(1);
 	}
 	switch (config::PsiType) {
@@ -915,7 +915,7 @@
 		break;
 	}
-	
+
 	// IonsInitRead
-	
+
 	ParseForParameter(verbose,file,"RCut", 0, 1, 1, double_type, &(config::RCut), 1, critical);
 	ParseForParameter(verbose,file,"IsAngstroem", 0, 1, 1, int_type, &(config::IsAngstroem), 1, critical);
@@ -924,7 +924,7 @@
 
 	// Routine from builder.cpp
-	
-	
-	for (i=MAX_ELEMENTS;i--;) 
+
+
+	for (i=MAX_ELEMENTS;i--;)
 		elementhash[i] = NULL;
 	cout << Verbose(0) << "Parsing Ions ..." << endl;
@@ -937,5 +937,5 @@
 		}
 		if (found > 0) {
-			if (zeile.find("Ions_Data") == 0) 
+			if (zeile.find("Ions_Data") == 0)
 				getline(*file,zeile,'\n'); // read next line and parse this one
 			istringstream input(zeile);
@@ -966,5 +966,5 @@
 			No++;
 		}
-	}	 
+	}
 	file->close();
 	delete(file);
@@ -974,5 +974,5 @@
  * \param *filename name of file
  * \param *periode pointer to a periodentafel class with all elements
- * \param *mol pointer to molecule containing all atoms of the molecule 
+ * \param *mol pointer to molecule containing all atoms of the molecule
  */
 bool config::Save(const char *filename, periodentafel *periode, molecule *mol) const
@@ -1081,5 +1081,5 @@
  * Note that this format cannot be parsed again.
  * \param *filename name of file (without ".in" suffix!)
- * \param *mol pointer to molecule containing all atoms of the molecule 
+ * \param *mol pointer to molecule containing all atoms of the molecule
  */
 bool config::SaveMPQC(const char *filename, molecule *mol) const
@@ -1092,5 +1092,5 @@
 	ofstream *output = NULL;
 	stringstream *fname = NULL;
-	
+
 	// first without hessian
 	fname = new stringstream;
@@ -1191,5 +1191,5 @@
 	delete(output);
 	delete(fname);
-	
+
 	return true;
 };
@@ -1203,5 +1203,5 @@
  * \param file file to be parsed
  * \param name Name of value in file (at least 3 chars!)
- * \param sequential 1 - do not reset file pointer to begin of file, 0 - set to beginning 
+ * \param sequential 1 - do not reset file pointer to begin of file, 0 - set to beginning
  *				(if file is sequentially parsed this can be way faster! However, beware of multiple values per line, as whole line is read -
  *				 best approach: 0 0 0 1 (not resetted only on last value of line) - and of yth, which is now
@@ -1223,5 +1223,5 @@
 	dummy1 = free_dummy = (char *) Malloc(256 * sizeof(char), "config::ParseForParameter: *free_dummy");
 
-	//fprintf(stderr,"Parsing for %s\n",name);	
+	//fprintf(stderr,"Parsing for %s\n",name);
 	if (repetition == 0)
 		//Error(SomeError, "ParseForParameter(): argument repetition must not be 0!");
@@ -1244,5 +1244,5 @@
 					file->clear();
 					file->seekg(file_position, ios::beg);	// rewind to start position
-					Free((void **)&free_dummy, "config::ParseForParameter: *free_dummy");					
+					Free((void **)&free_dummy, "config::ParseForParameter: *free_dummy");
 					return 0;
 				}
@@ -1250,5 +1250,5 @@
 			line++;
 		} while (dummy != NULL && dummy1 != NULL && ((dummy1[0] == '#') || (dummy1[0] == '\0'))); // skip commentary and empty lines
-		
+
 		// C++ getline removes newline at end, thus re-add
 		if ((dummy1 != NULL) && (strchr(dummy1,'\n') == NULL)) {
@@ -1276,5 +1276,5 @@
 				//fprintf(stderr,"Error: Cannot find tabs or spaces on line %i in search for %s\n", line, name);
 				//Free((void **)&free_dummy);
-				//Error(FileOpenParams, NULL);			
+				//Error(FileOpenParams, NULL);
 			} else {
 				//fprintf(stderr,"found tab at %i\n",(char *)dummy-(char *)dummy1);
@@ -1285,6 +1285,6 @@
 		if ((name == NULL) || (((dummy-dummy1 >= 3) && (strncmp(dummy1, name, strlen(name)) == 0)) && ((unsigned int)(dummy-dummy1) == strlen(name)))) {
 			found++; // found the parameter!
-			//fprintf(stderr,"found %s at line %i between %i and %i\n", name, line, dummy1, dummy);		
-			
+			//fprintf(stderr,"found %s at line %i between %i and %i\n", name, line, dummy1, dummy);
+
 			if (found == repetition) {
 				for (i=0;i<xth;i++) { // i = rows
@@ -1325,5 +1325,5 @@
 						dummy1[j+1] = '\0';
 					}
-	
+
 					int start = (type >= grid) ? 0 : yth-1 ;
 					for (j=start;j<yth;j++) { // j = columns
@@ -1348,5 +1348,5 @@
 										//return 0;
 										exit(255);
-										//Error(FileOpenParams, NULL);			
+										//Error(FileOpenParams, NULL);
 									} else {
 										//if (!sequential)
@@ -1363,5 +1363,5 @@
 								// found comment, skipping rest of line
 								//if (verbose) fprintf(stderr,"Error: '#' at %i and still missing %i value(s) for parameter %s\n", line, yth-j, name);
-								if (!sequential) { // here we need it! 
+								if (!sequential) { // here we need it!
 									file->seekg(file_position, ios::beg);	// rewind to start position
 								}
@@ -1378,5 +1378,5 @@
 										//value += sizeof(int);
 									break;
-								case(row_double): 
+								case(row_double):
 								case(grid):
 								case(lower_trigrid):
@@ -1419,5 +1419,5 @@
 			}
 		}
-	} 
+	}
 	if ((type >= row_int) && (verbose)) fprintf(stderr,"\n");
 	Free((void **)&free_dummy, "config::ParseForParameter: *free_dummy");
@@ -1427,5 +1427,5 @@
 	}
 	//fprintf(stderr, "End of Parsing\n\n");
-	
+
 	return (found); // true if found, false if not
 }
