RCM
From OpenGGCM
The RCM is called as a subroutine from the OpenGGCM.
The first call (mode=0) the RCM needs to report its grid dimensions nt and np.
The second call (mode=1) the RCM does its own initialization, and it fills some arrays for the OpenGGCM, such as coordinates.
On Each subsequent call (mode=2) the RCM performs one step. Parameters are passed between the OpnGGCM and the RCM as follows:
subroutine rcm(ijob,np,nt,maxfl,ifile,dt,time,
* alam,kspec,xlat,xlon,pot,fac,ftv,brad,bphi,beq,
* xlam,eeta,rrio,ttio
* )
ijob: execution mode (input)
0: query nt and np. only the first call has mode==0. In this
mode nt,np come in as (1,1) to satisfy the dimension statements,
but the true values for nt,np must be returned.
1: intitialization, i.e., RCM reads its data files and
parameters, initializes fields, etc.
Fill and return xlat,xlon,alam,kspec.
2: perform one time step
ifile: Name of the input file (input). This is the input file with
general parameters as RCM expects it. It is generated from the
'runme' file during the pre-processing phase. The parameters for
the RCM are prefixed 'rcm_' in the runme file.
nt,np: the dimensions of the RCM ionosphere arrays. The leading
dimension is latitude, where imin is the highest latitude,
the second dimension is
longitude (which direction?? where is 0??). input, except
for mode==0 where it is output.
maxfl: Maximum number of fluids (input). RCM should stop and print
an error message in mode==1 if this number is too small.
dt: time step (seconds)
mode==1: output, say what the first time step would be.
mode==2: on input: requested time step. Usually what was returned
on the previous call, but could be smaller, for
example to satisfy certain output times. output:
permissible step for the next call. (not yet implemented)
time: Time, in seconds since 01/01/1966. (input) Primary use
for tagging output files, but may later also be relevant
for data assimilation or other things. Must be REAL*8.
alam: The energies of the fluids (output, unit: eV)
kspec: Type of fluid (output: 1: e-, 2: protons, 3: He+, 4: He++, 5: O+).
xlat,xlon: latitude and longitude (output for mode==0, unit: degrees)
corresponding to the RCM ionosphere grid. SM coordinates.
pot: Ionosphere potential, without corotation (input, unit: V)
fac: Field aligned current (output, unit: A/m**2)
ftv: Flux tube volume (input, unit: Re**3/Wb)
brad: mapping radius in the equatorial plane (input, unit: RE)
bphi: LT location in the equatorial plane (hours from midnight??)
beq: Bz in the equatorial plane (input, nT)
xlam: lambda parameter (output, unit ????). - output
eeta: Eta parameter (output, unit 1/Wb). - output
rrio: Number density, mapped to the ionosphere (input: MHD number
density, for RCM to fill boundary conditions; output:
RCM number density; unit: 1/m**3). - input/output
ttio: Temperature (unit: eV), otherwise the same as rrio. - input/output.
The temperature on output is defined such that p=nkT.
