3-Dimensional MHD Simulation of Earth's Magnetosphere 2001.09.29 by T. Ogino We will demonstrate how to execute the 3-Dimensional magnetohydrodynamic (MHD) Simulation of Earth's Magnetosphere in 1/4 volume by HPF/JA and how to use the graphics programs to make PostScript files and VRML files in this section. In the MHD model, MHD and Maxwell's equations are solved in the solar-magnetospheric coordinate system by using modified leap-frog method when the upstream solar wind and interplanetary magnetic field (IMF) boundary conditions are given. Moreover, north-south symmetry and dawn-dusk symmetry are assumed, therefore it is enough to solve 1/4 volume as the simulation box. The main simulation Fortran program, proghpf.f is fully vectorized and fully parallelized by HPF/JA on a vector/parallel-type supercomputer, Fujitsu VPP5000/56 in the Computer Center, Nagoya University. By executing the main MHD simulation code, a simulated binary file is produced as output. When the output binary file is used as input, graphics programs can be executed to make PostScript files and VRML files for three dimensional visualization. main program : proghpf.f using HPF/JA proghpf.f using modified leap-frog scheme 3D MHD simulation of 1/4 earth's magnetosphere Cartesian coordinate finite resistivity 45 degree boundary (nx,ny,nz)=(320,80,80) : grid number without boundary nxp=80 : parameter to determine earth position last=16384 : number of time steps iiq0=8 : a unit of modified leap-frog scheme iip0= 32 : adjust upstream boundary condition iis0= 8192 : sampling step of data thx=2.3450007 : parameter to adjust time step (xl,yl,zl)=(128.4,32.4,32.4)Re: length in each direction hx=xl/float(nx+1)=0.4Re : grid interval in x direction hy=yl/float(ny+1)=0.4Re : grid interval in y direction hz=zl/float(nz+1)=0.4Re : grid interval in z direction t=0.5*hx*thx : time interval t(real)=t*ts : real time to one time step advance =0.5*0.4*2.3450007*0.937 : ts is normalization value in time =0.43945 sec Time(iis0)=iis0*t(real)=8192*0.43945=3600(sec)=60(min)=1(hour) x=0.5*hx*float(2*i-nx2-1+2*nxp) : x position versus grid number y=0.5*hy*float(2*j-3) : y position versus grid number z=0.5*hz*float(2*k-3) : z position versus grid number where nx2=nx+2, ny2=ny+2 and nz2=nz+2 ro01=5.0E-4 (5/cc) : mass density of solar wind pr01=3.56E-8 : pressure of solar wind vsw=0.044 (300km/s) : speed of solar wind bis=CP(11)=1.5E-4 (5nT) : amplitude of IMF eatt : resistivity rmuu : viscosity eud0 : friction or collision term 4-dimensional array variable f(i,j,k,m) i=[1,nx2], j=[1,ny2], k=[1,nz2], m=[1,nb] nb=8 m=1 : rho, plasma density m=2 : Vx m=3 : Vy m=4 : Vz m=5 : P, plasma pressure m=6 : Bx m=7 : By m=8 : Bz <> Execution by HPF (High Performance Fortran) with 2PE HPF Fortran program, proghpf.f is located in directory, test and the compile information is found in the file, hpflist. 1. qsub -q x -eo -o pconphpf2.out pcomphpf2.sh compile "proghpf.f" by parallelization and vectorization mode 2. qsub -q z -eo -lPv 2 -o pexechpf.out pexechpf.sh execute the execution file "proghpf" cd test frt -Wh,-Lt proghpf.f -Pdt -o proghpf -Z hpflist # @$ -lt 1:30:00 # @$-q z -eo cd test timex proghpf where file must be defined in open statement like c open(10,file='earthbh0.data', c 1 access='sequential',form='unformatted') open(11,file='earthbh1.data', 1 access='sequential',form='unformatted') c <> 1. f77 -c -O gsub150.f 2. f77 -O gm150b.f gsub150.o 3. a.out > gm150a.ps & 4. gs gm150a.ps 5. lp gm150a.ps 1. f77 -c -O gsub220.f 2. f77 -O gm220b.f gsub220.o 3. a.out > gm220a.ps & 1. f77 -c -O gsub480b.f 2. f77 -O gm480b.f gsub480b.o 3. a.out & : output is written in fort.10 <> 1. f77 -c -O zvrsubb.f 2. f77 -O zvrmagb.f zvrsubb.o 3. a.out & : output is written in fort.10 4. mv fort.10 fort.102 1. f77 -c -O zvrsubb.f 5. f77 -O zvrcrob.f zvrsubb.o 6. a.out & : output is written in fort.10 7. mv fort.10 fort.101 8. cat fort.101 fort.102 > zvrml01.wrl References: T. Ogino, A three-dimensional MHD simulation of the interaction of the solar wind with the earth's magnetosphere: The generation of field-aligned currents, J. Geophys. Res., 91, 6791-6806 (1986). T. Ogino, R.J. Walker and M. Ashour-Abdalla, A global magnetohydrodynamic simulation of the magnetosheath and magnetopause when the interplanetary magnetic field is northward, IEEE Transactions on Plasma Science, Vol.20, No.6, 817-828 (1992). T. Ogino, Two-Dimensional MHD Code, (in Computer Space Plasma Physics), Ed. by H. Matsumoto and Y. Omura, Terra Scientific Publishing Company, 161-215, 411-467 (1993). T. Ogino, R.J. Walker and M. Ashour-Abdalla, A global magnetohydrodynamic simulation of the response of the magnetosphere to a northward turning of the interplanetary magnetic field, J. Geophys. Res., Vol.99, No.A6, 11,027-11,042 (1994).