Skip to content

Commit 47c430f

Browse files
authored
Merge branch 'develop' into fism
2 parents 9289699 + ce962ed commit 47c430f

File tree

135 files changed

+13058
-3166
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+13058
-3166
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@
99

1010
# Run and build directories
1111
run/
12-
run.test/
12+
run*/
1313
build/
1414

1515
# Doxygen generated files
1616
doc/generated
1717

1818
# Python extras
1919
__pycache__
20+
.ipynb_checkpoints
2021

2122
# autogenerated files
2223
tags

CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ endif()
1818

1919
# Directory variables
2020
file(GLOB SRC_FILES ${PROJECT_SOURCE_DIR}/src/*.cpp)
21+
file(GLOB TEST_FILES ${PROJECT_SOURCE_DIR}/srcTest/*.cpp)
2122
set(MAIN_DIR ${PROJECT_SOURCE_DIR}/src/main)
2223
set(TESTS_DIR ${PROJECT_SOURCE_DIR}/tests)
2324
set(OUT_DIR ${PROJECT_SOURCE_DIR}/src/output)
@@ -34,7 +35,7 @@ elseif(TEST_EXCHANGE)
3435
elseif(TEST_GRADIENT)
3536
add_executable(aether ${SRC_FILES} ${MSIS_FILES} ${MAIN_DIR}/main_test_gradient.cpp)
3637
else()
37-
add_executable(aether ${SRC_FILES} ${MSIS_FILES} ${IE_FILES} ${MAIN_DIR}/main.cpp)
38+
add_executable(aether ${SRC_FILES} ${TEST_FILES} ${MSIS_FILES} ${IE_FILES} ${MAIN_DIR}/main.cpp)
3839
endif()
3940

4041
if(USE_DOUBLE_PRECISION)
@@ -100,6 +101,14 @@ if (USE_NETCDF)
100101
target_link_libraries(aether PUBLIC ${NETCDF_LIBRARIES_C})
101102
endif()
102103

104+
# use_old_timing
105+
# cmake -DUSE_OLD_TIMING=ON ..
106+
option(USE_OLD_TIMING "Use old timing for performance - default is off" OFF)
107+
if (USE_OLD_TIMING)
108+
add_definitions(-DOLD_TIMING)
109+
set(OLD_TIMING "YES")
110+
endif()
111+
103112
# Set up links for executable
104113
file(CREATE_LINK ${CMAKE_BINARY_DIR}/aether
105114
${PROJECT_SOURCE_DIR}/share/run/aether SYMBOLIC)

CONTRIBUTING.md

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,29 +34,20 @@ on WSL with Ubuntu, the command seems to be:
3434

3535
astyle --options=.astylerc src/*.cpp
3636

37-
#### Linting
37+
Astyle can also be used within VSCode as an extension. Install the "Astyle" extension (author: Chieh Yu). Then go to settings (the "Manage" wheel on the bottom left, then click on "settings"). Under "Extensions", click on "Astyle Configuration". Within that, you can set the location of the astylerc file. Click on "Edit in settings.json". Modify the file so it has the following line:
38+
"[cpp]": {
39+
"editor.defaultFormatter": "chiehyu.vscode-astyle",
40+
"editor.formatOnSave": true
41+
},
42+
"astyle.astylerc": "${workspaceRoot}/.astylerc"
3843

39-
For *C++* code make sure to use a static code checker like
40-
[cpplint](https://github.com/cpplint/cpplint) to check the code for
41-
any style issues before submitting. For *Python*,
42-
[flake8](https://flake8.pycqa.org/en/latest/) is a good option. Both
43-
of these may by installed using pip.
44+
This should then allow you to format the code using the defaults that we have set in the astyle file. This can be done with (Ctrl-Shift-I for Linux, Alt-Shift-F for Windows) and upon saving the file - this reformats the whole file to put it into the astyle format.
4445

45-
To install `cpplint`
46+
#### Linting
4647

47-
```sh
48-
# depending on your system one of these lines applies
49-
pip install --user cpplint
50-
pip install cpplint
51-
python3 -m pip cpplint
52-
python3 -m pip --user cpplint
53-
```
48+
For *Python*,
49+
[flake8](https://flake8.pycqa.org/en/latest/) is a good option. This may by installed using pip.
5450

55-
Using a linter in an editor is a good supplement, but not a replacement for the
56-
static linters. The linter in the 'atom' editor requires that you install the
57-
`linter` and `gcc-linter` packages. Atom also has additional packages
58-
`whitespaces` and `tabs-to-spaces` to automatically remove whitespaces at the
59-
end of the lines, and convert tabs to spaces.
6051

6152
## Commit Styling
6253

README.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ developed.
1919

2020
## Contents
2121

22-
- [Aether](#aether)
23-
- [Contents](#contents)
24-
- [Quick Start](#quick-start)
25-
- [Dependencies](#dependencies)
26-
- [Getting the Code](#getting-the-code)
27-
- [Compiling \& Running](#compiling--running)
28-
- [Code Manual](#code-manual)
29-
- [Further Documentation](#further-documentation)
22+
- [Contents](#contents)
23+
- [Quick Start](#quick-start)
24+
- [Dependencies](#dependencies)
25+
- [Getting the Code](#getting-the-code)
26+
- [Compiling \& Running](#compiling--running)
27+
- [Inputs](#inputs)
28+
- [Code Manual](#code-manual)
29+
- [Further Documentation](#further-documentation)
3030

3131
## Quick Start
3232

@@ -141,9 +141,16 @@ structure like this:
141141
cd ..
142142
cp -R share/run ./run.test
143143
cd run.test
144-
./aether
144+
mpirun -np 4 ./aether
145145
```
146146

147+
This will run the default configuration of Aether, which requires four MPI processors.
148+
The default grids are `sphere4` and `dipole4` for the neutrals and ions (respectively),
149+
which both require four "root nodes", or MPI workers. To read more about root nodes and
150+
the available grids, please see [this page in the documentation](doc/internals/grid.md).
151+
152+
### Inputs
153+
147154
There are essentially two input files that specify the settings in the code.
148155
When you are in a run directory, they are:
149156

doc/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Contents within `doc`:
3232
- [Ensembles](internals/ensembles.md)
3333
- [Indices](internals/indices.md)
3434
- [The Grid](internals/grid.md)
35+
- [Coordinate Systems](internals/coordinates.md)
3536
- [Doxyfile](Doxyfile)
3637
- [README (this page)](README.md)
3738
- [Citations](citations.md)

doc/installation/dependencies.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,35 @@ If a path is printed, `cmake` is installed. To check the version, run `cmake
2121
The layout of this page is as follows:
2222

2323
- [Installing Dependencies](#installing-dependencies)
24-
- [Install gcc](#install-gcc)
24+
- [Install Compiler](#install-compiler)
2525
- [Install cmake](#install-cmake)
2626
- [Install JSON libraries](#install-json-libraries)
2727
- [Install Armadillo (and boost)](#install-armadillo-and-boost)
2828
- [Install NetCDF (optional)](#install-netcdf-optional)
2929

30-
## Install gcc
30+
## Install Compiler
3131

32-
This comes installed by default on Ubuntu. On MacOS this can be installed, for
33-
example, using:
32+
On MacOS this can be installed, for example, using:
3433

3534
```bash
36-
sudo port install gcc11
35+
sudo port install g++
3736
```
3837

39-
> As development began, gcc11 was the latest version; there are newer versions
40-
> of `gcc` available now (latest version is gcc14), which have not yet been
41-
> validated.
38+
> NOTE: On Macos, cmake will default to using clang instead of gcc.
39+
You need to set an environmental variable to tell cmake to use g++ instead.
40+
Do this with `export CXX=/opt/local/bin/g++`,
41+
and replace the path if it is placed somewhere different.
42+
43+
On Ubuntu, `gcc` (the C-compiler) is pre-installed, but the C++ compiler is not. This
44+
can be installed with (subsituting your machine's package manager command):
45+
46+
```bash
47+
sudo apt install g++
48+
```
4249

4350
## Install cmake
4451

45-
Aether uses [CMake](https://cmake.org/) instead of `make`. If you don't have it
52+
Aether uses [CMake](https://cmake.org/) instead of GNU make. If you don't have it
4653
installed, you need it.
4754

4855
For MacOS, this can be installed with:
@@ -57,7 +64,7 @@ For Ubuntu/Debian Linux:
5764
sudo apt install cmake
5865
```
5966

60-
This can be done on RedHat using yum also.
67+
This can be done on RedHat using `yum` also.
6168

6269
## Install JSON libraries
6370

@@ -100,7 +107,7 @@ sudo port install lapack
100107
sudo port install OpenBLAS
101108
sudo port install boost
102109
sudo port install armadillo
103-
sudo port install openmpi-bin libopenmpi-dev
110+
sudo port install openmpi
104111
```
105112

106113
## Install NetCDF (optional)
@@ -119,7 +126,7 @@ sudo port install netcdf-cxx4
119126
If you want the gcc version of netcdf, then:
120127

121128
```bash
122-
sudo port install netcdf-cxx4 +gcc10
129+
sudo port install netcdf-cxx4
123130
```
124131

125132
On Ubuntu, gcc is the default compiler, it seems like you can probably just do:

doc/installation/installation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ Here `FLAG` is a flag name and `VALUE` is the desired value (note the `-D`). A
9797
more complete discussion of the available compilation flags can be found on the
9898
[Compilation Options](build_opts.md) page.
9999

100-
If your default compiler isn't a GCC compiler, you will likely need to specify
101-
the desired GCC compiler at this step using:
100+
> If your default compiler isn't a GCC compiler, you will likely need to specify
101+
the desired GCC compiler at this step using the environmental variable `$CXX`, or:
102102

103-
```bash
103+
> ```bash
104104
cmake -DCMAKE_CXX_COMPILER=<gcc or mpi executable with full path>
105105
```
106106

doc/internals/coordinates.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,16 @@
2020

2121
## Dipole Coordinates
2222
- Longitude (radians) - radians east of the meridian that contains the north magnetic pole and north rotation axis
23-
- P (?) - Identifies the field line, related to L-shell
24-
- Q (meters?) - The distance along the field line from some reference point, related to magnetic latitude.
23+
- P (meters) - Identifies the field line. This is the same as L-shell and is constant along wach field line.
24+
- Q (dimensionless) - parameterizes the distance along the field line, related to magnetic latitude & radius. This varies along the field line, but the values are idential for all field lines within each node. q=0 at the equator, and approaches positive (negative) infinity as theta points towards the north (south) pole. Thus, q values will be negative in the southern hemisphere and the change in q "upwards" will be negative in the northern hemisphere. See [../../edu/examples/Dipole](../../edu/examples/Dipole) for more information.
2525

2626
## More Dipole Coordinates
2727
- L-shell (Planetary Radii) - The distance from the planet's center at which the magnetic field encounters the dipole's equatorial plane
28-
- Magnetic Latitude (radians) - angle between the dipole's equatorial plane and the point.
29-
- Invariant Latitude (degrees) - angle between the dipole's equatorial plane and the point at which the field-line passes through a reference radius of the planet. This is constant along the field-line and is related to the L-Shell.
28+
- Magnetic Latitude (radians) - angle between the dipole's equatorial plane and a point.
29+
- Invariant Latitude (radians) - angle between the dipole's equatorial plane and the point at which the field-line passes through a reference radius of the planet ([specified in the inputs](../internals/grid.md#inputs)). This is constant along the field-line and is related to the L-Shell.
3030
- Magnetic Local Time (hours) - Angle between the sun, the north magnetic pole, and the point. Explicitly, this is done in PSE XY coordinates, ignoring the Z coorinate.
3131

32+
> The dipole `(i,j,k)` coordinates are (magnetic longitude, p, q).
3233
3334
# Coordinates in Aether
3435

@@ -46,12 +47,15 @@ Because Aether considers gravity to be a function of radius and explicitly inclu
4647

4748
## i, j, k Coordinates
4849

49-
As described in the grid.md file, Aether uses a logical '(i, j, k)' 3D grid structure. Therefore, we refer to the 'primary' coordinates as the ijk coordinate system. What this means is that the i-coordinate is in the i-direction, the j-coordinate is in the j-direction, and the k-coordinate is in the k-direction.
50+
As described in the grid.md file, Aether uses a logical `(i, j, k)` 3D grid structure. Therefore, we refer to the 'primary' coordinates as the ijk coordinate system. What this means is that the i-coordinate is in the i-direction, the j-coordinate is in the j-direction, and the k-coordinate is in the k-direction.
5051

5152
For the (perfectly) spherical grid, the i-coordinate is longitude, the j-coordinate is latitude, and the k-coordinate is radius.
5253

5354
For the Cubedsphere grid, the i-coordinate is RIGHT, the j-coodinate is UP, and the k-coordinate is radius. Each face of the cubedsphere has the same coordinate system, but only with reference to that face. This means that if each face is looked at independently, the lower left corner is at (about) i = -45, j = -45 deg, while the upper right corner is at i = +45, j = +45 deg. Radius is treated the same as in a spherical grid.
5455

56+
For the dipole coordinate system, the i-coordinate is magnetic longitude, the j-coordinate is L-shell, and the k-coordinate is Q: a dimensionless parameter, normalized to the planet radius, representing diatance along a magnetic field line. The dipole is orthogonal to a dipolar magnetic field.
57+
58+
5559
Should the official coordinates be in the native coordinates (which could be different for each system), or should the coordinates be in meters, such that when gradients are taken, they are in /m?
5660

5761
Maybe we could have:
@@ -69,6 +73,6 @@ Locations:
6973
All locations should be described in the following coordinates:
7074
- i, j, k
7175
- lon, lat, radius (+alt)
72-
- magnetic lon, invariant lat?
76+
- magnetic lon, invariant lat (only the dipole magnetic grid then has magnetic latitude)
7377

7478

0 commit comments

Comments
 (0)