@@ -84,7 +84,7 @@ Field3D Grad_parP(const Field3D& apar, const Field3D& f) {
8484
8585 Field3D result{emptyFrom (f)};
8686
87- int const ncz = mesh->LocalNz ;
87+ const int ncz = mesh->LocalNz ;
8888
8989 Coordinates* metric = apar.getCoordinates ();
9090
@@ -106,15 +106,15 @@ Field3D Grad_parP(const Field3D& apar, const Field3D& f) {
106106 for (int z = 0 ; z < ncz; z++) {
107107 BoutReal by = 1 . / sqrt (metric->g_22 (x, y, z));
108108 // Z indices zm and zp
109- int const zm = (z - 1 + ncz) % ncz;
110- int const zp = (z + 1 ) % ncz;
109+ const int zm = (z - 1 + ncz) % ncz;
110+ const int zp = (z + 1 ) % ncz;
111111
112112 // bx = -DDZ(apar)
113- BoutReal const bx = (apar (x, y, zm) - apar (x, y, zp))
113+ const BoutReal bx = (apar (x, y, zm) - apar (x, y, zp))
114114 / (0.5 * metric->dz (x, y, zm) + metric->dz (x, y, z)
115115 + 0.5 * metric->dz (x, y, zp));
116116 // bz = DDX(f)
117- BoutReal const bz = (apar (x + 1 , y, z) - apar (x - 1 , y, z))
117+ const BoutReal bz = (apar (x + 1 , y, z) - apar (x - 1 , y, z))
118118 / (0.5 * metric->dx (x - 1 , y, z) + metric->dx (x, y, z)
119119 + 0.5 * metric->dx (x + 1 , y, z));
120120
@@ -251,19 +251,19 @@ Field3D Div_par(const Field3D& f, const Field3D& v) {
251251 for (int j = mesh->ystart ; j <= mesh->yend ; j++) {
252252 for (int k = mesh->zstart ; k <= mesh->zend ; k++) {
253253 // Value of f and v at left cell face
254- BoutReal const fL = 0.5 * (f (i, j, k) + f.ydown ()(i, j - 1 , k));
255- BoutReal const vL = 0.5 * (v (i, j, k) + v.ydown ()(i, j - 1 , k));
254+ const BoutReal fL = 0.5 * (f (i, j, k) + f.ydown ()(i, j - 1 , k));
255+ const BoutReal vL = 0.5 * (v (i, j, k) + v.ydown ()(i, j - 1 , k));
256256
257- BoutReal const fR = 0.5 * (f (i, j, k) + f.yup ()(i, j + 1 , k));
258- BoutReal const vR = 0.5 * (v (i, j, k) + v.yup ()(i, j + 1 , k));
257+ const BoutReal fR = 0.5 * (f (i, j, k) + f.yup ()(i, j + 1 , k));
258+ const BoutReal vR = 0.5 * (v (i, j, k) + v.yup ()(i, j + 1 , k));
259259
260260 // Calculate flux at right boundary (y+1/2)
261- BoutReal const fluxRight =
261+ const BoutReal fluxRight =
262262 fR * vR * (coord->J (i, j, k) + coord->J (i, j + 1 , k))
263263 / (sqrt (coord->g_22 (i, j, k)) + sqrt (coord->g_22 (i, j + 1 , k)));
264264
265265 // Calculate at left boundary (y-1/2)
266- BoutReal const fluxLeft =
266+ const BoutReal fluxLeft =
267267 fL * vL * (coord->J (i, j, k) + coord->J (i, j - 1 , k))
268268 / (sqrt (coord->g_22 (i, j, k)) + sqrt (coord->g_22 (i, j - 1 , k)));
269269
@@ -469,12 +469,12 @@ Coordinates::FieldMetric b0xGrad_dot_Grad(const Field2D& phi, const Field2D& A,
469469 Coordinates* metric = phi.getCoordinates (outloc);
470470
471471 // Calculate phi derivatives
472- Coordinates::FieldMetric const dpdx = DDX (phi, outloc);
473- Coordinates::FieldMetric const dpdy = DDY (phi, outloc);
472+ const Coordinates::FieldMetric dpdx = DDX (phi, outloc);
473+ const Coordinates::FieldMetric dpdy = DDY (phi, outloc);
474474
475475 // Calculate advection velocity
476- Coordinates::FieldMetric const vx = -metric->g_23 () * dpdy;
477- Coordinates::FieldMetric const vy = metric->g_23 () * dpdx;
476+ const Coordinates::FieldMetric vx = -metric->g_23 () * dpdy;
477+ const Coordinates::FieldMetric vy = metric->g_23 () * dpdx;
478478
479479 // Upwind A using these velocities
480480 Coordinates::FieldMetric result = VDDX (vx, A, outloc) + VDDY (vy, A, outloc);
@@ -502,12 +502,12 @@ Field3D b0xGrad_dot_Grad(const Field2D& phi, const Field3D& A, CELL_LOC outloc)
502502 Coordinates* metric = phi.getCoordinates (outloc);
503503
504504 // Calculate phi derivatives
505- Coordinates::FieldMetric const dpdx = DDX (phi, outloc);
506- Coordinates::FieldMetric const dpdy = DDY (phi, outloc);
505+ const Coordinates::FieldMetric dpdx = DDX (phi, outloc);
506+ const Coordinates::FieldMetric dpdy = DDY (phi, outloc);
507507
508508 // Calculate advection velocity
509- Coordinates::FieldMetric const vx = -metric->g_23 () * dpdy;
510- Coordinates::FieldMetric const vy = metric->g_23 () * dpdx;
509+ const Coordinates::FieldMetric vx = -metric->g_23 () * dpdy;
510+ const Coordinates::FieldMetric vy = metric->g_23 () * dpdx;
511511 Coordinates::FieldMetric vz = metric->g_12 () * dpdy - metric->g_22 () * dpdx;
512512
513513 if (mesh->IncIntShear ) {
@@ -542,13 +542,13 @@ Field3D b0xGrad_dot_Grad(const Field3D& p, const Field2D& A, CELL_LOC outloc) {
542542 Coordinates* metric = p.getCoordinates (outloc);
543543
544544 // Calculate phi derivatives
545- Field3D const dpdx = DDX (p, outloc);
546- Field3D const dpdy = DDY (p, outloc);
547- Field3D const dpdz = DDZ (p, outloc);
545+ const Field3D dpdx = DDX (p, outloc);
546+ const Field3D dpdy = DDY (p, outloc);
547+ const Field3D dpdz = DDZ (p, outloc);
548548
549549 // Calculate advection velocity
550- Field3D const vx = metric->g_22 () * dpdz - metric->g_23 () * dpdy;
551- Field3D const vy = metric->g_23 () * dpdx - metric->g_12 () * dpdz;
550+ const Field3D vx = metric->g_22 () * dpdz - metric->g_23 () * dpdy;
551+ const Field3D vy = metric->g_23 () * dpdx - metric->g_12 () * dpdz;
552552
553553 // Upwind A using these velocities
554554
@@ -579,13 +579,13 @@ Field3D b0xGrad_dot_Grad(const Field3D& phi, const Field3D& A, CELL_LOC outloc)
579579 Coordinates* metric = phi.getCoordinates (outloc);
580580
581581 // Calculate phi derivatives
582- Field3D const dpdx = DDX (phi, outloc);
583- Field3D const dpdy = DDY (phi, outloc);
584- Field3D const dpdz = DDZ (phi, outloc);
582+ const Field3D dpdx = DDX (phi, outloc);
583+ const Field3D dpdy = DDY (phi, outloc);
584+ const Field3D dpdz = DDZ (phi, outloc);
585585
586586 // Calculate advection velocity
587- Field3D const vx = metric->g_22 () * dpdz - metric->g_23 () * dpdy;
588- Field3D const vy = metric->g_23 () * dpdx - metric->g_12 () * dpdz;
587+ const Field3D vx = metric->g_22 () * dpdz - metric->g_23 () * dpdy;
588+ const Field3D vy = metric->g_23 () * dpdx - metric->g_12 () * dpdz;
589589 Field3D vz = metric->g_12 () * dpdy - metric->g_22 () * dpdx;
590590
591591 if (mesh->IncIntShear ) {
@@ -666,13 +666,13 @@ Field3D bracket(const Field3D& f, const Field2D& g, BRACKET_METHOD method,
666666 for (int x = mesh->xstart ; x <= mesh->xend ; x++) {
667667 for (int y = mesh->ystart ; y <= mesh->yend ; y++) {
668668 for (int z = 0 ; z < ncz; z++) {
669- int const zm = (z - 1 + ncz) % ncz;
670- int const zp = (z + 1 ) % ncz;
669+ const int zm = (z - 1 + ncz) % ncz;
670+ const int zp = (z + 1 ) % ncz;
671671
672672 BoutReal gp, gm;
673673
674674 // Vx = DDZ(f)
675- BoutReal const vx = (f (x, y, zp) - f (x, y, zm)) / (2 . * metric->dz (x, y, z));
675+ const BoutReal vx = (f (x, y, zp) - f (x, y, zm)) / (2 . * metric->dz (x, y, z));
676676
677677 // Set stability condition
678678 solver->setMaxTimestep (metric->dx (x, y, z) / (fabs (vx) + 1e-16 ));
@@ -786,19 +786,19 @@ Field3D bracket(const Field3D& f, const Field2D& g, BRACKET_METHOD method,
786786 // Above is alternative to const int jzmTmp = (jz - 1 + ncz) % ncz;
787787
788788 // J++ = DDZ(f)*DDX(g) - DDX(f)*DDZ(g)
789- BoutReal const Jpp =
789+ const BoutReal Jpp =
790790 ((f (jx, jy, jzp) - f (jx, jy, jzm)) * (g (jx + 1 , jy) - g (jx - 1 , jy))
791791 - (f (jx + 1 , jy, jz) - f (jx - 1 , jy, jz)) * (g (jx, jy) - g (jx, jy)));
792792
793793 // J+x
794- BoutReal const Jpx =
794+ const BoutReal Jpx =
795795 (g (jx + 1 , jy) * (f (jx + 1 , jy, jzp) - f (jx + 1 , jy, jzm))
796796 - g (jx - 1 , jy) * (f (jx - 1 , jy, jzp) - f (jx - 1 , jy, jzm))
797797 - g (jx, jy) * (f (jx + 1 , jy, jzp) - f (jx - 1 , jy, jzp))
798798 + g (jx, jy) * (f (jx + 1 , jy, jzm) - f (jx - 1 , jy, jzm)));
799799
800800 // Jx+
801- BoutReal const Jxp = (g (jx + 1 , jy) * (f (jx, jy, jzp) - f (jx + 1 , jy, jz))
801+ const BoutReal Jxp = (g (jx + 1 , jy) * (f (jx, jy, jzp) - f (jx + 1 , jy, jz))
802802 - g (jx - 1 , jy) * (f (jx - 1 , jy, jz) - f (jx, jy, jzm))
803803 - g (jx - 1 , jy) * (f (jx, jy, jzp) - f (jx - 1 , jy, jz))
804804 + g (jx + 1 , jy) * (f (jx + 1 , jy, jz) - f (jx, jy, jzm)));
@@ -894,20 +894,20 @@ Field3D bracket(const Field3D& f, const Field3D& g, BRACKET_METHOD method,
894894 }
895895
896896 // Get current timestep
897- BoutReal const dt = solver->getCurrentTimestep ();
897+ const BoutReal dt = solver->getCurrentTimestep ();
898898
899899 FieldPerp vx (mesh), vz (mesh);
900900 vx.allocate ();
901901 vx.setLocation (outloc);
902902 vz.allocate ();
903903 vz.setLocation (outloc);
904904
905- int const ncz = mesh->LocalNz ;
905+ const int ncz = mesh->LocalNz ;
906906 for (int y = mesh->ystart ; y <= mesh->yend ; y++) {
907907 for (int x = 1 ; x <= mesh->LocalNx - 2 ; x++) {
908908 for (int z = 0 ; z < mesh->LocalNz ; z++) {
909- int const zm = (z - 1 + ncz) % ncz;
910- int const zp = (z + 1 ) % ncz;
909+ const int zm = (z - 1 + ncz) % ncz;
910+ const int zp = (z + 1 ) % ncz;
911911
912912 // Vx = DDZ(f)
913913 vx (x, z) = (f (x, y, zp) - f (x, y, zm)) / (2 . * metric->dz (x, y, z));
@@ -926,8 +926,8 @@ Field3D bracket(const Field3D& f, const Field3D& g, BRACKET_METHOD method,
926926
927927 for (int x = mesh->xstart ; x <= mesh->xend ; x++) {
928928 for (int z = 0 ; z < ncz; z++) {
929- int const zm = (z - 1 + ncz) % ncz;
930- int const zp = (z + 1 ) % ncz;
929+ const int zm = (z - 1 + ncz) % ncz;
930+ const int zp = (z + 1 ) % ncz;
931931
932932 BoutReal gp, gm;
933933
0 commit comments