Skip to content

CMake, Meson, Matlab, Python additions to GLOW. NCAR wants to publish only base code.

License

Notifications You must be signed in to change notification settings

space-physics/NCAR-GLOW

Repository files navigation

GLOW

DOI Actions Status

The GLobal airglOW Model, independently and easily accessed using Fortran compiler. Available from scripting languages including Python and Matlab.

We describe each language below; pick the one(s) that apply for you. Python is the easiest and recommennded choice. A Fortran compiler is required in any case.

Python

Install/compile by:

git clone https://github.com/space-physics/ncar-glow

pip install -e ncar-glow

Confirm the install with:

pytest ncar-glow

Then use examples such as:

  • Maxwellian.py: Maxwellian precipiation, specify Q and E0.
  • Monoenergetic.py: Specify unit flux for one energy bin, all other energy bins are zero flux.

or use GLOW in your own Python program by:

import ncarglow as glow

iono = glow.simple(time, glat, glon, Q, Echar, Nbins)

iono is an xarray.Dataset containing outputs from GLOW, including:

  • number densities of neutrals, ions and electrons
  • Pedersen and Hall currents
  • volume emssion rate vs. wavelength and altitude
  • precipitating flux vs. energy
  • many more, request if you want it.

Fortran standalone

You can call this repo from a Meson wrap or CMake FetchContent. To build Fortran code by itself, do either:

cmake -B build

cmake --build build

MPI / NetCDF

The parallel version of GLOW requires MPI and NetCDF for TIEGCM I/O.

mpirun -np 2 ./mpi_glow.bin < ~/data/in.namelist.tgcm

Note, for an unknown reason, in.namelist.msis only works with -O0 or -O1 with gfortran 7. We didn't look into why. Otherwise, -O3 works fine.

Matlab

The Matlab interface is in +ncarglow passing data to / from Glow over scratch disk binary files.