Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

 

Info

In this tutorial

  • what CPOs are
  • what UAL is
  • how can you integrate your code with UAL
  • how can you access data via UAL

...

2. Go to example directory

cd $ITMWORK/tutorials/split-2014/$TUTORIAL_DIR/cpo_basics/python/

3. Execute sample code

python put_cpo.py

...

 

VI related notice
I will use VI in every place where text files are modified. If you have any other text file editor of your choice - fell free to use it instead.

 

vi $ITMWORK/tutorials/split-2014$TUTORIAL_DIR/cpo_basics/python/put_cpo.py

What you can see here is a simple code that stores particular CPO into MDSPlus database using UAL.

Code Block
title$TUTORIAL_DIR/cpo_basics/python/put_cpo.py
import sys
from pylab import *
import ual

cpo = ual.itm(12,2)
cpo.create()

if not cpo.isConnected():
    print 'error during itmdb entry creation'
    sys.exit(1)

cpo.equilibriumArray.resize(1)

equi = cpo.equilibriumArray
equi.array[0].time = 0.0

equi.array[0].datainfo.dataprovider = 'MKO'
equi.array[0].datainfo.putdate = '18/02/2013'
equi.array[0].codeparam.parameters = 'param'

equi.array[0].eqgeometry.boundary.resize(1)
equi.array[0].eqgeometry.boundary[0].r = sin(arange(0,2*pi,2*pi/100))
equi.array[0].eqgeometry.boundary[0].z = cos(arange(0,2*pi,2*pi/100))


print equi.array[0].eqgeometry.boundary[0].r
print equi.array[0].eqgeometry.boundary[0].z

equi.put()

cpo.close()

...

2. Change directory to a demo location for this exercise

cd $ITMWORK/tutorials/split-2014/$TUTORIAL_DIR/cpo_basics/fortran

3. Open GetSlice.f90 file

vi GetSlice.f90

 

...

Esc Esc : q ! Enter

...

4. You should see code similar to following one

...