From OpenGGCM
Jump to: navigation, search

This page describes the coupling between the OpenGGCM main/io4(potential solver)/MHD and CTIM. CTIM is treated as a subroutine and runs on a separate processor (managed by main). The subroutine call is as follows:

     subroutine ctim_interface(infile,ofile,uttime,basetime,ieprmod,
    +        ipotmod,ff107,nnp,nnt,pot,e_prec_f_1,e_prec_e0_1,
    +        e_prec_f_2,e_prec_e0_2,sigp,sigh,fac_dyn,ist)

The code in ctim_interface is a strongly modified version of tucan (I believe) where most of the time step control has been taken out and where much of the coe has been made into subroutines. Here is the meaning of the variables in the parameter list:

 infile (input, character string):  File name with the parameters for CTIM. 
  The parameters are defined in the
 'runme' file and the massaged into CTIM's input format so CTIM can read them in its usual way.
 ofile (input,  character string):  Prefix (including full directory path name) 
 for CTIM output files.   Apparently unused right now.
 uttime, basetime (input, real*8):  The last time (real time in epoch1966 seconds) that
 ctim_interface has been
 called and the current real time.  Used to tag output files and for coordinate system conversions.
 ieprmod, ipotmod (input, integer):  always 0.  Can be used to switch off passing of potential or 
 precipitation parameters.
 ff107 (input, real*4):  Value of f107 flux.
 nnp, nnt (input):  Dimensions, (phi, longitude, and theta, latitude) of the ionosphere
 arrays coming from MHD.  Currently nnp=121, nnt=361.
 pot (input, real*4 array(nnp,nnt)):  array with potential in V.
 e_prec_f_1 (input, real*4 array(nnp,nnt)):  array with diffuse electron energy flux (mW/m).
 e_prec_f_2 (input, real*4 array(nnp,nnt)):  array with discrete electron energy flux (mW/m).
 e_prec_e0_1 (input, real*4 array(nnp,nnt)):  array with diffuse electron mean energy (V).
 e_prec_e0_2 (input, real*4 array(nnp,nnt)):  array with discrete electron mean energy (V).
 sigp (output, real*4 array(nnp,nnt)):  array with Pedersen conductance (S).
 sigh (output, real*4 array(nnp,nnt)):  array with Hall conductance (S).
 fac_dyn (output, real*4 array(nnp,nnt)):  array with dynamo current (microA/m**2).
 ist (input, integer):  Time step number (unused).

ctim_interface is called every 60 seconds real time. When it is called for the first time it must do its own initialization. It does read a lot of stuff in (some of which may be unused). The path/filenames are given in the input file infile. Here is a partial listing of ctim_interface for those who want to dig further: Media:ctim_interface.f.