3-Dimensional MHD Simulation of Earth's Magnetosphere 2001.09.29 by T. Ogino main program : prog90.f using VPP Fortran earthb10.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 nornalization 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 Fortran90 with 2PE (Vectorization and Parallelization) In this case one needs to declare to use 2PE by (npe=2) in source program. 1. qsub -q c -eo -o pcomp90.out pcomp90.sh compile "prog90.f" by parallelization and vectorization mode. 2. qsub -q z -eo -lPv 2 -o pexec90.out pexec90.sh execute the execution file "prog90" <> gpcs% more pcomp90.sh cd sub0 frt -Wx -o prog90 prog90.f <> gpcs% more pexec90.sh # @$ -lt 9:30:00 # @$-q z -eo cd sub0 timex prog90 where file must be defined in open statement like c open(10,file='earthbv0.data', c 1 access='sequential',form='unformatted') open(11,file='earthbv1.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 zvrsuba.f 5. f77 -O zvrcrob.f zvrsuba.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).