Versions Compared

Key

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

...

The wrapper program contained in the file  save_input_main .f90  performs the following actions:

  • ????????      Initializes an instance of the  edge_profiles   IDS in the code memory with writing some mandatory fields.
  • Writes some labels to the IDS.
  • Allocates the  grid_ggd  AOS with only one elementReads the command file 'save_input.par', putting its content to the structures 'imas_controls', 'grid_controls', 'equilibrium_files', and 'edge_profiles_data'.
  • 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.
  • Inputs distributions of input tallies from data files, invoking the functions 'collect_data_for_edge_profiles_input' and 'collect_data_for_equilibrium_input'.
  • Creates an IMAS database entry, invoking the IMAS library subroutine 'imas_create_env'.
  • Puts the information (the grid and the tallies) into 2 IMAS IDS's, using the subroutines  'save_input_to_edge_profiles' and 'save_input_to_equilibrium'. 
  • Closes the database, invoking the IMAS library subroutine 'imas_close'.
  • Deallocates the structures holding the dataWrites the IDS prepared in the code memory to the IMAS database and closes the database.

The program contained in the file  recoverprovide_input_gridmain.f90  performs the following actions:

  • Reads the command file 'provide_input.par', putting its content to the structures 'imas_controls', 'grid_controls', and 'equilibrium_files'.
  • Opens the IMAS database by calling , invoking the IMAS library subroutine  imas_open_env  .
  • Reads the IMAS IDS  edge_profiles, using the subroutine  ids_get .
  • Extracts the information about the grid from the IDS and puts it into a  type(triangular_grid)-structure, using the subroutine  get_triangular_grid_from_ids  (module  triangular_grid_ids_io).
  • Writes the grid to EIRENE-format files (subroutine  write_eirene_grid, module  triangular_grid_module).
  • Closes the IMAS database
  • Inputs the data (the grid and the tallies) from 2 IMAS IDS's, using the subroutines  'fetch_input_from_edge_profiles' and 'fetch_input_from_equilibrium'.
  • Writes these data to EIRENE-format files, invoking the subroutines 'write_eirene_grid', 'write_input_data_from_edge_profiles_ids', and 'write_input_data_from_equilibrium_ids'.
  • Closes the database, invoking the IMAS library subroutine 'imas_close'.
  • Deallocates the structures holding the data.

The statements that are to deallocate the IDS's in the program memory when they are not needed anymore are now commented out (they are in the modules 'edge_profiles_io' and 'equilibrium_io'). The reason is that the IMAS library subroutine 'ids_deallocate' hangs the program 'save_input.exe' if it is called for both IDS's ('edge_profiles' and 'equilibrium'). This issue is yet to be resolved.

Things to be done

  • Code parameters
  • Headers of data files
  • Generalize to multi-atom ions
  • Resolve the issue with non-deallocated structures
  • Implement ion velocities (after IMAS 3.38 appears)
  • Extend the list of input quantities
  • IMASification of the EIRENE output
  • Try to adjust the processing of exceptions to GSL practices (if worthwhile)

...