**The COCOS
Convention**

**Coordinate COnvetionS for 3D current and magnetic fields**

A current in a ring in a usual
cylindrical coordinate
system yields a magnetic field in the negative direction in a "usual"
coordinate local to
the ring. This helix can appear "right-handed" again by changing the
choice of >0 or of >0.

This has led to several
different choices in codes related to magnetized plasmas. We have therefore
defined a unique index to specify the COCOS convention as described in :

**Useful transformations files**:

·
COCOS set of tools, ask for a copy from git
spc.epfl.ch "cocos" repository: Code_transfer_COCOS_generic.pdf

·
Matlab – IMAS: generic
transformation of IDSs: Interface Data Structure used in particular within the
ITER Modeling and Analysis Suite

·
Matlab other functions: readeqdsk_simple.m,
writeeqdsk.m,
eqdsk_cocos_transform.m,
cocos.m.

In this way you can:

>> eqdsk_in = readeqdsk_simple('EQDSKfilename',cocos_in);

>> [eqdsk_cocosout]=eqdsk_cocos_transform(eqdsk_in,[cocos_in cocos_out]);

>> writeeqdsk(EQDSKfilename_out,eqdsk_cocosout,cocos_out);

·
f90: see COCOS routines/tools (used within CHEASE for example)

The Appendix of the paper
contains two useful Tables concerning the known COCOS convention for various
codes and tokamaks. They are kept up-to-date here below: