mesh.f90 Source File


This file depends on

sourcefile~~mesh.f90~~EfferentGraph sourcefile~mesh.f90 mesh.f90 sourcefile~phys_consts.f90 phys_consts.F90 sourcefile~mesh.f90->sourcefile~phys_consts.f90

Files dependent on this one

sourcefile~~mesh.f90~~AfferentGraph sourcefile~mesh.f90 mesh.f90 sourcefile~multifluid.f90 multifluid.f90 sourcefile~multifluid.f90->sourcefile~mesh.f90 sourcefile~ionization.f90 ionization.f90 sourcefile~multifluid.f90->sourcefile~ionization.f90 sourcefile~precipbcs_mod.f90 precipBCs_mod.f90 sourcefile~multifluid.f90->sourcefile~precipbcs_mod.f90 sourcefile~grid.f90 grid.f90 sourcefile~multifluid.f90->sourcefile~grid.f90 sourcefile~advec_mpi.f90 advec_mpi.f90 sourcefile~multifluid.f90->sourcefile~advec_mpi.f90 sourcefile~calculus.f90 calculus.f90 sourcefile~multifluid.f90->sourcefile~calculus.f90 sourcefile~sources.f90 sources.f90 sourcefile~multifluid.f90->sourcefile~sources.f90 sourcefile~diffusion.f90 diffusion.f90 sourcefile~multifluid.f90->sourcefile~diffusion.f90 sourcefile~ionization.f90->sourcefile~mesh.f90 sourcefile~ionization.f90->sourcefile~grid.f90 sourcefile~neutral.f90 neutral.f90 sourcefile~ionization.f90->sourcefile~neutral.f90 sourcefile~temporal.f90 temporal.f90 sourcefile~temporal.f90->sourcefile~mesh.f90 sourcefile~precipbcs_mod.f90->sourcefile~mesh.f90 sourcefile~precipbcs_mod.f90->sourcefile~grid.f90 sourcefile~grid.f90->sourcefile~mesh.f90 sourcefile~gemini.f90 gemini.f90 sourcefile~gemini.f90->sourcefile~mesh.f90 sourcefile~gemini.f90->sourcefile~multifluid.f90 sourcefile~gemini.f90->sourcefile~temporal.f90 sourcefile~gemini.f90->sourcefile~precipbcs_mod.f90 sourcefile~gemini.f90->sourcefile~grid.f90 sourcefile~potentialbcs_mumps.f90 potentialBCs_mumps.f90 sourcefile~gemini.f90->sourcefile~potentialbcs_mumps.f90 sourcefile~potential_comm_mumps.f90 potential_comm_mumps.f90 sourcefile~gemini.f90->sourcefile~potential_comm_mumps.f90 sourcefile~gemini.f90->sourcefile~neutral.f90 sourcefile~io.f90 io.f90 sourcefile~gemini.f90->sourcefile~io.f90 sourcefile~potential_mumps.f90 potential_mumps.f90 sourcefile~potential_mumps.f90->sourcefile~mesh.f90 sourcefile~potential_mumps.f90->sourcefile~calculus.f90 sourcefile~advec_mpi.f90->sourcefile~mesh.f90 sourcefile~advec_mpi.f90->sourcefile~grid.f90 sourcefile~calculus.f90->sourcefile~mesh.f90 sourcefile~sources.f90->sourcefile~mesh.f90 sourcefile~sources.f90->sourcefile~grid.f90 sourcefile~sources.f90->sourcefile~calculus.f90 sourcefile~potentialbcs_mumps.f90->sourcefile~mesh.f90 sourcefile~potentialbcs_mumps.f90->sourcefile~grid.f90 sourcefile~magcalc.f90 magcalc.f90 sourcefile~magcalc.f90->sourcefile~mesh.f90 sourcefile~magcalc.f90->sourcefile~grid.f90 sourcefile~magcalc.f90->sourcefile~io.f90 sourcefile~potential_comm_mumps.f90->sourcefile~mesh.f90 sourcefile~potential_comm_mumps.f90->sourcefile~grid.f90 sourcefile~potential_comm_mumps.f90->sourcefile~potential_mumps.f90 sourcefile~potential_comm_mumps.f90->sourcefile~calculus.f90 sourcefile~potential_comm_mumps.f90->sourcefile~potentialbcs_mumps.f90 sourcefile~neutral.f90->sourcefile~mesh.f90 sourcefile~neutral.f90->sourcefile~grid.f90 sourcefile~diffusion.f90->sourcefile~mesh.f90 sourcefile~diffusion.f90->sourcefile~grid.f90 sourcefile~integral.f90 integral.f90 sourcefile~integral.f90->sourcefile~calculus.f90 sourcefile~div.f90 div.f90 sourcefile~div.f90->sourcefile~calculus.f90 sourcefile~gradient.f90 gradient.f90 sourcefile~gradient.f90->sourcefile~calculus.f90 sourcefile~potential_root.f90 potential_root.f90 sourcefile~potential_root.f90->sourcefile~potential_comm_mumps.f90 sourcefile~sources_mpi.f90 sources_mpi.f90 sourcefile~sources_mpi.f90->sourcefile~sources.f90 sourcefile~potential2d.f90 potential2d.f90 sourcefile~potential2d.f90->sourcefile~grid.f90 sourcefile~potential2d.f90->sourcefile~potential_mumps.f90 sourcefile~potential2d.f90->sourcefile~calculus.f90 sourcefile~read.f90 read.f90 sourcefile~read.f90->sourcefile~grid.f90 sourcefile~io.f90->sourcefile~grid.f90 sourcefile~atmos.f90 atmos.f90 sourcefile~atmos.f90->sourcefile~neutral.f90 sourcefile~glow_run.f90 glow_run.F90 sourcefile~glow_run.f90->sourcefile~ionization.f90 sourcefile~glow_dummy.f90 glow_dummy.f90 sourcefile~glow_dummy.f90->sourcefile~ionization.f90 sourcefile~potential_worker.f90 potential_worker.f90 sourcefile~potential_worker.f90->sourcefile~potential_comm_mumps.f90 sourcefile~mag_hdf5.f90 mag_hdf5.f90 sourcefile~mag_hdf5.f90->sourcefile~io.f90 sourcefile~mag.f90 mag.f90 sourcefile~mag.f90->sourcefile~io.f90 sourcefile~aurora.f90 aurora.f90 sourcefile~aurora.f90->sourcefile~io.f90 sourcefile~output.f90 output.f90 sourcefile~output.f90->sourcefile~io.f90 sourcefile~readgrid_raw.f90 readgrid_raw.f90 sourcefile~readgrid_raw.f90->sourcefile~read.f90 sourcefile~plasma.f90 plasma.f90 sourcefile~plasma.f90->sourcefile~io.f90 sourcefile~input.f90 input.f90 sourcefile~input.f90->sourcefile~io.f90 sourcefile~mag_raw.f90 mag_raw.f90 sourcefile~mag_raw.f90->sourcefile~io.f90 sourcefile~readgrid_hdf5.f90 readgrid_hdf5.f90 sourcefile~readgrid_hdf5.f90->sourcefile~read.f90 sourcefile~mag_ncdf.f90 mag_ncdf.f90 sourcefile~mag_ncdf.f90->sourcefile~io.f90 sourcefile~plasma_output_raw.f90 plasma_output_raw.f90 sourcefile~plasma_output_raw.f90->sourcefile~plasma.f90 sourcefile~plasma_output_ncdf.f90 plasma_output_ncdf.f90 sourcefile~plasma_output_ncdf.f90->sourcefile~plasma.f90 sourcefile~plasma_input_hdf5.f90 plasma_input_hdf5.f90 sourcefile~plasma_input_hdf5.f90->sourcefile~plasma.f90 sourcefile~plasma_input_raw.f90 plasma_input_raw.f90 sourcefile~plasma_input_raw.f90->sourcefile~plasma.f90 sourcefile~plasma_output_hdf5.f90 plasma_output_hdf5.f90 sourcefile~plasma_output_hdf5.f90->sourcefile~plasma.f90 sourcefile~path_exists_intel.f90 path_exists_intel.f90 sourcefile~path_exists_intel.f90->sourcefile~input.f90 sourcefile~aurora_ncdf.f90 aurora_ncdf.f90 sourcefile~aurora_ncdf.f90->sourcefile~aurora.f90 sourcefile~path_exists.f90 path_exists.f90 sourcefile~path_exists.f90->sourcefile~input.f90 sourcefile~aurora_hdf5.f90 aurora_hdf5.f90 sourcefile~aurora_hdf5.f90->sourcefile~aurora.f90 sourcefile~aurora_raw.f90 aurora_raw.f90 sourcefile~aurora_raw.f90->sourcefile~aurora.f90

Contents

Source Code


Source Code

module mesh

use phys_consts, only: wp
implicit none

type :: curvmesh
  !CURVILINEAR VARIABLES AND DIFFS.
  real(wp), dimension(:), allocatable :: x1
  real(wp), dimension(:), allocatable :: x1i
  real(wp), dimension(:), pointer :: dx1    !because sub arrays need to be assigned to aliases in calculus module program units
  real(wp), dimension(:), allocatable :: dx1i

  real(wp), dimension(:), allocatable :: x2
  real(wp), dimension(:), allocatable :: x2i
  real(wp), dimension(:), pointer :: dx2
  real(wp), dimension(:), allocatable :: dx2i

  real(wp), dimension(:), allocatable :: x3
  real(wp), dimension(:), allocatable :: x3i
  real(wp), dimension(:), pointer :: dx3
  real(wp), dimension(:), allocatable :: dx3i

  real(wp), dimension(:), allocatable :: x2all
  real(wp), dimension(:), allocatable  :: x2iall
  real(wp), dimension(:), pointer :: dx2all
  real(wp), dimension(:), allocatable  :: dx2iall

  real(wp), dimension(:), allocatable :: x3all
  real(wp), dimension(:), allocatable  :: x3iall
  real(wp), dimension(:), pointer :: dx3all
  real(wp), dimension(:), allocatable  :: dx3iall

  !METRIC FACTORS
  real(wp), dimension(:,:,:), pointer :: h1,h2,h3            !these are the cell-centered metric coefficients
  real(wp), dimension(:,:,:), allocatable :: h1x1i,h2x1i,h3x1i   !metric factors at x1 cell interfaces; dimension 1 has size lx1+1
  real(wp), dimension(:,:,:), allocatable :: h1x2i,h2x2i,h3x2i   !metric factors at x2 interfaces; dim. 2 has lx2+1
  real(wp), dimension(:,:,:), allocatable :: h1x3i,h2x3i,h3x3i   !metric factors at x3 interfaces; dim. 3 has lx3+1

  !ROOT ONLY FULL GRID METRIC FACTORS (WORKERS WILL NOT ALLOCATE)
  real(wp), dimension(:,:,:), pointer :: h1all,h2all,h3all
  real(wp), dimension(:,:,:), allocatable :: h1x1iall,h2x1iall,h3x1iall   !dimension 1 has size lx1+1
  real(wp), dimension(:,:,:), allocatable :: h1x2iall,h2x2iall,h3x2iall   !dim. 2 has lx2all+1
  real(wp), dimension(:,:,:), allocatable :: h1x3iall,h2x3iall,h3x3iall   !dim. 3 has lx3all+1

  !SHALL WE ALSO PRECOMPUTE SOME OF THE PRODUCTS FOR ADVECTION?

  !SIZE INFORMATION
  integer :: lx1,lx2,lx3,lx2all,lx3all    !for program units that may not be able to access module globals

  !UNIT VECTORS - NO ONE NEEDS A FULL GRID COPY OF THESE, I BELIEVE
  real(wp), dimension(:,:,:,:), allocatable :: e1,e2,e3     !unit vectors in curvilinear space (in cartesian components)
  real(wp), dimension(:,:,:,:), allocatable :: er,etheta,ephi    !spherical unit vectors (in cartesian components)

  !GEOMAGNETIC GRID DATA
  real(wp), dimension(:,:,:), allocatable :: r,theta,phi    !may be used in the interpolation of neutral perturbations

  !FULL-GRID GEOMAGNETIC INFORMATION - USED BY ROOT IN INTERPOLATING ELECTRIC FIELD FILE INPUT
  real(wp), dimension(:,:,:), allocatable :: rall,thetaall,phiall

  !GEOGRAPHIC DATA
  real(wp), dimension(:,:,:), allocatable :: glat,glon,alt

  !MAGNETIC FIELD - THIS IS  PART OF THE GRID SINCE THE COORDINATE SYSTEM USED IS BASED ON THE MAGNETIC FIELD
  real(wp), dimension(:,:,:), allocatable :: Bmag
  real(wp), dimension(:,:), allocatable :: I

  !DEFINE POINTS TO EXCLUDE FROM NUMERICAL SOLVES?
  real(wp), dimension(:,:,:), allocatable :: nullpts   !this could be a logical but I'm going to treat it as real*8
  integer :: lnull                                    !length of null point index array
  integer, dimension(:,:), allocatable :: inull

  !DIFFERENTIAL LENGTH ELEMENTS NEEDED TO COMPUTE COURANT NUMBERS
  real(wp), dimension(:,:,:), allocatable :: dl1i,dl2i,dl3i

  !A FLAG FOR INDICATING WHETHER OR NOT PERIODIC
  logical :: flagper
end type curvmesh

end module mesh