Versions Compared

Key

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

...

FILES

CONTENT

​triangular_grid_module.f90

Module that supports reading, writing and processing triangular grids

triangular_grid_ids_io.f90Module supporing supporting the storage of triangular grids in IMAS
imas_data_io.f90Module supporing supporting the storage of physical quantities (tallies) in IMAS
eirene_data_io.f90Module supporing supporting reading / writing of EIRENE data files
edge_profiles_io.f90Module that supports placing the data to the 'edge_profiles' IDS
equilibrium_io.f90Module that supports placing the data to the 'equilibrium' IDS
imas_controls_for_input.f90Module that works with the parameter files (the files controlling the work of the programs)
global_parameters.f90Module that holds constants and some service routines
save_input_main.f90Main file of the program save_input.exe
provide_input_main.f90Main file of the program provide_input.exe
MakefileUsed to compile the programs
save_input.parA template parameter file for the program save_input.exe
provide_input.parA template parameter file for the program provide_input.exe
soledge3x.npco_charTriangular grid example received from the EIRENE team
soledge3x.elementeAnother file of this example
soledge3x.neighborAnother file of this example
Te.dat, nT.dat, TT.dat, nD.dat, TD.datSample files supposed to contain the temperature and density of electrons, D ions and T ions
Btotal.dat, bx.dat, by.dat, bz.datSample files supposed to contain the strength and components of the magnetic field
README.txtBrief description of how to compile and run
user_guide.pdfPDF version of this document

...

You can use the prepared data files (the files soledge3x.npco_char, soledge3x.elemente, soledge3x.neighbor, and the files with the suffix '.dat'). Admittedly, the dat-files have no physical sense and were created with the only aim to check the corectness correctness of input/output operations. 

  1. Copy the files to your directory. 
  2. If you wish to test the programs with your own files, copy them to the same direcctorydirectory. Do not forget to put the correct names to the command file save_input.par.
  3. Load the IMAS library by typing:
    module load imasenv/3.37.0    
  4. Create the IMAS database entry:
    imasdb eirene 
  5. Now you can compile the examples. Type
    make clean 
    make save_input 
  6. Run the program:
    ./save_input.exe 
    The program puts the grid stored in the files soledge3x.* and the content of the dat-files into the IMAS database  eirene .
  7. Type
    make provide_input 
  8. Run the program:
    ./provide_input.exe 
  9. Compare the new files  eirene.*   with the original files  soledge3x.* and the original data files with the new files (their names end with the suffix '_input.dat').

...

! Parameters that control saving the EIRENE input to IMAS.
! Use '!' when inserting comment lines.
! You can add comments at the end of each line unless this line holds a text that may contain blanks (e.g., a description field).
! Do not change the order of the parameters.
!
eirene                                         <= IMAS database
10003                                         <= shot
1                                                <= run
'IDS created to test EIRENE input storage'     <= IDS comment
'Yurii Yakovenko'                          <= input provider
'once upon a time'                       <= creation date
!!! grid data
"SN"                                         <= grid name
4                                              <= grid index in dictionary (single null)
"EIRENE grid for single null configuration"  <= grid description
"primary_standard"                 <= poloidal space name
"primary poloidal triangular grid" <= poloidal space description
soledge3x.npco_char                <= grid node file
soledge3x.elemente                 <= grid triangle file
soledge3x.neighbors                <= grid neighbor file
!!! Physical quantities
bx.dat       <= bx file
by.dat       <= by file
bz.dat       <= bz file
Btotal.dat   <= Btotal file
vx.dat       <= vx file
vy.dat       <= vy file
vz.dat      <= vz file
Te.dat       <= Te file
!!! Ion physical quantities
2           <= Number of ion species
! Ion species 1
D  2  1  1  <= label, mass, Z_ion, Z_element
TD.dat      <= temperature file
nD.dat      <= density file
! Ion species 2
T  3  1  1  <= label, mass, Z_ion, Z_element
TT.dat      <= temperature file
nT.dat      <= density file

A tempalate template of the file provide_input.par that controls the program provide_input.exe is as follows:

! 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 of created files
!!! Names of created files: grid data
eirene.nodes                <= grid node file
eirene.triangles            <= grid triangle file
eirene.neighbors          <= grid neighbor file
!!! Physical Names of created files: 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

...

The file describing the boundaries and neighbours of the triangles in terms of its vertices (soledge3x.neighbor  in the provided example) has the following structure. The line 1 contains the number of triangles. Each following line contains 12 integers:
triangle index, N1, S1, M1, N2, S2, M2, N3, S3, M3,  ixtri   ,  iytri .

Here Ni  is the index of the neighbouring triangle on side i, Si  is the index of this side in the triangle Ni, Mi  is the ‘material property’ of the side i,   ixtri  and  iytri  are not used now (they are zeros in this example). Note that side 1 connects vertices 1 and 2; side 2, vertices 2 and 3; side 3, vertices 3 and 1. The material property (MP) is an index referring to a surface model defined in the main EIRENE file. In particular, MP is 0 for transparent (i.e., internal) grid edges. The MP of boundary edges can have different positive values. In the provides example, there are boundary edges with MP = 1, 2, 3.

...

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


EIRENE input wrappers

Now the subroutines are united in wrapper programs, but, if desired, they can be incorporated into the code. 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

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)') TL 
        READ (IFILE,'(A72)') TL
        READ (IFILE,'(A72)') T1
        READ (IFILE,'(A24)') T2
        READ (IFILE,'(A24)') T3
        READ (IFILE,'(A72)') TL
        READ (IFILE,'(A72)') TL
        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 extra array element No. NR usually contains the average over all cells. 

??????????

 Module eirene_data_io

This module provides tools for dealing with files containing EIRENE input data.

 Data types provided

type eirene_data
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 present                   ! Shows if extra_data is filled
end type eirene_data

...