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. Storing the EIRENE input
    1. Structure of EIRENE input files
    2. Module eirene_data_io
      1. Data types provided
      2. Methods provided 
    3. ???
    4. Main program files  save_input_main.f90  and  provide_input_main.f90
  7. 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_gridtype(triangular_grid)resultPartly filled grid structure
grid_ggdtype(ids_generic_grid_dynamic_space), dimension(:)inSpace 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_gridtype(triangular_grid)inoutPartly filled grid structure
subsetstype(ids_generic_grid_dynamic_grid_subset), dimension(:)inSpace 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_gridtype

Argument

Type

Intent

Description

eirene_gridtype
(triangular_grid)inThe grid to be saved
grid_ggdtype(ids_generic_grid_aos3_root)
, pointer
pointerPointer to the  grid_ggd  AOS element to hold the grid

coord_type

integer

in

To be done

nSpaces

integer

in

The dimension of  space  AOS to be allocated

eirene_space_index

integer

in

Index of the triangular grid space in  space  AOS

grid_

name

identifier

character(len=*

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

Argument

Type

Intent

Description

space
eirene_gridtype(triangular_grid)inThe grid to be saved
grid_ggdtype(ids_generic_grid_dynamic
_space
)
, pointer
pointerPointer to the 
space
grid_ggd  AOS element to hold the grid

nSpaces

integer

in

The dimension of  space  AOS to be allocated

eirene_space_index

integer

in

Index of the triangular grid space in  space  AOS

grid_identifier

type(

triangular_grid

ids_identifier_dynamic_aos3)

in

The grid

Grid identifier to be

saved

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

subset
spacestype(ids_generic_grid_dynamic_
grid_subset
space), dimension(:), pointer
pointer
resultPointer to the
  grid_subset  AOS element to hold the subset
allocated and filled 'space' AoS
grid
space
type(
ids
triangular_
generic_
grid
_dynamic_space
)
, pointer
pointer
in

Pointer to the  space  AOS element holding the triangular grid space

The grid to be saved

nSpaces

integer

in

The dimension of  space  AOS to be allocated

eirene_space_index

integer

in

Index of the triangular grid space in

the

  space  AOS

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

subsetspacetype(ids_generic_grid_dynamic_grid_subsetspace), pointer

pointer

Pointer to the  grid_subset  AOS element to hold the subset

space

type(ids_generic_grid_dynamic_space), pointer

pointer

resultIDS space structure holding the grid
gridtype(triangular_grid)inThe grid to be saved

space_name

character(len=*)

in

Name assigned to Pointer to the  space  AOS element holding the triangular grid space

space_indexintegerdescription

character(len=*)

in

Index Verbose description of the triangular grid space in the  space  AOS

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

subsetstype(ids_generic_grid_dynamic_grid_subset), pointer, dimension(:)resultIDS space structure holding the grid
eirene_spacetype(ids_generic_grid_dynamic_space)
the GGD grid space to which the subsets are attached
eirene_space_indexintegerinthe index of this space in the 'space' AoS
gridtype(triangular_grid)inThe 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  grid_subset  AOS element to hold the subset

space

type(ids_generic_grid_dynamic_space)

in

The  space  AOS element holding the triangular grid space

space_index

integer

in

Index of the triangular grid space in the  space  AOS

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  grid_subset  AOS element to hold the subset

space

type(ids_generic_grid_dynamic_space)

in

The  space  AOS element holding the triangular grid space

space_index

integer

in

Index of the triangular grid space in the  space  AOS

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  grid_subset  AOS element to hold the subset

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 subroutine  setIDSFundamentals  (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 (module  triangular_grid_module).
  • Puts the grid information into the IDS, using the  put_triangular_grid_to_ids  subroutine (module  triangular_grid_ids_io).
  • Creates the corresponding IDS in an IMAS database, using the  createIDS  subroutine (module  ids_utility).
  • Writes the IDS prepared in the code memory to the IMAS database and closes the database, using the subroutine  putIDS  (module  ids_utility).

...