Skip to content

Commit d8f79a5

Browse files
committed
[FEAT]: Experimental check for nLats & attempt to run in 1D
> Probably won't work. But a decent starting point, I hope. Feel free to revert this commit if it's broken.
1 parent 70802b8 commit d8f79a5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/init_mag_grid.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,18 @@ void Grid::init_dipole_grid(Quadtree quadtree, Planets planet)
412412
// lShells and baseLats are currently set for southern hemisphere then mirrored
413413
arma_vec Lshells(nF), baseLats(nF);
414414

415+
// now make sure the user used 1 or an even number for nLats
416+
if (nLats % 2 != 0)
417+
{
418+
if (nLats == 1)
419+
{
420+
report.print(0, ">> Running in 1D. Experinental!!");
421+
nF = 1;
422+
}
423+
else
424+
report.error("Cannot use odd nLats with dipole grid!");
425+
}
426+
415427
blat_min_ = cos(pow(min_lat, 1.0 / LatStretch));
416428
blat_max_ = cos(pow(max_lat, 1.0 / LatStretch));
417429
del_lat = (blat_max_ - blat_min_) / (nF - nGCs * 2.0);

0 commit comments

Comments
 (0)