V3FIT
Data Types | Functions/Subroutines | Variables
bmw_context Module Reference

Defines the base class of the type bmw_context_class. This contains the state variables needed by BMW. More...

Data Types

type  bmw_context_class
 Base class representing a bmw context. This contains all memory needed to operate bmw. More...
 
interface  bmw_context_set_up_grid
 Interface to set the unprimed grid. More...
 

Functions/Subroutines

type(bmw_context_class) function, pointer bmw_context_construct (mgrid_file_name, wout_file_name, siesta_file_name, flags, num_p, parallel, io_unit)
 Construct a bmw_context_class object. More...
 
subroutine bmw_context_destruct (this)
 Deconstruct a bmw_context_class object. More...
 
subroutine bmw_context_set_up_grid_m (this, p_start, p_end, parallel, io_unit)
 Set the unprimed grid. More...
 
subroutine bmw_context_set_up_grid_a (this, r_grid, z_grid, dphi, parallel, io_unit)
 Set the unprimed grid. More...
 
subroutine bmw_context_init_nc (this, result_file_name, parallel)
 
subroutine bmw_context_write (this, result_file_name, parallel)
 Write NetCDF based result file. More...
 

Variables

integer, parameter series = 2
 Version number.
 

Detailed Description

Defines the base class of the type bmw_context_class. This contains the state variables needed by BMW.

Function/Subroutine Documentation

◆ bmw_context_construct()

type (bmw_context_class) function, pointer bmw_context::bmw_context_construct ( character (len=*), intent(in)  mgrid_file_name,
character (len=*), intent(in)  wout_file_name,
character (len=*), intent(in)  siesta_file_name,
integer, intent(in)  flags,
integer, intent(inout)  num_p,
type (bmw_parallel_context_class), intent(in)  parallel,
integer, intent(in)  io_unit 
)

Construct a bmw_context_class object.

Allocates memory and initializes a bmw_context_class object.

Parameters
[in]mgrid_file_namePath and name of the mgrid file.
[in]wout_file_namePath and name of the wout file.
[in]siesta_file_namePath and name of the siesta file.
[in]flagsOption flags.
[in]num_pNumber of phi planes per field period.
[in]parallelbmw_parallel_context_class object instance.
[in]io_unitUnit number to write messages to.
Returns
A pointer to a constructed bmw_context_class object.

Definition at line 72 of file bmw_context.f.

◆ bmw_context_destruct()

subroutine bmw_context::bmw_context_destruct ( type (bmw_context_class), pointer  this)

Deconstruct a bmw_context_class object.

Deallocates memory and uninitializes a bmw_context_class object.

Parameters
[in,out]thisA bmw_context_class instance.

Definition at line 140 of file bmw_context.f.

◆ bmw_context_init_nc()

subroutine bmw_context::bmw_context_init_nc ( type (bmw_context_class), intent(in)  this,
character (len=*), intent(in)  result_file_name,
type (bmw_parallel_context_class), intent(in)  parallel 
)

Initialize NetCDF based result file.

If a result file already exists, open it. If a previous result file does not already exist create a new one.

Parameters
[in]thisA bmw_context_class instance.
[in]result_file_nameNetCDF file id of the result file.
[in]parallelbmw_parallel_context_class object instance.

Definition at line 294 of file bmw_context.f.

◆ bmw_context_set_up_grid_a()

subroutine bmw_context::bmw_context_set_up_grid_a ( type (bmw_context_class), intent(inout)  this,
real (rprec), dimension(:,:,:), intent(in)  r_grid,
real (rprec), dimension(:,:,:), intent(in)  z_grid,
real (rprec), intent(in)  dphi,
type (bmw_parallel_context_class), intent(in)  parallel,
integer, intent(in)  io_unit 
)

Set the unprimed grid.

This initializes the unprimed file using supplied grid as the unprimed grid.

Parameters
[in,out]thisA bmw_context_class instance.
[in]r_grid3D Array of r positions.
[in]z_grid3D Array of z positions.
[in]dphiPhi grid spacing.
[in]parallelbmw_parallel_context_class object instance.
[in]io_unitUnit number to write messages to.
Returns
A pointer to a constructed bmw_context_class object.

Definition at line 225 of file bmw_context.f.

◆ bmw_context_set_up_grid_m()

subroutine bmw_context::bmw_context_set_up_grid_m ( type (bmw_context_class), intent(inout)  this,
integer, intent(in)  p_start,
integer, intent(in)  p_end,
type (bmw_parallel_context_class), intent(in)  parallel,
integer, intent(in)  io_unit 
)

Set the unprimed grid.

This initializes the unprimed file using the mgrid grid as the unprimed grid.

Parameters
[in,out]thisA bmw_context_class instance.
[in]p_startStarting phi index to compute fields to.
[in]p_endEnding phi index to compute fields to.
[in]parallelbmw_parallel_context_class object instance.
[in]io_unitUnit number to write messages to.
Returns
A pointer to a constructed bmw_context_class object.

Definition at line 184 of file bmw_context.f.

◆ bmw_context_write()

subroutine bmw_context::bmw_context_write ( type (bmw_context_class), intent(in)  this,
character (len=*), intent(in)  result_file_name,
type (bmw_parallel_context_class), intent(in)  parallel 
)

Write NetCDF based result file.

Defines dimensions and variables for the BMW result file. Flat internal arrays need to be reshaped to the dimension.

Parameters
[in]thisA bmw_context_class instance.
[in]result_file_nameNetCDF file id of the result file.
[in]parallelbmw_parallel_context_class object instance.

Definition at line 319 of file bmw_context.f.