From 23a8caff37bc8bd9471954e0362197572252e1b0 Mon Sep 17 00:00:00 2001 From: Michele Guerini Rocco Date: Tue, 6 Feb 2024 17:30:44 +0100 Subject: [PATCH] remove references to COCOS 0,10 While technically accepted by GRAY, these indices do not carry a special meaning, as wrongly implied by the documentation: they are equivalent to 8, 18 and specifically don't change the meaning of sgnbi,sgni. --- doc/3.io-files.md | 9 +++------ input/gray.ini | 11 +++++++---- input/gray_params.data | 2 +- src/equilibrium.f90 | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/3.io-files.md b/doc/3.io-files.md index 006c57d..6924e2d 100644 --- a/doc/3.io-files.md +++ b/doc/3.io-files.md @@ -350,18 +350,15 @@ Variable Type Units Valid range Definition 2=none (`ab`=0). `filenmprf` String len$(s) ≤ 24$ Name of file for kinetic profiles - (extension `.prf` appended). `psdbnd` Real 1 $x > 0$ Normalized psi value at the plasma boundary where $n_e$ is set to zero (typ. $1 ≤ {\tt psdbnd} ≤ 1.1$). -`sgnbphi` Real 1 -1, +1 Signum of toroidal B, used if `icocos`=0. +`sgnbphi` Real 1 -1, +1, 0 Force signum of toroidal B, used if nonzero -`sgniphi` Real 1 -1, +1 Signum of toroidal plasma current $I$, used if `icocos`=0. +`sgniphi` Real 1 -1, +1, 0 Force Signum of toroidal plasma current $I$, used if nonzero -`icocos` Int 0-8, 10-18 COCOS index used in `filenmeqq` as defined in [@cocos]: - 0=no COCOS convention and psi in Wb/rad, - 10=means no convention and psi in Wb. +`icocos` Int 1-8, 11-18 COCOS index used in the EQDSK equilibrium as defined in [@cocos]: ---------------------------------------------------------------------------------------------------------------------------- Table: GRAY input data `gray_params.data` - plasma data {#tbl:input2} diff --git a/input/gray.ini b/input/gray.ini index 8acec10..7d81850 100644 --- a/input/gray.ini +++ b/input/gray.ini @@ -92,8 +92,8 @@ iequil = EQ_EQDSK_FULL ; Filepath of the equilibrium data (relative to this file) filenm = "magneticdata.eqdsk" -; COCOS index -icocos = 0 +; COCOS index of the EQDSK equilibrium +icocos = 7 ; Whether the poloidal function is normalised (G-EQDSK) ; false: is not normalised, ψ → |ψ - ψ(edge)|/|ψ(axis) - ψ(edge)| @@ -119,8 +119,11 @@ ixp = X_IS_MISSING ssplps = 0.005 ; for ψ(R,Z), normalised poloidal flux ssplf = 0.01 ; for F(ψ)=R⋅B_T, poloidal current function -; Sign of toroidal field/current (used when COCOS index is 0,10) -; When viewing from above: +1 → counter-clockwise, -1 → clockwise +; Force the sign of toroidal field/plasma current +; When viewing from above: +; +1 → counter-clockwise +; -1 → clockwise +; 0 → use sign from COCOS sgnb = -1 sgni = +1 ; Rescaling factor for the magnetic field diff --git a/input/gray_params.data b/input/gray_params.data index 8671f06..ce1380a 100644 --- a/input/gray_params.data +++ b/input/gray_params.data @@ -13,7 +13,7 @@ beam.data x filename for beam data 2 x iequil= 0 vacuum, 1 analytical equilibrium, 2 EQDSK equiln.txt x filename for equilibrium -11 0 1 0 x icocos [=0..8,10..18], ipsinorm =0/1 [psi normalized (1) or not (0) in EQDSK], idesc =0/1, ifreefmt= 0/1 +11 0 1 0 x icocos [=1..8,11..18], ipsinorm =0/1 [psi normalized (1) or not (0) in EQDSK], idesc =0/1, ifreefmt= 0/1 0 0.005 0.01 : indXpoint, sspl spline coeff psi, ssplf spline coeff fpol -1 -1 1 x signum B_phi I_phi +1=counterclockwise , -1=clockwise from above, factb diff --git a/src/equilibrium.f90 b/src/equilibrium.f90 index d3506c2..604ba81 100644 --- a/src/equilibrium.f90 +++ b/src/equilibrium.f90 @@ -385,8 +385,8 @@ contains data%psia = data%psia * params%factb data%fpol = data%fpol * params%factb - ! Compute the signs to be shown in the outputs header when cocos≠0,10. - ! Note: In these cases the values sgni,sgnb from gray.ini are unused. + ! Compute the signs to be shown in the outputs header + ! Note: this is needed if sgni, sgnb = 0 in gray.ini params%sgni = int(sign(one, -data%psia)) params%sgnb = int(sign(one, +data%fpol(size(data%fpol)))) end select