MAIN PROGRAM FOR GEMINI3D Need program statement for FORD stops with de facto "skip test" return code INITIALIZE MESSING PASSING VARIABLES, IDS ETC. READ FILE INPUT CHECK THE GRID SIZE AND ESTABLISH A PROCESS GRID
following grid_size these are in scope LOAD UP THE GRID STRUCTURE/MODULE VARS. FOR THIS SIMULATION read in a previously generated grid from filenames listed in input file
CREATE/PREP OUTPUT DIRECTORY AND OUTPUT SIMULATION SIZE AND GRID DATA ONLY THE ROOT PROCESS WRITES OUTPUT DATA ALLOCATE ARRAYS (AT THIS POINT ALL SIZES ARE SET FOR EACH PROCESS SUBGRID) allocate space for neutral perturbations in case they are used with this run ALLOCATE MEMORY FOR ROOT TO STORE CERTAIN VARS. OVER ENTIRE GRID ALLOCATE MEMORY FOR AURORAL EMISSIONS, IF CALCULATED LOAD ICS AND DISTRIBUTE TO WORKERS (REQUIRES GRAVITY FOR INITIAL GUESSING)
this assumes that the grid is defined s.t. the x1 direction corresponds to the magnetic field direction (hence zero B2 and B3).
INITIALIZE ELECTRODYNAMIC QUANTITIES FOR POLARIZATION CURRENT only root stores entire potential array INITIALIZE AURORAL EMISSION MAP
MAIN LOOP TIME STEP CALCULATION throttle how quickly we allow dt to increase hard-code these to zero for the first time step GET NEUTRAL PERTURBATIONS FROM ANOTHER MODEL this triggers the code to load the neutral frame correspdonding ot the beginning time of the simulation POTENTIAL SOLUTION UPDATE THE FLUID VARIABLES NOW OUR SOLUTION IS FULLY UPDATED SO UPDATE TIME VARIABLES TO MATCH... print every 10th time step to avoid extreme amounts of console printing OUTPUT close enough to warrant an output now... GLOW OUTPUT DEALLOCATE MAIN PROGRAM DATA DEALLOCATE MODULE VARIABLES (MAY HAPPEN AUTOMATICALLY IN F2003???) SHUT DOWN MPI
Type | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|
integer | :: | ierr | ||||
integer, | dimension(3) | :: | ymd | VARIABLES READ IN FROM CONFIG.INI FILE year,month,day of simulation |
||
real(kind=wp) | :: | UTsec | UT (s) |
|||
real(kind=wp) | :: | UTsec0 | UT start time of simulation (s) |
|||
real(kind=wp) | :: | tdur | duration of simulation |
|||
real(kind=wp), | dimension(3) | :: | activ | f10.7a,f10.7,ap |
||
real(kind=wp) | :: | tcfl | target CFL number |
|||
real(kind=wp) | :: | Teinf | exospheric temperature |
|||
integer | :: | potsolve | what type of potential solve |
|||
integer | :: | flagperiodic | toggles whether or not the grid is treated as periodic in the x3 dimension (affects some of the message passing) |
|||
integer | :: | flagoutput | what type of output to do (1 - everything; 2 - avg'd parms.; 3 - ne only) |
|||
integer | :: | flagcap | internal capacitance? |
|||
character(len=:), | allocatable | :: | infile | INPUT AND OUTPUT FILES command line argument input file |
||
character(len=:), | allocatable | :: | outdir | " " output directory |
||
character(len=:), | allocatable | :: | indatsize | grid size and data filenames |
||
character(len=:), | allocatable | :: | indatgrid | grid size and data filenames |
||
type(curvmesh) | :: | x | GRID STRUCTURE structure containg grid locations, finite differences, etc.: see grid module for details |
|||
real(kind=wp), | dimension(:,:,:,:), allocatable | :: | ns | STATE VARIABLES fluid state variables |
||
real(kind=wp), | dimension(:,:,:,:), allocatable | :: | vs1 | STATE VARIABLES fluid state variables |
||
real(kind=wp), | dimension(:,:,:,:), allocatable | :: | vs2 | STATE VARIABLES fluid state variables |
||
real(kind=wp), | dimension(:,:,:,:), allocatable | :: | vs3 | STATE VARIABLES fluid state variables |
||
real(kind=wp), | dimension(:,:,:,:), allocatable | :: | Ts | STATE VARIABLES fluid state variables |
||
real(kind=wp), | dimension(:,:,:), allocatable | :: | E1 | electrodynamic state variables |
||
real(kind=wp), | dimension(:,:,:), allocatable | :: | E2 | electrodynamic state variables |
||
real(kind=wp), | dimension(:,:,:), allocatable | :: | E3 | electrodynamic state variables |
||
real(kind=wp), | dimension(:,:,:), allocatable | :: | J1 | electrodynamic state variables |
||
real(kind=wp), | dimension(:,:,:), allocatable | :: | J2 | electrodynamic state variables |
||
real(kind=wp), | dimension(:,:,:), allocatable | :: | J3 | electrodynamic state variables |
||
real(kind=wp), | dimension(:,:,:), allocatable | :: | rhov2 | inductive state vars. (for future use - except for B1 which is used for the background field) |
||
real(kind=wp), | dimension(:,:,:), allocatable | :: | rhov3 | inductive state vars. (for future use - except for B1 which is used for the background field) |
||
real(kind=wp), | dimension(:,:,:), allocatable | :: | B1 | inductive state vars. (for future use - except for B1 which is used for the background field) |
||
real(kind=wp), | dimension(:,:,:), allocatable | :: | B2 | inductive state vars. (for future use - except for B1 which is used for the background field) |
||
real(kind=wp), | dimension(:,:,:), allocatable | :: | B3 | inductive state vars. (for future use - except for B1 which is used for the background field) |
||
real(kind=wp), | dimension(:,:,:), allocatable | :: | rhom | inductive auxiliary |
||
real(kind=wp), | dimension(:,:,:), allocatable | :: | v1 | inductive auxiliary |
||
real(kind=wp), | dimension(:,:,:), allocatable | :: | v2 | inductive auxiliary |
||
real(kind=wp), | dimension(:,:,:), allocatable | :: | v3 | inductive auxiliary |
||
real(kind=wp), | dimension(:,:,:,:), allocatable | :: | nn | neutral density array |
||
real(kind=wp), | dimension(:,:,:), allocatable | :: | Tn | neutral temperature and velocities |
||
real(kind=wp), | dimension(:,:,:), allocatable | :: | vn1 | neutral temperature and velocities |
||
real(kind=wp), | dimension(:,:,:), allocatable | :: | vn2 | neutral temperature and velocities |
||
real(kind=wp), | dimension(:,:,:), allocatable | :: | vn3 | neutral temperature and velocities |
||
real(kind=wp), | dimension(:,:,:), allocatable | :: | Phiall | full-grid potential solution. To store previous time step value |
||
real(kind=wp), | dimension(:,:,:), allocatable | :: | iver | integrated volume emission rate of aurora calculated by GLOW |
||
real(kind=wp) | :: | t | = | 0._wp | time from beginning of simulation (s) and time step (s) |
|
real(kind=wp) | :: | dt | = | 1e-6_wp | time from beginning of simulation (s) and time step (s) |
|
real(kind=wp) | :: | dtprev | time from beginning of simulation (s) and time step (s) |
|||
real(kind=wp) | :: | tout | time for next output and time between outputs |
|||
real(kind=wp) | :: | dtout | time for next output and time between outputs |
|||
real(kind=wp) | :: | tstart | temp. vars. for measuring performance of code blocks |
|||
real(kind=wp) | :: | tfin | temp. vars. for measuring performance of code blocks |
|||
integer | :: | it | time and species loop indices |
|||
integer | :: | isp | time and species loop indices |
|||
real(kind=wp), | allocatable | :: | dl1 | |||
real(kind=wp), | allocatable | :: | dl2 | |||
real(kind=wp), | allocatable | :: | dl3 | |||
integer | :: | flagdneu | toggles neutral perturbations (0 - none; 1 - file-based neutral inputs) |
|||
integer | :: | interptype | toggles whether the neutral input data are interpreted (0 - Cartesian; 1 - axisymmetric) |
|||
real(kind=wp) | :: | dxn | finite differences for the neutral input data in the horizontal and vertical directions |
|||
real(kind=wp) | :: | drhon | finite differences for the neutral input data in the horizontal and vertical directions |
|||
real(kind=wp) | :: | dzn | finite differences for the neutral input data in the horizontal and vertical directions |
|||
real(kind=wp) | :: | sourcemlat | mag. lat./long for the neutral source location |
|||
real(kind=wp) | :: | sourcemlon | mag. lat./long for the neutral source location |
|||
character(len=:), | allocatable | :: | sourcedir | directory where neutral input data are located |
||
real(kind=wp) | :: | dtneu | time interval [s] in between neutral inputs |
|||
integer | :: | flagprecfile | PRECIPITATION FILE INPUT VARIABLES flag toggling precipitation file input (0 - no; 1 - yes) |
|||
real(kind=wp) | :: | dtprec | time interval between precip. inputs |
|||
character(len=:), | allocatable | :: | precdir | directory containing precip. input files |
||
integer | :: | flagE0file | ELECTRIC FIELD FILE INPUT VARIABLES flag toggling electric field (potential BCs) file input (0 - no; 1 - yes) |
|||
real(kind=wp) | :: | dtE0 | time interval between electric field file inputs |
|||
character(len=:), | allocatable | :: | E0dir | directory containing electric field file input data |
||
integer | :: | flagglow | GLOW MODULE INPUT VARIABLES flag toggling GLOW module run (include aurora) (0 - no; 1 - yes) |
|||
real(kind=wp) | :: | dtglow | time interval between GLOW runs (s) |
|||
real(kind=wp) | :: | dtglowout | time interval between GLOW auroral outputs (s) |
|||
real(kind=wp) | :: | tglowout | time for next GLOW output |
|||
logical | :: | nooutput | = | .false. | FOR HANDLING OUTPUT |
|
integer | :: | argc | ||||
character(len=256) | :: | argv | ||||
integer | :: | lid2in | ||||
integer | :: | lid3in | ||||
character(len=10) | :: | date | ||||
character(len=10) | :: | time | ||||
real(kind=wp), | parameter | :: | dtscale | = | 2d0 | TO CONTROL THROTTLING OF TIME STEP MAIN PROGRAM |