...
The module contains routines that support writing a grid having the type(triangular_grid)
form to IMAS IDS's and, vice versa, reading a grid from IMAS and putting it into the type(triangular_grid)
form. It depends on the module triangular_grid_module
and the IMAS modules ids_schemas
and ids_routines
.
The module contains the following routines:
...
Data types provided
type grid_control_panel
type(ids_identifier_dynamic_aos3) :: grid_identifier
character(len=ids_string_length) :: poloidal_space_name, poloidal_space_description
character(len=ids_string_length) :: node_file, triangle_file, neighbor_file
integer :: grid_index = 1 ! Use grid_ggd in time slice 1
integer :: ggd_index = 1 ! Use ggd in time slice 1
! The following fields are not used when getting the grid from IDS
integer :: grid_dictionary_index
!! Allocation of IMAS grid space for EIRENE triangular grid
integer :: nSpaces = 1 ! Total number of GGD spaces;
! may change if toroidal coordinate is added
integer :: eirene_space_index = 1 ! May change if toroidal coordinate is added
integer :: Ngrid_slices = 1 ! Number of grid_ggd slices to be allocated
integer :: Nggd_slices = 1 ! Number of ggd slices to be allocated
end type grid_control_panel
The structure type grid_control_panel is intended for holding the control parameters taken from a command file. These parameters determine how the EIRENE triangular grid is saved in / recovered from an IMAS IDS.
Methods provided
The module contains the following routines:
get_grid_controls_for_input_saving
Get from the command file the parameters that control saving the EIRENE grid to an IMAS database that is to hold an EIRENE input.- get_grid_controls_for_input_fetching
Get from the command file the parameters that control extracting the EIRENE grid from an IMAS database holding an EIRENE input.
get_triangular_grid_from_ids
Read a triangular grid from an IDS (not 'equilibrium'), put it into atype(triangular_grid)
-structure, and build the missing parts of the structure.- get_triangular_grid_from_equilibrium
Read a triangular grid from the 'equilibrium' IDS, put it into atype(triangular_grid)
-structure, and build the missing parts of the structure. - get_grid_objects
Get objects from the space holding a triangular grid and put them into a type(triangular_grid)-structure. - arrange_material_properties
Get information about the material properties of grid edges from IDS and add it to the type(triangular_grid)-structure holding the grid description. put_eirene_grid_to_ids
Save a triangular grid given as atype(triangular_grid)
-structure into a grid_ggd AoS element (not applicable to the 'equilibrium' IDS).- put_eirene_grid_to_equilibrium
Save a triangular grid given as atype(triangular_grid)
-structure into a grid_ggd AoS element (intended for the 'equilibrium' IDS). - arrange_grid_space
Create the 'space' AoS of grid_ggd. arrange_triangular_grid_space
Put a triangular grid given as atype(triangular_grid)
-structure to a desiredgrid_ggd
space.- arrange_subsets
Create the 'subset' AoS. arrange_standard_2d_subset
Arrange a "standard" subset in the poloidal 2d 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
Arrange a special single-element subset for storing averages.
Detailed description of the methods:
function get_grid_controls_for_input_saving (io_unit) result (grid_controls)
Prepare the control parameters for saving an EIRENE grid to an IMAS database that is to hold an EIRENE input. The control parameters are taken from a command file.
Argument | Type | Intent | Description |
---|---|---|---|
grid_controls | type(grid_control_panel) | result | Structure holding the control parameters |
io_unit | integer | in | I/O unit attached to the command file |
function get_grid_controls_for_input_fetching (io_unit) result (grid_controls)
Prepare the control parameters for extracting an EIRENE grid from an IMAS database holding an EIRENE input. The control parameters are taken from a command file.
Argument | Type | Intent | Description |
---|---|---|---|
grid_controls | type(grid_control_panel) | result | Structure holding the control parameters |
io_unit | integer | in | I/O unit attached to the command file |
function get_triangular_grid_from_ids (grid_ggd) result (eirene_grid)
...
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 different). To extract the grid from the 'equilibrium' IDS, use the function get_triangular_grid_from_equilibrium.
Argument | Type | Intent | Description |
---|---|---|---|
eirene_grid | type(triangular_grid) | result | The retrieved grid |
grid_ggd | type(ids_generic_grid_aos3_root), pointer | pointer | Pointer to the grid_ggd AOS element containing the grid |
function get_triangular_grid_from_equilibrium (grid_ggd) result (eirene_grid)
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 different). To extract the grid from another IDS, use the
Detailed description of the methods:
function get_triangular_grid_from_ids.
Argument | Type | Intent | Description |
---|---|---|---|
eirene_grid | type(triangular_grid) | result | The retrieved grid |
grid_ggd | type(ids_generic_grid_dynamic), pointer | pointer | Pointer to the grid_ggd AOS element containing the grid |
function get_grid_objects (space space_index) result (eirene_grid)Read data about
a triangular grid from a given space of GGD grid, put it into a The function returns a type(triangular_grid)-structure and call the function arrange_neighbors
(from triangular_grid_module
) to build the missing parts of the 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 |
typeids_generic_grid_ |
dynamic_ |
grid_ggd
AOS element containing the gridspace
AOSspace), dimension(:) | in | Space where the triangular grid is stored |
???????????????????????????????????????????? TO BE CHECKED
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)
Allocate the space AOS in a given grid_ggd
element with a given number of grid spaces, put a triangular grid given as a type(triangular_grid)
-structure into a desired element of the space
AOS, and organize necessary grid subsets.
...