subroutine refy(eve,y0,thy0,y,thy) implicit none integer eve double precision y0, thy0, y, thy, ytest double precision ymax, zmax parameter(ymax=4.5,zmax=28.) double precision ymin, zmin parameter(ymin=0.,zmin=0.) c c-------------------------------------------------------------------------- c Why here we ytest = y0 + ((zmax-zmin)*dtan(thy0)) if(ytest.ge.0.and.ytest.le.ymax) then y = ytest thy = thy0 elseif(ytest.gt.ymax) then y = 2.*ymax - y0 - (zmax-zmin)*dtan(abs(thy0)) ! why ? thy = -1.*thy0 elseif(ytest.lt.ymin) then y = 2.*ymin - y0 + (zmax-zmin)*dtan(abs(thy0)) ! why ? thy = -1.*thy0 endif return end