Using AMNS data within an Integrated Tokamak Modelling ...

27
Using AMNS data within an Integrated Tokamak Modelling Environment Presented by: David Coster (AMNS Coordinator, IMP3 Leader, Deputy Task Force Leader) TF Leader : G. Falchetto Deputies: R. Coelho, D. P. Coster EFDA CSU Contact Person: D. Kalupin

Transcript of Using AMNS data within an Integrated Tokamak Modelling ...

Page 1: Using AMNS data within an Integrated Tokamak Modelling ...

Using AMNS data within an Integrated Tokamak Modelling

Environment

Presented by: David Coster

(AMNS Coordinator, IMP3 Leader, Deputy Task Force Leader)

TF Leader : G. FalchettoDeputies: R. Coelho, D. P. Coster

EFDA CSU Contact Person: D. Kalupin

Page 2: Using AMNS data within an Integrated Tokamak Modelling ...

Using AMNS data within an Integrated Tokamak Modelling Environment2

Background

• The EFDA Task Force on Integrated

Tokamak Modelling

– coordinates the development of a coherent set of validated simulation tools

– benchmarks these tools on existing tokamakexperiments

– provides a comprehensive simulation package for ITER and DEMO plasmas

Page 3: Using AMNS data within an Integrated Tokamak Modelling ...

Using AMNS data within an Integrated Tokamak Modelling Environment3

ITM use of AMNS data

• AMNS data should be centralized and managed

– Version control of data imported to the ITM-TF

data base is mandatory.

– The provenance of the data must be accurate

and stored in the ITM database

– For “production” runs with ITM-TF codes using

AMNS data it is important that the data have

been given a stamp of approval by an expert.

Page 4: Using AMNS data within an Integrated Tokamak Modelling ...

Using AMNS data within an Integrated Tokamak Modelling Environment4

ITM use of AMNS data

• The data should be comprehensive, ubiquitous and easily used

– This means identifying what data is needed

• not always easy!

– The AMNS data must be communicated to ITM-

TF codes via a standardised interface

• this should also ensure coherence between different ITM-TF codes needing the same type of data

– All AMNS data used by codes should be

available through the AMNS data interface

• no back doors

Page 5: Using AMNS data within an Integrated Tokamak Modelling ...

Using AMNS data within an Integrated Tokamak Modelling Environment5

Approach in the ITM

Atomic Data

Molecular Data

Nuclear Data

Surface Data

AMNS

Library

Physics

Code

Physics

Code

Physics

Code

Physics

Code

AMNS Database

• Data selection

• Data import

• Data storage

• Data

transport

• User interface

design

• Supporting

multiple

languages

Page 6: Using AMNS data within an Integrated Tokamak Modelling ...

Using AMNS data within an Integrated Tokamak Modelling Environment6

Data selection

• Driven by

– user codes’ requirements

• fully differential cross sections for all relevant processes and species

– don’t really want to resolve all excited states so some sort of effective cross-section might be useful

» “bundling”

– data availability

• imported all of the ADAS ADF11 rate coefficients

Page 7: Using AMNS data within an Integrated Tokamak Modelling ...

Using AMNS data within an Integrated Tokamak Modelling Environment7

Data storage

• Need to have a data storage mechanism that

– allows us to store all of the AMNS data that are

needed

– allows us to store all of the additional meta-data

associated with the AMNS data

– allows us to effectively and efficiently use the

data

Page 8: Using AMNS data within an Integrated Tokamak Modelling ...

Using AMNS data within an Integrated Tokamak Modelling Environment8

Data import

• Need to store the data from outside sources in the AMNS database

– external data

• is available in a wide variety of formats

• is not always of the same quality

– need to capture the meta-data about the

imported data

• source of the data

• import procedure

• quality estimate

Page 9: Using AMNS data within an Integrated Tokamak Modelling ...

Using AMNS data within an Integrated Tokamak Modelling Environment9

Data transport

• Need to make the AMNS data available to ITM codes that might be running in a distributed environment

– remote data access is supported by the ITM’s

UAL (Universal Access Layer) for CPOs

(Consistent Physical Objects)

– could also create local copies of the database

• which can pose a problem of data consistency

• also means that we want to limit the number of files

– SOLPS uses a subset from > 1400 files, > 180 MB

Page 10: Using AMNS data within an Integrated Tokamak Modelling ...

Using AMNS data within an Integrated Tokamak Modelling Environment10

Making data available

• Need to make the AMNS data available through a standardized interface

– allows the data storage mechanism to change

without affecting user codes

– (hopefully) ensures that the data are correctly

used in the ITM codes

– allows users’ codes access to newer versions

of the data when such data becomes available

without the user having to re-code the data

access routines

Page 11: Using AMNS data within an Integrated Tokamak Modelling ...

Using AMNS data within an Integrated Tokamak Modelling Environment11

Making data available, II

• Challenges:– within the ITM we have codes written in

• Fortran

• C

• C++

• Matlab

• Python

– many codes will also be used outside of the ITM environment and code developers are not that keen on having to support one version within the ITM and one for use outside of the ITM

Page 12: Using AMNS data within an Integrated Tokamak Modelling ...

Using AMNS data within an Integrated Tokamak Modelling Environment12

ITM approach

• AMNS task under the ITM leadership

• Developed a data format for data storage

– actively evolving as we learn more about what

data is needed and discover that it doesn’t fit

• Developed a data access paradigm

– implemented this paradigm in a data access

library in Fortran

– have C bindings for this library

– are working on a Python interface

Page 13: Using AMNS data within an Integrated Tokamak Modelling ...

Using AMNS data within an Integrated Tokamak Modelling Environment13

Details: data storage

• ITM uses CPOs (Consistent Physical Objects) to store data

– experimental data (from present tokamaks)

– simulation data

– machine descriptions

– AMNS data

• Each CPO is described by an XML Schema– automatic tools then provide data access routines in

Fortran, C++, Matlab, Python, Java

– automatic tools provide for the storage, retrieval and transport of CPO data

• backends are (currently) MDSplus and HDF5; with add-ons ASCII data is also supported

Page 14: Using AMNS data within an Integrated Tokamak Modelling ...

Using AMNS data within an Integrated Tokamak Modelling Environment14

AMNS CPO

• ITM CPOs are identified by– USERNAME / DEVICE / DATA_VERSION / SHOT_NUMBER / RUN_NUMBER

• For the AMNS system we have chosen to use– USERNAME is the actual user, or if the user has no data, then

“amnsdata”

– DEVICE is “amns”

– DATA_VERSION is managed centrally and is changed when a new version of the CPO data structure is released (currently “4.10a”)

– SHOT_NUMBER is derived from the heaviest species involved in a process and equals ZN + ZM*1000 (ZN is the nuclear charge, ZM is the number of nucleons if the reaction depends on the isotopenand 0 otherwise)

– RUN_NUMBER represents the AMNS version number of the data

• Doing things this way allows us to leverage the already existing ITM infrastructure and to benefit from future developments

Page 15: Using AMNS data within an Integrated Tokamak Modelling ...

Using AMNS data within an Integrated Tokamak Modelling Environment15

AMNS CPO

• Design concept is still evolving

• Want to support data provided as– table

• R(x1. x2, .., xn)

• linear interpolation at the moment (1d, 2d, 3d, …)

– for R or log(R)

– for xi or log(xi)

• data stored in the AMNS database

– formula• R(x1. x2, .., xn)

• hopefully the formula has the right asymptotic behaviour!

• index to a predefined function stored in the database, together with any coefficients

Page 16: Using AMNS data within an Integrated Tokamak Modelling ...

Using AMNS data within an Integrated Tokamak Modelling Environment16

AMNS CPO, II

Page 17: Using AMNS data within an Integrated Tokamak Modelling ...

Using AMNS data within an Integrated Tokamak Modelling Environment17

Implementation

Physics code

• Access to AMNS data only via

interface

– initialization (2)

– finalization (2)

– querying parameters (2)

– setting parameters (2)

– getting data (1)

• Separation between use of the

data and the implementation of

the data

• Code author doesn’t need to

become an expert in AMNS

• Ensures compatibility between

codes

AMNS implementation

• Only accessed by a set of

defined calls

• Implementation by AMNS

experts

• Different versions can be

supported

• Different implementations

possible

– Analytic formulae

– Table lookup

• “Old” versions should always be

recoverable (even if wrong)

• Should become easier to

implement “new” data

Page 18: Using AMNS data within an Integrated Tokamak Modelling ...

Using AMNS data within an Integrated Tokamak Modelling Environment18

An example• A prototype has been implemented

– As a F90 module using derived types

– Interface will handle error estimates in the AMNS data!

call ITM_AMNS_SETUP(amns)

query%string='version'

call ITM_AMNS_QUERY(amns,query,answer)

...

call ITM_AMNS_SETUP_TABLE(amns, lr_rx, species_lr, amns_lr)

query%string='source'

call ITM_AMNS_QUERY_TABLE(amns_lr,query,answer)

...

set%string='nowarn'

call ITM_AMNS_SET_TABLE(amns_lr,set)

...

call ITM_AMNS_RX(amns_lr,rate(:,:),ne(:,:),te(:,:))

...

call ITM_AMNS_FINISH_TABLE(amns_lr))

call ITM_AMNS_FINISH(amns)

Page 19: Using AMNS data within an Integrated Tokamak Modelling ...

Using AMNS data within an Integrated Tokamak Modelling Environment19

Some examples

• Electron impact ionization (ADAS ADF11 SCD)

Page 20: Using AMNS data within an Integrated Tokamak Modelling ...

Using AMNS data within an Integrated Tokamak Modelling Environment20

Some examples

• D-D fusion cross section (Bosch-Hale formula)

Page 21: Using AMNS data within an Integrated Tokamak Modelling ...

Using AMNS data within an Integrated Tokamak Modelling Environment21

Some examples

• Differential elastic cross section for W (at 90o) (Tokesi, preliminary data)

Page 22: Using AMNS data within an Integrated Tokamak Modelling ...

Using AMNS data within an Integrated Tokamak Modelling Environment22

Coronal example: W

Page 23: Using AMNS data within an Integrated Tokamak Modelling ...

Using AMNS data within an Integrated Tokamak Modelling Environment23

Coronal example: W radiation

• No guarantees about the correctness

of the data used, or for the program

that calculated these results

• It was done to demonstrate how the

ITM AMNS system is used.

Page 24: Using AMNS data within an Integrated Tokamak Modelling ...

Using AMNS data within an Integrated Tokamak Modelling Environment24

Documentation

• Entries in the ITM web site derived from the AMNS database.

Page 25: Using AMNS data within an Integrated Tokamak Modelling ...

Using AMNS data within an Integrated Tokamak Modelling Environment25

Documentation• A sample entry

Page 26: Using AMNS data within an Integrated Tokamak Modelling ...

Using AMNS data within an Integrated Tokamak Modelling Environment26

Some thoughts

• Data needs are still evolving• ITM has

– data consumers

» data needs, not always clearly formulated

– data providers

– data packagers

» format of the AMNS CPO

» data import

» AMNS access library

– � Not always properly synchronized

Page 27: Using AMNS data within an Integrated Tokamak Modelling ...

Using AMNS data within an Integrated Tokamak Modelling Environment27

Some thoughts

• Having an IAEA recommended data set will make the ITM-AMNS job of selecting data easier

• If the IAEA data is in a standard format, then importing the data will also be easier

• If the IAEA data set has the provenance information standardized, then this will also make it easier when importing the data

• Decisions on how to categorize and store the data in the IAEA database might affect the organization within the ITM

• The ITM is likely, though, to have requirements that the IAEA database doesn’t