From 91c6d77bfa5c7d9c4a066825dd70710f37a5de71 Mon Sep 17 00:00:00 2001
From: Jochem Snuverink <jochem.snuverink@psi.ch>
Date: Fri, 25 Sep 2020 11:23:02 +0200
Subject: [PATCH] cleanup unused code, some from #62

---
 ippl/test/FFT/SeaborgRes/TestFFT-PPP.cpp      |  4 --
 ippl/test/FFT/SeaborgRes/TestFFT-SPP.cpp      |  4 --
 ippl/test/FFT/SeaborgRes/TestFFT-SSP.cpp      | 18 +--------
 ippl/test/FFT/SeaborgRes/TestFFT.cpp          |  4 --
 ippl/test/FFT/TestFFT-XT3.cpp                 |  4 --
 ippl/test/FFT/TestRCMIC.cpp                   |  7 +---
 ippl/test/PwrSpec/PwrSpec.cpp                 |  2 +-
 ippl/test/particle/PIC3d.cpp                  |  2 +-
 ippl/test/toyfdtf/ipplToyFDTD2.cpp            |  2 -
 src/AbstractObjects/OpalData.h                |  3 --
 src/Algorithms/ParallelCyclotronTracker.cpp   |  4 +-
 src/Algorithms/lomb.cpp                       |  5 ---
 src/Amr/AmrYtWriter.cpp                       |  2 +-
 src/Amr/AmrYtWriter.h                         |  2 +-
 src/Classic/AbsBeamline/RFCavity.cpp          |  7 ++--
 src/Classic/AbsBeamline/TravelingWave.cpp     |  1 -
 src/Classic/Algorithms/PartBunch.cpp          | 34 +---------------
 src/Classic/Fields/Fieldmap.cpp               |  4 ++
 src/Classic/Fields/Interpolation/MMatrix.cpp  | 11 -----
 src/Classic/Fields/Interpolation/MMatrix.h    |  9 +----
 src/Classic/Fields/Interpolation/MVector.cpp  |  5 ---
 src/Classic/Fields/Interpolation/MVector.h    |  9 -----
 src/Classic/Fields/SectorField.h              |  4 +-
 src/Classic/Fields/SectorMagneticFieldMap.cpp |  8 ++--
 src/Classic/Fields/SectorMagneticFieldMap.h   |  4 +-
 src/Classic/FixedAlgebra/FTpsData.h           |  2 -
 src/Distribution/Distribution.cpp             | 14 +++----
 src/Elements/OpalCavity.cpp                   | 13 +-----
 src/Elements/OpalCavity.h                     |  5 ---
 src/Elements/OpalQuadrupole.cpp               |  6 +--
 src/Elements/OpalTravelingWave.cpp            | 15 +------
 src/Elements/OpalTravelingWave.h              |  6 ---
 src/Expressions/Expressions.cpp               |  2 +-
 src/Main.cpp                                  |  2 -
 src/Solvers/BoxCornerDomain.h                 |  5 ---
 src/Structure/Beam.cpp                        | 40 +------------------
 src/Structure/Beam.h                          | 18 ---------
 src/Structure/BoundaryGeometry.cpp            | 12 ------
 src/Structure/BoundaryGeometry.h              | 25 ------------
 src/Structure/ElementPositionWriter.h         |  2 +-
 src/Structure/FieldSolver.cpp                 |  1 -
 src/Structure/MemoryProfiler.h                |  1 -
 src/Track/TrackCmd.cpp                        |  2 -
 .../AbsBeamline/MultipoleTTest.cpp            |  5 +--
 tools/opal2sdds/main.cpp                      |  1 -
 45 files changed, 44 insertions(+), 292 deletions(-)

diff --git a/ippl/test/FFT/SeaborgRes/TestFFT-PPP.cpp b/ippl/test/FFT/SeaborgRes/TestFFT-PPP.cpp
index 92d3ec33e..727233b70 100644
--- a/ippl/test/FFT/SeaborgRes/TestFFT-PPP.cpp
+++ b/ippl/test/FFT/SeaborgRes/TestFFT-PPP.cpp
@@ -49,10 +49,6 @@ bool Configure(int argc, char *argv[], InterPolT *interPol,
   Inform msg("Configure ");
   Inform errmsg("Error ");
 
-  string bc_str;
-  string interPol_str;
-  string dist_str;
-
   for (int i=1; i < argc; ++i) {
     string s(argv[i]);
     if (s == "-grid") {
diff --git a/ippl/test/FFT/SeaborgRes/TestFFT-SPP.cpp b/ippl/test/FFT/SeaborgRes/TestFFT-SPP.cpp
index c9cc83d87..323bcc08c 100644
--- a/ippl/test/FFT/SeaborgRes/TestFFT-SPP.cpp
+++ b/ippl/test/FFT/SeaborgRes/TestFFT-SPP.cpp
@@ -24,10 +24,6 @@ bool Configure(int argc, char *argv[], InterPolT *interPol,
   Inform msg("Configure ");
   Inform errmsg("Error ");
 
-  string bc_str;
-  string interPol_str;
-  string dist_str;
-
   for (int i=1; i < argc; ++i) {
     string s(argv[i]);
     if (s == "-grid") {
diff --git a/ippl/test/FFT/SeaborgRes/TestFFT-SSP.cpp b/ippl/test/FFT/SeaborgRes/TestFFT-SSP.cpp
index 80b4b5012..c2726c9c0 100644
--- a/ippl/test/FFT/SeaborgRes/TestFFT-SSP.cpp
+++ b/ippl/test/FFT/SeaborgRes/TestFFT-SSP.cpp
@@ -49,10 +49,6 @@ bool Configure(int argc, char *argv[], InterPolT *interPol,
   Inform msg("Configure ");
   Inform errmsg("Error ");
 
-  string bc_str;
-  string interPol_str;
-  string dist_str;
-
   for (int i=1; i < argc; ++i) {
     string s(argv[i]);
     if (s == "-grid") {
@@ -247,16 +243,4 @@ int main(int argc, char *argv[])
     testmsg << " nx= " << nx << " ny= " << ny << " nz= " << nz;
     testmsg << " ||d||= " << fabs(realDiff) << endl;
     return 0;
-}
-
-/***************************************************************************
- * $RCSfile: TestFFT-SSP.cpp,v $   $Author: adelmann $
- * $Revision: 1.1.1.1 $   $Date: 2003/01/23 07:40:36 $
- ***************************************************************************/
-
-/***************************************************************************
- * $RCSfile: addheaderfooter,v $   $Author: adelmann $
- * $Revision: 1.1.1.1 $   $Date: 2003/01/23 07:40:17 $
- * IPPL_VERSION_ID: $Id: addheaderfooter,v 1.1.1.1 2003/01/23 07:40:17 adelmann Exp $ 
- ***************************************************************************/
-
+}
\ No newline at end of file
diff --git a/ippl/test/FFT/SeaborgRes/TestFFT.cpp b/ippl/test/FFT/SeaborgRes/TestFFT.cpp
index c7f457f71..13fc03744 100644
--- a/ippl/test/FFT/SeaborgRes/TestFFT.cpp
+++ b/ippl/test/FFT/SeaborgRes/TestFFT.cpp
@@ -49,10 +49,6 @@ bool Configure(int argc, char *argv[], InterPolT *interPol,
   Inform msg("Configure ");
   Inform errmsg("Error ");
 
-  string bc_str;
-  string interPol_str;
-  string dist_str;
-
   for (int i=1; i < argc; ++i) {
     string s(argv[i]);
     if (s == "-grid") {
diff --git a/ippl/test/FFT/TestFFT-XT3.cpp b/ippl/test/FFT/TestFFT-XT3.cpp
index 914aa453f..4177f44f5 100644
--- a/ippl/test/FFT/TestFFT-XT3.cpp
+++ b/ippl/test/FFT/TestFFT-XT3.cpp
@@ -51,10 +51,6 @@ bool Configure(int argc, char *argv[], InterPolT *interPol,
   Inform msg("Configure ");
   Inform errmsg("Error ");
 
-  string bc_str;
-  string interPol_str;
-  string dist_str;
-
   for (int i=1; i < argc; ++i) {
     string s(argv[i]);
     if (s == "-grid") {
diff --git a/ippl/test/FFT/TestRCMIC.cpp b/ippl/test/FFT/TestRCMIC.cpp
index fbfa3869e..a5880d331 100644
--- a/ippl/test/FFT/TestRCMIC.cpp
+++ b/ippl/test/FFT/TestRCMIC.cpp
@@ -26,9 +26,6 @@ bool Configure(int argc, char *argv[],
   Inform msg("Configure ");
   Inform errmsg("Error ");
 
-  string bc_str;
-  string dist_str;
-
   for (int i=1; i < argc; ++i) {
     string s(argv[i]);
     if (s == "-grid") {
@@ -167,8 +164,8 @@ int main(int argc, char *argv[])
   BareField<double,D>   RFieldSPStan_save(layoutSPStan);
   BareField<std::complex<double>,D> CFieldSPStan0h(layoutSPStan0h);
 
-  INFOMSG("RFieldSPStan   layout= " << layoutSPStan << endl;);
-  INFOMSG("CFieldSPStan0h layout= " << layoutSPStan0h << endl;);
+  INFOMSG("RFieldSPStan   layout= " << layoutSPStan << endl);
+  INFOMSG("CFieldSPStan0h layout= " << layoutSPStan0h << endl);
 
   // For calling FieldDebug functions from debugger, set up output format:
   setFormat(4,3);
diff --git a/ippl/test/PwrSpec/PwrSpec.cpp b/ippl/test/PwrSpec/PwrSpec.cpp
index 02ef5cb2e..d849f8d65 100644
--- a/ippl/test/PwrSpec/PwrSpec.cpp
+++ b/ippl/test/PwrSpec/PwrSpec.cpp
@@ -195,7 +195,7 @@ void PwrSpec<T,Dim>::CICforward(ChargedParticles<T,Dim> *univ)
 
     rho_m[gDomainL_m]  = rhocic_m[gDomainL_m];
 
-    INFOMSG("rhocic_m= " << sum(rhocic_m) << " sum(M)= " << sum(univ->M) << " rho_m= " << sum(rho_m) << endl;);
+    INFOMSG("rhocic_m= " << sum(rhocic_m) << " sum(M)= " << sum(univ->M) << " rho_m= " << sum(rho_m) << endl);
 }
 
 /***************************************************************************
diff --git a/ippl/test/particle/PIC3d.cpp b/ippl/test/particle/PIC3d.cpp
index 9385229fc..10c950a52 100644
--- a/ippl/test/particle/PIC3d.cpp
+++ b/ippl/test/particle/PIC3d.cpp
@@ -474,7 +474,7 @@ public:
                 smsg->put(tmp[i]);
             bool res = Ippl::Comm->send(smsg, 0, tag);
             if (! res)
-                ERRORMSG("Ippl::Comm->send(smsg, 0, tag) failed " << endl;);
+                ERRORMSG("Ippl::Comm->send(smsg, 0, tag) failed " << endl);
         }
     }
 
diff --git a/ippl/test/toyfdtf/ipplToyFDTD2.cpp b/ippl/test/toyfdtf/ipplToyFDTD2.cpp
index ae86ab556..0d9c8725a 100644
--- a/ippl/test/toyfdtf/ipplToyFDTD2.cpp
+++ b/ippl/test/toyfdtf/ipplToyFDTD2.cpp
@@ -211,8 +211,6 @@ int main(int argc, char *argv[]){
     Inform msg(argv[0]);
     Inform msg2all(argv[0],INFORM_ALL_NODES);
 
-    // variable declarations
-    int i,j,k;
     // indices of the 3D array of cells
     int nx, ny, nz;
     // total number of cells along the x, y, and z axes, respectively
diff --git a/src/AbstractObjects/OpalData.h b/src/AbstractObjects/OpalData.h
index 7be29388a..5e1982115 100644
--- a/src/AbstractObjects/OpalData.h
+++ b/src/AbstractObjects/OpalData.h
@@ -38,9 +38,6 @@ class BoundaryGeometry;
 // store element name, max phase
 typedef std::pair<std::string, double > MaxPhasesT;
 typedef std::map<double, double> energyEvolution_t;
-typedef energyEvolution_t::value_type energyEvData_t;
-
-
 
 // Class OpalData
 // ------------------------------------------------------------------------
diff --git a/src/Algorithms/ParallelCyclotronTracker.cpp b/src/Algorithms/ParallelCyclotronTracker.cpp
index 2fcbf31ec..fcfd363f3 100644
--- a/src/Algorithms/ParallelCyclotronTracker.cpp
+++ b/src/Algorithms/ParallelCyclotronTracker.cpp
@@ -899,7 +899,7 @@ void ParallelCyclotronTracker::visitRFCavity(const RFCavity &as) {
     RFCavity *elptr = dynamic_cast<RFCavity *>(as.clone());
     myElements.push_back(elptr);
 
-    if((elptr->getComponentType() != "SINGLEGAP") && (elptr->getComponentType() != "DOUBLEGAP")) {
+    if ( elptr->getComponentType() != "SINGLEGAP" ) {
         *gmsg << (elptr->getComponentType()) << endl;
         throw OpalException("ParallelCyclotronTracker::visitRFCavity",
                             "The ParallelCyclotronTracker can only play with cyclotron type RF system currently ...");
@@ -1633,7 +1633,7 @@ double ParallelCyclotronTracker::getHarmonicNumber() const {
         return elcycl->getCyclHarm();
     throw OpalException("ParallelCyclotronTracker::getHarmonicNumber()",
                         std::string("The first item in the FieldDimensions list does not ")
-                        +std::string("seem to be an Ring or a Cyclotron element"));
+                        +std::string("seem to be a Ring or a Cyclotron element"));
 }
 
 
diff --git a/src/Algorithms/lomb.cpp b/src/Algorithms/lomb.cpp
index 7fb2600d8..07dcdae98 100644
--- a/src/Algorithms/lomb.cpp
+++ b/src/Algorithms/lomb.cpp
@@ -52,8 +52,6 @@ int LOMB_class::period(std::vector<LOMB_TYPE> *indata, std::vector<LOMB_TYPE> *o
     LOMB_TYPE pt;
 
     CI_lt p, q;
-    CI_vd ai;
-
     /*---------------------------------------------------------------------------*/
 
     wi.erase(wi.begin(), wi.end());
@@ -266,10 +264,7 @@ int LOMB_class::moment(std::vector<LOMB_TYPE> *indata, double *ave, double *adev
     int      n;
     double  pnr, s, ep;
 
-    std::vector<double> xvec;
-
     CI_lt p, q;
-    CI_vd xp;
     /*---------------------------------------------------------------------------*/
 
     p = indata->begin();
diff --git a/src/Amr/AmrYtWriter.cpp b/src/Amr/AmrYtWriter.cpp
index 91647c5ff..2de79b863 100644
--- a/src/Amr/AmrYtWriter.cpp
+++ b/src/Amr/AmrYtWriter.cpp
@@ -496,9 +496,9 @@ void AmrYtWriter::writeBunch(const AmrPartBunch* bunch_p,
         std::string filePrefix(LevelDir);
         filePrefix += '/';
         filePrefix += "DATA_";
-        bool groupSets(false), setBuf(true);
 
         if (gotsome) {
+            bool groupSets(false), setBuf(true);
             for(amrex::NFilesIter nfi(nOutFiles, filePrefix, groupSets, setBuf); nfi.ReadyToWrite(); ++nfi) {
                 std::ofstream& myStream = (std::ofstream&) nfi.Stream();
                 //
diff --git a/src/Amr/AmrYtWriter.h b/src/Amr/AmrYtWriter.h
index 73572ccec..581985071 100644
--- a/src/Amr/AmrYtWriter.h
+++ b/src/Amr/AmrYtWriter.h
@@ -39,7 +39,7 @@ public:
      * @param step we write
      * @param bin energy bin we write (multi-bunch simulation)
      */
-    AmrYtWriter(int step, int bin = 0);
+    explicit AmrYtWriter(int step, int bin = 0);
     
     /*!
      * Write yt files to the simulation subdirectory
diff --git a/src/Classic/AbsBeamline/RFCavity.cpp b/src/Classic/AbsBeamline/RFCavity.cpp
index 52cbb2c87..62f9718ba 100644
--- a/src/Classic/AbsBeamline/RFCavity.cpp
+++ b/src/Classic/AbsBeamline/RFCavity.cpp
@@ -534,7 +534,7 @@ double RFCavity::getAutoPhaseEstimateFallback(double E0, double t0, double q, do
 }
 
 double RFCavity::getAutoPhaseEstimate(const double &E0, const double &t0, const double &q, const double &mass) {
-	std::vector<double> t, E, t2, E2;
+    std::vector<double> t, E, t2, E2;
     std::vector<double> F;
     std::vector< std::pair< double, double > > G;
     gsl_spline *onAxisInterpolants;
@@ -543,6 +543,7 @@ double RFCavity::getAutoPhaseEstimate(const double &E0, const double &t0, const
     double phi = 0.0, tmp_phi, dphi = 0.5 * Physics::pi / 180.;
     double dz = 1.0, length = 0.0;
     fieldmap_m->getOnaxisEz(G);
+    if (G.size() == 0) return 0.0;
     double begin = (G.front()).first;
     double end   = (G.back()).first;
     std::unique_ptr<double[]> zvals(      new double[G.size()]);
@@ -628,9 +629,9 @@ double RFCavity::getAutoPhaseEstimate(const double &E0, const double &t0, const
             t[i] = t[i - 1] + getdT(i, E, dz, mass);
             t2[i] = t2[i - 1] + getdT(i, E2, dz, mass);
 
-            E[i] = E[i - 1];
+            E[i]  = E [i - 1];
             E2[i] = E2[i - 1];
-            E[i] += q * scale_m * getdE(i, t, dz, phi, frequency_m, F) ;
+            E[i]  += q * scale_m * getdE(i, t, dz, phi, frequency_m, F) ;
             E2[i] += q * scale_m * getdE(i, t2, dz, phi + dphi, frequency_m, F);
         }
 
diff --git a/src/Classic/AbsBeamline/TravelingWave.cpp b/src/Classic/AbsBeamline/TravelingWave.cpp
index 50e2f4e38..6575e3fd9 100644
--- a/src/Classic/AbsBeamline/TravelingWave.cpp
+++ b/src/Classic/AbsBeamline/TravelingWave.cpp
@@ -199,7 +199,6 @@ void TravelingWave::initialise(PartBunchBase<double, 3> *bunch, double &startFie
     }
 
     Inform msg("TravelingWave ", *gmsg);
-    std::stringstream errormsg;
 
     RefPartBunch_m = bunch;
     double zBegin = 0.0, zEnd = 0.0;
diff --git a/src/Classic/Algorithms/PartBunch.cpp b/src/Classic/Algorithms/PartBunch.cpp
index 2be8fe9af..d7f7c9154 100644
--- a/src/Classic/Algorithms/PartBunch.cpp
+++ b/src/Classic/Algorithms/PartBunch.cpp
@@ -345,7 +345,7 @@ void PartBunch::resizeMesh() {
                R[n](1) < ymin || R[n](1) > ymax) {
 
                 // delete the particle
-                INFOMSG(level2 << "destroyed particle with id=" << ID[n] << endl;);
+                INFOMSG(level2 << "destroyed particle with id=" << ID[n] << endl);
                 destroy(1, n);
             }
 
@@ -831,38 +831,6 @@ void PartBunch::updateFields(const Vector_t& /*hr*/, const Vector_t& origin) {
                     vbc_m);
 }
 
-
-/**
- * Here we emit particles from the cathode. All particles in a new simulation (not a restart) initially reside in the bin
- container "pbin_m" and are not part of the beam bunch (so they cannot "see" fields, space charge etc.). In pbin_m, particles
- are sorted into the bins of a time histogram that describes the longitudinal time distribution of the beam, where the number
- of bins is given by \f$NBIN \times SBIN\f$. \f$NBIN\f$ and \f$SBIN\f$ are parameters given when defining the initial beam
- distribution. During emission, the time step of the simulation is set so that an integral number of these bins are emitted each step.
- Once all of the particles have been emitted, the simulation time step is reset to the value defined in the input file.
-
- A typical integration time step, \f$\Delta t\f$, is broken down into 3 sub-steps:
-
- 1) Drift particles for \f$\frac{\Delta t}{2}\f$.
-
- 2) Calculate fields and advance momentum.
-
- 3) Drift particles for \f$\frac{\Delta t}{2}\f$ at the new momentum to complete the
- full time step.
-
- The difficulty for emission is that at the cathode position there is a step function discontinuity in the  fields. If we
- apply the typical integration time step across this boundary, we get an artificial numerical bunching of the beam, especially
- at very high accelerating fields. This function takes the cathode position boundary into account in order to achieve
- smoother particle emission.
-
- During an emission step, an integral number of time bins from the distribution histogram are emitted. However, each particle
- contained in those time bins will actually be emitted from the cathode at a different time, so will only spend some fraction
- of the total time step, \f$\Delta t_{full-timestep}\f$, in the simulation. The trick to emission is to give each particle
- a unique time step, \f$Delta t_{temp}\f$, that is equal to the actual time during the emission step that the particle
- exists in the simulation. For the next integration time step, the particle's time step is set back to the global time step,
- \f$\Delta t_{full-timestep}\f$.
-  */
-
-
 inline
 PartBunch::VectorPair_t PartBunch::getEExtrema() {
     const Vector_t maxE = max(eg_m);
diff --git a/src/Classic/Fields/Fieldmap.cpp b/src/Classic/Fields/Fieldmap.cpp
index b01f97905..91ec1594d 100644
--- a/src/Classic/Fields/Fieldmap.cpp
+++ b/src/Classic/Fields/Fieldmap.cpp
@@ -290,6 +290,10 @@ MapType Fieldmap::readHeader(std::string Filename) {
     if (Filename == "1DPROFILE1-DEFAULT")
         return T1DProfile1;
 
+    if (Filename.empty())
+        throw GeneralClassicException("Fieldmap::readHeader()",
+                                      "No field map file specified");
+
     if (!fs::exists(Filename))
         throw GeneralClassicException("Fieldmap::readHeader()",
                                       "File \"" + Filename + "\" doesn't exist");
diff --git a/src/Classic/Fields/Interpolation/MMatrix.cpp b/src/Classic/Fields/Interpolation/MMatrix.cpp
index 69bdab9d9..f1c6e1faa 100644
--- a/src/Classic/Fields/Interpolation/MMatrix.cpp
+++ b/src/Classic/Fields/Interpolation/MMatrix.cpp
@@ -374,17 +374,6 @@ template <class Tmplt> std::istream& operator>>(std::istream& in, MMatrix<Tmplt>
 
 
 ///////////////// INTERFACES
-const gsl_matrix*         MMatrix_to_gsl(const MMatrix<double>&    m)
-{
-  if(m._matrix == NULL) throw(GeneralClassicException("MMatrix_to_gsl", "Attempt to reference uninitialised matrix"));
-  return (gsl_matrix*)m._matrix;
-}
-
-const gsl_matrix_complex* MMatrix_to_gsl(const MMatrix<m_complex>& m)
-{
-  if(m._matrix == NULL) throw(GeneralClassicException("MMatrix_to_gsl", "Attempt to reference uninitialised matrix"));
-  return (gsl_matrix_complex*)m._matrix;
-}
 
 MMatrix<double>    re(MMatrix<m_complex> mc)
 {
diff --git a/src/Classic/Fields/Interpolation/MMatrix.h b/src/Classic/Fields/Interpolation/MMatrix.h
index c76295ce6..588ffff75 100644
--- a/src/Classic/Fields/Interpolation/MMatrix.h
+++ b/src/Classic/Fields/Interpolation/MMatrix.h
@@ -172,10 +172,7 @@ public:
   friend MMatrix<m_complex>& operator +=(MMatrix<m_complex>& m1, const MMatrix<m_complex>& m2);
   friend MMatrix<double>&    operator +=(MMatrix<double>&    m1, const MMatrix<double>&    m2);
   template <class Tmplt2> friend MMatrix<Tmplt2>      operator + (MMatrix<Tmplt2>      m1, const MMatrix<Tmplt2>      m2);
- 
-  friend const gsl_matrix*         MMatrix_to_gsl(const MMatrix<double>& m);
-  friend const gsl_matrix_complex* MMatrix_to_gsl(const MMatrix<gsl_complex>& m);
- 
+
   friend class MMatrix<double>; //To do the eigenvector problem, MMatrix<double> needs to see MMatrix<complex>'s _matrix
 
 
@@ -233,10 +230,6 @@ MMatrix<double>    im(MMatrix<m_complex> m);
 MMatrix<m_complex> complex(MMatrix<double> real);
 MMatrix<m_complex> complex(MMatrix<double> real, MMatrix<double> imaginary);
 
-//return pointer to gsl_matrix objects that store matrix data in m
-const gsl_matrix*         MMatrix_to_gsl(const MMatrix<double>&      m);
-const gsl_matrix_complex* MMatrix_to_gsl(const MMatrix<gsl_complex>& m);
-
 //////////////////////////// MMatrix declaration end ///////////////
 
 
diff --git a/src/Classic/Fields/Interpolation/MVector.cpp b/src/Classic/Fields/Interpolation/MVector.cpp
index 56454291d..a442602b1 100644
--- a/src/Classic/Fields/Interpolation/MVector.cpp
+++ b/src/Classic/Fields/Interpolation/MVector.cpp
@@ -188,11 +188,6 @@ template <class Tmplt> std::istream& operator>>(std::istream& in, MVector<Tmplt>
   return in;
 }
 
-const gsl_vector*         MVector_to_gsl(const MVector<double>&      vd)
-{return vd.get_vector(vd);}
-const gsl_vector_complex* MVector_to_gsl(const MVector<gsl_complex>& vc)
-{return vc.get_vector(vc);}
-
 template <class Tmplt>
 MVector<Tmplt> MVector<Tmplt>::sub(size_t n1, size_t n2) const
 {
diff --git a/src/Classic/Fields/Interpolation/MVector.h b/src/Classic/Fields/Interpolation/MVector.h
index 88829aa6c..4042147ce 100644
--- a/src/Classic/Fields/Interpolation/MVector.h
+++ b/src/Classic/Fields/Interpolation/MVector.h
@@ -150,11 +150,6 @@ public:
   friend class MMatrix<Tmplt>;
   friend class MMatrix<double>;
 
-//  friend gsl_vector*         MVectorToGSL(MVector<double>&     );
-//  friend gsl_vector_complex* MVectorToGSL(MVector<gsl_complex>&);
-  friend const gsl_vector*         MVector_to_gsl(const MVector<double>&     );
-  friend const gsl_vector_complex* MVector_to_gsl(const MVector<gsl_complex>&);
-
 private:
   void build_vector ( size_t size ); //copy from data and put it in the vector
   void build_vector ( const Tmplt* data_start, const Tmplt* data_end ); //copy from data and put it in the vector
@@ -204,10 +199,6 @@ MVector<m_complex> complex(MVector<double> real, MVector<double> imaginary);
 MVector<double>    re     (MVector<m_complex> mv);
 MVector<double>    im     (MVector<m_complex> mv);
 
-//Interface to gsl
-const gsl_vector*         MVector_to_gsl(const MVector<double>&      vd);
-const gsl_vector_complex* MVector_to_gsl(const MVector<gsl_complex>& vc);
-
 ///////////////// MVector End ///////////////// Nb: some inlined functions below...
 
 //////////////////////////// MVector Inlined Functions //////////////
diff --git a/src/Classic/Fields/SectorField.h b/src/Classic/Fields/SectorField.h
index 0578bd3fa..a6eb80c42 100644
--- a/src/Classic/Fields/SectorField.h
+++ b/src/Classic/Fields/SectorField.h
@@ -79,8 +79,8 @@ class SectorField {
      *         Overwrites any existing data
      *  \returns true if any field value is non-zero
      */
-    virtual bool getFieldstrengthPolar
-                  (const Vector_t &R_p, Vector_t &E_p, Vector_t &B_p) const = 0;
+    /* virtual bool getFieldstrengthPolar */
+    /*               (const Vector_t &R_p, Vector_t &E_p, Vector_t &B_p) const = 0; */
 
     /** Return the field value in cartesian coordinates
      *
diff --git a/src/Classic/Fields/SectorMagneticFieldMap.cpp b/src/Classic/Fields/SectorMagneticFieldMap.cpp
index e3579d63e..9836ce020 100644
--- a/src/Classic/Fields/SectorMagneticFieldMap.cpp
+++ b/src/Classic/Fields/SectorMagneticFieldMap.cpp
@@ -189,8 +189,9 @@ std::string SectorMagneticFieldMap::SymmetryToString
           ));
 }
 
-bool SectorMagneticFieldMap::getFieldstrengthPolar (
-        const Vector_t &R_p, Vector_t &/*E_p*/, Vector_t &B_p) const {
+/*
+bool SectorMagneticFieldMap::getFieldstrengthPolar
+                    (const Vector_t &R_p, Vector_t &, Vector_t &B_p) const {
     // vector_t::operator[i] const returns by value, not by const reference
     // so we need to make an array here
     double R_temp[3] = {R_p[0], R_p[1], R_p[2]};
@@ -202,13 +203,14 @@ bool SectorMagneticFieldMap::getFieldstrengthPolar (
     SectorField::convertToPolar(R_temp, &(B_p[0]));
     return false;
 }
+*/
 
 bool SectorMagneticFieldMap::getFieldstrength (
         const Vector_t &R_c, Vector_t &/*E_c*/, Vector_t &B_c) const {
     // coordinate transform; field is in the x-z plane but OPAL-CYCL assumes
     // x-y plane; rotate to the start of the bend and into polar coordinates;
     // apply mirror symmetry about the midplane
-    double radius = (getPolarBoundingBoxMin()[0]+getPolarBoundingBoxMax()[0])/2;
+    double radius   = (getPolarBoundingBoxMin()[0]+getPolarBoundingBoxMax()[0])/2;
     double midplane = (getPolarBoundingBoxMin()[1]+getPolarBoundingBoxMax()[1])/2;
     double R_temp[3] = {R_c(0)+radius, R_c(1), R_c(2)};
     double B_temp[3] = {0., 0., 0.};
diff --git a/src/Classic/Fields/SectorMagneticFieldMap.h b/src/Classic/Fields/SectorMagneticFieldMap.h
index ae1417485..26a59ecb3 100644
--- a/src/Classic/Fields/SectorMagneticFieldMap.h
+++ b/src/Classic/Fields/SectorMagneticFieldMap.h
@@ -114,8 +114,8 @@ class SectorMagneticFieldMap : public SectorField {
      *         Overwrites any existing data
      *  \returns false if R_p is inside the bounding box
      */
-    bool getFieldstrengthPolar
-                  (const Vector_t &R_p, Vector_t &E_p, Vector_t &B_p) const;
+    /* bool getFieldstrengthPolar */
+    /*               (const Vector_t &R_p, Vector_t &E_p, Vector_t &B_p) const; */
 
     /** Get the field value in cartesian coordinates
      *
diff --git a/src/Classic/FixedAlgebra/FTpsData.h b/src/Classic/FixedAlgebra/FTpsData.h
index b11700df1..3779396d2 100644
--- a/src/Classic/FixedAlgebra/FTpsData.h
+++ b/src/Classic/FixedAlgebra/FTpsData.h
@@ -25,8 +25,6 @@
 #include "FixedAlgebra/FArray1D.h"
 #include "FixedAlgebra/FMonomial.h"
 
-#define DEBUG_FTpsData_H
-
 // Template class FTpsData<N>
 // ------------------------------------------------------------------------
 /// Internal utility class for FTps<T,N> class.
diff --git a/src/Distribution/Distribution.cpp b/src/Distribution/Distribution.cpp
index 1cf37f4db..4a88b8643 100644
--- a/src/Distribution/Distribution.cpp
+++ b/src/Distribution/Distribution.cpp
@@ -304,7 +304,7 @@ void Distribution::create(size_t &numberOfParticles, double massIneV, double cha
         createDistributionMultiGauss(numberOfLocalParticles, massIneV);
         break;
     default:
-        INFOMSG("Distribution unknown." << endl;);
+        INFOMSG("Distribution unknown." << endl);
         break;
     }
 
@@ -1194,15 +1194,15 @@ void Distribution::createMatchedGaussDistribution(size_t numberOfParticles,
     int Nsectors = (int)Attributes::getReal(itsAttr[Attrib::Distribution::NSECTORS]);
 
     if ( Nint < 0 )
-        throw OpalException("Distribution::CreateMatchedGaussDistribution()",
+        throw OpalException("Distribution::createMatchedGaussDistribution()",
                             "Negative number of integration steps");
 
     if ( Nsectors < 0 )
-        throw OpalException("Distribution::CreateMatchedGaussDistribution()",
+        throw OpalException("Distribution::createMatchedGaussDistribution()",
                             "Negative number of sectors");
 
     if ( Nsectors > 1 && full == false )
-        throw OpalException("Distribution::CreateMatchedGaussDistribution()",
+        throw OpalException("Distribution::createMatchedGaussDistribution()",
                             "Averaging over sectors can only be done with SECTOR=FALSE");
 
     *gmsg << "* ----------------------------------------------------" << endl;
@@ -1226,7 +1226,7 @@ void Distribution::createMatchedGaussDistribution(size_t numberOfParticles,
     if ( CyclotronElement->getFMLowE()  < 0 ||
          CyclotronElement->getFMHighE() < 0 )
     {
-        throw OpalException("Distribution::CreateMatchedGaussDistribution()",
+        throw OpalException("Distribution::createMatchedGaussDistribution()",
                             "Missing attributes 'FMLOWE' and/or 'FMHIGHE' in "
                             "'CYCLOTRON' definition.");
     }
@@ -1241,7 +1241,7 @@ void Distribution::createMatchedGaussDistribution(size_t numberOfParticles,
         Attributes::getReal(itsAttr[Attrib::Distribution::DENERGY]);
 
     if ( denergy < 0.0 )
-        throw OpalException("Distribution:CreateMatchedGaussDistribution()",
+        throw OpalException("Distribution:createMatchedGaussDistribution()",
                             "DENERGY < 0");
 
     double accuracy =
@@ -1256,7 +1256,7 @@ void Distribution::createMatchedGaussDistribution(size_t numberOfParticles,
         cof_t cof(massIneV*1E-6, charge, Nint, CyclotronElement, full, Nsectors);
         cof.findOrbit(accuracy, maxitCOF, E_m*1E-6, denergy, rguess, true);
 
-        throw EarlyLeaveException("Distribution::CreateMatchedGaussDistribution()",
+        throw EarlyLeaveException("Distribution::createMatchedGaussDistribution()",
                                   "Do only tune calculation.");
     }
 
diff --git a/src/Elements/OpalCavity.cpp b/src/Elements/OpalCavity.cpp
index 3f56dce77..8133ad092 100644
--- a/src/Elements/OpalCavity.cpp
+++ b/src/Elements/OpalCavity.cpp
@@ -40,16 +40,6 @@ OpalCavity::OpalCavity():
                    ("LAG", "Phase lag (rad)");
     itsAttr[DLAG] = Attributes::makeReal
                     ("DLAG", "Phase lag error (rad)");
-    itsAttr[HARMON] = Attributes::makeReal
-                      ("HARMON", "Harmonic number");
-    itsAttr[BETARF] = Attributes::makeReal
-                      ("BETRF", "beta_RF");
-    itsAttr[PG] = Attributes::makeReal
-                  ("PG", "RF power in MW");
-    itsAttr[ZSHUNT] = Attributes::makeReal
-                      ("SHUNT", "Shunt impedance in MOhm");
-    itsAttr[TFILL] = Attributes::makeReal
-                     ("TFILL", "Fill time in microseconds");
     itsAttr[FMAPFN] = Attributes::makeString
                       ("FMAPFN", "Filename of the fieldmap");
     itsAttr[GEOMETRY] = Attributes::makeString
@@ -95,8 +85,7 @@ OpalCavity::OpalCavity(const std::string &name, OpalCavity *parent):
 
 
 OpalCavity::~OpalCavity() {
-    if(owk_m)
-        delete owk_m;
+    delete owk_m;
 }
 
 
diff --git a/src/Elements/OpalCavity.h b/src/Elements/OpalCavity.h
index bc4694d7b..12e8076aa 100644
--- a/src/Elements/OpalCavity.h
+++ b/src/Elements/OpalCavity.h
@@ -35,11 +35,6 @@ public:
         FREQ,           // The RF frequency.
         LAG,            // The phase lag.
         DLAG,           // The phase lag error.
-        HARMON,         // The harmonic number.
-        BETARF,         // The beta_RF.
-        PG,             // The RF power.
-        ZSHUNT,         // The shunt impedance.
-        TFILL,          // The filling time.
         FMAPFN,         // The filename of the fieldmap
         FAST,           // Faster but less accurate
         APVETO,         // Do not use this cavity in the Autophase procedure
diff --git a/src/Elements/OpalQuadrupole.cpp b/src/Elements/OpalQuadrupole.cpp
index 2c8a2bc71..c7ae41903 100644
--- a/src/Elements/OpalQuadrupole.cpp
+++ b/src/Elements/OpalQuadrupole.cpp
@@ -39,10 +39,9 @@ OpalQuadrupole::OpalQuadrupole():
                   ("DK1", "Normalised upright quadrupole coefficient error in m^(-2)");
     itsAttr[K1S] = Attributes::makeReal
                    ("K1S", "Normalised skew quadrupole coefficient in m^(-2)");
-
     itsAttr[DK1S] = Attributes::makeReal
                    ("DK1S", "Normalised skew quadrupole coefficient error in m^(-2)");
-                   
+
     itsAttr[NSLICES] = Attributes::makeReal
                       ("NSLICES",
                       "The number of slices/ steps for this element in Map Tracking", 1);
@@ -61,8 +60,7 @@ OpalQuadrupole::OpalQuadrupole(const std::string &name, OpalQuadrupole *parent):
 
 
 OpalQuadrupole::~OpalQuadrupole() {
-    if(parmatint_m)
-        delete parmatint_m;
+    delete parmatint_m;
 }
 
 
diff --git a/src/Elements/OpalTravelingWave.cpp b/src/Elements/OpalTravelingWave.cpp
index 48761df3b..eda5d282f 100644
--- a/src/Elements/OpalTravelingWave.cpp
+++ b/src/Elements/OpalTravelingWave.cpp
@@ -36,24 +36,12 @@ OpalTravelingWave::OpalTravelingWave():
                    ("LAG", "Phase lag in rad");
     itsAttr[DLAG] = Attributes::makeReal
                     ("DLAG", "Phase lag error in rad");
-    itsAttr[HARMON] = Attributes::makeReal
-                      ("HARMON", "Harmonic number");
-    itsAttr[BETARF] = Attributes::makeReal
-                      ("BETRF", "beta_RF");
-    itsAttr[PG] = Attributes::makeReal
-                  ("PG", "RF power in MW");
-    itsAttr[ZSHUNT] = Attributes::makeReal
-                      ("SHUNT", "Shunt impedance in MOhm");
-    itsAttr[TFILL] = Attributes::makeReal
-                     ("TFILL", "Fill time in microseconds");
     itsAttr[FMAPFN] = Attributes::makeString
                       ("FMAPFN", "Filename for the fieldmap");
     itsAttr[FAST] = Attributes::makeBool
                     ("FAST", "Faster but less accurate", true);
     itsAttr[APVETO] = Attributes::makeBool
                     ("APVETO", "Do not use this cavity in the Autophase procedure", false);
-    itsAttr[CAVITYTYPE] = Attributes::makeString
-                          ("CAVITYTYPE", "STANDING or TRAVELING wave cavity in photoinjector and LINAC; SINGLEGAP or DOUBLEGAP cavity in cyclotron");
     itsAttr[NUMCELLS] = Attributes::makeReal
                         ("NUMCELLS", "Number of cells in a TW structure");
     itsAttr[DESIGNENERGY] = Attributes::makeReal
@@ -75,8 +63,7 @@ OpalTravelingWave::OpalTravelingWave(const std::string &name, OpalTravelingWave
 
 
 OpalTravelingWave::~OpalTravelingWave() {
-    if(owk_m)
-        delete owk_m;
+    delete owk_m;
 }
 
 
diff --git a/src/Elements/OpalTravelingWave.h b/src/Elements/OpalTravelingWave.h
index 2456e934c..c462b6b19 100644
--- a/src/Elements/OpalTravelingWave.h
+++ b/src/Elements/OpalTravelingWave.h
@@ -33,15 +33,9 @@ public:
         FREQ,           // The RF frequency.
         LAG,            // The phase lag.
         DLAG,           // The phase lag error
-        HARMON,         // The harmonic number.
-        BETARF,         // The beta_RF.
-        PG,             // The RF power.
-        ZSHUNT,         // The shunt impedance.
-        TFILL,          // The filling time.
         FMAPFN,         // The filename of the fieldmap
         APVETO,         // Do not use this cavity in the Autophase procedure
         FAST,           // Faster but less accurate
-        CAVITYTYPE,     // STANDING or TRAVELING wave structure
         NUMCELLS,       // Number of cells in a TW structure
         DESIGNENERGY,   // The mean kinetic energy at exit
         MODE,           // The phase shift between cells
diff --git a/src/Expressions/Expressions.cpp b/src/Expressions/Expressions.cpp
index 8f0170bb4..b6289a991 100644
--- a/src/Expressions/Expressions.cpp
+++ b/src/Expressions/Expressions.cpp
@@ -744,7 +744,7 @@ namespace Expressions {
                     array.push_back(SNull<double>::make(*fun));
                     result = new AList<double>(array);
                 } else if(const ArrayFun *fun = find(tablea, frstName)) {
-                    PtrToArray<double> arg1 = parseRealArray(stat);
+                    arg1 = parseRealArray(stat);
                     ArrayOfPtrs<double> array;
                     array.push_back(new ASUnary<double>(*fun, arg1));
                     result = new AList<double>(array);
diff --git a/src/Main.cpp b/src/Main.cpp
index 59fd4ac77..f834b1483 100644
--- a/src/Main.cpp
+++ b/src/Main.cpp
@@ -416,7 +416,6 @@ int main(int argc, char *argv[]) {
     } catch(SDDSParserException &ex) {
         Inform errorMsg("Error", std::cerr, INFORM_ALL_NODES);
 
-        std::stringstream msg;
         errorMsg << "\n*** Error detected by function \""
                  << ex.where() << "\"\n";
         std::string what = ex.what();
@@ -432,7 +431,6 @@ int main(int argc, char *argv[]) {
     } catch(IpplException &ex) {
         Inform errorMsg("Error", std::cerr, INFORM_ALL_NODES);
 
-        std::stringstream msg;
         errorMsg << "\n*** Error detected by function \""
                  << ex.where() << "\"\n";
         std::string what = ex.what();
diff --git a/src/Solvers/BoxCornerDomain.h b/src/Solvers/BoxCornerDomain.h
index 227c47fcb..2a6d8f594 100644
--- a/src/Solvers/BoxCornerDomain.h
+++ b/src/Solvers/BoxCornerDomain.h
@@ -122,14 +122,9 @@ private:
 
     double actBMax_m;
 
-    /// length of the structure
-    double length_m;
-
     /// height of the corner
     double C_m;
 
-
-
     inline double getXIntersection(double cx, int /*z*/) const {
         return (cx < 0) ? getXRangeMin() : getXRangeMax();
     }
diff --git a/src/Structure/Beam.cpp b/src/Structure/Beam.cpp
index 1327c3129..deb647b36 100644
--- a/src/Structure/Beam.cpp
+++ b/src/Structure/Beam.cpp
@@ -46,9 +46,6 @@ namespace {
 
         // BEAM CURRENT AND EMITTANCES:
         BCURRENT,   // Beam current in A
-        EX,         // Horizontal emittance
-        EY,         // Vertical emittance
-        ET,         // Longitudinal emittance
 
         // BEAM FREQUENCY
         BFREQ,  // Beam frequency in MHz
@@ -88,12 +85,6 @@ Beam::Beam():
     // BEAM CURRENT AND EMITTANCES:
     itsAttr[BCURRENT] = Attributes::makeReal
                         ("BCURRENT", "Beam current in A (all bunches)");
-    itsAttr[EX] = Attributes::makeReal
-                  ("EX", "Horizontal emittance");
-    itsAttr[EY] = Attributes::makeReal
-                  ("EY", "Vertical emittance");
-    itsAttr[ET] = Attributes::makeReal
-                  ("ET", "Longitudinal emittance");
 
     // BEAM FREQUENCY
     itsAttr[BFREQ] = Attributes::makeReal
@@ -158,21 +149,6 @@ size_t Beam::getNumberOfParticles() const {
     return (size_t)Attributes::getReal(itsAttr[NPART]);
 }
 
-double Beam::getEX() const {
-    return Attributes::getReal(itsAttr[EX]);
-}
-
-
-double Beam::getEY() const {
-    return Attributes::getReal(itsAttr[EY]);
-}
-
-
-double Beam::getET() const {
-    return Attributes::getReal(itsAttr[ET]);
-}
-
-
 const PartData &Beam::getReference() const {
     // Cast away const, to allow logically constant Beam to update.
     const_cast<Beam *>(this)->update();
@@ -209,21 +185,6 @@ double Beam::getMassPerParticle() const {
     return getMass() * getChargePerParticle() / (getCharge() * Physics::q_e);
 }
 
-void Beam::setEX(double value) {
-    Attributes::setReal(itsAttr[EX], value);
-}
-
-
-void Beam::setEY(double value) {
-    Attributes::setReal(itsAttr[EY], value);
-}
-
-
-void Beam::setET(double value) {
-    Attributes::setReal(itsAttr[ET], value);
-}
-
-
 void Beam::update() {
     // Find the particle name.
     if(itsAttr[PARTICLE]) {
@@ -266,6 +227,7 @@ void Beam::update() {
     double charge = itsAttr[CHARGE] ? Attributes::getReal(itsAttr[CHARGE]) : 1.0;
     reference = PartData(charge, mass, 1.0);
 
+    // Checks
     if(itsAttr[GAMMA]) {
         double gamma = Attributes::getReal(itsAttr[GAMMA]);
         if(gamma > 1.0) {
diff --git a/src/Structure/Beam.h b/src/Structure/Beam.h
index f67512744..0bb1657a0 100644
--- a/src/Structure/Beam.h
+++ b/src/Structure/Beam.h
@@ -54,15 +54,6 @@ public:
     /// Find named BEAM.
     static Beam *find(const std::string &name);
 
-    /// Return emittance for mode 1.
-    double getEX() const;
-
-    /// Return emittance for mode 2.
-    double getEY() const;
-
-    /// Return emittance for mode 3.
-    double getET() const;
-
     //ff => get gamma value
     double getGamma() const;
 
@@ -96,15 +87,6 @@ public:
     /// Mass per macro particle in GeV/c^2
     double getMassPerParticle() const;
 
-    /// Store emittance for mode 1.
-    void setEX(double);
-
-    /// Store emittance for mode 2.
-    void setEY(double);
-
-    /// Store emittance for mode 3.
-    void setET(double);
-
     /// Update the BEAM data.
     virtual void update();
 
diff --git a/src/Structure/BoundaryGeometry.cpp b/src/Structure/BoundaryGeometry.cpp
index 4fd93edb9..b157bce4c 100644
--- a/src/Structure/BoundaryGeometry.cpp
+++ b/src/Structure/BoundaryGeometry.cpp
@@ -785,9 +785,6 @@ BoundaryGeometry::BoundaryGeometry() :
          "Shift in z direction",
          0.0);
 
-    itsAttr[APERTURE]  = Attributes::makeRealArray
-        ("APERTURE", "The element aperture");
-
     itsAttr[INSIDEPOINT] = Attributes::makeRealArray
         ("INSIDEPOINT", "A point inside the geometry");
 
@@ -1772,15 +1769,6 @@ Change orientation if diff is:
     *gmsg << "* Initializing Boundary Geometry..." << endl;
     IpplTimings::startTimer (Tinitialize_m);
 
-    apert_m = Attributes::getRealArray(itsAttr[APERTURE]);
-    if (hasApperture()) {
-        *gmsg << "* Found additional aperture." << endl;
-        for (unsigned int i=0; i<apert_m.size(); i=i+3)
-            *gmsg << "* zmin = " << apert_m[i]
-                  << " zmax = " << apert_m[i+1]
-                  << " r= " << apert_m[i+2] << endl;
-    }
-
     *gmsg << "* Filename: " << h5FileName_m.c_str() << endl;
 
     double xscale = Attributes::getReal(itsAttr[XSCALE]);
diff --git a/src/Structure/BoundaryGeometry.h b/src/Structure/BoundaryGeometry.h
index 2ec308c63..3590434ec 100644
--- a/src/Structure/BoundaryGeometry.h
+++ b/src/Structure/BoundaryGeometry.h
@@ -167,19 +167,6 @@ public:
 
     bool findInsidePoint (void);
 
-    inline bool isOutsideApperture(Vector_t x) {
-        if (hasApperture()) {
-            for (size_t i = 0; i < apert_m.size(); i += 3) {
-                if ((apert_m[i] <= x(2)) && (x(2) < apert_m[i+1])) {
-                    // yes we are inside the interval
-                    const double r = apert_m[i+2] * apert_m[i+2];
-                    return ((x(0)*x(0)) + (x(1)*x(1))) > r;
-                }
-            }
-        }
-        return false;
-    }
-
     int intersectRayBoundary (
         const Vector_t& P,
         const Vector_t& v,
@@ -259,13 +246,6 @@ private:
     bool haveInsidePoint_m;
     Vector_t insidePoint_m;             // attribute INSIDEPOINT
 
-    /*
-       An additional structure to hold apperture information
-       to prevent that particles go past the geometry. The user
-       can specify n trippel with the form: (zmin, zmax, r)
-    */
-    std::vector<double> apert_m;
-
     gsl_rng *randGen_m;         //
 
     IpplTimings::TimerRef Tinitialize_m; // initialize geometry
@@ -280,10 +260,6 @@ private:
     // Clone constructor.
     BoundaryGeometry(const std::string& name, BoundaryGeometry* parent);
 
-    inline bool hasApperture() {
-        return (apert_m.size() != 0);
-    }
-
     inline const Vector_t& getPoint (const int triangle_id, const int vertex_id) {
         PAssert (1 <= vertex_id && vertex_id <=3);
         return Points_m[Triangles_m[triangle_id][vertex_id]];
@@ -322,7 +298,6 @@ private:
         XSCALE,   // Multiplicative scaling factor for x-coordinates
         YSCALE,   // Multiplicative scaling factor for y-coordinates
         ZSCALE,   // Multiplicative scaling factor for z-coordinates
-        APERTURE,    // in addition to the geometry
         INSIDEPOINT,
         SIZE
     };
diff --git a/src/Structure/ElementPositionWriter.h b/src/Structure/ElementPositionWriter.h
index c58b7a43d..2dba113f1 100644
--- a/src/Structure/ElementPositionWriter.h
+++ b/src/Structure/ElementPositionWriter.h
@@ -6,7 +6,7 @@
 class ElementPositionWriter : public SDDSWriter {
 
 public:
-    ElementPositionWriter(const std::string& fname);
+    explicit ElementPositionWriter(const std::string& fname);
 
     void addRow(double spos,
                 const std::vector<double>& row,
diff --git a/src/Structure/FieldSolver.cpp b/src/Structure/FieldSolver.cpp
index 88fe719e7..738dadc94 100644
--- a/src/Structure/FieldSolver.cpp
+++ b/src/Structure/FieldSolver.cpp
@@ -135,7 +135,6 @@ FieldSolver::FieldSolver():
                                                       "FFT, "
                                                       "FFTPERIODIC, "
                                                       "SAAMG, "
-                                                      "AMR, "
                                                       "NONE ");
 
     itsAttr[MX] = Attributes::makeReal("MX", "Meshsize in x");
diff --git a/src/Structure/MemoryProfiler.h b/src/Structure/MemoryProfiler.h
index 18e123d60..e35a46d9b 100644
--- a/src/Structure/MemoryProfiler.h
+++ b/src/Structure/MemoryProfiler.h
@@ -66,7 +66,6 @@ private:
     void compute(vm_t& vmMin, vm_t& vmMax, vm_t& vmAvg);
     
 private:
-    std::string fname_m;
     std::map<std::string, int> procinfo_m;
     vm_t vmem_m;
     units_t unit_m;
diff --git a/src/Track/TrackCmd.cpp b/src/Track/TrackCmd.cpp
index 98c3266dd..bdb86ed11 100644
--- a/src/Track/TrackCmd.cpp
+++ b/src/Track/TrackCmd.cpp
@@ -84,8 +84,6 @@ TrackCmd::TrackCmd():
 
     registerOwnership(AttributeHandler::COMMAND);
     AttributeHandler::addAttributeOwner("TRACK", AttributeHandler::COMMAND, "RUN");
-    AttributeHandler::addAttributeOwner("TRACK", AttributeHandler::COMMAND, "START");
-    AttributeHandler::addAttributeOwner("TRACK", AttributeHandler::COMMAND, "TSAVE");
     AttributeHandler::addAttributeOwner("TRACK", AttributeHandler::COMMAND, "ENDTRACK");
 }
 
diff --git a/tests/classic_src/AbsBeamline/MultipoleTTest.cpp b/tests/classic_src/AbsBeamline/MultipoleTTest.cpp
index 241707e25..b98c4f58d 100644
--- a/tests/classic_src/AbsBeamline/MultipoleTTest.cpp
+++ b/tests/classic_src/AbsBeamline/MultipoleTTest.cpp
@@ -157,8 +157,8 @@ TEST(MultipoleTTest, CurvedMagnet) {
         curlMag += gsl_sf_pow_int(curl[1], 2.0);
         curlMag += gsl_sf_pow_int(curl[2], 2.0);
         curlMag = sqrt(curlMag);
-        coordinatetransform::CoordinateTransform t(x[n], z, y[n], 2.2, 0.3, 0.3, 4.4 / 0.628);
-        std::vector<double> r = t.getTransformation();
+        coordinatetransform::CoordinateTransform ct(x[n], z, y[n], 2.2, 0.3, 0.3, 4.4 / 0.628);
+        std::vector<double> r = ct.getTransformation();
         EXPECT_NEAR(div, 0, 2e-2)
                      << "R: " << r[0] << " " << r[1] << " " << r[2] << std::endl
                      << "R: " << x[n] << " " << z << " " << y[n] << std::endl
@@ -237,7 +237,6 @@ TEST(MultipoleTTest, CurvedConstRadius) {
     double stepSize = 1e-3;
     double radius = 4.4 / 0.628;
     double z = 0.2;
-    Vector_t R(0.0, 0.0, 0.0), P(3), E(3);
     for (double theta = 0; theta <= 0.3001; theta += 0.2) {
         double x = radius * cos(theta) - radius;
         double y = radius * sin(theta);
diff --git a/tools/opal2sdds/main.cpp b/tools/opal2sdds/main.cpp
index ad8e4637c..766193495 100644
--- a/tools/opal2sdds/main.cpp
+++ b/tools/opal2sdds/main.cpp
@@ -260,7 +260,6 @@ void writeSDDSFile(const std::string &fname, const data_t &data, const attribute
                                                         {"p", "p"}};
     SDDS_DATASET SDDS_dataset;
     const long rows = data.at("x").size();
-    std::vector<std::vector<double> > fileData;
 
     char buffer0[256];
     char buffer1[64];
-- 
GitLab