00001
00002
00003 module coordinate_grav_xyz
00004 use grid_parameter_cartesian, only : nx, ny, nz, nxhalf, nnx, nny, nnz, nstar
00005 implicit none
00006 real(8) :: dx, dy, dz
00007 real(8) :: x(nnx), y(nny), z(nnz)
00008
00009 contains
00010
00011 subroutine grid_xyz
00012 implicit none
00013 Integer :: ix, iy, iz, igrid
00014
00015 igrid = mod(nx,2)
00016 if (igrid.eq.0) write(6,*) ' ## Volume centered ## '
00017 if (igrid.eq.1) write(6,*) ' ## Grid centered ## '
00018
00019 dx = 1.0d0/dble(nstar)
00020 dy = dx
00021 dz = dx
00022
00023 x(1) = - dx*dble(nxhalf) + 0.5d0*dx*dble(1-igrid)
00024 y(1) = x(1)
00025 z(1) = x(1)
00026 do ix = 2, nx
00027 x(ix) = x(1) + dx*dble(ix-1)
00028 y(ix) = x(ix)
00029 z(ix) = x(ix)
00030 end do
00031
00032 end subroutine grid_xyz
00033 end module coordinate_grav_xyz