subroutine set_pole use mod_global_parameters select case (coordinate) case (spherical) ! For spherical grid, check whether phi-direction is periodic if(periodB(ndim)) then if(phi_/=3) call mpistop("phi_ should be 3 in 3D spherical coord!") if(mod(ng3(1),2)/=0) call mpistop(& "Number of meshes in phi-direction should be even!") if(abs(xprobmin2)<smalldouble) then if(mype==0) write(unitterm,*)& "Will apply pi-periodic conditions at northpole!" poleB(1,2)=.true. else if(mype==0) write(unitterm,*) "There is no northpole!" end if if(abs(xprobmax2-dpi)<smalldouble) then if(mype==0) write(unitterm,*)& "Will apply pi-periodic conditions at southpole!" poleB(2,2)=.true. else if(mype==0) write(unitterm,*) "There is no southpole!" end if end if case (cylindrical) if (1 == phi_ .and. periodB(1)) then if(mod(ng1(1),2)/=0) then call mpistop("Number of meshes in phi-direction should be even!") end if if(abs(xprobmin1)<smalldouble) then if (mype==0) then write(unitterm,*) "Will apply pi-periodic conditions at r=0" end if poleB(1,1)=.true. else if (mype==0) then write(unitterm,*) "There is no cylindrical axis!" end if end if end if if (2 == phi_ .and. periodB(2)) then if(mod(ng2(1),2)/=0) then call mpistop("Number of meshes in phi-direction should be even!") end if if(abs(xprobmin1)<smalldouble) then if (mype==0) then write(unitterm,*) "Will apply pi-periodic conditions at r=0" end if poleB(1,1)=.true. else if (mype==0) then write(unitterm,*) "There is no cylindrical axis!" end if end if end if if (3 == phi_ .and. periodB(3)) then if(mod(ng3(1),2)/=0) then call mpistop("Number of meshes in phi-direction should be even!") end if if(abs(xprobmin1)<smalldouble) then if (mype==0) then write(unitterm,*) "Will apply pi-periodic conditions at r=0" end if poleB(1,1)=.true. else if (mype==0) then write(unitterm,*) "There is no cylindrical axis!" end if end if end if end select end subroutine set_pole