The LTR developer pages contain information & diagrams specific to code development of model coupling.
LFMMIX is a coupled model between LFM and MIX. MIX provides an inner boundary condition for the LFM global MHD model. LFM computes and MIX solves the potential in the equation
Convention:
There are three constraints to determine the maximum number of processors that should be used for a particular grid:
np > 1
. Using a single processor (np=1
) may give unexpected results.A formula to determine the number of processors is:
For example, using the default on a 53x24x32 grid, and . So
So you can use up to 18 processors on a 53x24x32 grid.
On a 106x48x64 grid, and . So
So you can use up to 78 processors on a 106x48x64 grid.
This diagram shows the order of data exchanges between LFM, MIX, TIEGCM and RCM. Click for a larger version:
start
: Occurs only once, at the beginning of a sequence:loop
, middle
: Occurs one or more times within time loop. Prefixed/suffixed by one start & stop exchange.start
: Occurs only once, at the end of a sequence:Sequence Type 
Exchange Order 
UT 
LFM 
MIX 
RCM 

start 
1 
4:00:00 
Send to MIX 
Recv from LFM 

start 

4:00:00 

Compute Potential 

start 
2 
4:00:00 
Recv from MIX 
Send to LFM 

start 
3 
4:00:00 
Send to RCM 

Recv from LFM 
start 
4 
4:00:00 

Send to RCM 
Recv from MIX 






loop 

4:00:10 
Send to MIX 
Recv from LFM 

loop 

4:00:10 

Compute Potential 

loop 

4:00:10 
Recv from MIX 
Send to LFM 

loop 
... 










middle 
1 
4:02:00 
Recv from RCM 

Send to LFM 
middle 
2 
4:02:00 
Send to MIX 
Recv from LFM 

middle 
3 
4:02:00 

Recv from RCM 
Send to MIX 
middle 

4:02:00 

Compute Potential 

middle 
4 
4:02:00 
Recv from MIX 
Send to LFM 

middle 
5 
4:02:00 

Send to RCM 
Recv from MIX 
middle 
6 
4:02:00 
Send to RCM 

Recv from LFM 






loop 

4:02:10 
Send to MIX 
Recv from LFM 

loop 

4:02:10 

Compute Potential 

loop 

4:02:10 
Recv from MIX 
Send to LFM 

loop 
... 










end 
1 
4:04:00 
Recv from RCM 

Send to LFM 
end 
2 
4:04:00 
Send to MIX 
Recv from LFM 

end 
3 
4:04:00 

Recv from RCM 
Send to MIX 
end 

4:04:00 

Compute Potential 

end 
4 
4:04:00 
Recv from MIX 
Send to LFM 

RCM Intermediate Grid
Send Order 
IC Variable 
Variable(s) 
Dimensions/Size 
Type 
Units 
Notes 

1 
immhd_ig_size 
Nx, Ny, Nz 
1d array (len=3) 
int 
n/a 
1xN broadcast 
2 
immhd_igx 
X 
1d array (Nx) 
float 
m (SM Coord) 
1xN broadcast 
3 
immhd_igy 
Y 
1d array (Ny) 
float 
m (SM Coord) 
1xN broadcast 
4 
immhd_igz 
Z 
1d array (Nz) 
float 
m (SM Coord) 
1xN broadcast 
LFM Grid
Send Order 
IC Variable 
Variable(s) 
Dimensions/Size 
Type 
Units 

5 
mhdim_lfm_size 
Ni, Nj, Nk 
1d array (len=3) 
int 
n/a 
6 
mhdim_lfmx 
X cell center 
3d array (Ni+1,Nj+1,Nk+1) 
float 
m (SM Coord) 
7 
mhdim_lfmy 
Y cell center 
3d array (Ni+1,Nj+1,Nk+1) 
float 
m (SM Coord) 
8 
mhdim_lfmz 
Z cell center 
3d array (Ni+1,Nj+1,Nk+1) 
float 
m (SM Coord) 
Other
Send Order 
IC Variable 
Variable(s) 
Dimensions/Size 
Type 
Units 
Notes 

9 
mhdim_dipole_moment 
Dipole Moment 
scalar 
float 
m k s 
1xN broadcast 
Click here for a description of the Accumulate routine.
Send Order 
IC Variable 
Variable(s) 
Dimensions/Size 
Type 
Units 

1 
mhdim_density 
rho 
1d (Nx*Ny*Nz) on intermediate grid 
float 
SI units 
2 
mhdim_pressure 
P 
1d (Nx*Ny*Nz) on intermediate grid 
float 
SI units 
3 
mhdim_bx 
Bx 
1d (Nx*Ny*Nz) on intermediate grid 
float 
SI units 
4 
mhdim_by 
By 
1d (Nx*Ny*Nz) on intermediate grid 
float 
SI units 
5 
mhdim_bz 
Bz 
1d (Nx*Ny*Nz) on intermediate grid 
float 
SI units 
6 
mhdim_v 
magnitude(v) 
1d (Nx*Ny*Nz) on intermediate grid 
float 
SI units 
Send Order 
IC_Variable 
Variable(s) 
Dimensions/Size 
Type 
Units 
Notes 

1 
immhd_density 
rho 
3d (Ni+1,Nj+1,Nk+1) LFM cellcentered 
float 
SI units 

2 
immhd_pressure 
P 
3d (Ni+1,Nj+1,Nk+1) LFM cellcentered 
float 
SI units 

3 
immhd_rcm_mask 
mask 
3d (Ni+1,Nj+1,Nk+1) LFM cellcentered 
int 
N/A 
0  not part of RCM 
RCM Ionosphere Grid
Send Order 
IC Variable 
Variable(s) 
Dimensions/Size 
Type 
Units 
Notes 

1 
imcpl_im_size 
nLon, nLat 
1d array (len=2) 
int 
N/A 
nLon+1 brings you back to the periodic point 
2 
cplim_r_i 
R_i 
scalar 
float 
m 
Radius of Ionosphere; IM exits if its value of RION is different in CPL 
3 
imcpl_latitude 
latitude 
1d array (nLat) 
float 
colatitude from pole (SM, radians) 

4 
imcpl_longitude 
longitude 
1d array (nLon) 
float 
0 at noon (SM, radians) 

Important Notes:
RCM Ionosphere information (i.e. sent to LFM/MIX)
Send Order 
IC Variable 
Variable(s) 
Dimensions/Size 
Type 
Units 
Notes 

1 
imcpl_avg_energy 
E_av (Avg Eng) 
2d (nLat, nLon) 
float 
J (SI) 
Unused by MIX as of r1268 (April 2010) 
2 
imcpl_avg_flux 
F_e (Energy Flux) 
2d (nLat, nLon) 
float 
W/(m*m) (SI) 
Unused by MIX as of r1268 (April 2010) 
3 
imcpl_fac 
J (total FAC density) 
2d (nLat, nLon) 
float 
A/(m*m) (SI) 
Unused by MIX as of r1268 (April 2010); How does MIX split the total FAC, which is defined once for halfgrid? 
LFM/MIX ionosphere information (i.e. sent to RCM)
Send Order 
IC Variable 
Variable(s) 
Dimensions/Size 
Type 
Units 
Notes 

1 
cplim_potential 
phi (potential 
2d (nLat, nLon)  on RCM grid 
float 
V (SI) 

2 
cplim_sigma_p 
Pedersen Conductance 
2d (nLat, nLon)  on RCM grid 
float 


3 
cplim_sigma_h 
Hall conductance 
2d (nLat, nLon)  on RCM grid 
float 


Note: MIX currently sends the Potential and conductances for the Northern hemisphere only! In the future we need to somehow average or sum over both hemispheres.
All time exchanges occur as a UT floatingpoint array (Year, Month, Day, Hour, Minute, Second). Note we pack extra information into the array for clean, efficient data transfer between the code.
Handshake
Send Order 
IC Variable 
Variable(s) 
Dimensions/Size 
Type 
Units 
Notes 

1 
mhdim_startup_scalars 
kill signal, Start UT, delta t (in seconds) 
1d (8 elements) 
int 
Kill_signal, Y, M, D, H, M, S, dt 
1xN broadcast 
At each exchange...
Send Order 
IC Variable 
Variable(s) 
Dimensions/Size 
Type 
Units 
Notes 

1 
mhdim_scalars 
kill signal, current UT 
1d (8 elements) 
int 
Kill_signal, Y, M, D, H, M, S 
1xN broadcast 
Kill_signal: