CRCM

From OpenGGCM

The CRCM is called as a subroutine from the OpenGGCM.

The first call (ijob=0) the CRCM needs to report its grid dimensions.

The second call (ijob=1) the CRCM does its own initialization, and it fills some arrays for the OpenGGCM, such as ionospheric grid, energy and pitch angle grids.

On Each subsequent call (ijob=2) the CRCM performs one step. Parameters are passed between the OpenGGCM and the CRCM as follows:

 subroutine crcm(ijob,np,nt,neng,npit,nspec,delta_t,Hiono, &
                 npmax,npt,gb,bb,brad,bphi,beq,ftv,pot,rrio,ttio,  &
                 kspec,xlat,xmlt,energy,sinAo,fac,phot,flux)
     integer npt(np,nt)
     integer kspec(nspec)
     real gb(np,nt,npmax,3)
     real bb(np,nt,npmax)
     real brad(np,nt)
     real bphi(np,nt)
     real beq(np,nt)
     real ftv(np,nt)
     real pot(np,nt)
     real rrio(np,nt)
     real ttio(np,nt)
     real xlat(np)
     real xmlt(nt)
     real energy(neng)
     real sinAo(npit)
     real fac(np,nt)
     real phot(np,nt)
     real flux(nspec,np,nt,neng,npit)


  ijob:      execution mode (input)
             0:    query nt,np,neng,npit,nspec.  
             1:    initialization.
                   Fill and return kspec,xlat,xmlt,energy,sinAo, etc.
             2:    perform one time step
  np,nt:     the dimensions of the CRCM ionosphere arrays.  The leading
             dimension is latitude, where np is the highest latitude,
             the second dimension is magnetic local time.
             (input, except for ijob=0 where it is output)
  neng,npit: the dimensions of energy and pitch angle arrays.
             (input, except for ijob=0 where it is output)
  nspec:     number of species. (input, except for ijob=0 where it is output)
  delta_t:   OpenGGCM and CRCM exchange information every delta_t. (input, second)
  Hiono:     OpenGGCM ionosphere altitude. (input, unit: km)
  npmax:     OpenGGCM maximum possible number of points in tracing a field line (input)
  npt:       npt(np,nt). Unused for ijob=0,1. OpenGGCM number of field line tracing
             points for a given (xlat,xmlt). npt(i,j)=0 represents open field line
             at xlat(i), xmlt(j). (input)
  gb:        gb(np,nt,npmax,3). Unused for ijob=0,1. OpenGGCM field line trace points in
             SM coordinates. (input, unit: Re)
  bb:        bb(np,nt,npmax). Unused for ijob=0,1. OpenGGCM magnetic field magnitude
             at gb.  SM coordinates. (input, unit: nT)
  brad:      brad(np,nt). mapping radius in the equatorial plane (input, unit: Re)
  bphi:      bphi(np,nt). LT location in the equatorial plane
             (input, unit: hours from midnight)
  beq:       beq(np,nt). B in the equatorial plane (input, unit: nT)
  ftv:       ftv(np,nt). Flux tube volume (input, unit: Re**3/Wb)
  pot:       pot(np,nt). Ionosphere potential, without corotation (input, unit: Volt)
  rrio:      rrio(np,nt). Number density, mapped to the ionosphere 
             (input: MHD number density, for CRCM to fill boundary conditions;
              output: CRCM number density; unit: 1/m**3). - input/output
  ttio:      ttio(np,nt). Temperature (unit: eV), otherwise the same as rrio. 
             - input/output.  
  kspec:     kspec(nspec). Type of species 
             (output for ijob=1. 1: e-, 2: protons, 3: He+, 4: O+)
  xlat,xmlt: xlat(np),xmlt(nt). latitude and magnetic local time (output for ijob=1, 
             unit: degrees) corresponding to the CRCM ionosphere grid. SM coordinates.
  energy:    energy(neng). The energies in keV of ring current particles 
             (output for ijob=1, unit: keV)
  sinAo:     sinAo(npit). The sine of equatorial pitch angle of ring current particles 
             (output for ijob=1)
  fac:       fac(np,nt). Field aligned current (output, unit: A/m**2)
  phot:      phot(np,nt). isotropic pressure from ring current (hot) particles
             (output, unit: nPa)
  flux:      flux(nspec,np,nt,neng,npit). particle differential flux
             (output, unit: cm^-2 s^-1 keV^-1 sr^-1)