...
- Introduction
- Files provided
- Running a test example
- Structure of the parameter command files
- Storing the EIRENE triangular grids in IMAS
- Structure of EIRENE files keeping the grid
- Presentation of EIRENE grid in GGD
- Module triangular_grid_modile
- Data types
- Methods
- Module triangular_grid_ids_io
- Data types
- Methods
- EIRENE input wrapper
- Structure of EIRENE input files
- Module eirene_data_io
- Data types
- Methods
- Module imas_data_io
- Constants
- Methods
- Module edge_profiles_io
- Data types
- Methods
- Module equilibrium_io
- Data types
- Methods
- Module global_objects
- Constants
- Methods
- Module imas_controls_for_input
- Data types
- Methods
- Main program files save_input_main.f90 and provide_input_main.f90
- Known issues
- Things to be done
Introduction
...
The structure of this document is as follows. Section 2 lists the files provided. Section 3 describes how to run a test example. Section 4 presents the parameter files controlling the wrapper programs. Section 5 describes the organization of the grid storage. In Section 6, the wrapper for the EIRENE input is described. Finally, the things to be done are outlined in Section 7.
Files provided
This document can be found at EIRENE IMASification - Scientific Worfklows - PCSS Confluence (psnc.pl), https://docs.psnc.pl/display/WFMS/EIRENE+IMASification.
The repository folder of the current version is The files listed below can be found in the public directory ~g2yyakov/public/eirene/version0.910.!!! To be updated
Files provided
FILES | CONTENT |
---|---|
triangular_grid_module.f90 | Module that supports reading, writing and processing triangular grids |
triangular_grid_ids_io.f90 | Module supporting the storage of triangular grids in IMAS |
imas_data_io.f90 | Module supporting the storage of physical quantities (tallies) in IMAS |
eirene_data_io.f90 | Module supporting reading / writing of EIRENE data files |
edge_profiles_io.f90 | Module that supports placing the data to the 'edge_profiles' IDS |
equilibrium_io.f90 | Module that supports placing the data to the 'equilibrium' IDS |
imas_controls_for_input.f90 | Module that works with the parameter files (the files controlling the work of the programs) |
global_parameters.f90 | Module that holds constants and some service routines |
save_input_main.f90 | Main file of the program save_input.exe |
provide_input_main.f90 | Main file of the program provide_input.exe |
Makefile | Used to compile the programs |
save_input.par | A template parameter command file for the program save_input.exe |
provide_input.par | A template parameter command file for the program provide_input.exe |
soledge3x.npco_char | Triangular grid example received from the EIRENE team |
soledge3x.elemente | Another file of this example |
soledge3x.neighbor | Another file of this example |
Te.dat, nT.dat, TT.dat, nD.dat, TD.dat | Sample files supposed to contain the temperature and density of electrons, D ions and T ions |
Btotal.dat, bx.dat, by.dat, bz.dat | Sample files supposed to contain the strength and components of the magnetic field |
README.txt | Brief description of how to compile and run |
EIRENE_wrapper_ user_guide.pdf | PDF version of this document |
...
- Copy the files to your directory.
- If you wish to test the programs with your own files, copy them to the same directory. Do not forget to put the correct names to the command file save_input.par.
- Load the IMAS library by typing:
module load imasenv/3.37.0
- Create the IMAS database entry:
imasdb eirene
- Now you can compile the examples. Type
make clean
make save_input
- Run the program:
./save_input.exe
The program puts the grid stored in the files soledge3x.* and the content of the dat-files into the IMAS databaseeirene
. - Type
make provide_input
- Run the program:
./provide_input.exe
- Compare the new files
eirene.*
with the original filessoledge3x.*
and the original data files with the new files (their names end with the suffix '_input.dat').
Structure of the
...
command files
The program save_input.exe takes parameters that control the work of the program from the file save_input.par. A template of this file is given below.
Code Block |
---|
! Parameters that control saving the EIRENE input to IMAS. |
...
! Use '!' when inserting comment lines. |
...
! You can add comments at the end of each line unless this line holds a text that may contain blanks (e.g., a description field). |
...
! Do not change the order of the parameters. ! |
! Parameters that control saving the EIRENE input to IMAS.
! Use '!' when inserting comment lines.
! You can add comments at the end of each line unless this line holds a text that may contain blanks (e.g., a description field).
! Do not change the order of the parameters.
!
!
eirene <= IMAS database
10003 <= shot
1 <= run
'IDS created to test EIRENE input storage' <= IDS comment
'Yurii Yakovenko' <= input provider
'once upon a time' <= creation date
!!! grid data
"SN" <= grid name
4 <= grid index in dictionary (single null)
"EIRENE grid for single null configuration" <= grid description
"primary_standard" <= poloidal space name
"primary poloidal triangular grid" <= poloidal space description
soledge3x.npco_char <= grid node file
soledge3x.elemente <= grid triangle file
soledge3x.neighbors <= grid neighbor file
!!! Physical quantities
bx.dat <= bx file
by.dat <= by file
bz.dat <= bz file
Btotal.dat <= Btotal file
vx.dat <= vx file
vy.dat <= vy file
vz.dat <= vz file
Te.dat <= Te file
!!! Ion physical quantities
2 <= Number of ion species
! Ion species 1
D 2 1 1 <= label, mass, Z_ion, Z_element
TD.dat <= temperature file
nD.dat <= density file
! Ion species 2
T 3 1 1 <= label, mass, Z_ion, Z_element
TT.dat <= temperature file
nT.dat <= density file
...
The wrapper program contained in the file save_input_main
.f90
performs the following actions:
- ???????? Initializes an instance of the
edge_profiles
IDS in the code memory with writing some mandatory fields. - Writes some labels to the IDS.
- Allocates the
grid_ggd
AOS with only one elementReads the command file 'save_input.par', putting its content to the structures 'imas_controls', 'grid_controls', 'equilibrium_files', and 'edge_profiles_data'. - Reads information about the grid from files and establishes grid edges, using the
read_eirene_grid
function (moduletriangular_grid_module
). - Puts the grid information into the IDS, using the
put_triangular_grid_to_ids
subroutine (moduletriangular_grid_ids_io
). - Creates the corresponding IDS in an IMAS database.
- Writes the IDS prepared in the code memory to the IMAS database and closes the database.
The program contained in the file recover_grid.f90
performs the following actions:
...
- Inputs distributions of input tallies from data files, invoking the functions 'collect_data_for_edge_profiles_input' and 'collect_data_for_equilibrium_input'.
- Creates an IMAS database entry, invoking the IMAS library subroutine 'imas_create_env'.
- Puts the information (the grid and the tallies) into 2 IMAS IDS's, using the subroutines 'save_input_to_edge_profiles' and 'save_input_to_equilibrium'.
- Closes the database, invoking the IMAS library subroutine 'imas_close'.
- Deallocates the structures holding the data.
The program contained in the file provide_input_main
.f90
performs the following actions:
- Reads the command file 'provide_input.par', putting its content to the structures 'imas_controls', 'grid_controls', and 'equilibrium_files'.
- Opens the IMAS database, invoking the IMAS library subroutine
imas_open_env
. - Inputs the data (the grid and the tallies) from 2 IMAS IDS's, using the subroutines 'fetch_input_from_edge_profiles' and 'fetch_input_from_equilibrium'.
- Writes these data to EIRENE-format files, invoking the subroutines 'write_eirene_grid', 'write_input_data_from_edge_profiles_ids', and 'write_input_data_from_equilibrium_ids'.
- Closes the database, invoking the IMAS library subroutine 'imas_close'.
- Deallocates the structures holding the data.
Known issues
The statements that are to deallocate the IDS's in the program memory when they are not needed anymore are now commented out (they are in the modules 'edge_profiles_io' and 'equilibrium_io'). The reason is that the IMAS library subroutine 'ids_deallocate' hangs the program 'save_input.exe' if it is called for both IDS's ('edge_profiles' and 'equilibrium'). This issue is yet to be resolved
...
.
Things to be done
- Code parameters
- Headers of data files
- Generalize to multi-atom ions
- Resolve the issue with non-deallocated structures
- Implement ion velocities (after IMAS 3.38 appears)
- Extend the list of input quantities
- IMASification of the EIRENE output
- Try to adjust the processing of exceptions to GSL practices (if worthwhile)
...