iol_source_m Module

Compute ion orbit loss source/sink coupling to ion-orbit-loss-standalone see https://gitlab.mpcdf.mpg.de/phoenix/ion-orbit-loss-standalone [R.W. Brzozowski III, Phys. Plasmas 26:042511 (2019), https://doi.org/10.1063/1.5075613]


Uses


Contents


Interfaces

interface

  • public module subroutine init_iol(self, filename, equi, mesh, polars)

    Initialises IOL source

    Arguments

    Type IntentOptional Attributes Name
    class(iol_source_t), intent(inout) :: self

    Instance of the type

    character(len=*), intent(in) :: filename

    Filename, to read parameters from

    class(equilibrium_t), intent(inout) :: equi

    Equilibrium

    type(mesh_cart_t), intent(in) :: mesh

    Mesh

    type(polars_t), intent(in) :: polars

    Polar grid and operators

interface

  • public module subroutine read_params_iol(self, filename, equi)

    Reads IOL parameters

    Arguments

    Type IntentOptional Attributes Name
    class(iol_source_t), intent(inout) :: self

    Instance of the type

    character(len=*), intent(in) :: filename

    Filename, to read parameters from

    class(equilibrium_t), intent(inout) :: equi

    Equilibrium

interface

  • public module subroutine grid_init(self, equi, polars)

    Initialises IOL grid ( = polar grid + extended information)

    Arguments

    Type IntentOptional Attributes Name
    class(iol_source_t), intent(inout) :: self

    Instance of the type

    class(equilibrium_t), intent(inout) :: equi

    Equilibrium

    type(polars_t), intent(in) :: polars

    Polar grid and operators

interface

  • public module subroutine spline_grid_init(self, equi, mesh, polars)

    Initialises spline grid

    Arguments

    Type IntentOptional Attributes Name
    class(iol_source_t), intent(inout) :: self

    Instance of the type

    class(equilibrium_t), intent(inout) :: equi

    Equilibrium

    type(mesh_cart_t), intent(in) :: mesh

    Mesh

    type(polars_t), intent(in) :: polars

    Polar grid and operators

interface

  • public module subroutine xplane_init(self, equi, mesh)

    Initialises xplane, i.e. horizontal plane intersecting X-point

    Arguments

    Type IntentOptional Attributes Name
    class(iol_source_t), intent(inout) :: self

    Instance of the type

    class(equilibrium_t), intent(inout) :: equi

    Equilibrium

    type(mesh_cart_t), intent(in) :: mesh

    Mesh within poloidal plane

interface

  • public module subroutine flip(self)

    Flips grids vertically to account for flipped equilibria

    Arguments

    Type IntentOptional Attributes Name
    class(iol_source_t), intent(inout) :: self

    Instance of the type

interface

  • public module subroutine driver_iol(self, comm_handler, equi, mesh, polars, tau, dtau, ne, pot, ti, src_vort, update_performed, force_no_update)

    Driver routine for computing IOL sources. Takes care of time averaging procedure, i.e. (Re-)computes IOL sources at time frames tau_average based on internal average fields. Adds contribution of fields to current internal average fields

    Arguments

    Type IntentOptional Attributes Name
    class(iol_source_t), intent(inout) :: self

    Instance of the type

    type(comm_handler_t), intent(in) :: comm_handler

    Communication handler

    class(equilibrium_t), intent(inout) :: equi

    Equilibrium

    type(mesh_cart_t), intent(inout) :: mesh

    Mesh within poloidal plane

    type(polars_t), intent(in) :: polars

    Polar grid and operators

    real(kind=GP), intent(in) :: tau

    Current time of simulation

    real(kind=GP), intent(in) :: dtau

    Timestep of simulation

    type(variable_t), intent(in) :: ne

    Electron density

    type(variable_t), intent(in) :: pot

    Electrostatic potential

    type(variable_t), intent(in) :: ti

    Ion temperature

    real(kind=GP), intent(inout), dimension(mesh%get_n_points_inner()) :: src_vort

    Vorticity source, on output with IOL contribution added

    logical, intent(out) :: update_performed

    Indicates if update of IOL source was performed

    logical, intent(in), optional :: force_no_update

    Switch that enforces that IOL source is not updated

interface

  • public module subroutine add_fields_to_averaged_internal_fields(self, comm_handler, equi, mesh, polars, ne, pot, ti)

    Adds current fields ne, pot and ti, to current internal time averaged fields used for IOL source evaluation

    Arguments

    Type IntentOptional Attributes Name
    class(iol_source_t), intent(inout) :: self

    Instance of the type

    type(comm_handler_t), intent(in) :: comm_handler

    Communication handler

    class(equilibrium_t), intent(inout) :: equi

    Equilibrium

    type(mesh_cart_t), intent(inout) :: mesh

    Mesh within poloidal plane

    type(polars_t), intent(in) :: polars

    Polar grid and operators

    type(variable_t), intent(in) :: ne

    Electron density

    type(variable_t), intent(in) :: pot

    Electrostatic potential

    type(variable_t), intent(in) :: ti

    Ion temperature

interface

  • public module subroutine update_iol_source(self, comm_handler, equi, mesh, polars)

    Internally updates the iol source with the current averaged fields Here is the interface to the IOL-standalone library see https://gitlab.mpcdf.mpg.de/phoenix/ion-orbit-loss-standalone for its interface description

    Arguments

    Type IntentOptional Attributes Name
    class(iol_source_t), intent(inout) :: self

    Instance of the type

    type(comm_handler_t), intent(in) :: comm_handler

    Communication handler

    class(equilibrium_t), intent(inout) :: equi

    Equilibrium

    type(mesh_cart_t), intent(inout) :: mesh

    Mesh within poloidal plane

    type(polars_t), intent(in) :: polars

    Polar grid and operators

interface

  • public module subroutine display_iol_source(self)

    Displays parameters for iol_source

    Arguments

    Type IntentOptional Attributes Name
    class(iol_source_t), intent(inout) :: self

    Instance of the type

interface

  • public module subroutine write_netcdf_iol_source(self, tau, fexist, fgid)

    Writes current IOL source to NETCDF file

    Arguments

    Type IntentOptional Attributes Name
    class(iol_source_t), intent(in) :: self

    Instance of the type

    real(kind=GP), intent(in) :: tau

    Timestamp of current IOL source

    logical, intent(in) :: fexist

    Indicates if file

    integer, intent(in) :: fgid

    File or group id number of existing NETCDF file

interface

  • public module subroutine read_netcdf_iol_source(self, fgid, nsnaps_req, nsnaps, tau)

    Reads IOL source from NETCDF file

    Arguments

    Type IntentOptional Attributes Name
    class(iol_source_t), intent(inout) :: self

    Instance of the type

    integer, intent(in) :: fgid

    File or group id number of existing NETCDF file

    integer, intent(in), optional :: nsnaps_req

    Number of requested snapshot

    integer, intent(out), optional :: nsnaps

    Number of snapshot returned

    real(kind=GP), intent(out), optional :: tau

    Tme stamp of snapshot

interface

  • public module subroutine write_ascii_iol_source(self, dirpath)

    Writes information of IOL to ASCII format Useful for running test case with IOL-standalone see https://gitlab.mpcdf.mpg.de/phoenix/ion-orbit-loss-standalone

    Arguments

    Type IntentOptional Attributes Name
    class(iol_source_t), intent(inout) :: self

    Instance of the type

    character(len=*), intent(in) :: dirpath

    Directory, where files are written


Derived Types

type, public ::  iol_source_t

Contains information/routines to compute ion-orbit-loss effects See interface description of ion-orbit-loss standalone routines

Finalizations Procedures

final :: destructor_iol

Type-Bound Procedures

procedure , public :: init => init_iol Interface
procedure , public :: get_init_continue Function
procedure , public :: driver => driver_iol Interface
procedure , public :: display => display_iol_source Interface
procedure , public :: write_netcdf => write_netcdf_iol_source Interface
procedure , public :: read_netcdf => read_netcdf_iol_source Interface
procedure , public :: write_ascii => write_ascii_iol_source Interface

Functions

public pure function get_init_continue(self)

Getter routine

Arguments

Type IntentOptional Attributes Name
class(iol_source_t), intent(in) :: self

Instance of the type

Return Value logical


Subroutines

public subroutine destructor_iol(self)

Deallocates stuff related with iol source

Arguments

Type IntentOptional Attributes Name
type(iol_source_t), intent(inout) :: self

Instance of the type