Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Introduction
  2. Files provided
  3. Running a test example
  4. Structure of the parameter files
  5. Storing the EIRENE triangular grids in IMAS
    1. Structure of EIRENE files keeping the grid
    2. Presentation of EIRENE grid in GGD
    3. Module  triangular_grid_modile 
      1. Data types provided
      2. Methods provided 
    4. Module  triangular_grid_ids_io
      1. Data types provided
      2. Methods provided
  6. EIRENE input wrapper
    1. Structure of EIRENE input files
    2. Module eirene_data_io
      1. Data types provided
      2. Methods provided 
    3. Module imas_data_io
      1. Constants
      2. Methods
    4. Module edge_profiles_io
      1. Data types
      2. Methods
    5. Module equilibrium_io
      1. Data types
      2. Methods
    6. Module global_objects
      1. Constants
      2. Methods
    7. ???
    8. Main program files  save_input_main.f90  and  provide_input_main.f90
  7. Things to be done

...

The module depends on the IMAS module  ids_types   (uses the constant  IDS_real  – the kind of real variables in IMAS).

Data types

...

The following data types are provided:

...

The type  edge_structure  is intended for information about an edge. The integer child array  vertex   holds indices of the edge vertices in  triangular_grid%vertex  . The leaf  material_property   holds the MP of the edge. The child array  adjacent   holds the indices of the neighbouring triangles in  triangular_grid%triangle .

Methods

...

The module member routines are as follows:

...

At present, only one grid space is arranged: a two-dimensional poloidal grid space holding a triangular grid. However, the routines of this modules are organized in a way that should facilitate adding additional spaces (most probably, a 1D toroidal space) if required. When the poloidal grid is recovered from an IDS, it is taken from the space having the identifier index equal to 1 (see the function get_grid_objects).

 Data types

...

    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

...

The module contains the following routines:

...

This module provides tools for dealing with files containing EIRENE input data (see the file format in Section 6.1).

 Data types

...

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

...

The module contains the following routines:

...

Storage of 'extra_data' is yet to be done (after adding the corresponding extra part to the grid).

...

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

...

  • 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'.

...

The module provides tools for information exchange with the 'edge_profiles' IDS.

Data types

...

type ion_file_set
    character(len=32) :: n, T !, vx, vy, vz ! To be added
end type ion_file_set

...

This structure holds all parameters characterizing an ion sort.

Methods

...

  • 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

...

The module provides tools for information exchange with the 'edge_profiles' IDS.

 Data types

...

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 holds names of the files holding the magnetic field components.

 Methods

...

  • deallocate_equilibrium_data
    Deallocate all components of the structure.
  • initiate_equilibrium_data_for_input
    Read the part of the command file that controls saving the EIRENE data to the equilibrium IDS.
  • collect_data_for_equilibrium_input
    Read the EIRENE input data intended for the equilibrium IDS from files,
  • transform_equilibrium_for_ids
    Transform the magnetic field data to the form suitable for the equilibrium IDS.
  • save_input_to_equilibrium
    Put EIRENE input to the equilibrium IDS.
  • fetch_input_from_equilibrium
    Get all physical quantities from the equilibrium IDS.
  • get_quantities_from_equilibrium
    Get all physical quantities from the equilibrium IDS.
  • transform_equilibrium_for_eirene

  • write_input_data_from_equilibrium_ids

...

Uses the subroutines: put_quantity_to_ids (module imas_data_io), put_eirene_grid_to_equilibrium (module triangular_grid_ids_io), transform_equilibrium_for_ids (this module).

Argument

Type

Intent

Description

idxintegerinindex of the I/O unit attached to the IMAS database
imas_controlstype(imas_control_panel)inparameters of the IMAS database and basic information to be put to IDS
grid_controlstype(grid_control_panel)inparameters controlling the grid saving

equilibrium_data

type(equilibrium_data_set)

inout

structure holding the distributions of physical quantities

eirene_gridtype(triangular_grid)instructure keeping the EIRENE triangular grid


subroutine fetch_input_from_equilibrium (idx, grid_controls, fetch_grid, equilibrium_data, eirene_grid)

...

Uses the subroutines: get_triangular_grid_from_equilibrium (module triangular_grid_ids_io), get_quantities_from_equilibrium (this module), transform_equilibrium_for_eirene (this module).

Argument

Type

Intent

Description

idxintegerinindex of the I/O unit attached to the IMAS database
grid_controlstype(grid_control_panel)inparameters controlling the grid saving/recovering
fetch_gridlogicalinswitches on reading the grid

equilibrium_data

type(equilibrium_data_set)

out

the structure holding the data found in the equilibrium IDS (except for the grid)

eirene_gridtype(triangular_grid)inoutstructure containing the grid; if fetch_input=.true., it is filled with data read from the IDS; otherwise, it remains unchanged.


function get_quantities_from_equilibrium (ggd, grid_ggd_aos) result (equilibrium_data)

Get all physical quantities from the equilibrium IDS, putting them to a type(equilibrium_data_set) structure.

Argument

Type

Intent

Description

equilibrium_datatype(equilibrium_data_set)resultthe structure holding the obtained data
ggdtype(ids_equilibrium_ggd)inggd AoS element where the quantities are written
grid_ggd_aostype(ids_generic_grid_dynamic), dimension(:)inAoS containing the GGD grids


subroutine transform_equilibrium_for_eirene (equilibrium_data)

...

The input files must contain b_x, b_y, b_z (b is the mag. field unit vector), and B_total. The equilibrium IDS accepts B_R, B_Z, B_phi. Here x=R, y=Z (vertical), z=phi (toroidal).

Argument

Type

Intent

Description

equilibrium_data

type(equilibrium_data_set)

inout

structure that holds all magnetic field data


subroutine write_input_data_from_equilibrium_ids (equilibrium_data, equilibrium_files)

...

The names of the generated files are taken from the 'equilibrium_files' structure.

Argument

Type

Intent

Description

equilibrium_datatype(equilibrium_data_set)inthe structure holding the obtained data
equilibrium_filestype(equilibrium_file_set)inthe structure containing the file names


Module global_

...

objects

The module contains global constants and service routines used in other modules.

Constants

    real(IDS_real), parameter :: density_unit_ratio = 1.e6_IDS_real, &
                               & velocity_unit_ratio = 1.e-2_IDS_real, &
                               & temperature_unit_ratio = 1._IDS_real, &
                               & Bfield_unit_ratio = 1._IDS_real
    real(IDS_real), parameter :: length_unit_ratio = 1.e-2_IDS_real

Each of these constants is the ratio of an EIRENE unit to the corresponding IMAS unit (for example, 1 cm / 1 m = 10^(-2) for length).

Methods

  • read_next_line
    Return the next file record not starting with '!'.
  • get_imas_version
    Get the versions of IMAS and IMAS Access Layer from the system environment.

??????????????

Module imas_controls_for_input

...