...
- Introduction
- Files provided
- Running a test example
- Structure of the parameter 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 provided
- Methods provided
- Module triangular_grid_ids_io
- Data types provided
- Methods provided
- Storing the EIRENE input
- Structure of EIRENE input files
- Module eirene_data_io
- Data types provided
- Methods provided
- ???
- Main program files save_input_main.f90 and provide_input_main.f90
- Things to be done
...
! Parameters that control saving the EIRENE input to IMAS.
! Use '!' when inserting comment lines.
! You can add comments at the end of each line.
! 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
Storing the EIRENE triangular grids in IMAS
The Fortran routines described herein take files containing the description of a triangular grid in native EIRENE format and store this grid in an IMAS IDS; on the other hand, they extract a stored grid description from IMAS and provide it in EIRENE format. At present, these routines have been tested only with the IDS's edge_profiles
and equilibrium.
...
Read data about a triangular grid from a given space of GGD grid, put it into a type(triangular_grid)
-structure and call the subroutines arrange_material_properties
(from this module) and arrange_neighbors
(from triangular_grid_module
) to build the missing parts of the structure. This function is not applicable to the grid stored in the 'equilibrium' IDS (because the type of the structure used for storing the GGD grid in this IDS is differentpeculiar). To extract the grid from the 'equilibrium' IDS, use the function get_triangular_grid_from_equilibrium.
...
Read data about a triangular grid from a given space of GGD grid, put it into a type(triangular_grid)
-structure and call the subroutines arrange_material_properties
(from this module) and arrange_neighbors
(from triangular_grid_module
) to build the missing parts of the structure. This function is applicable only to the grid stored in the 'equilibrium' IDS (because the type of the structure used for storing the GGD grid in this IDS is differentpeculiar). To extract the grid from another IDS, use the function get_triangular_grid_from_ids.
...
The function returns a type(triangular_grid)-structure, which is partly filled with information read from the GGD grid space having the identifier index equal to 1 (i.e., being the 'primary grid space'). The function takes as a parameter the AoS of all grid spaces.
Argument | Type | Intent | Description |
---|---|---|---|
eirene_grid | type(triangular_grid) | result | Partly filled grid structure |
grid_ggd | type(ids_generic_grid_dynamic_space), dimension(:) | in | Space where the triangular grid is stored |
???????????????????????????????????????????? TO BE CHECKED
subroutine arrange_material_properties subroutine put_eirene_grids_to_ids (eirene_grid, coord_type, grid_ggd, nSpaces, eirene_space_index, grid_name, grid_description, eirene_space_name, eirene_space_description)subsets)
Get information about the MPs of grid edges from IDS and add it to the type(triangular_grid)-structure holding the grid description. This information is stored in GGD in the form of subsets uniting the edges with certain values of the MP.
Argument | Type | Intent | Description |
---|---|---|---|
eirene_grid | type(triangular_grid) | inout | Partly filled grid structure |
subsets | type(ids_generic_grid_dynamic_grid_subset), dimension(:) | in | Space where the triangular grid is stored |
subroutine put_eirene_grid_to_ids (eirene_grid, grid_ggd, nSpaces, eirene_space_index, grid_identifier, eirene_space_name, eirene_space_description)
Place a grid into Allocate the space AOS in a given grid_ggd
element structure by allocating the space AOS with a given number of grid spaces, put putting a triangular grid given as a type(triangular_grid)
-structure into a desired element of the space
AOS AOS, and organize organizing the necessary grid subsets. This subroution cannot be used for putting a grid into the 'equilibrium' IDS (because the type of the structure used for storing the GGD grid in this IDS is peculiar). To put the grid into the 'equilibrium' IDS, use the function put_eirene_grid_to_equilibrium.
Argument | Type | Intent | Description |
---|---|---|---|
eirene_grid | type |
Argument
Type
Intent
Description
(triangular_grid) | in | The grid to be saved |
grid_ggd | type(ids_generic_grid_aos3_root) |
pointer | Pointer to the grid_ggd AOS element to hold the grid |
coord_type
integer
To be done
nSpaces | integer | in | The dimension of |
eirene_space_index | integer | in | Index of the triangular grid space in |
grid_ |
identifier |
grid_description
character(len=*)
in
Verbose description of the grid_ggd
element
type(ids_identifier_dynamic_aos3) | in |
Name assigned to the grid_ggd
element
Grid identifier to be put to IDS |
eirene_space_name | character(len=*) | in | Name assigned to the triangular grid space |
eirene_space_description | character(len=*) | in | Verbose description of the triangular grid space |
subroutine arrangeput_triangulareirene_grid_to_space (space, grid, equilibrium (eirene_grid, grid_ggd, nSpaces, eirene_space_index, grid_identifier, eirene_space_name, eirene_space_description)
Put Place a triangular grid into a given element of the space
AOS. The grid information is taken from grid_ggd
structure by allocating the space AOS with a given number of grid spaces, putting a triangular grid given as a type(triangular_grid)
-structure .into a desired element of the space
AOS, and organizing the necessary grid subsets. This subroution can be used only for putting a grid into the 'equilibrium' IDS (because the type of the structure used for storing the GGD grid in this IDS is peculiar). To put the grid into another IDS, use the function put_eirene_grid_to_ids.
Argument |
---|
Type | Intent | Description |
---|
eirene_grid | type(triangular_grid) | in | The grid to be saved |
grid_ggd | type(ids_generic_grid_dynamic |
) |
pointer | Pointer to the |
space
grid_ggd AOS element to hold the grid | |||
nSpaces | integer | in | The dimension of |
eirene_space_index | integer | in | Index of the triangular grid space in |
grid_identifier | type( |
ids_identifier_dynamic_aos3) | in |
Grid identifier to be |
put to IDS | |||
eirene_space_name | character(len=*) | in | Name assigned to the triangular grid space |
eirene_space_description | character(len=*) | in | Verbose description of the triangular grid space |
subroutine function arrange_standardgrid_2d_subsetspaces (subsetgrid, spacenSpaces, eirene_space_index, dimensionality, subset_id)eirene_space_name, eirene_space_description) result (spaces)
Place a grid into a given grid_ggd
structure by allocating the space AOS with a given number of grid spaces, putting a triangular grid given as a type(triangular_grid)
-structure into a desired element of the space
AOS, and organizing the necessary grid subsets. This subroution can be used only for putting a grid into the 'equilibrium' IDS (because the type of the structure used for storing the GGD grid in this IDS is peculiar). To put the grid into another IDS, use the function put_eirene_grid_to_idsArrange a "standard" subset in the poloidal space – a subset of all nodes, edges, or triangular cells (depending on the dimensionality, 1, 2, or 3, respectively). The subset gets the name 'poln', where n is the dimensionality.
Argument | Type | Intent | Description |
---|
spaces | type(ids_generic_grid_dynamic_ |
space), dimension(:), pointer |
result | Pointer to the |
grid_subset
AOS element to hold the subsetallocated and filled 'space' AoS |
grid |
type( |
triangular_ |
grid |
) |
in |
Pointer to the space
AOS element holding the triangular grid space
The grid to be saved | |||
nSpaces | integer | in | The dimension of |
eirene_space_index | integer | in | Index of the triangular grid space in |
|
dimensionality
integer
in
Dimensionality of subset objects (1 for nodes, 2 for edges etc.)
subset_id
integer
in
Integer identifier of the subset
subroutine arrange_mat_property_subset (subset, space, space_index, grid, mat_property, subset_id)
eirene_space_name | character(len=*) | in | Name assigned to the triangular grid space |
eirene_space_description | character(len=*) | in | Verbose description of the triangular grid space |
function arrange_triangular_grid_space (grid, space_name, space_description) result (space)
Create a GGD space and put the objects (nodes, edges, and cells) of an EIRENE triangular grid there. The information about grid objects is taken from a type(triangular_grid)
-structureArrange a subset for edges with a certain value of MP. The subset gets the name 'MPnnnn', where nnnn is the MP value.
Argument | Type | Intent | Description | |||||
---|---|---|---|---|---|---|---|---|
subsetspace | type(ids_generic_grid_dynamic_grid_subsetspace), pointer | pointer | Pointer to the | space | type(ids_generic_grid_dynamic_space), pointer | pointer | result | IDS space structure holding the grid |
grid | type(triangular_grid) | in | The grid to be saved | |||||
space_name | character(len=*) | in | Name assigned to Pointer to the | |||||
space_indexintegerdescription | character(len=*) | in | Index Verbose description of the triangular grid space in the | |||||
grid | type(triangular_grid) | in | The grid being saved | |||||
mat_property | integer | in | MP value | |||||
subset_id | integer | in | Integer identifier of the subset |
Storing EIRENE input
Only a part of input quantities are now processed.
Structure of EIRENE input files
...
space |
function arrange_subsets (eirene_space, eirene_space_index, grid) result (subsets)
Create a GGD space and put the objects (nodes, edges, and cells) of an EIRENE triangular grid there. The information about grid objects is taken from a type(triangular_grid)
-structure.
Argument | Type | Intent | Description |
---|---|---|---|
subsets | type(ids_generic_grid_dynamic_grid_subset), pointer, dimension(:) | result | IDS space structure holding the grid |
eirene_space | type(ids_generic_grid_dynamic_space) | the GGD grid space to which the subsets are attached | |
eirene_space_index | integer | in | the index of this space in the 'space' AoS |
grid | type(triangular_grid) | in | The grid to be saved |
subroutine arrange_standard_2d_subset(subset, space, space_index, dimensionality, subset_id)
Arrange a "standard" subset in the poloidal space – a subset of all nodes, edges, or triangular cells (depending on the dimensionality, 1, 2, or 3, respectively). The subset gets the name 'poln', where n is the dimensionality.
Argument | Type | Intent | Description |
---|---|---|---|
subset | type(ids_generic_grid_dynamic_grid_subset) | pointer | Pointer to the |
space | type(ids_generic_grid_dynamic_space) | in | The |
space_index | integer | in | Index of the triangular grid space in the |
dimensionality | integer | in | Dimensionality of subset objects (1 for nodes, 2 for edges etc.) |
subset_id | integer | in | Integer identifier of the subset |
subroutine arrange_mat_property_subset (subset, space, space_index, grid, mat_property, subset_id)
Arrange a subset for edges with a certain value of MP. The subset gets the name 'MPnnnn', where nnnn is the MP value.
Argument | Type | Intent | Description |
---|---|---|---|
subset | type(ids_generic_grid_dynamic_grid_subset) | pointer | Pointer to the |
space | type(ids_generic_grid_dynamic_space) | in | The |
space_index | integer | in | Index of the triangular grid space in the |
grid | type(triangular_grid) | in | The grid being saved |
mat_property | integer | in | MP value |
subset_id | integer | in | Integer identifier of the subset |
subroutine arrange_subset_for_averages (subset, subset_id)
Arrange a special subset for storing 2d averages. The subset gets the name 'average'.
Argument | Type | Intent | Description |
---|---|---|---|
subset | type(ids_generic_grid_dynamic_grid_subset) | pointer | Pointer to the |
subset_id | integer | in | Integer identifier of the subset |
Storing EIRENE input
Only a part of input quantities is now processed.
Structure of EIRENE input files
Module eirene_data_io
This module provides tools for dealing with files containing EIRENE input data.
Data types provided
type eirene_data
real(ids_real), allocatable :: main_part(:)
real(ids_real) :: average
real(ids_real), allocatable :: extra_data(:) ! To be implemented yet
logical :: extra_data_present ! Shows if extra_data is filled
end type eirene_data
This type is intended for storage ?????????????????
Methods provided
The module contains the following routines:
- deallocate_data_set
- read_quantity_from_file
- write_quantity_to_file
???
Main files save_input_main.f90
and provide_input_main
.f90
The program contained in the file save_input_gridmain
.f90
performs the following actions:
- ???????? Initializes an instance of the
edge_profiles
IDS in the code memory (with writing some mandatory fields), using the subroutinesetIDSFundamentals
(module ids_utility). - Writes some labels to the IDS.
- Allocates the
grid_ggd
AOS with only one element. - 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, using the
createIDS
subroutine (moduleids_utility
). - Writes the IDS prepared in the code memory to the IMAS database and closes the database, using the subroutine
putIDS
(moduleids_utility
).
...