I want to know how one can write down a CFT such that its conserved currents will satisfy some chosen (affine) Lie algebra $G$.
On the few pages leading up to page 192 in here one can see see the analysis of the CFT obtained in the compactified directions of closed bosonic strings.
From what one sees in these notes it seems that a CFT with the above properties will exist if it is put on a torus $\mathbb{R}^n/\Lambda$ where $n=rank (G)$ and $\Lambda =$root lattice of $G$.
Is the above correct? If it is correct then how does one write down the corresponding Lagrangian and the currents?
But in the string context where these attached notes are based one is forced to have simply laced $G$ and hence only the $A,D,E$ series. How would one do this for say the group $G_2$? (..being concerned with just a CFT and not connected to string theory..)
The restriction of being on the $A$, $D$, $E$ series is related to the fact that in string context one has to tune all the compactification radius to the same selfdual point. If $i$ indexes the compact directions , $1\leq i \leq n$ then the current operators are possibly like $:\partial _{z} X_i (z):$ and $:e^{i\vec{\alpha}.\vec{X}}:$ where the first set is one for each Cartan and the send set is one for each root $\alpha$. But I wonder where would the radius of the circles go in these currents.
 Finally where in this process can one tune the level of the affine Lie algebra? What choice fixes that?



You can construct WessZuminoNovikovWitten model starting with finitedimensional subalgebra of your affine Lie algebra. The action of this model is written in terms of field $g:\mathbb{C}\cup\left\{\infty\right\}\sim S^2 \to G$, where $G$ is a Lie group, such that $\mathfrak{g}$ is finite dimensional subalgebra and $\hat{\mathfrak{g}}$ is your affine Lie aglebra. The action has following form: $ S=\frac{k}{8\pi}\int d^2x\; \mathcal{K} (g^{1}\partial^{\mu}g, g^{1} \partial_{\mu}g) \\  \frac{k }{24\pi^{2}} \int_{B}\epsilon_{ijk} \mathcal{K}\left( \tilde g^{1}\frac{\partial \tilde g}{\partial y^i},\left[ \tilde g^{1}\frac{\partial \tilde g}{\partial y^j} \tilde g^{1}\frac{\partial \tilde g}{\partial y^k}\right]\right) d^3y $ The conserved currents are $J(z)= k \partial_zg g^{1}$, $\bar J(\bar z)=k g^{1}\partial_{\bar z}g$. Modes of $J,\bar{J}$ satisfy commutation relations of affine Lie algebra $\hat{\mathfrak{g}}$ : $ \left[J^a_n,J^b_m\right]=\sum_c i f^{abc}J^c_{n+m}+kn\delta^{ab}\delta_{n+m,0} \; \text{where} \; J^a(z)=\sum\limits_{n\in \mathbb Z}z^{n1}J^a_n $. Some WZNWmodels can be obtained by compactification of free bosons, but not all. See http://arxiv.org/abs/hepth/9911187 for very accessible introduction to the subject or part C in the book "Conformal field theory" by P. Di Francesco, P. Mathieu and D. Senechal. 


Disclaimer. I am just talking about the chiral part of a conformal field theory. The chiral parts of WZW model are described by affine KacMoody algebras. I am describing how to obtain the KacMoody algebras starting with abelian currents (derivative of a free bosons). $n$ free Abelian currents $\{J_1,\ldots, J_n\}$ correspond to target space $\mathbb R^n$ and compactifying the target space by a lattice $\Lambda\subset \mathbb R^n$ corresponds to add a vertex operator $V_\alpha$ for every point $\alpha\in \Lambda$ of a lattice (or just for a basis). By compactifying the target space $\mathbb R^n$ with a root lattice in the case of a of a simply laced Lie algebra (all roots have the same length $\langle\alpha,\alpha\rangle=2$) one obtains the affine Lie algebra of this corresponding Lie algebra at level 1. Namely the $J_n$ and the $V_{\alpha,n}$ with $\alpha\in\Lambda$ and $\langle\alpha,\alpha\rangle=2$ form a basis of the affine KacMoody algebra at level 1. The simple simply laced Lie algebras are exactly the one with A,D,E Dynkin diagram. That is basically the FrenkelKac construction: I. B. Frenkel and V. G. Kac. Basic representations of affine Lie algebras and dual resonance models. Invent. Math., 62(1):23–66, 1980. Some other one can get by conformal inclusions, for example $G_2$ at level 3 embeds into $E_6$ at level 1. I guess one obtains all level 1 cases by regarding conformal inclusions $(C_n)_1\times SU(2)_m\subset D_{2m}$ and $G_2\times F_4\subset E_8$. Finally level $\ell$ one can embed in the $n$fold tensor product of level 1 by $$J_a^{(\ell)}(z) \sim \sum_k 1 \otimes \cdots \otimes \underbrace{J^{(1)}_a(z)}_{k\text{th position}}\otimes \cdots\otimes 1$$ 

