Skip to content

Commit

Permalink
Code clean-up.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bengtsson committed Oct 6, 2017
1 parent 898b3e3 commit 010a345
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion projects/src/bare_da.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ int no_tps = NO;
// DIAMOND-II 4-BA 4,
// DIAMOND-II 6-BA 5.
// DIAMOND-II 8-BA 6.
const int lat_case = 6;
const int lat_case = 3;

const double delta_max[] = {3.0e-2, 3.0e-2, 1.5e-2, 3e-2, 3e-2, 3e-2};

Expand Down
2 changes: 1 addition & 1 deletion projects/src/dnu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ int no_tps = NO;
// DIAMOND-II 4-BA 4,
// DIAMOND-II 6-BA 5.
// DIAMOND-II 8-BA 6.
const int lat_case = 6;
const int lat_case = 3;

const double
A_max[][2] =
Expand Down
2 changes: 1 addition & 1 deletion tracy/inc/radia2tracy.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
void Read_IDfile(char *fic_radia, double &L, int &pnx, int &pnz,
double tabx[IDXMAX], double tabz[IDZMAX],
double thetax[IDZMAX][IDXMAX], double thetaz[IDZMAX][IDXMAX],
bool &long_comp, double B2[IDZMAX][IDXMAX]);
bool &long_comp, double B2[IDZMAX][IDXMAX], int linear);

template<typename T>
void LinearInterpolation2(T &X, T &Z, T &TX, T &TZ, T &B2, CellType &Cell,
Expand Down
5 changes: 3 additions & 2 deletions tracy/src/radia2tracy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void splie2(double x1a[], double x2a[], double **ya,
void Read_IDfile(char *fic_radia, double &L, int &nx, int &nz,
double tabx[IDXMAX], double tabz[IDZMAX],
double thetax[IDZMAX][IDXMAX], double thetaz[IDZMAX][IDXMAX],
bool &long_comp, double B2[IDZMAX][IDXMAX])
bool &long_comp, double B2[IDZMAX][IDXMAX], int linear)
{
FILE *fi;
char dummy[5000];
Expand All @@ -123,7 +123,8 @@ void Read_IDfile(char *fic_radia, double &L, int &nx, int &nz,
printf("Reading ID filename %s \n", fic_radia);
printf("E = %6.3f GeV\n", globval.Energy);
printf("(Brho) = %6.3f\n", Brho);

printf("linear = %1d\n", linear);

/* first line */
fscanf(fi, "%[^\n]\n", dummy); /* Read a full line */
printf("%s\n", dummy);
Expand Down
6 changes: 4 additions & 2 deletions tracy/src/rdmfile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,8 @@ void rdmfile(const char *mfile_dat)
Cell[i].Elem.ID->nx, Cell[i].Elem.ID->nz,
Cell[i].Elem.ID->tabx, Cell[i].Elem.ID->tabz,
Cell[i].Elem.ID->thetax1, Cell[i].Elem.ID->thetaz1,
Cell[i].Elem.ID->long_comp, Cell[i].Elem.ID->B2);
Cell[i].Elem.ID->long_comp, Cell[i].Elem.ID->B2,
Cell[i].Elem.ID->linear);
} else if (n == 2) {
Cell[i].Elem.ID->firstorder = false;
Cell[i].Elem.ID->secondorder = true;
Expand All @@ -302,7 +303,8 @@ void rdmfile(const char *mfile_dat)
Cell[i].Elem.ID->nx, Cell[i].Elem.ID->nz,
Cell[i].Elem.ID->tabx, Cell[i].Elem.ID->tabz,
Cell[i].Elem.ID->thetax, Cell[i].Elem.ID->thetaz,
Cell[i].Elem.ID->long_comp, Cell[i].Elem.ID->B2);
Cell[i].Elem.ID->long_comp, Cell[i].Elem.ID->B2,
Cell[i].Elem.ID->linear);
} else {
std::cout << "rdmfile: undef order " << n << std::endl;
exit_(1);
Expand Down
10 changes: 5 additions & 5 deletions tracy/src/t2elem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1995,11 +1995,11 @@ void Insertion_Pass(CellType &Cell, ss_vect<T> &x)
Drift(LN/2e0, x);

for (i = 1; i <= Nslice; i++) {
printf("%3d %2d %2d %5.3f %11.3e %11.3e %11.3e %11.3e %11.3e %11.3e\n",
i, elemp->ID->linear, elemp->ID->secondorder, elemp->ID->scaling,
is_double<T>::cst(x[x_]), is_double<T>::cst(x[px_]),
is_double<T>::cst(x[y_]), is_double<T>::cst(x[py_]),
is_double<T>::cst(x[delta_]), is_double<T>::cst(x[ct_]));
// printf("%3d %2d %2d %5.3f %11.3e %11.3e %11.3e %11.3e %11.3e %11.3e\n",
// i, elemp->ID->linear, elemp->ID->secondorder, elemp->ID->scaling,
// is_double<T>::cst(x[x_]), is_double<T>::cst(x[px_]),
// is_double<T>::cst(x[y_]), is_double<T>::cst(x[py_]),
// is_double<T>::cst(x[delta_]), is_double<T>::cst(x[ct_]));
// Second order kick
if (elemp->ID->secondorder){
// if (!elemp->ID->linear)
Expand Down
4 changes: 2 additions & 2 deletions tracy/src/t2lat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3336,7 +3336,7 @@ static bool Lat_DealElement(FILE **fi_, FILE **fo_, long *cc_, long *ll_,
WITH5->firstorder = true;
Read_IDfile(WITH5->fname1, WITH1->PL, WITH5->nx, WITH5->nz,
WITH5->tabx, WITH5->tabz, WITH5->thetax1, WITH5->thetaz1,
WITH5->long_comp, WITH5->B2);
WITH5->long_comp, WITH5->B2, WITH5->linear);
// scale factor from Radia: Tmm to get Tm.
for (kx = 0; kx < WITH5->nx; kx++) {
for (kz = 0; kz < WITH5->nz; kz++) {
Expand All @@ -3357,7 +3357,7 @@ static bool Lat_DealElement(FILE **fi_, FILE **fo_, long *cc_, long *ll_,
// Read Id file for second order kicks
Read_IDfile(WITH5->fname2, WITH1->PL, WITH5->nx, WITH5->nz,
WITH5->tabx, WITH5->tabz, WITH5->thetax, WITH5->thetaz,
WITH5->long_comp, WITH5->B2);
WITH5->long_comp, WITH5->B2, WITH5->linear);
} else {
strcpy(WITH5->fname2,"/*No_Filename2_Given*/");
}
Expand Down

0 comments on commit 010a345

Please sign in to comment.