diff options
author | allen <allen@c78560ca-4b45-4335-b268-5f3340f3cb52> | 1999-04-02 14:46:23 +0000 |
---|---|---|
committer | allen <allen@c78560ca-4b45-4335-b268-5f3340f3cb52> | 1999-04-02 14:46:23 +0000 |
commit | 1d0928ad88d0801ebd254e11b66ef04e4b503ff6 (patch) | |
tree | 0f2a461e1b444dc1cb8a2af0b2eb336332ae1a4f | |
parent | aef2db62ee4a0eb36ae10734598cb71937efb46a (diff) |
Fixes for strange results in octant mode
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/CartGrid3D/trunk@21 c78560ca-4b45-4335-b268-5f3340f3cb52
-rw-r--r-- | src/CartGrid3D.F | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/src/CartGrid3D.F b/src/CartGrid3D.F index cfc04bd..70395eb 100644 --- a/src/CartGrid3D.F +++ b/src/CartGrid3D.F @@ -3,7 +3,7 @@ @date Thu Feb 18 @author Gabrielle Allen @desc - Set up coordinates for a 3D Cartesian grid + Set up coordinates for a 3D Cartesian grid @enddesc @@*/ @@ -28,7 +28,7 @@ iflag = 0 ! Gets set to one if we set a grid - iconv = 2**convlevel + iconv = 2**(convlevel-1) c -------------------------------------------------------------- @@ -55,14 +55,14 @@ c Grid spacing on coarsest grid coarse_dz = zmax/(DBLE(global_sh(3))-1.5d0) c Grid spacing on this grid - this_dx = -coarse_dx*0.5d0 - this_dy = -coarse_dy*0.5d0 - this_dz = -coarse_dz*0.5d0 + this_dx = coarse_dx/levfac + this_dy = coarse_dy/levfac + this_dz = coarse_dz/levfac c Minimum coordinate values on this grid - x0 = (0.5-dble(nghostzones))*dx - y0 = (0.5-dble(nghostzones))*dy - z0 = (0.5-dble(nghostzones))*dz + x0 = (0.5-dble(nghostzones))*this_dx + y0 = (0.5-dble(nghostzones))*this_dy + z0 = (0.5-dble(nghostzones))*this_dz else if (CCTK_Equals(symmetry,'quadrant') == 1) then @@ -91,9 +91,9 @@ c dx,dy,dz on the coarsest grid of each GH end if c dx,dy,dz on the grid we are on - dx = coarse_dx/levfac - dy = coarse_dy/levfac - dz = coarse_dz/levfac + this_dx = coarse_dx*iconv/levfac + this_dy = coarse_dy*iconv/levfac + this_dz = coarse_dz*iconv/levfac write(*,'(1X,A,1X,3(A,G12.7,2X))') & 'Grid by range: Setting ','dx=>',this_dx,'dy=>', @@ -178,9 +178,9 @@ c dx,dy,dz on the coarsest grid of each GH coarse_dz = 1.d0/max(global_sh(1)-1,1) c dx,dy,dz on the grid we are on - this_dx = coarse_dx/levfac - this_dy = coarse_dy/levfac - this_dz = coarse_dz/levfac + this_dx = coarse_dx*iconv/levfac + this_dy = coarse_dy*iconv/levfac + this_dz = coarse_dz*iconv/levfac c Special cases if (global_sh(1) == 1) x0 = 0.0D0 @@ -199,7 +199,6 @@ c No grid was set up c ------------------ if (iflag.ne.1) then call CCTK_Warn(0,"No grid set up in CartGrid3D") - call CCTK_Exit(GH) end if @@ -223,24 +222,23 @@ c ----------------------- #ifdef CARTGRID3D_DEBUG write(*,*) - write(*,*) "CartGrid3D" - write(*,*) "----------" - write(*,*) "Dx, Dy, Dz on coarse grid = ", + write(*,*) " CartGrid3D" + write(*,*) " ----------" + write(*,*) " Dx, Dy, Dz on coarse grid = ", & coarse_dx,coarse_dy,coarse_dz - write(*,*) "Dx, Dy, Dz on this grid = ",delta_space(1), + write(*,*) " Dx, Dy, Dz on this grid = ",delta_space(1), & delta_space(2),delta_space(3) - write(*,*) "Convergence level = ",convlevel - write(*,*) "Grid level = ",levfac - write(*,*) "Minimum Global Coords = ",x0,y0,z0 - write(*,*) "Maximum Global Coords = ",x0+this_dx*(global_sh(1)-1), - & y0+this_dy*(global_sh(2)-1),z0+this_dz**(global_sh(3)-1) - write(*,*) "Minimum Local Coords = ",x(1,1,1), + write(*,*) " Convergence level = ",convlevel + write(*,*) " Grid level = ",levfac + write(*,*) " Minimum Global Coords = ",x0,y0,z0 + write(*,*) " Maximum Global Coords = ",x0+this_dx*(global_sh(1)-1), + & y0+this_dy*(global_sh(2)-1),z0+this_dz*(global_sh(3)-1) + write(*,*) " Minimum Local Coords = ",x(1,1,1), & y(1,1,1),z(1,1,1) - write(*,*) "Maximum Local Coords = ",x(sh(1),sh(2),sh(3)), + write(*,*) " Maximum Local Coords = ",x(sh(1),sh(2),sh(3)), & y(sh(1),sh(2),sh(3)),z(sh(1),sh(2),sh(3)) #endif - return end subroutine CartGrid3D |