Skip to content

Commit aae064f

Browse files
committed
BUG: Ensure dk is negative for the dipole grid.
Dipole grid's dk's may not be decreasing
1 parent f3e7f81 commit aae064f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/grid_spacing.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ void Grid::calc_k_grid_spacing() {
148148
}
149149
// This needs to be turned into a distance for the dipole:
150150
if (iGridShape_ == iDipole_){
151+
// the dk's may not be negative (like the sphere). make sure they are
152+
// this gets rid of SO many errors...
153+
dk_center_scgc = -1.0 * abs(dk_center_scgc);
154+
dk_edge = -1.0 * abs(dk_edge);
155+
dr_edge = -1.0 * abs(dr_edge);
151156
dk_center_m_scgc = pow(magAlt_scgc, 3) % dk_center_scgc / delTheta(magLat_scgc);
152157
dk_edge_m = pow(magAlt_scgc, 3) % dk_edge / delTheta(magLat_scgc);
153158
}

0 commit comments

Comments
 (0)