Index: src/Parser/PcpParser.cpp
===================================================================
--- src/Parser/PcpParser.cpp	(revision 4fdc6536733f18fb07af327a470c5552ca8c10ce)
+++ src/Parser/PcpParser.cpp	(revision 7a1dd0dd732364be0f3893be54188e99c0bbc3ce)
@@ -167,189 +167,192 @@
 
   // 1. parse in options
-  ParseForParameter(verbose,FileBuffer, "mainname", 0, 1, 1, string_type, (Paths.mainname), 1, critical);
-  ParseForParameter(verbose,FileBuffer, "defaultpath", 0, 1, 1, string_type, (Paths.defaultpath), 1, critical);
-  ParseForParameter(verbose,FileBuffer, "pseudopotpath", 0, 1, 1, string_type, (Paths.pseudopotpath), 1, critical);
-  ParseForParameter(verbose,FileBuffer,"ProcPEGamma", 0, 1, 1, int_type, &(Parallelization.ProcPEGamma), 1, critical);
-  ParseForParameter(verbose,FileBuffer,"ProcPEPsi", 0, 1, 1, int_type, &(Parallelization.ProcPEPsi), 1, critical);
-
-  if (!ParseForParameter(verbose,FileBuffer,"Seed", 0, 1, 1, int_type, &(LocalizedOrbitals.Seed), 1, optional))
-    LocalizedOrbitals.Seed = 1;
-
-  if(!ParseForParameter(verbose,FileBuffer,"DoOutOrbitals", 0, 1, 1, int_type, &(Switches.DoOutOrbitals), 1, optional)) {
-    Switches.DoOutOrbitals = 0;
+  if (!ParseForParameter(verbose,FileBuffer, "mainname", 0, 1, 1, string_type, (Paths.mainname), 1, critical)) {
+    DoeLog(1) && (eLog()<< Verbose(1) << "mainname is missing, is file empty?" << endl);
   } else {
-    if (Switches.DoOutOrbitals < 0) Switches.DoOutOrbitals = 0;
-    if (Switches.DoOutOrbitals > 1) Switches.DoOutOrbitals = 1;
-  }
-  ParseForParameter(verbose,FileBuffer,"DoOutVis", 0, 1, 1, int_type, &(Switches.DoOutVis), 1, critical);
-  if (Switches.DoOutVis < 0) Switches.DoOutVis = 0;
-  if (Switches.DoOutVis > 1) Switches.DoOutVis = 1;
-  if (!ParseForParameter(verbose,FileBuffer,"VectorPlane", 0, 1, 1, int_type, &(LocalizedOrbitals.VectorPlane), 1, optional))
-    LocalizedOrbitals.VectorPlane = -1;
-  if (!ParseForParameter(verbose,FileBuffer,"VectorCut", 0, 1, 1, double_type, &(LocalizedOrbitals.VectorCut), 1, optional))
-    LocalizedOrbitals.VectorCut = 0.;
-  ParseForParameter(verbose,FileBuffer,"DoOutMes", 0, 1, 1, int_type, &(Switches.DoOutMes), 1, critical);
-  if (Switches.DoOutMes < 0) Switches.DoOutMes = 0;
-  if (Switches.DoOutMes > 1) Switches.DoOutMes = 1;
-  if (!ParseForParameter(verbose,FileBuffer,"DoOutCurr", 0, 1, 1, int_type, &(Switches.DoOutCurrent), 1, optional))
-    Switches.DoOutCurrent = 0;
-  if (Switches.DoOutCurrent < 0) Switches.DoOutCurrent = 0;
-  if (Switches.DoOutCurrent > 1) Switches.DoOutCurrent = 1;
-  ParseForParameter(verbose,FileBuffer,"AddGramSch", 0, 1, 1, int_type, &(LocalizedOrbitals.UseAddGramSch), 1, critical);
-  if (LocalizedOrbitals.UseAddGramSch < 0) LocalizedOrbitals.UseAddGramSch = 0;
-  if (LocalizedOrbitals.UseAddGramSch > 2) LocalizedOrbitals.UseAddGramSch = 2;
-  if(!ParseForParameter(verbose,FileBuffer,"DoWannier", 0, 1, 1, int_type, &(Switches.DoWannier), 1, optional)) {
-    Switches.DoWannier = 0;
-  } else {
-    if (Switches.DoWannier < 0) Switches.DoWannier = 0;
-    if (Switches.DoWannier > 1) Switches.DoWannier = 1;
-  }
-  if(!ParseForParameter(verbose,FileBuffer,"CommonWannier", 0, 1, 1, int_type, &(LocalizedOrbitals.CommonWannier), 1, optional)) {
-    LocalizedOrbitals.CommonWannier = 0;
-  } else {
-    if (LocalizedOrbitals.CommonWannier < 0) LocalizedOrbitals.CommonWannier = 0;
-    if (LocalizedOrbitals.CommonWannier > 4) LocalizedOrbitals.CommonWannier = 4;
-  }
-  if(!ParseForParameter(verbose,FileBuffer,"SawtoothStart", 0, 1, 1, double_type, &(LocalizedOrbitals.SawtoothStart), 1, optional)) {
-    LocalizedOrbitals.SawtoothStart = 0.01;
-  } else {
-    if (LocalizedOrbitals.SawtoothStart < 0.) LocalizedOrbitals.SawtoothStart = 0.;
-    if (LocalizedOrbitals.SawtoothStart > 1.) LocalizedOrbitals.SawtoothStart = 1.;
-  }
-
-  if (ParseForParameter(verbose,FileBuffer,"DoConstrainedMD", 0, 1, 1, int_type, &(Switches.DoConstrainedMD), 1, optional))
-    if (Switches.DoConstrainedMD < 0)
-      Switches.DoConstrainedMD = 0;
-  ParseForParameter(verbose,FileBuffer,"MaxOuterStep", 0, 1, 1, int_type, &(StepCounts.MaxOuterStep), 1, critical);
-  if (!ParseForParameter(verbose,FileBuffer,"Deltat", 0, 1, 1, double_type, &(Deltat), 1, optional))
-    Deltat = 1;
-  ParseForParameter(verbose,FileBuffer,"OutVisStep", 0, 1, 1, int_type, &(StepCounts.OutVisStep), 1, optional);
-  ParseForParameter(verbose,FileBuffer,"OutSrcStep", 0, 1, 1, int_type, &(StepCounts.OutSrcStep), 1, optional);
-  ParseForParameter(verbose,FileBuffer,"TargetTemp", 0, 1, 1, double_type, &(World::getInstance().getThermostats()->TargetTemp), 1, optional);
-  //ParseForParameter(verbose,FileBuffer,"Thermostat", 0, 1, 1, int_type, &(ScaleTempStep), 1, optional);
-  if (!ParseForParameter(verbose,FileBuffer,"EpsWannier", 0, 1, 1, double_type, &(LocalizedOrbitals.EpsWannier), 1, optional))
-    LocalizedOrbitals.EpsWannier = 1e-8;
-
-  // stop conditions
-  //if (MaxOuterStep <= 0) MaxOuterStep = 1;
-  ParseForParameter(verbose,FileBuffer,"MaxPsiStep", 0, 1, 1, int_type, &(StepCounts.MaxPsiStep), 1, critical);
-  if (StepCounts.MaxPsiStep <= 0) StepCounts.MaxPsiStep = 3;
-
-  ParseForParameter(verbose,FileBuffer,"MaxMinStep", 0, 1, 1, int_type, &(StepCounts.MaxMinStep), 1, critical);
-  ParseForParameter(verbose,FileBuffer,"RelEpsTotalE", 0, 1, 1, double_type, &(StepCounts.RelEpsTotalEnergy), 1, critical);
-  ParseForParameter(verbose,FileBuffer,"RelEpsKineticE", 0, 1, 1, double_type, &(StepCounts.RelEpsKineticEnergy), 1, critical);
-  ParseForParameter(verbose,FileBuffer,"MaxMinStopStep", 0, 1, 1, int_type, &(StepCounts.MaxMinStopStep), 1, critical);
-  ParseForParameter(verbose,FileBuffer,"MaxMinGapStopStep", 0, 1, 1, int_type, &(StepCounts.MaxMinGapStopStep), 1, critical);
-  if (StepCounts.MaxMinStep <= 0) StepCounts.MaxMinStep = StepCounts.MaxPsiStep;
-  if (StepCounts.MaxMinStopStep < 1) StepCounts.MaxMinStopStep = 1;
-  if (StepCounts.MaxMinGapStopStep < 1) StepCounts.MaxMinGapStopStep = 1;
-
-  ParseForParameter(verbose,FileBuffer,"MaxInitMinStep", 0, 1, 1, int_type, &(StepCounts.MaxInitMinStep), 1, critical);
-  ParseForParameter(verbose,FileBuffer,"InitRelEpsTotalE", 0, 1, 1, double_type, &(StepCounts.InitRelEpsTotalEnergy), 1, critical);
-  ParseForParameter(verbose,FileBuffer,"InitRelEpsKineticE", 0, 1, 1, double_type, &(StepCounts.InitRelEpsKineticEnergy), 1, critical);
-  ParseForParameter(verbose,FileBuffer,"InitMaxMinStopStep", 0, 1, 1, int_type, &(StepCounts.InitMaxMinStopStep), 1, critical);
-  ParseForParameter(verbose,FileBuffer,"InitMaxMinGapStopStep", 0, 1, 1, int_type, &(StepCounts.InitMaxMinGapStopStep), 1, critical);
-  if (StepCounts.MaxInitMinStep <= 0) StepCounts.MaxInitMinStep = StepCounts.MaxPsiStep;
-  if (StepCounts.InitMaxMinStopStep < 1) StepCounts.InitMaxMinStopStep = 1;
-  if (StepCounts.InitMaxMinGapStopStep < 1) StepCounts.InitMaxMinGapStopStep = 1;
-
-  // Unit cell and magnetic field
-  ParseForParameter(verbose,FileBuffer, "BoxLength", 0, 3, 3, lower_trigrid, BoxLength, 1, critical); /* Lattice->RealBasis */
-  double *cell_size = new double[6];
-  cell_size[0] = BoxLength[0];
-  cell_size[1] = BoxLength[3];
-  cell_size[2] = BoxLength[4];
-  cell_size[3] = BoxLength[6];
-  cell_size[4] = BoxLength[7];
-  cell_size[5] = BoxLength[8];
-  World::getInstance().setDomain(cell_size);
-  delete[] cell_size;
-  //if (1) fprintf(stderr,"\n");
-
-  ParseForParameter(verbose,FileBuffer,"DoPerturbation", 0, 1, 1, int_type, &(Switches.DoPerturbation), 1, optional);
-  ParseForParameter(verbose,FileBuffer,"DoOutNICS", 0, 1, 1, int_type, &(Switches.DoOutNICS), 1, optional);
-  if (!ParseForParameter(verbose,FileBuffer,"DoFullCurrent", 0, 1, 1, int_type, &(Switches.DoFullCurrent), 1, optional))
-    Switches.DoFullCurrent = 0;
-  if (Switches.DoFullCurrent < 0) Switches.DoFullCurrent = 0;
-  if (Switches.DoFullCurrent > 2) Switches.DoFullCurrent = 2;
-  if (Switches.DoOutNICS < 0) Switches.DoOutNICS = 0;
-  if (Switches.DoOutNICS > 2) Switches.DoOutNICS = 2;
-  if (Switches.DoPerturbation == 0) {
-    Switches.DoFullCurrent = 0;
-    Switches.DoOutNICS = 0;
-  }
-
-  ParseForParameter(verbose,FileBuffer,"ECut", 0, 1, 1, double_type, &(PlaneWaveSpecifics.ECut), 1, critical);
-  ParseForParameter(verbose,FileBuffer,"MaxLevel", 0, 1, 1, int_type, &(PlaneWaveSpecifics.MaxLevel), 1, critical);
-  ParseForParameter(verbose,FileBuffer,"Level0Factor", 0, 1, 1, int_type, &(PlaneWaveSpecifics.Lev0Factor), 1, critical);
-  if (PlaneWaveSpecifics.Lev0Factor < 2) {
-    PlaneWaveSpecifics.Lev0Factor = 2;
-  }
-  ParseForParameter(verbose,FileBuffer,"RiemannTensor", 0, 1, 1, int_type, &di, 1, critical);
-  if (di >= 0 && di < 2) {
-    PlaneWaveSpecifics.RiemannTensor = di;
-  } else {
-    cerr << "0 <= RiemanTensor < 2: 0 UseNotRT, 1 UseRT" << endl;
-    exit(1);
-  }
-  switch (PlaneWaveSpecifics.RiemannTensor) {
-    case 0: //UseNoRT
-      if (PlaneWaveSpecifics.MaxLevel < 2) {
-        PlaneWaveSpecifics.MaxLevel = 2;
-      }
-      PlaneWaveSpecifics.LevRFactor = 2;
-      PlaneWaveSpecifics.RTActualUse = 0;
+    ParseForParameter(verbose,FileBuffer, "defaultpath", 0, 1, 1, string_type, (Paths.defaultpath), 1, critical);
+    ParseForParameter(verbose,FileBuffer, "pseudopotpath", 0, 1, 1, string_type, (Paths.pseudopotpath), 1, critical);
+    ParseForParameter(verbose,FileBuffer,"ProcPEGamma", 0, 1, 1, int_type, &(Parallelization.ProcPEGamma), 1, critical);
+    ParseForParameter(verbose,FileBuffer,"ProcPEPsi", 0, 1, 1, int_type, &(Parallelization.ProcPEPsi), 1, critical);
+
+    if (!ParseForParameter(verbose,FileBuffer,"Seed", 0, 1, 1, int_type, &(LocalizedOrbitals.Seed), 1, optional))
+      LocalizedOrbitals.Seed = 1;
+
+    if(!ParseForParameter(verbose,FileBuffer,"DoOutOrbitals", 0, 1, 1, int_type, &(Switches.DoOutOrbitals), 1, optional)) {
+      Switches.DoOutOrbitals = 0;
+    } else {
+      if (Switches.DoOutOrbitals < 0) Switches.DoOutOrbitals = 0;
+      if (Switches.DoOutOrbitals > 1) Switches.DoOutOrbitals = 1;
+    }
+    ParseForParameter(verbose,FileBuffer,"DoOutVis", 0, 1, 1, int_type, &(Switches.DoOutVis), 1, critical);
+    if (Switches.DoOutVis < 0) Switches.DoOutVis = 0;
+    if (Switches.DoOutVis > 1) Switches.DoOutVis = 1;
+    if (!ParseForParameter(verbose,FileBuffer,"VectorPlane", 0, 1, 1, int_type, &(LocalizedOrbitals.VectorPlane), 1, optional))
+      LocalizedOrbitals.VectorPlane = -1;
+    if (!ParseForParameter(verbose,FileBuffer,"VectorCut", 0, 1, 1, double_type, &(LocalizedOrbitals.VectorCut), 1, optional))
+      LocalizedOrbitals.VectorCut = 0.;
+    ParseForParameter(verbose,FileBuffer,"DoOutMes", 0, 1, 1, int_type, &(Switches.DoOutMes), 1, critical);
+    if (Switches.DoOutMes < 0) Switches.DoOutMes = 0;
+    if (Switches.DoOutMes > 1) Switches.DoOutMes = 1;
+    if (!ParseForParameter(verbose,FileBuffer,"DoOutCurr", 0, 1, 1, int_type, &(Switches.DoOutCurrent), 1, optional))
+      Switches.DoOutCurrent = 0;
+    if (Switches.DoOutCurrent < 0) Switches.DoOutCurrent = 0;
+    if (Switches.DoOutCurrent > 1) Switches.DoOutCurrent = 1;
+    ParseForParameter(verbose,FileBuffer,"AddGramSch", 0, 1, 1, int_type, &(LocalizedOrbitals.UseAddGramSch), 1, critical);
+    if (LocalizedOrbitals.UseAddGramSch < 0) LocalizedOrbitals.UseAddGramSch = 0;
+    if (LocalizedOrbitals.UseAddGramSch > 2) LocalizedOrbitals.UseAddGramSch = 2;
+    if(!ParseForParameter(verbose,FileBuffer,"DoWannier", 0, 1, 1, int_type, &(Switches.DoWannier), 1, optional)) {
+      Switches.DoWannier = 0;
+    } else {
+      if (Switches.DoWannier < 0) Switches.DoWannier = 0;
+      if (Switches.DoWannier > 1) Switches.DoWannier = 1;
+    }
+    if(!ParseForParameter(verbose,FileBuffer,"CommonWannier", 0, 1, 1, int_type, &(LocalizedOrbitals.CommonWannier), 1, optional)) {
+      LocalizedOrbitals.CommonWannier = 0;
+    } else {
+      if (LocalizedOrbitals.CommonWannier < 0) LocalizedOrbitals.CommonWannier = 0;
+      if (LocalizedOrbitals.CommonWannier > 4) LocalizedOrbitals.CommonWannier = 4;
+    }
+    if(!ParseForParameter(verbose,FileBuffer,"SawtoothStart", 0, 1, 1, double_type, &(LocalizedOrbitals.SawtoothStart), 1, optional)) {
+      LocalizedOrbitals.SawtoothStart = 0.01;
+    } else {
+      if (LocalizedOrbitals.SawtoothStart < 0.) LocalizedOrbitals.SawtoothStart = 0.;
+      if (LocalizedOrbitals.SawtoothStart > 1.) LocalizedOrbitals.SawtoothStart = 1.;
+    }
+
+    if (ParseForParameter(verbose,FileBuffer,"DoConstrainedMD", 0, 1, 1, int_type, &(Switches.DoConstrainedMD), 1, optional))
+      if (Switches.DoConstrainedMD < 0)
+        Switches.DoConstrainedMD = 0;
+    ParseForParameter(verbose,FileBuffer,"MaxOuterStep", 0, 1, 1, int_type, &(StepCounts.MaxOuterStep), 1, critical);
+    if (!ParseForParameter(verbose,FileBuffer,"Deltat", 0, 1, 1, double_type, &(Deltat), 1, optional))
+      Deltat = 1;
+    ParseForParameter(verbose,FileBuffer,"OutVisStep", 0, 1, 1, int_type, &(StepCounts.OutVisStep), 1, optional);
+    ParseForParameter(verbose,FileBuffer,"OutSrcStep", 0, 1, 1, int_type, &(StepCounts.OutSrcStep), 1, optional);
+    ParseForParameter(verbose,FileBuffer,"TargetTemp", 0, 1, 1, double_type, &(World::getInstance().getThermostats()->TargetTemp), 1, optional);
+    //ParseForParameter(verbose,FileBuffer,"Thermostat", 0, 1, 1, int_type, &(ScaleTempStep), 1, optional);
+    if (!ParseForParameter(verbose,FileBuffer,"EpsWannier", 0, 1, 1, double_type, &(LocalizedOrbitals.EpsWannier), 1, optional))
+      LocalizedOrbitals.EpsWannier = 1e-8;
+
+    // stop conditions
+    //if (MaxOuterStep <= 0) MaxOuterStep = 1;
+    ParseForParameter(verbose,FileBuffer,"MaxPsiStep", 0, 1, 1, int_type, &(StepCounts.MaxPsiStep), 1, critical);
+    if (StepCounts.MaxPsiStep <= 0) StepCounts.MaxPsiStep = 3;
+
+    ParseForParameter(verbose,FileBuffer,"MaxMinStep", 0, 1, 1, int_type, &(StepCounts.MaxMinStep), 1, critical);
+    ParseForParameter(verbose,FileBuffer,"RelEpsTotalE", 0, 1, 1, double_type, &(StepCounts.RelEpsTotalEnergy), 1, critical);
+    ParseForParameter(verbose,FileBuffer,"RelEpsKineticE", 0, 1, 1, double_type, &(StepCounts.RelEpsKineticEnergy), 1, critical);
+    ParseForParameter(verbose,FileBuffer,"MaxMinStopStep", 0, 1, 1, int_type, &(StepCounts.MaxMinStopStep), 1, critical);
+    ParseForParameter(verbose,FileBuffer,"MaxMinGapStopStep", 0, 1, 1, int_type, &(StepCounts.MaxMinGapStopStep), 1, critical);
+    if (StepCounts.MaxMinStep <= 0) StepCounts.MaxMinStep = StepCounts.MaxPsiStep;
+    if (StepCounts.MaxMinStopStep < 1) StepCounts.MaxMinStopStep = 1;
+    if (StepCounts.MaxMinGapStopStep < 1) StepCounts.MaxMinGapStopStep = 1;
+
+    ParseForParameter(verbose,FileBuffer,"MaxInitMinStep", 0, 1, 1, int_type, &(StepCounts.MaxInitMinStep), 1, critical);
+    ParseForParameter(verbose,FileBuffer,"InitRelEpsTotalE", 0, 1, 1, double_type, &(StepCounts.InitRelEpsTotalEnergy), 1, critical);
+    ParseForParameter(verbose,FileBuffer,"InitRelEpsKineticE", 0, 1, 1, double_type, &(StepCounts.InitRelEpsKineticEnergy), 1, critical);
+    ParseForParameter(verbose,FileBuffer,"InitMaxMinStopStep", 0, 1, 1, int_type, &(StepCounts.InitMaxMinStopStep), 1, critical);
+    ParseForParameter(verbose,FileBuffer,"InitMaxMinGapStopStep", 0, 1, 1, int_type, &(StepCounts.InitMaxMinGapStopStep), 1, critical);
+    if (StepCounts.MaxInitMinStep <= 0) StepCounts.MaxInitMinStep = StepCounts.MaxPsiStep;
+    if (StepCounts.InitMaxMinStopStep < 1) StepCounts.InitMaxMinStopStep = 1;
+    if (StepCounts.InitMaxMinGapStopStep < 1) StepCounts.InitMaxMinGapStopStep = 1;
+
+    // Unit cell and magnetic field
+    ParseForParameter(verbose,FileBuffer, "BoxLength", 0, 3, 3, lower_trigrid, BoxLength, 1, critical); /* Lattice->RealBasis */
+    double *cell_size = new double[6];
+    cell_size[0] = BoxLength[0];
+    cell_size[1] = BoxLength[3];
+    cell_size[2] = BoxLength[4];
+    cell_size[3] = BoxLength[6];
+    cell_size[4] = BoxLength[7];
+    cell_size[5] = BoxLength[8];
+    World::getInstance().setDomain(cell_size);
+    delete[] cell_size;
+    //if (1) fprintf(stderr,"\n");
+
+    ParseForParameter(verbose,FileBuffer,"DoPerturbation", 0, 1, 1, int_type, &(Switches.DoPerturbation), 1, optional);
+    ParseForParameter(verbose,FileBuffer,"DoOutNICS", 0, 1, 1, int_type, &(Switches.DoOutNICS), 1, optional);
+    if (!ParseForParameter(verbose,FileBuffer,"DoFullCurrent", 0, 1, 1, int_type, &(Switches.DoFullCurrent), 1, optional))
+      Switches.DoFullCurrent = 0;
+    if (Switches.DoFullCurrent < 0) Switches.DoFullCurrent = 0;
+    if (Switches.DoFullCurrent > 2) Switches.DoFullCurrent = 2;
+    if (Switches.DoOutNICS < 0) Switches.DoOutNICS = 0;
+    if (Switches.DoOutNICS > 2) Switches.DoOutNICS = 2;
+    if (Switches.DoPerturbation == 0) {
+      Switches.DoFullCurrent = 0;
+      Switches.DoOutNICS = 0;
+    }
+
+    ParseForParameter(verbose,FileBuffer,"ECut", 0, 1, 1, double_type, &(PlaneWaveSpecifics.ECut), 1, critical);
+    ParseForParameter(verbose,FileBuffer,"MaxLevel", 0, 1, 1, int_type, &(PlaneWaveSpecifics.MaxLevel), 1, critical);
+    ParseForParameter(verbose,FileBuffer,"Level0Factor", 0, 1, 1, int_type, &(PlaneWaveSpecifics.Lev0Factor), 1, critical);
+    if (PlaneWaveSpecifics.Lev0Factor < 2) {
+      PlaneWaveSpecifics.Lev0Factor = 2;
+    }
+    ParseForParameter(verbose,FileBuffer,"RiemannTensor", 0, 1, 1, int_type, &di, 1, critical);
+    if (di >= 0 && di < 2) {
+      PlaneWaveSpecifics.RiemannTensor = di;
+    } else {
+      cerr << "0 <= RiemanTensor < 2: 0 UseNotRT, 1 UseRT" << endl;
+      exit(1);
+    }
+    switch (PlaneWaveSpecifics.RiemannTensor) {
+      case 0: //UseNoRT
+        if (PlaneWaveSpecifics.MaxLevel < 2) {
+          PlaneWaveSpecifics.MaxLevel = 2;
+        }
+        PlaneWaveSpecifics.LevRFactor = 2;
+        PlaneWaveSpecifics.RTActualUse = 0;
+        break;
+      case 1: // UseRT
+        if (PlaneWaveSpecifics.MaxLevel < 3) {
+          PlaneWaveSpecifics.MaxLevel = 3;
+        }
+        ParseForParameter(verbose,FileBuffer,"RiemannLevel", 0, 1, 1, int_type, &(PlaneWaveSpecifics.RiemannLevel), 1, critical);
+        if (PlaneWaveSpecifics.RiemannLevel < 2) {
+          PlaneWaveSpecifics.RiemannLevel = 2;
+        }
+        if (PlaneWaveSpecifics.RiemannLevel > PlaneWaveSpecifics.MaxLevel-1) {
+          PlaneWaveSpecifics.RiemannLevel = PlaneWaveSpecifics.MaxLevel-1;
+        }
+        ParseForParameter(verbose,FileBuffer,"LevRFactor", 0, 1, 1, int_type, &(PlaneWaveSpecifics.LevRFactor), 1, critical);
+        if (PlaneWaveSpecifics.LevRFactor < 2) {
+          PlaneWaveSpecifics.LevRFactor = 2;
+        }
+        PlaneWaveSpecifics.Lev0Factor = 2;
+        PlaneWaveSpecifics.RTActualUse = 2;
+        break;
+    }
+    ParseForParameter(verbose,FileBuffer,"PsiType", 0, 1, 1, int_type, &di, 1, critical);
+    if (di >= 0 && di < 2) {
+      PlaneWaveSpecifics.PsiType = di;
+    } else {
+      cerr << "0 <= PsiType < 2: 0 UseSpinDouble, 1 UseSpinUpDown" << endl;
+      exit(1);
+    }
+    switch (PlaneWaveSpecifics.PsiType) {
+    case 0: // SpinDouble
+      ParseForParameter(verbose,FileBuffer,"MaxPsiDouble", 0, 1, 1, int_type, &(PlaneWaveSpecifics.MaxPsiDouble), 1, critical);
+      ParseForParameter(verbose,FileBuffer,"PsiMaxNoUp", 0, 1, 1, int_type, &(PlaneWaveSpecifics.PsiMaxNoUp), 1, optional);
+      ParseForParameter(verbose,FileBuffer,"PsiMaxNoDown", 0, 1, 1, int_type, &(PlaneWaveSpecifics.PsiMaxNoDown), 1, optional);
+      ParseForParameter(verbose,FileBuffer,"AddPsis", 0, 1, 1, int_type, &(PlaneWaveSpecifics.AddPsis), 1, optional);
       break;
-    case 1: // UseRT
-      if (PlaneWaveSpecifics.MaxLevel < 3) {
-        PlaneWaveSpecifics.MaxLevel = 3;
-      }
-      ParseForParameter(verbose,FileBuffer,"RiemannLevel", 0, 1, 1, int_type, &(PlaneWaveSpecifics.RiemannLevel), 1, critical);
-      if (PlaneWaveSpecifics.RiemannLevel < 2) {
-        PlaneWaveSpecifics.RiemannLevel = 2;
-      }
-      if (PlaneWaveSpecifics.RiemannLevel > PlaneWaveSpecifics.MaxLevel-1) {
-        PlaneWaveSpecifics.RiemannLevel = PlaneWaveSpecifics.MaxLevel-1;
-      }
-      ParseForParameter(verbose,FileBuffer,"LevRFactor", 0, 1, 1, int_type, &(PlaneWaveSpecifics.LevRFactor), 1, critical);
-      if (PlaneWaveSpecifics.LevRFactor < 2) {
-        PlaneWaveSpecifics.LevRFactor = 2;
-      }
-      PlaneWaveSpecifics.Lev0Factor = 2;
-      PlaneWaveSpecifics.RTActualUse = 2;
+    case 1: // SpinUpDown
+      if (Parallelization.ProcPEGamma % 2) Parallelization.ProcPEGamma*=2;
+      ParseForParameter(verbose,FileBuffer,"MaxPsiDouble", 0, 1, 1, int_type, &(PlaneWaveSpecifics.MaxPsiDouble), 1, optional);
+      ParseForParameter(verbose,FileBuffer,"PsiMaxNoUp", 0, 1, 1, int_type, &(PlaneWaveSpecifics.PsiMaxNoUp), 1, critical);
+      ParseForParameter(verbose,FileBuffer,"PsiMaxNoDown", 0, 1, 1, int_type, &(PlaneWaveSpecifics.PsiMaxNoDown), 1, critical);
+      ParseForParameter(verbose,FileBuffer,"AddPsis", 0, 1, 1, int_type, &(PlaneWaveSpecifics.AddPsis), 1, optional);
       break;
-  }
-  ParseForParameter(verbose,FileBuffer,"PsiType", 0, 1, 1, int_type, &di, 1, critical);
-  if (di >= 0 && di < 2) {
-    PlaneWaveSpecifics.PsiType = di;
-  } else {
-    cerr << "0 <= PsiType < 2: 0 UseSpinDouble, 1 UseSpinUpDown" << endl;
-    exit(1);
-  }
-  switch (PlaneWaveSpecifics.PsiType) {
-  case 0: // SpinDouble
-    ParseForParameter(verbose,FileBuffer,"MaxPsiDouble", 0, 1, 1, int_type, &(PlaneWaveSpecifics.MaxPsiDouble), 1, critical);
-    ParseForParameter(verbose,FileBuffer,"PsiMaxNoUp", 0, 1, 1, int_type, &(PlaneWaveSpecifics.PsiMaxNoUp), 1, optional);
-    ParseForParameter(verbose,FileBuffer,"PsiMaxNoDown", 0, 1, 1, int_type, &(PlaneWaveSpecifics.PsiMaxNoDown), 1, optional);
-    ParseForParameter(verbose,FileBuffer,"AddPsis", 0, 1, 1, int_type, &(PlaneWaveSpecifics.AddPsis), 1, optional);
-    break;
-  case 1: // SpinUpDown
-    if (Parallelization.ProcPEGamma % 2) Parallelization.ProcPEGamma*=2;
-    ParseForParameter(verbose,FileBuffer,"MaxPsiDouble", 0, 1, 1, int_type, &(PlaneWaveSpecifics.MaxPsiDouble), 1, optional);
-    ParseForParameter(verbose,FileBuffer,"PsiMaxNoUp", 0, 1, 1, int_type, &(PlaneWaveSpecifics.PsiMaxNoUp), 1, critical);
-    ParseForParameter(verbose,FileBuffer,"PsiMaxNoDown", 0, 1, 1, int_type, &(PlaneWaveSpecifics.PsiMaxNoDown), 1, critical);
-    ParseForParameter(verbose,FileBuffer,"AddPsis", 0, 1, 1, int_type, &(PlaneWaveSpecifics.AddPsis), 1, optional);
-    break;
-  }
-
-  // IonsInitRead
-
-  ParseForParameter(verbose,FileBuffer,"RCut", 0, 1, 1, double_type, &(PlaneWaveSpecifics.RCut), 1, critical);
-  ParseForParameter(verbose,FileBuffer,"IsAngstroem", 0, 1, 1, int_type, &(IsAngstroem), 1, critical);
-  ParseForParameter(verbose,FileBuffer,"MaxTypes", 0, 1, 1, int_type, &(MaxTypes), 1, critical);
-  if (!ParseForParameter(verbose,FileBuffer,"RelativeCoord", 0, 1, 1, int_type, &(RelativeCoord) , 1, optional))
-    RelativeCoord = 0;
-  if (!ParseForParameter(verbose,FileBuffer,"StructOpt", 0, 1, 1, int_type, &(StructOpt), 1, optional))
-    StructOpt = 0;
+    }
+
+    // IonsInitRead
+
+    ParseForParameter(verbose,FileBuffer,"RCut", 0, 1, 1, double_type, &(PlaneWaveSpecifics.RCut), 1, critical);
+    ParseForParameter(verbose,FileBuffer,"IsAngstroem", 0, 1, 1, int_type, &(IsAngstroem), 1, critical);
+    ParseForParameter(verbose,FileBuffer,"MaxTypes", 0, 1, 1, int_type, &(MaxTypes), 1, critical);
+    if (!ParseForParameter(verbose,FileBuffer,"RelativeCoord", 0, 1, 1, int_type, &(RelativeCoord) , 1, optional))
+      RelativeCoord = 0;
+    if (!ParseForParameter(verbose,FileBuffer,"StructOpt", 0, 1, 1, int_type, &(StructOpt), 1, optional))
+      StructOpt = 0;
+  }
 
   // 3. parse the molecule in
