...
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 |
EIRENE input wrappers
Only a part of input quantities is now processed. The storage of velocities will become possible after IMAS 3.38 is implemented.
Structure of EIRENE input files
In addition to the files containing the grid, the EIRENE input includes file holding spatial distributions of physical quantities (magnetic field components, temperatures and densities of plasma species etc.). The values of the quantities are given at the cells (triangles) constituting the grid. The easiest way to describe the format of the input files is to present a sample code reading it:
READ (IFILE,'(A72)') Text_header1
READ (IFILE,'(A72)') Text_header2
READ (IFILE,'(A72)') Text_header3
READ (IFILE,'(A24)') Text_header4
READ (IFILE,'(A24)') Text_header5
READ (IFILE,'(A72)') Text_header6
READ (IFILE,'(A72)') Text_header7
READ (IFILE,*) NR,NP,NT,NB,NTT
DO IRAD=1,NTT,5
READ (IFILE,*) (PROF(IR),IR=IRAD,IRAD+4)
END DO
Here NR=NTRI+1, NTRI is the number of grid triangles, NP=1, NT=1, NB=1, NTT = total number of cells including the additional cells outside of the triangle grid, see below. The additional array element with the index NR usually contains the average over all cells. Further extra elements with indices NR+1, ..., NTT correspond to extra cells outside the implemented triangular mesh (i.e., cells in pump ducts). These elements are not processed now.
The text headers are comments describing the file content, system units etc. It is agreed with the EIRENE team that (a) when reading a data file, the wrapper will consider all lines starting with '*' or '!' as a header line and will not store in IMAS the header texts; (b) when writing a fata file, the wrapper will generate new reasonable headers anew. The headers are not implemented yet.
Module eirene_data_io
This module provides tools for dealing with files containing EIRENE input data (see the file format in Section 6.1).
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 structure item 'main_part' is intended for storage of array elements 1, ..., NTRI, which correspond to grid triangles (see Section 6.1). The item 'average' is to contain average (element NTRI+1). The item 'extra_data' is intended for storing the extra elements NTRI+2, ..., NTT if they are available, with the item 'extra_data_present' showing if the extra elements are present.
Methods provided
The module contains the following routines:
- deallocate_data_set
Dallocate the components of a type(eirene_data) variable. - read_quantity_from_file
Read an EIRENE input file holding a distribution of a physical quantity. - write_quantity_to_file
Write an EIRENE input file holding a distribution of a physical quantity.
subroutine deallocate_data_set (quantity)
Deallocate all components of the structure.
...
Argument
...
Type
...
Intent
...
Description
...
quantity
...
type(eirene_data)
...
inout
...
Structure to be deallocated
subroutine read_quantity_from_file (file_name, quantity, report, io_unit)
Read a physical quantity from a file with the format of EIRENE input tallies.
...
Argument
...
Type
...
Intent
...
Description
...
quantity
...
type(eirene_data)
...
out
...
structure to be filled with data from the file
...
Two wrapper programs are provided. The first program, save_input.exe, accepts the EIRENE input (files with a grid description and files with spatial distributions of physical quantities) prepared by some programs and saves their content in a desired IMAS database. The second program, provide_input.exe, recreate these input files, so that they can be used by EIRENE. Both programs are controlled by certain text files ('command files') described in Section 4.
Only a part of input quantities is now processed. According to information received from the EIRENE team, the storage of the following tallies (physical quantities) is of first priority: electron temperature; temperature, density, and velocity components (in cylindrical coordinates) of several sorts of ions; total magnetic field; components of the magnetic field unit vector in cylindrical coordinates.
The storage of the magnetic field, temperatures, and densities is already implemented in the wrappers. However, there is a restriction: the wrappers are able to deal with single-atom ions only.
The storage of velocities will become possible after IMAS 3.38 is implemented.
Structure of EIRENE input files
In addition to the files containing the grid, the EIRENE input includes file holding spatial distributions of physical quantities (magnetic field components, temperatures and densities of plasma species etc.). The values of the quantities are given at the cells (triangles) constituting the grid. The easiest way to describe the format of the input files is to present a sample code reading it:
READ (IFILE,'(A72)') Text_header1
READ (IFILE,'(A72)') Text_header2
READ (IFILE,'(A72)') Text_header3
READ (IFILE,'(A24)') Text_header4
READ (IFILE,'(A24)') Text_header5
READ (IFILE,'(A72)') Text_header6
READ (IFILE,'(A72)') Text_header7
READ (IFILE,*) NR,NP,NT,NB,NTT
DO IRAD=1,NTT,5
READ (IFILE,*) (PROF(IR),IR=IRAD,IRAD+4)
END DO
Here NR=NTRI+1, NTRI is the number of grid triangles, NP=1, NT=1, NB=1, NTT = total number of cells including the additional cells outside of the triangle grid, see below. The additional array element with the index NR usually contains the average over all cells. Further extra elements with indices NR+1, ..., NTT correspond to extra cells outside the implemented triangular mesh (i.e., cells in pump ducts). These elements are not processed now.
The text headers are comments describing the file content, system units etc. It is agreed with the EIRENE team that (a) when reading a data file, the wrapper will consider all lines starting with '*' or '!' as a header line and will not store in IMAS the header texts; (b) when writing a fata file, the wrapper will generate new reasonable headers anew. The headers are not implemented yet.
Module eirene_data_io
This module provides tools for dealing with files containing EIRENE input data (see the file format in Section 6.1).
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 structure item 'main_part' is intended for storage of array elements 1, ..., NTRI, which correspond to grid triangles (see Section 6.1). The item 'average' is to contain average (element NTRI+1). The item 'extra_data' is intended for storing the extra elements NTRI+2, ..., NTT if they are available, with the item 'extra_data_present' showing if the extra elements are present.
Methods provided
The module contains the following routines:
- deallocate_data_set
Dallocate the components of a type(eirene_data) variable. - read_quantity_from_file
Read an EIRENE input file holding a distribution of a physical quantity. - write_quantity_to_file
Write an EIRENE input file holding a distribution of a physical quantity.
subroutine deallocate_data_set (quantity)
Deallocate all components of the structure.
Argument | Type | Intent | Description |
---|---|---|---|
quantity | type(eirene_data) | inout | Structure to be deallocated |
subroutine read_quantity_from_file (file_name, quantity, report, io_unit)
Read a physical quantity from a file with the format of EIRENE input tallies.
Argument | Type | Intent | Description |
---|---|---|---|
file_name | character(len=*) | in | file name |
quantity | type(eirene_data) | out | structure to be filled with data from the file |
report | logical, optional (=false) | in | turns on info about each step |
io_unit | integer, optional (=69) | in | I/O unit to be used |
subroutine write_quantity_to_file (file_name, quantity, report, io_unit)
Write a physical quantity to a file with the format of EIRENE input tallies.
Argument | Type | Intent | Description |
---|---|---|---|
file_name | character(len=*) | in | file name |
quantity | type(eirene_data) | in | structure holding data to be saved |
report | logical, optional (=false) | in | turns on info about each step |
io_unit | integer, optional (=69) | in | I/O unit to be used |
Module imas_data_io
The module contains methods used for writing an EIRENE tally (given as a type(eirene_data)-structure) to IMAS IDS and, vice versa, reading it from IDS. The 'main_part' component is associated with the grid subset of all triangles (the subset identifier name 'pol3'); the 'average' component, with the subset having the name 'average'.
It is a difficult choice to decide whether the methods should look for the subsets in the 'subset' AoS by their identifier names or by their dictionary indices (the idea to assign fixed places in the AoS to the subsets seems very bad because it can result in numerous bugs and confusions if it happens that the AoS requires changes). Now the subsets are found by their names. The main reason for this choice is that we have many subsets that have no standard dictionary indices (subsets of edges with given MPs, subset for averages). It is possible to introducing custom indices for them, but it seems a way to great confusion.
Storage of 'extra_data' is yet to be done (after adding the corresponding extra part to the grid).
Module constants
! Name of the subset to which the values at all triangles are attached
character(len=ids_string_length), parameter :: main_subset_label = 'pol3'
! Name of the subset to which the average value is attached
character(len=ids_string_length), parameter :: average_subset_label = 'average'
The constants are the identifier names by which the subsets are found by the methods of this module when writing an EIRENE tally (given as a type(eirene_data)-structure) to IMAS IDS and, vice versa, reading it from IDS. The 'main_part' component is associated with the grid subset of all triangles (named 'pol3'); the 'average' component, with the subset having the name 'average'.
Methods provided
- put_quantity_to_ids
Put a type(eirene_data)-structure to IDS. - get_quantity_from_ids
Get a type(eirene_data)-structure from an IDS (not suitable for the 'equilibrium' IDS). - get_quantity_from_equilibrium
Get a type(eirene_data)-structure from the 'equilibrium' IDS. - put_quantity_for_single_subset
Write a quantity given as array to a given IDS slot, attaching it to a grid subset with a given name. - get_quantity_for_single_subset
Get from a given IDS slot a quantity given as an array attached to the grid subset with a given name (not suitable for the 'equilibrium' IDS). - get_quantity_for_single_subset_in_equilibrium
Get from a given IDS slot a quantity given as an array attached to the grid subset with a given name; suitable only for 'equilibrium'.
subroutine put_quantity_to_ids (quantity, grid_subset, grid_index, quantity_aos, code_to_imas_unit_ratio)
Put a quantity to a given IDS slot (sub-AoS of the ggd AoS intended for the storage of a single physical quantity). The AoS is allocated with the size of 2 in order to save values attached to two grid subsets: the subset of all triangles and the subset organized to store the averages. These subsets are found by their identifier names, which are given by the module constants main_subset_label and average_subset_label, respectively.
Argument | Type | Intent | Description |
---|
subroutine write_quantity_to_file (file_name, quantity, report, io_unit)
Write a physical quantity to a file with the format of EIRENE input tallies.
Argument | Type | Intent | Description | file_name | character(len=*) | in | file name
---|---|---|---|---|---|
quantity | type(eirene_data) | in | structure holding data the quantity to be saved | ||
grid_subset | type(ids_generic_grid_dynamic_grid_subset), dimension(: | report | logical, optional (=false) | in | turns on info about each step |
io_unit | integer, optional (=69) | in | I/O unit to be used |
Module imas_data_io
The module contains methods used for writing an EIRENE tally (given as a type(eirene_data)-structure) to IMAS IDS and, vice versa, reading it from IDS. The 'main_part' component is associated with the grid subset of all triangles (the subset identifier name 'pol3'); the 'average' component, with the subset having the name 'average'.
It is a difficult choice to decide whether the methods should look for the subsets in the 'subset' AoS by their identifier names or by their dictionary indices (the idea to assign fixed places in the AoS to the subsets seems very bad because it can result in numerous bugs and confusions if it happens that the AoS requires changes). Now the subsets are found by their names. The main reason for this choice is that we have many subsets that have no standard dictionary indices (subsets of edges with given MPs, subset for averages). It is possible to introducing custom indices for them, but it seems a way to great confusion.
Storage of 'extra_data' is yet to be done (after adding the corresponding extra part to the grid).
Module constants
! Name of the subset to which the values at all triangles are attached
character(len=ids_string_length), parameter :: main_subset_label = 'pol3'
! Name of the subset to which the average value is attached
character(len=ids_string_length), parameter :: average_subset_label = 'average'
The constants are the identifier names by which the subsets are found by the methods of this module when writing an EIRENE tally (given as a type(eirene_data)-structure) to IMAS IDS and, vice versa, reading it from IDS. The 'main_part' component is associated with the grid subset of all triangles (named 'pol3'); the 'average' component, with the subset having the name 'average'.
Methods provided
- put_quantity_to_ids
Put a type(eirene_data)-structure to IDS. - get_quantity_from_ids
Get a type(eirene_data)-structure from an IDS (not suitable for the 'equilibrium' IDS). - get_quantity_from_equilibrium
Get a type(eirene_data)-structure from the 'equilibrium' IDS. - put_quantity_for_single_subset
Write a quantity given as array to a given IDS slot, attaching it to a grid subset with a given name. - get_quantity_for_single_subset
Get from a given IDS slot a quantity given as an array attached to the grid subset with a given name (not suitable for the 'equilibrium' IDS). - get_quantity_for_single_subset_in_equilibrium
Get from a given IDS slot a quantity given as an array attached to the grid subset with a given name; suitable only for 'equilibrium'.
AoS, grid subsets | |||
grid_index | integer | in | index of the grid used in the grid_ggd AOS (must be put to IDS) |
quantity_aos | type(ids_generic_grid_scalar), dimension(:) | pointer | AoS (IDS slot) where the quantity should be written |
code_to_imas_unit_ratio | real(ids_real) | in | ratio of the quantity unit in the code to that in IMAS |
function get_quantity_from_ids (grid_ggd_aos, quantity_aos, code_to_imas_unit_ratio) result (quantity)
Get a quantity from a given IDS slot (sub-AoS of the ggd AoS intended for the storage of a single physical quantity). The subroutine scans the slot, investigating the identifier names of the grid subsets to which the slot array elements are attached (the 'grid_index' and the 'subset_index' components of the element are used to reach this subset). The subroutine obtains the value arrays attached to two grid subsets: the subset of all triangles and the subset organized to store the averages. These subsets are found by their identifier names, which are given by the module constants main_subset_label and average_subset_label, respectively. The obtained arrays are put into the components 'main_data' and 'average' of the function result. Not suitable for the 'equilibrium' IDS (use get_quantity_from_equilibrium for this IDS).
Argument | Type | Intent | Description |
---|---|---|---|
quantity | type(eirene_data) | result | structure holding the obtained quantity |
grid_ggd_aos | type(ids_generic_grid_aos3_root), intent(in), dimension(:) | in | grid_ggd (AoS holding the description of GGD grids) |
quantity_aos | type(ids_generic_grid_scalar), dimension(:) | in | AoS (IDS slot) whence the quantity should be taken |
code_to_imas_unit_ratio | real(ids_real) | in | ratio of the quantity unit in the code to that in IMAS |
function get_quantity_from_equilibrium (grid_ggd_aossubroutine put_quantity_to_ids (quantity, grid_subset, grid_index, quantity_aos, code_to_imas_unit_ratio) result (quantity)
Put Get a quantity to from a given IDS slot (sub-AoS of the ggd AoS intended for the storage of a single physical quantity). The AoS is allocated with the size of 2 in order to save values of a single physical quantity) of the 'equilibrium' IDS. The subroutine scans the slot, investigating the identifier names of the grid subsets to which the slot array elements are attached (the 'grid_index' and the 'subset_index' components of the element are used to reach this subset). The subroutine obtains the value arrays attached to two grid subsets: the subset of all triangles and the subset organized to store the averages. These subsets are found by their identifier names, which are given by the module constants main_subset_label and average_subset_label, respectively. The obtained arrays are put into the components 'main_data' and 'average' of the function result. Use get_quantity_from_ids for IDS other than 'equilibrium'.
Argument | Type | Intent | Description | |||
---|---|---|---|---|---|---|
quantity | type(eirene_data) | inresult | structure holding the obtained quantity to be saved | |||
grid_ggd_subsetaos | type(ids_generic_grid_dynamic_grid_subsetaos3_root), intent(in), dimension(:) | inAoS, grid subsets | grid_index | integer | in | index of the grid used in the grid_ggd AOS (must be put to IDS(AoS holding the description of GGD grids) |
quantity_aos | type(ids_generic_grid_scalar), dimension(:) | pointerin | AoS (IDS slot) where whence the quantity should be writtentaken | |||
code_to_imas_unit_ratio | real(ids_real) | in | ratio of the quantity unit in the code to that in IMAS |
function getsubroutine put_quantity_for_fromsingle_ids (grid_ggd_aos, quantity_aos, code_to_imas_unit_ratio) result (quantity)subset (quantity, ids_slot, code_to_imas_unit_ratio, grid_subset, grid_index, subset_label)
Write a quantity given as array to a given IDS slot, attaching it to a grid subset with a given name. The array size must coincide with the size of the grid subset.Get a quantity from a given IDS slot (sub-AoS of the ggd AoS intended for the storage of a single physical quantity). The subroutine scans the slot, investigating the identifier names of the grid subsets to which the slot array elements are attached (the 'grid_index' and the 'subset_index' components of the element are used to reach this subset). The subroutine obtains the value arrays attached to two grid subsets: the subset of all triangles and the subset organized to store the averages. These subsets are found by their identifier names, which are given by the module constants main_subset_label and average_subset_label, respectively. The obtained arrays are put into the components 'main_data' and 'average' of the function result. Not suitable for the 'equilibrium' IDS (use get_quantity_from_equilibrium for this IDS).
Argument | Type | Intent | Description | |||
---|---|---|---|---|---|---|
quantity | ||||||
quantity | type(eirene_data) | result | structure holding the obtained quantity | |||
type(eirene_data) | result | structure holding the obtained quantity | ||||
ids_slot | ids_generic_grid_aos3_root), intent(in), dimension(:)in | grid_ggd (AoS holding the description of GGD grids) | quantity_aos | type(ids_generic_grid_scalar), dimension(:) | inout | AoS (IDS slot) whence the quantity should be taken |
code_to_imas_unit_ratio | real(ids_real) | in | ratio of the quantity unit in the code to that in IMAS |
function get_quantity_from_equilibrium (grid_ggd_aos, quantity_aos, code_to_imas_unit_ratio) result (quantity)
Get a quantity from a given IDS slot (sub-AoS of the ggd AoS intended for the storage of a single physical quantity) of the 'equilibrium' IDS. The subroutine scans the slot, investigating the identifier names of the grid subsets to which the slot array elements are attached (the 'grid_index' and the 'subset_index' components of the element are used to reach this subset). The subroutine obtains the value arrays attached to two grid subsets: the subset of all triangles and the subset organized to store the averages. These subsets are found by their identifier names, which are given by the module constants main_subset_label and average_subset_label, respectively. The obtained arrays are put into the components 'main_data' and 'average' of the function result. Use get_quantity_from_ids for IDS other than 'equilibrium'.
grid_subset | type(ids_generic_grid_dynamic_grid_subset), dimension(:) | in | array of grid subsets |
grid_index | integer | in | index of the grid used in the grid_ggd AOS (must be put to IDS) |
subset_label | character(len=*) | in | identifier name of the grid subset |
subroutine get_quantity_for_single_subset (ids_slot, subset_label, code_to_imas_unit_ratio, grid_ggd_aos, quantity, grid_index, subset_index)
Get from a given IDS slot a quantity given as an array attached to the grid subset with a given name (not suitable for the 'equilibrium' IDS).
Argument | Type | Intent | Description |
---|---|---|---|
ids_slot | type(ids_generic_grid_scalar) | in | AoS (IDS slot) whence the quantity should be taken |
subset_label | character(len=*) | in | identifier name of the required grid subset |
code_to_imas_unit_ratio | real(ids_real) | in | ratio of the quantity unit in the code to that in IMAS |
Argument | Type | Intent | Description |
quantity | type(eirene_data) | result | structure holding the obtained quantity|
grid_ggd_aos | type(ids_generic_grid_aos3_root), intent(in), dimension(:) | in | grid_ggd (AoS holding the description of GGD grids)AOS |
quantity_aos | typereal(ids_generic_grid_scalarreal), dimension(:), allocatable | in | AoS (IDS slot) whence the quantity should be taken |
code_to_imas_unit_ratio | real(ids_real) | in | ratio of the quantity unit in the code to that in IMAS |
out | values of the quantity at a grid subset | ||
grid_index | integer | out | index of the used grid in grid_ggd AOS |
subset_index | integer | out | index of the grid subset in the 'subset' AoS. |
subroutine getsubroutine put_quantity_for_single_subset_in_equilibrium (quantity, ids_slot, subset_label, code_to_imas_unit_ratio, grid_ggd_subsetaos, quantity, grid_index, subset_labelindex)
Write Get from a given IDS slot a quantity given as an array to a given IDS slot, attaching it to a grid subset with a given name. The array size must coincide with the size of the grid subsetattached to the grid subset with a given name (suitable onlyfor the 'equilibrium' IDS).
Argument | Type | Intent | Description | quantity | type(eirene_data) | result | structure holding the obtained quantity
---|---|---|---|---|---|---|
ids_slot | type(ids_generic_grid_scalar) | outin | AoS (IDS slot) whence the quantity should be taken | |||
subset_label | character(len=*) | in | identifier name of the required grid subset | |||
code_to_imas_unit_ratio | real(ids_real) | in | ratio of the quantity unit in the code to that in IMAS | |||
grid_ggd_subsetaos | type(ids_generic_grid_dynamic_grid_subset_dynamic), dimension(:) | in | grid_ggd AOS | |||
quantity | real(ids_real), dimension(:), allocatable | inout | array values of the quantity at a grid subsetssubset | |||
grid_index | integer | inout | index of the used grid used in the grid_ggd AOS (must be put to IDS) | |||
subset_label | character(len=*) | in | index | integer | out | index identifier name of the grid subset |
subroutine get_quantity_for_single_subset (ids_slot, subset_label, code_to_imas_unit_ratio, grid_ggd_aos, quantity, grid_index, subset_index)
Get from a given IDS slot a quantity given as an array attached to the grid subset with a given name (not suitable for the 'equilibrium' IDS).
...
Argument
...
Type
...
Intent
...
Description
...
subroutine get_quantity_for_single_subset_in_equilibrium (ids_slot, subset_label, code_to_imas_unit_ratio, grid_ggd_aos, quantity, grid_index, subset_index)
Get from a given IDS slot a quantity given as an array attached to the grid subset with a given name (suitable onlyfor the 'equilibrium' IDS).
...
Argument
...
Type
...
Intent
...
Description
...
in the 'subset' AoS. |
Module edge_profiles_io
The module provides tools for information exchange with the 'edge_profiles' IDS.
Data types provided
type ion_file_set
character(len=32) :: n, T !, vx, vy, vz ! To be added
end type ion_file_set
This structure holds the collection of names of data files that store characteristics for one ion sort.
type ion_data_set
type(eirene_data) :: n, T !, vx, vy, vz ! To be added
end type ion_data_set
This structure holds the collection of data for one ion sort.
type ion_parameters
character(len=ids_string_length) :: label
real(ids_real) :: mass, Z_ion, Z_element
type(ion_file_set) :: files
type(ion_data_set) :: data
end type ion_parameters
This structure holds all parameters characterizing an ion sort.
Methods provided
- deallocate_edge_profiles_data
Deallocate all components of a type(edge_profiles_data_set)-stucture. - initiate_ion_list_for_input_saving
Read that part of the command file controls the input wrapper which concerns ions. - initiate_edge_profiles_data_for_input_saving
Read the part of the command file that controls saving the EIRENE data to the edge_profiles IDS. - collect_data_for_edge_profiles_input
Read the EIRENE input data intended for the edge_profiles IDS from files. - save_input_to_edge_profiles
Put EIRENE input to the edge_profiles IDS. - organize_ion_storage
Primary organization of the structure array for storing the ion data. - put_ions_to_edge_profiles
Put quantities associated with ions to the edge_profiles IDS. - fetch_input_from_edge_profiles
Get data from the edge_profiles IDS - get_quantities_from_edge_profiles
Get all physical quantities from the edge_profiles IDS - get_ions_from_edge_profiles
Get quantities associated with ions from the edge_profiles IDS - write_input_data_from_edge_profiles_ids
Write the data extracted from the edge_profiles IDS to files in the format of EIRENE input tallies
subroutine deallocate_edge_profiles_data (all_data)
Deallocate all components of the structure.
Module edge_profiles_io
The module provides tools for information exchange with the 'edge_profiles' IDS.
Data types provided
type ion_file_set
character(len=32) :: n, T !, vx, vy, vz ! To be added
end type ion_file_set
This structure holds the collection of names of data files that store characteristics for one ion sort.
type ion_data_set
type(eirene_data) :: n, T !, vx, vy, vz ! To be added
end type ion_data_set
This structure holds the collection of data for one ion sort.
type ion_parameters
character(len=ids_string_length) :: label
real(ids_real) :: mass, Z_ion, Z_element
type(ion_file_set) :: files
type(ion_data_set) :: data
end type ion_parameters
This structure holds all parameters characterizing an ion sort.
Methods provided
...
Argument | Type | Intent | Description |
---|---|---|---|
all_data |
type(edge_profiles_data_set) |
...
inout | structure to be deallocated |
function initiate_ion_list_for_input_saving (io_unit) result (ion_list)
Read that part of the command file
...
of the input wrapper which concerns
...
ions.
Argument | Type | Intent | Description |
---|---|---|---|
ion_list | type(ion_parameters), allocatable, dimension(:) | result | array that holds parameters of all ions |
io_unit | integer | in | index of the I/O unit attached to the command file |
function initiate_edge_profiles_data_for_input_saving (io_unit) result (edge_profiles_data)
Read the part of the command file that controls saving the EIRENE data to the edge_profiles IDS.
...
Argument | Type | Intent | Description |
---|---|---|---|
edge_profiles_data | type(edge_profiles_data_set) | result | structure holding parameters obtained from the command file |
io_unit | integer | in | index of the I/O unit attached to the command file |
subroutine collect_data_for_edge_profiles_input (edge_profiles_data)
Read the EIRENE input data intended for the edge_profiles IDS from files. At the entry, the 'edge_profiles_data' structure is filled only partly (from the command file). The subroutine fills the remaining part, reading the information from data files.
Uses the subroutine read_quantity_from_file (module eirene_data_io)
subroutine deallocate_edge_profiles_data (all_data)
Deallocate all components of the structure.
Argument | Type | Intent | Description |
---|---|---|---|
alledge_profiles_data | type(edge_profiles_data_set) | inout | structure to be deallocated |
function initiate_ion_list_for_input_saving (io_unit) result (ion_list)
Read that part of the command file of the input wrapper which concerns ions.
...
Argument
...
Type
...
Intent
...
Description
...
ion_list
...
type(ion_parameters), allocatable, dimension(:)
...
result
...
array that holds parameters of all ions
...
that contains the names of the input files and accepts the data read from the files |
subroutine save_input_to_edge_profiles (idx, imas_controls, grid_controls, edge_profiles_data, eirene_grid)
Put EIRENE input to the edge_profiles IDS. The input consists of (1) a triangular grid; (2) a set of quantities (characteristics of several plasma species) defined on this grid; (3) properties of these species. The first item is provided in 'eirene_grid'; the last two, in 'edge_profiles_data'.
Uses the subroutines: put_quantity_to_ids (module imas_data_io), put_eirene_grid_to_ids (module triangular_grid_ids_io), put_ions_to_edge_profiles (this module)
function initiate_edge_profiles_data_for_input_saving (io_unit) result (edge_profiles_data)
Read the part of the command file that controls saving the EIRENE data to the edge_profiles IDS.
Argument | Type | Intent | Description |
---|---|---|---|
idx | |||
edge_profiles_data | type(edge_profiles_data_set) | result | structure holding parameters obtained from the command file |
io_unit | integer | in | index of the I/O unit attached to the command file |
subroutine collect_data_for_edge_profiles_input (edge_profiles_data)
Read the EIRENE input data intended for the edge_profiles IDS from files. At the entry, the 'edge_profiles_data' structure is filled only partly (from the command file). The subroutine fills the remaining part, reading the information from data files.
Uses the subroutine read_quantity_from_file (module eirene_data_io).
IMAS database | |||
imas_controls | type(imas_control_panel) | in | parameters of the IMAS database and basic information to be put to IDS |
grid_controls | type(grid_control_panel) | in | parameters controlling the grid saving | Argument | Type | Intent | Description
---|---|---|---|
edge_profiles_data | type(edge_profiles_data_set) | inoutin | structure that contains the names of the input files and accepts the data read from the files |
subroutine save_input_to_edge_profiles (idx, imas_controls, grid_controls, edge_profiles_data, eirene_grid)
Put EIRENE input to the edge_profiles IDS. The input consists of (1) a triangular grid; (2) a set of quantities (characteristics of several plasma species) defined on this grid; (3) properties of these species. The first item is provided in 'eirene_grid'; the last two, in 'edge_profiles_data'.
eirene_grid | type(triangular_grid) | in | structure keeping the EIRENE triangular grid |
subroutine organize_ion_storage (ion_list, ggd)
Primary organization of the structure array for storing the ion data (allocation of AoS and putting basic ion properties there).
Restrictions to be overcome: only single atoms (no molecules); one charge state per ion sort.
Argument | Type | Intent | Description |
---|---|---|---|
ion_list | type(ion_parameters), allocatable, dimension(:) | in | array that holds parameters of all ions |
ggd | type(ids_edge_profiles_time_slice) | inout | ggd AoS element to be filled |
subroutine put_ions_to_edge_profiles (ion_list, ggd, grid_subset, grid_index)
Put quantities associated with ions to the edge_profiles IDS.
Restrictions to be overcome: only single atoms (no molecules); one charge state per ion sortUses the subroutines: put_quantity_to_ids (module imas_data_io), put_eirene_grid_to_ids (module triangular_grid_ids_io), put_ions_to_edge_profiles (this module).
Argument | Type | Intent | Description | ||
---|---|---|---|---|---|
ion_list | type(ion_parameters), dimension(:) | idx | integerin | index of the I/O unit attached to the IMAS database | |
imas_controls | type(imas_control_panel) | in | parameters of the IMAS database and basic information to be put to IDS | ||
grid_controls | type(grid_control_panel) | in | parameters controlling the grid saving | ||
edge_profiles_data | type(edge_profiles_data_set) | in | structure that contains the names of the input files and accepts the data read from the files | ||
eirene_grid | type(triangular_grid) | in | structure keeping the EIRENE triangular grid |
subroutine organize_ion_storage (ion_list, ggd)
Primary organization of the structure array for storing the ion data (allocation of AoS and putting basic ion properties there).
array that holds parameters of all ions | |||
ggd | type(ids_edge_profiles_time_slice) | inout | ggd AoS element to be filled |
grid_subset | type(ids_generic_grid_dynamic_grid_subset), dimension(:) | in | array of grid subsets |
grid_index | integer | in | index of the grid_ggd AOS element holding the grid |
subroutine fetch_input_from_edge_profiles (idx, grid_controls, fetch_grid, edge_profiles_data, eirene_grid)
Get all physical quantities from the edge_profiles IDS, putting them to a type(edge_profiles_data_set) structure. If required, get the triangular grid.
Uses the subroutines: put_quantity_to_ids (module imas_data_io), put_eirene_grid_to_ids (module triangular_grid_ids_io), put_ions_to_edge_profiles (this module)Restrictions to be overcome: only single atoms (no molecules); one charge state per ion sort.
Argument | Type | Intent | Description | ||
---|---|---|---|---|---|
idx | integer | in | index of the I/O unit attached to the IMAS database | ||
grid_controls | ion_listtype( | ion_parameters), allocatable, dimension(:grid_control_panel) | in | array that holds parameters of all ions | |
ggd | type(ids_edge_profiles_time_slice) | inout | ggd AoS element to be filled |
subroutine put_ions_to_edge_profiles (ion_list, ggd, grid_subset, grid_index)
Put quantities associated with ions to the edge_profiles IDS.
parameters controlling the grid saving | |||
fetch_grid | logical | in | switches on reading the grid |
edge_profiles_data | type(edge_profiles_data_set) | out | the structure holding the data found in the edge_profiles IDS (except for the grid) |
eirene_grid | type(triangular_grid) | inout | structure containing the grid; if fetch_input=.true., it is filled with data read from the IDS; otherwise, it remains unchanged. |
function get_quantities_from_edge_profiles (ggd, grid_ggd_aos) result (edge_profiles_data)
Get all physical quantities from the edge_profiles IDS, putting them to a type(edge_profiles_data_set) structureRestrictions to be overcome: only single atoms (no molecules); one charge state per ion sort.
Argument | Type | Intent | Description | |||
---|---|---|---|---|---|---|
edge_profiles_ | listdata | type( | ion_parameters), dimension(:)in | array that holds parameters of all ionsedge_profiles_data_set) | result | the structure holding the obtained data |
ggd | type(ids_edge_profiles_time_slice) | inoutin | ggd AoS element to be filledwhere the quantities are written | |||
grid_ggd_subsetaos | type(ids_generic_grid_dynamicaos3_grid_subsetroot), dimension(:) | in | array of grid subsets | |||
grid_index | integer | in | index of the grid_ggd AOS element holding the grid | |||
AoS containing the GGD grids |
function get_ionssubroutine fetch_input_from_edge_profiles (idx, grid_controls, fetchggd_gridaos, edge_profiles_data, eirene_gridggd_ions) result (ion_list)
Get all physical quantities associated with ions from the edge_profiles IDS, putting them to a type(edge_profiles_data_set) structure. If required, get the triangular grid.Uses the subroutines: put_quantity_to_ids (module imas_data_io), put_eirene_grid_to_ids (module triangular_grid_ids_io), put_ions_to_edge_profiles (this module)
Restrictions: only single-atom ions (no molecules); one charge state per ion sort.
Argument | Type | Intent | Description |
---|
edge_profiles_data
type(edge_profiles_data_set)
out
the structure holding the data found in the edge_profiles IDS (except for the grid)
function get_quantities_from_edge_profiles (ggd, grid_ggd_aos) result (edge_profiles_data)
...
ion_list | type(ion_parameters), allocatable, dimension(:) | result | the structure holding the obtained data |
grid_ggd_aos | type(ids_generic_grid_aos3_root), dimension(:) | in | AoS containing the GGD grids |
ggd_ions | type(ids_edge_profiles_time_slice_ion), dimension(:) | in | sub-AoS of the ggd AOS where ion data are stored |
subroutine write_input_data_from_edge_profiles_ids (edge_profiles_data, file_suffix)
Write the data extracted from the edge_profiles IDS to files in the format of EIRENE input tallies.
The names of the generated files look like <ion_label>_<quantity_label>_<file_suffix>. For example, if the file suffix is "input.dat", and the ion label is "D+", the ion temperature will be written to the file "D+_n_input.dat".
Argument | Type | Intent | Description |
---|---|---|---|
edge_profiles_data | type(edge_profiles_data_set) | in | the structure |
...
Argument
...
Type
...
Intent
...
Description
...
holding the obtained data | |||
file_suffix | character(len=*) | in | the suffix added to the names of the created files |
Module equilibrium_io
The module provides tools for information exchange with the 'edge_profiles' IDS.
Data types provided
type equilibrium_data_set
type(eirene_data) :: bx, by, bz, Btotal ! Components used by EIRENE
type(eirene_data) :: BR, Bvert, Btor ! Components stored in IMAS
end type equilibrium_data_set
This type is a collection of magnetic field components.
type equilibrium_file_set
character(len=32) :: bx, by, bz, Btotal
end type equilibrium_file_set
This type holds names of the files holding the magnetic field components.
Methods provided
???
Module equilibrium_io
????????????
Module global_parameters
...