diff --git a/src/gray_core.f90 b/src/gray_core.f90 index 12ec932..24ae752 100644 --- a/src/gray_core.f90 +++ b/src/gray_core.f90 @@ -147,8 +147,8 @@ contains ! print ne, Te, q, Jphi versus psi, rhop, rhot call print_bres(bres) call print_prof - call print_maps(bres, xgcn, & - 0.01_wp_*sqrt(params%antenna%pos(1)**2 + params%antenna%pos(2)**2), & + call print_maps(bres, xgcn, & + norm2(params%antenna%pos(1:2)) * 0.01_wp_, & sin(params%antenna%beta*degree)) ! ========= pre-proc prints END ========= diff --git a/src/gray_jetto1beam.f90 b/src/gray_jetto1beam.f90 index e2362cb..8e6f3d4 100644 --- a/src/gray_jetto1beam.f90 +++ b/src/gray_jetto1beam.f90 @@ -53,7 +53,7 @@ subroutine gray_jetto1beam(ijetto, mr, mz, r, z, psin, psia, rax, zax, & use limiter, only : limiter_set_globals=>set_globals real(wp_) :: r0m - r0m = sqrt(params%antenna%pos(1)**2 + params%antenna%pos(2)**2)*0.01_wp_ + r0m = norm2(params%antenna%pos(1:2)) * 0.01_wp_ call range2rect(params%misc%rwall, max(r0m, r(mr)), z(1), z(mz), & data%equilibrium%rlim, data%equilibrium%zlim) ! Set the global variables of `limiter` diff --git a/src/main.f90 b/src/main.f90 index 879c127..26834c5 100644 --- a/src/main.f90 +++ b/src/main.f90 @@ -28,7 +28,7 @@ program main call read_parameters(opts%params_file, params) call params_set_globals(params) - ! Read the input data into set the global variables + ! Read the input data and set the global variables ! of the respective module. Note: order matters. call init_equilibrium(params, data) call init_profiles(params%profiles, params%equilibrium%factb, data%profiles) @@ -332,7 +332,7 @@ contains .or. params%raytracing%ipass < 0) then block real(wp_) :: rmxm, r0m, z0m, dzmx - r0m = sqrt(params%antenna%pos(1)**2 + params%antenna%pos(2)**2)* 0.01_wp_ + r0m = norm2(params%antenna%pos(1:2)) * 0.01_wp_ dzmx = abs(params%raytracing%ipass) * & params%raytracing%dst * params%raytracing%nstep * 0.01_wp_ z0m = params%antenna%pos(3) * 0.01_wp_ @@ -446,8 +446,8 @@ contains ! Print ne, Te, q, Jphi versus psi, rhop, rhot call print_bres(bres) call print_prof - call print_maps(bres, xgcn, & - 0.01_wp_*sqrt(params%antenna%pos(1)**2 + params%antenna%pos(2)**2), & + call print_maps(bres, xgcn, & + norm2(params%antenna%pos(1:2)) *0.01_wp_ , & sin(params%antenna%beta*degree)) ! ========= pre-proc prints END ========= diff --git a/src/reflections.f90 b/src/reflections.f90 index e71bc5d..7cc157b 100644 --- a/src/reflections.f90 +++ b/src/reflections.f90 @@ -72,9 +72,9 @@ subroutine inters_linewall(xv,kv,rw,zw,nw,sint,normw) dzw = zw(iint+1)-zw(iint) xint = xv(1) + sint*kv(1) yint = xv(2) + sint*kv(2) - rint = sqrt(xint**2+yint**2) - l = sqrt(drw**2+dzw**2) - kxy = sqrt(kv(1)**2+kv(2)**2) + rint = hypot(xint, yint) + l = hypot(drw, dzw) + kxy = norm2(kv(1:2)) normw(3) = -drw/l if (rint>zero) then normw(1) = xint/rint*dzw/l