-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
push changes into run in 1d branch #158
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Drafted first in python. This code makes plots & is adjustable. I commented everything so it's hopefully understandable... Reach out with questions. Similar to SAMI2/3 grid. It's B_par & B_perp aligned, made in dipole (p,q) coords, and specified w/ (nf, nz). Code hands back (r,lat) though, not (q,p) or anything like that... Code needs to be able to be modified for tilted, offset dipole so I left all the for-loops and didn't spend any time optimizing.
…lizing mag grid Paper on this from 2006: <https://arxiv.org/pdf/physics/0606044>
…lizing mag grid Paper on this from 2006: <https://arxiv.org/pdf/physics/0606044>
Working. Need to port to init_mag_grid.cpp
Code can run in 1D (alt)
Couple issues remain: - Longitudes are sometimes nan in output files? - nLats needs to be even. And it's not checked. - Ghost cells probably not implemented correctly.
Netcdf files can't be ready by xarray (python) when a dimension has the same name as a variable. This is a problem for "z". Renames all `(x,y,z,time)` -> `(n_x, n_y, n_z, n_time)` > there are two output_netcdf files. I dont think the other is used?
clean out old comments, improve comments that are gonna be left, refactor a bit. - Some nan's in lon are removed by changing the transform.cpp. It's not a bug so I included it in this commit. - Style in transform.coo too.
- not all ionGrid options are used for sphere/dipole grid. I'll add a doc page on this in the next commit...
! I removed the section about passing btwn N/S hemispheres, since that's undecided.
> Probably won't work. But a decent starting point, I hope. Feel free to revert this commit if it's broken.
Though I could do something clever. It's wasn't. Glad I caught this, geez
## Documentation changes: - Update description of geographic & dipole grids - Rearrange `.md` files, complete docs might be easier to generate with this ## test passing - I found an issue that caused tests to fail. this was a quick fix to the input files. ## DIPOLE GRID > big one here - I rewrote the magnetic grid to be in dipole coordinates. *should* be field-aligned. - Very similar to SAMI2/3 grid - Changed inputs, docs, etc. to support this.
[FEAT]: Dipole grid and 1D improvements
- Grid spacing was not exponential, as expected. The issue was with using nZ vs nAlts & is fixed.
unused funcs rm'ed from in init_mag_grid file for debugging removed from edu/examples/dipole/
- I can't test in 1D since things break in the geographic grid. If the dipole grid is broken in 1D, let me know! The altitude (along-field-line) ghost cells are treated as standard grid points. - At low altitudes, points are close enough this is OK. - At high altitudes, it's going to be hard to get ghost cells. - For example, if they extend along the field line, there will be points at +25 Re (L-shell of max_lat) - If they are scaled to lower radius, or just not as far along the field line, they will not be perpendicular to B anymore! > Maybe specify where field lines should be separated btwn open/closed? Then closed field lines will overlap across equator, and open field lines will not be perpendicular to B in the ghost cells? IDK yet! ---- Ghost cells in latitude currently go over the poles. Discussion is happening on whether this is a good idea or not. ---
[BUG]: Fix altitude spacing error in dipole grid
Advection v2
lots of NaNs, but that is why I am merging! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
We need to be able to run in 1D, so this will allow a testing place for that.