The LFM stores its data in HDF-4 files using the HDF Scientific Data Set. Note: These files are formatted completely different from HDF5. The data model is considerably different.
We think about the LFM grid as being of size NI
, NJ
, NK
where N?
describes the number of cells in a given logical direction. So for the 53x24x32 grid, there are ni+1, nj+1 and nk+1 points. All of the data sets in the file are of size NIP1
x NJP1
x NKP1
where "P1" stands for "plus 1". The "plus 1" size comes from defining the edges of the cells.
Some variables are cell-centered, while others are aligned on grid edges & faces. We define all the arrays to be the same size for coding simplicity within the LFM. Note: this means that certain variables are not defined & contain meaningless data on the last indices! Here is a list of variables stored in the file:
HDF Scientific Data Set |
Description |
Data Location |
units |
Valid Range |
---|---|---|---|---|
rho_ |
density |
Cell |
particles/cm^3^ |
Ni x Nj x Nk |
vx_ |
x-component of velocity |
Cell |
cm/s |
Ni x Nj x Nk |
vy_ |
y-component of velocity |
Cell |
cm/s |
Ni x Nj x Nk |
vz_ |
z-component of velocity |
Cell |
cm/s |
Ni x Nj x Nk |
c_ |
Sound Speed |
Cell |
cm/s |
Ni x Nj x Nk |
bx_ |
x-component of Magnetic field |
Cell |
Gauss |
Ni x Nj x Nk |
by_ |
y-component of Magnetic field |
Cell |
Gauss |
Ni x Nj x Nk |
bz_ |
z-component of Magnetic field |
Cell |
Gauss |
Ni x Nj x Nk |
bi_ |
Magnetic flux |
Face |
Gauss*cm^2 |
Ni+1 x Nj x Nk |
bj_ |
Magnetic flux |
Face |
Gauss*cm^2 |
Ni x Nj+1 x Nk |
bk_ |
Magnetic flux |
Face |
Gauss*cm^2 |
Ni x Nj x Nk+1 |
ei_ |
Electric field? |
Edge |
(cm/s*Gauss)*cm |
Ni x Nj+1 x Nk+1 |
ej_ |
Electric field? |
Edge |
(cm/s*Gauss)*cm |
Ni+1 x Nj x Nk+1 |
ek_ |
Electric field? |
Edge |
(cm/s*Gauss)*cm |
Ni+1 x Nj+1 x Nk |
X_grid |
Grid coord |
Edge |
cm |
Ni+1 x Nj+1 x Nk+1 |
Y_grid |
Grid Coord |
Edge |
cm |
Ni+1 x Nj+1 x Nk+1 |
Z_grid |
Grid Coord |
Edge |
cm |
Ni+1 x Nj+1 x Nk+1 |
Derived variables are calculated as follows:
keV/cm^3
ei_
, ej_
, ek_
to the cell centers is fairly complicated and involves knowing the electric field value and the direction of the edges.
Symbol |
Description |
Data Location |
units |
Valid Range |
---|---|---|---|---|
P |
Pressure |
Cell |
keV/cm^3^ |
Ni x Nj x Nk |
Ex |
Electric Field |
Cell |
V/m |
Ni x Nj x Nk |
Ey |
Electric Field |
Cell |
V/m |
Ni x Nj x Nk |
Ez |
Electric Field |
Cell |
V/m |
Ni x Nj x Nk |
Jx |
Current |
Face |
Ni x Nj x Nk |
|
Jy |
Current |
Face |
Ni x Nj x Nk |
|
Jz |
Current |
Face |
Ni x Nj x Nk |
These variables are calculated by the CISM_DX LFM data reader. See the code at:
The LFM uses a distorted spherical grid which is adapted to the magnetosphere. This is described in detail in the 2004 paper The Lyon-Fedder-Mobarry (LFM) global MHD magnetospheric simulation code.
The X_grid,Y_grid,Z_grid
positions in the HDF file are in cartesian coordinates. Occasionally it is useful to work with the LFM grid in cylindrical coordinates. If you dig around the code much, you may see references to X2,Y2
and PHI
. These are the LFM grid in cylindrical coordinates. The transformation to X2,Y2,PHI
is:
x2(i,j) = x(i, j, 0) over all i,j y2(i,j) = y(i, j, 0) over all i,j phi(k) = atan2( z(10, 10, k), y(10, 10, k) ) for all k.
The LFM grid is aligned with the dipole axis. The dipole tilt is determined at runtime by the solar wind file: we assume that velocities are fed in in SM coordinates, which has the Z axis aligned with the dipole axis. The fact that the dipole is not aligned with the geographical axis is handled by the transformation of solar wind data from CSE or GSM coordinates to SM. In effect, the LFM fixes the dipole and rotate the universe around it.
Several tools are available to read HDF4 LFM model output. The easiest is CISM_DX. Read below for more advanced methods of reading data.
See example code in the repository at common/src/RMSerror/HDF_data.h
See example code in the repository at LFM-para/src/hdftake-para.F
.
The NCAR Command Language (NCL) includes a utility to convert from HDF4 to NetCDF: ncl_convert2nc
. See the NCL documentation for more information.
See the Post-processing with Python page for details.