Need program statement for FORD THIS IS THE MAIN PROGRAM FOR COMPUTING MAGNETIC FIELDS FROM OUTPUT FROM A SIMULATIONS DONE BY GEMINI3D. THIS PROGRAM VERY MUCH MIRRORS THE SETUP OF THE MAIN GEMINI.F90 CODE.
INITIALIZE MESSING PASSING VARIABLES, IDS ETC. CHECK THE GRID SIZE AND ESTABLISH A PROCESS GRID LOAD UP THE GRID STRUCTURE/MODULE VARS. FOR THIS SIMULATION - THIS ALSO PERMUTES DIMENSIONS OF 2D GRID, IF NEEDED read in a previously generated grid from filename listed in input file, distribute subgrids to individual workers a 2D simulation was done, which changes how the integrations go... this file contains the field points at which we are computing magnetic perturbations, it will be copied into the output directory
the integrations are being treated as Cartesian so flatten out the local spherical coordinates into cartesian, as well GET END VOLUMES SO THE INTEGRALS ARE 'COMPLETE' need to define the differential volume on the edge of this x3-slab in
COMPUTE NEEDED PROJECTIONS fourth dimension of unit vectors is the 3 Cartesian components of each vector DEALLOCATE GRID MODULE VARIABLES TO SAVE MEMORY (PROGRAM DOESN'T ACTUALLY NEED THESE ONCE X,Y,Z CREATED STORAGE FOR MAGNETIC FIELD CALCULATIONS latter is cell centered hence -1 in size, max is needed to prevent zero sized array only used by root, but I think workers need to have space allocated for this
MAIN LOOP FIXME: MAY BE MISSING A CORNER POINT HERE??? NO I THINK IT'S OKAY BASED ON SOME SQUARES I DREW, haha...
DO WE NEED TO CHECK HERE FOR DIV BY ZERO??? ALSO IN 2D WE KNOW THAT WE ARE ONLY DIVIDED IN THE 3 DIMENSION SO THERE IS NO NEED TO WORRY ABOUT ADDING A 'TOP' ETC.
without dim= input it just sums everything which is what we want
without dim= input it just sums everything which is what we want DEALLOCATE MAIN PROGRAM DATA SHUT DOWN MPI
Type | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|
integer, | dimension(3) | :: | ymd | VARIABLES READ IN FROM CONFIG.DAT 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 |
||
character(len=:), | allocatable | :: | outdir | |||
character(len=:), | allocatable | :: | indatsize | |||
character(len=:), | allocatable | :: | indatgrid | |||
character(len=:), | allocatable | :: | fieldpointfile | GRID STRUCTURE |
||
type(curvmesh) | :: | x | ||||
real(kind=wp), | dimension(:,:,:), allocatable | :: | J1 | |||
real(kind=wp), | dimension(:,:,:), allocatable | :: | J2 | |||
real(kind=wp), | dimension(:,:,:), allocatable | :: | J3 | |||
real(kind=wp) | :: | t | = | 0._wp | ||
real(kind=wp) | :: | dt | ||||
real(kind=wp) | :: | tout | ||||
real(kind=wp) | :: | dtout | ||||
real(kind=wp) | :: | tstart | ||||
real(kind=wp) | :: | tfin | ||||
integer | :: | it | ||||
integer | :: | isp | ||||
integer | :: | flag2D | ||||
real(kind=wp), | dimension(:,:,:), allocatable | :: | xp | |||
real(kind=wp), | dimension(:,:,:), allocatable | :: | yp | |||
real(kind=wp), | dimension(:,:,:), allocatable | :: | zp | |||
real(kind=wp), | dimension(:), allocatable | :: | xf | |||
real(kind=wp), | dimension(:), allocatable | :: | yf | |||
real(kind=wp), | dimension(:), allocatable | :: | zf | |||
real(kind=wp), | dimension(:), allocatable | :: | r | |||
real(kind=wp), | dimension(:), allocatable | :: | theta | |||
real(kind=wp), | dimension(:), allocatable | :: | phi | |||
real(kind=wp), | dimension(:,:,:), allocatable | :: | dV | |||
integer | :: | ipoints | ||||
integer | :: | lpoints | ||||
real(kind=wp), | dimension(:,:,:), allocatable | :: | proj_e1er | |||
real(kind=wp), | dimension(:,:,:), allocatable | :: | proj_e2er | |||
real(kind=wp), | dimension(:,:,:), allocatable | :: | proj_e3er | |||
real(kind=wp), | dimension(:,:,:), allocatable | :: | proj_e1etheta | |||
real(kind=wp), | dimension(:,:,:), allocatable | :: | proj_e2etheta | |||
real(kind=wp), | dimension(:,:,:), allocatable | :: | proj_e3etheta | |||
real(kind=wp), | dimension(:,:,:), allocatable | :: | proj_e1ephi | |||
real(kind=wp), | dimension(:,:,:), allocatable | :: | proj_e2ephi | |||
real(kind=wp), | dimension(:,:,:), allocatable | :: | proj_e3ephi | |||
real(kind=wp), | dimension(:,:,:), allocatable | :: | Jx | |||
real(kind=wp), | dimension(:,:,:), allocatable | :: | Jy | |||
real(kind=wp), | dimension(:,:,:), allocatable | :: | Jz | |||
real(kind=wp), | dimension(:,:,:), allocatable | :: | Rx | |||
real(kind=wp), | dimension(:,:,:), allocatable | :: | Ry | |||
real(kind=wp), | dimension(:,:,:), allocatable | :: | Rz | |||
real(kind=wp), | dimension(:,:,:), allocatable | :: | Rcubed | |||
real(kind=wp), | dimension(:,:,:), allocatable | :: | integrand | |||
real(kind=wp), | dimension(:,:,:), allocatable | :: | integrandavg | |||
real(kind=wp), | dimension(:,:,:), allocatable | :: | alt | |||
real(kind=wp), | dimension(:), allocatable | :: | Br | |||
real(kind=wp), | dimension(:), allocatable | :: | Btheta | |||
real(kind=wp), | dimension(:), allocatable | :: | Bphi | |||
real(kind=wp), | dimension(:), allocatable | :: | Brall | |||
real(kind=wp), | dimension(:), allocatable | :: | Bthetaall | |||
real(kind=wp), | dimension(:), allocatable | :: | Bphiall | |||
real(kind=wp), | dimension(:,:), allocatable | :: | Jxend | |||
real(kind=wp), | dimension(:,:), allocatable | :: | Jyend | |||
real(kind=wp), | dimension(:,:), allocatable | :: | Jzend | |||
real(kind=wp), | dimension(:,:), allocatable | :: | Rxend | |||
real(kind=wp), | dimension(:,:), allocatable | :: | Ryend | |||
real(kind=wp), | dimension(:,:), allocatable | :: | Rzend | |||
real(kind=wp), | dimension(:,:), allocatable | :: | Rcubedend | |||
real(kind=wp), | dimension(:,:), allocatable | :: | dVend | |||
real(kind=wp), | dimension(:,:), allocatable | :: | integrandend | |||
real(kind=wp), | dimension(:,:), allocatable | :: | integrandavgend | |||
real(kind=wp), | dimension(:,:), allocatable | :: | Jxtop | |||
real(kind=wp), | dimension(:,:), allocatable | :: | Jytop | |||
real(kind=wp), | dimension(:,:), allocatable | :: | Jztop | |||
real(kind=wp), | dimension(:,:), allocatable | :: | Rxtop | |||
real(kind=wp), | dimension(:,:), allocatable | :: | Rytop | |||
real(kind=wp), | dimension(:,:), allocatable | :: | Rztop | |||
real(kind=wp), | dimension(:,:), allocatable | :: | Rcubedtop | |||
real(kind=wp), | dimension(:,:), allocatable | :: | dVtop | |||
real(kind=wp), | dimension(:,:), allocatable | :: | integrandtop | |||
real(kind=wp), | dimension(:,:), allocatable | :: | integrandavgtop | |||
integer | :: | ix1 | ||||
integer | :: | ix2 | ||||
integer | :: | ix3 | ||||
real(kind=wp) | :: | rmean | ||||
real(kind=wp) | :: | thetamean | ||||
integer | :: | flagdneu | ||||
integer | :: | interptype | ||||
real(kind=wp) | :: | dxn | ||||
real(kind=wp) | :: | drhon | ||||
real(kind=wp) | :: | dzn | ||||
real(kind=wp) | :: | sourcemlat | ||||
real(kind=wp) | :: | sourcemlon | ||||
character(len=:), | allocatable | :: | sourcedir | |||
real(kind=wp) | :: | dtneu | ||||
integer | :: | flagprecfile | ||||
real(kind=wp) | :: | dtprec | ||||
character(len=:), | allocatable | :: | precdir | ELECTRIC FIELD FILE INPUT VARIABLES (UNUSED) |
||
integer | :: | flagE0file | ||||
real(kind=wp) | :: | dtE0 | ||||
character(len=:), | allocatable | :: | E0dir | GLOW MODULE INPUT VARIABLES |
||
integer | :: | flagglow | ||||
real(kind=wp) | :: | dtglow | ||||
real(kind=wp) | :: | dtglowout | FOR SPECIFYING THE PROCESS GRID |
|||
integer | :: | lid2in | FOR HANDLING INPUT |
|||
integer | :: | lid3in | FOR HANDLING INPUT |
|||
integer | :: | argc | ||||
integer | :: | ierr | ||||
character(len=256) | :: | argv | ||||
logical | :: | file_exists | REGULATOR FOR 1/R^3 |
|||
real(kind=wp), | parameter | :: | R3min | = | 1d9 | |
real(kind=wp), | parameter | :: | Rmin | = | 5d3 | ## MAIN PROGRAM |