...
- Introduction
- Files provided
- Running a test example
- Structure of the command parameter files
- Storing EIRENE triangular grids in IMAS
- Structure of EIRENE files keeping the grid
- Presentation of EIRENE grid in GGD
- Module triangular_grid_modile
- Module triangular_grid_ids_io
- Template files save_grid.f90 and recover_grid.f90
- Storing the EIRENE input
- Things to be done
...
The structure of this document is as follows. Section 2 lists the files provided. Section 3 ??????????????????????????????????????
Files provided
The files listed below can be found in the public directory ~g2yyakov/public/eirene/version0.9.
...
FILES | CONTENT |
---|---|
triangular_grid_module.f90 | Module that supports reading, writing and processing triangular grids |
triangular_grid_ids_io.f90 | Module supporing the storage of triangular grids in IMAS |
imas_data_io.f90 | Module supporing the storage of physical quantities (tallies) in IMAS |
eirene_data_io.f90 | Module supporing 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 | Program that takes a set of EIRENE input files and puts their content to IMASMain file of the program save_input.exe |
provide_input_main.f90Program that extracts EIRENE input from IMAS, providing it in EIRENE native format | Main file of the program provide_input.exe |
Makefile | Used to compile the programs |
save_input.par | A template parameter file for the program save_input.exe |
provide_input.par | A template parameter 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 |
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 direcctory. 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
...
parameter files
The program save_input.exe takes parameters from the file that control the work of the program from the file save_input.par. ????????????????????????????. A template of this file is given below.
! 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 comment
! (i.e., a text containing blanks).
! 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
'long ago' <= 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
File A tempalte ofb the file provide_input.par that controls the program provide_input.exe is as follows:
! 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 comment
! (i.e., a text containing blanks).
! Do not change the order of parameters.
!
eirene <= IMAS database
10003 <= shot
1 <= run
input.dat <= generic suffix
!!! grid data
eirene.nodes <= grid node file
eirene.triangles <= grid triangle file
eirene.neighbors <= grid neighbor file
!!! Physical quantities
bx_input.dat <= bx file
by_input.dat <= by file
bz_input.dat <= bz file
BF_input.dat <= total B file
vx_input.dat <= vx file
vy_input.dat <= vy file
vz_input.dat <= vz file
...
subroutine read_vertices
Read the coordinates of grid vertices from an EIRENE-format file;.subroutine read_triangles
Reads Read indices of the vertices that form each grid triangle from an EIRENE-format file;.subroutine read_neighbors
subroutine write_vertices
subroutine write_triangles
- Read information on the neighbours of each grid triangle from an EIRENE-format file, putting it to the substructure grid % triangle.
subroutine write_vertices
Write the coordinates of grid vertices into an EIRENE-format file.subroutine write_triangles
Write information on the vertices that form each grid triangle into an EIRENE-format file.subroutine write_neighbors
Write information on the neighbors of each grid triangle into an EIRENE-format file.subroutine find_neighboring_triangles
integer function find_side
- Given the index of a vertex grid % vertex, the subroutine finds the indices of all triangles containing this vertex.
integer function find_side
Given two vertex indices and a triangle structure, the function returns the index of the edge consisting of these vertices in the triangle (0 when the edge does not belong to the triangle).subroutine write_edges
Write grid edges to a file.subroutine check_edges
Sanity check: The subroutine checks if all edges that have both adjacent triangles have material_property/=0 and vice versa.subroutine check_edgesvertices
subroutine check_vertices
Sanity check: The subroutine checks if every grid vertex belongs to a triangle.subroutine grid_statistics
Print grid statistics.integer function neighboring_triangle_index
The function returns the index of a triangle neighoring with a reference triangle. The neighbor index must be larger than the reference triangle index. When there is no such a triangle, the function returns 0.integer function edge_index
index
Return the index of an edge consisting of two given vertices (0 when there is no such edge).
Detailed interface Detailed description of the methods:
function read_eirene_grid (coord_file, triangles_file, neighbors_file, do_tests, io_unit) result (grid)
...
Argument | Type | Intent | Description |
---|---|---|---|
grid | type(triangular_grid) | in | Grid structure |
mat_property | integer | in | MP value |
result | integer, allocatable, dimension(:) | result | List of edge indices of the edges in the substructure grid % edge |
subroutine deallocate_grid (grid)
...
The module contains the following routines:
get_grid_controls_for_input_saving
- get_grid_controls_for_input_fetching
get_triangular_grid_from_ids
Read a triangular grid contained in a given space of a GGD grid and transform it into atype(triangular_grid)
-structure.- get_triangular_grid_from_equilibrium
- get_grid_objects
- arrange_material_properties
put_eirene_grids_to_ids
Save a triangular grid given as atype(triangular_grid)
-structure ingrid_ggd
, invoking other routines of this module (arrange_triangular_grid_space
,arrange_standard_2d_subset
, andarrange_mat_property_subset
).- put_eirene_grid_to_equilibrium
- arrange_grid_space
arrange_triangular_grid_space
Put a triangular grid given as atype(triangular_grid)
-structure to a desiredgrid_ggd
space.- arrange_subsets
arrange_standard_2d_subset
Arrange a "standard" subset in the poloidal space (subset of all nodes, all edges, or all triangular cells).arrange_mat_property_subset
Arrange a subset of edges with a certain value of MP.- arrange_subset_for_averages
Detailed description of the methods:
...