Definition of variable
Returns dimension of variable
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(variable_t), | intent(in) | :: | self |
Instance of the type |
Returns pointer to halo field located at plane=plane+ihalo
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(variable_t), | intent(inout), | target | :: | self |
Instance of the type |
|
| type(comm_handler_t), | intent(in) | :: | comm_handler |
Communicators |
||
| integer, | intent(in) | :: | ihalo |
Displacement to plane, where information is fetched from |
Pointer to halo field
Initialises variable
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(variable_t), | intent(inout) | :: | self |
Instance of the type |
||
| type(comm_handler_t), | intent(in) | :: | comm_handler |
Communicators |
||
| integer, | intent(in) | :: | ndim |
Dimension of variable |
||
| logical, | intent(in) | :: | staggered |
Indicates if variable is defined on staggered or canonical grid WILL BE REMOVED |
||
| real(kind=GP), | intent(in), | optional, | dimension(ndim) | :: | init_vals |
Values for initialisation if present, otherwise will be initialised with zeros |
Allocates halo fields
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(variable_t), | intent(inout), | target | :: | self |
Instance of the type |
|
| type(comm_handler_t), | intent(in) | :: | comm_handler |
Communicators |
||
| integer, | intent(in) | :: | nhalo_fwd |
Number of halo planes in the forward direction |
||
| integer, | intent(in) | :: | nhalo_bwd |
Number of halo planes in the backward direction |
Starts communication of halo fields
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(variable_t), | intent(inout) | :: | self |
Instance of the type |
||
| type(comm_handler_t), | intent(in) | :: | comm_handler |
Communicators |
||
| integer, | intent(in), | optional | :: | step |
Only starts communication to get data from plane+step If not present, communication over all halos is performed |
Finalizes communication of halos
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(variable_t), | intent(inout) | :: | self |
Instance of the type |
||
| type(comm_handler_t), | intent(in) | :: | comm_handler |
Communicators |
||
| integer, | intent(in), | optional | :: | step |
Only finalizes communication that gets data from plane+step If not present, communication over all halos is finalized |
Sets Gaussian in (R, phi, Z) for variable data
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(variable_t), | intent(inout) | :: | self |
Instance of the type |
||
| type(mesh_cart_t), | intent(in) | :: | mesh |
Mesh within poloidal plane (canonical or staggered) |
||
| real(kind=GP), | intent(in) | :: | x0 |
x-coordinate of center of blob |
||
| real(kind=GP), | intent(in) | :: | y0 |
y-coordinate of center of blob |
||
| real(kind=GP), | intent(in) | :: | phi0 |
phi-coordinate of center of blob |
||
| real(kind=GP), | intent(in) | :: | wx |
Gaussian width of blob in x-direction |
||
| real(kind=GP), | intent(in) | :: | wy |
Gaussian width of blob in y-direction |
||
| real(kind=GP), | intent(in) | :: | wphi |
Gaussian width of blob in toroidal phi-direction A delta peak on first plane is assumed if width is set to zero |
||
| real(kind=GP), | intent(in) | :: | amp |
Amplitude of blob |
Sets Gaussian in (R, parallel, Z) for variable data, aligned along magnetic field
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(variable_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 (canonical or staggered) |
||
| real(kind=GP), | intent(in) | :: | x0 |
x-coordinate of center of blob |
||
| real(kind=GP), | intent(in) | :: | y0 |
y-coordinate of center of blob |
||
| real(kind=GP), | intent(in) | :: | phi0 |
phi-coordinate of center of blob |
||
| real(kind=GP), | intent(in) | :: | wx |
Gaussian width of blob in x-direction |
||
| real(kind=GP), | intent(in) | :: | wy |
Gaussian width of blob in y-direction |
||
| real(kind=GP), | intent(in) | :: | wpar |
Gaussian width of blob in toroidal phi-direction A delta peak is assumed if width is set to zero |
||
| real(kind=GP), | intent(in) | :: | amp |
Amplitude of blob |
Writes variable to NETCDF file
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(variable_t), | intent(in) | :: | self |
Instance of the type |
||
| type(comm_handler_t), | intent(in) | :: | comm_handler |
MPI communication handler |
||
| integer, | intent(in) | :: | fgid |
NETCDF file or group id |
||
| character(len=*), | intent(in) | :: | varname |
Name for variable for identification in NETCDF file |
Reads variable from NETCDF file Note: This routine only works yet for axisymmetric conditions, but not for 3D geometries
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(variable_t), | intent(out) | :: | self |
Instance of the type |
||
| type(comm_handler_t), | intent(in) | :: | comm_handler |
MPI communication handler |
||
| integer, | intent(in) | :: | fgid |
NETCDF file or group id |
||
| character(len=*), | intent(in) | :: | varname |
Name for variable for identification in NETCDF file |
Frees memory associated with variable
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(variable_t), | intent(inout) | :: | self |
Instance of the type |
Datatype for variable_t
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=GP), | public, | allocatable, dimension(:) | :: | vals |
Values of variable |
||
| real(kind=GP), | public, | dimension(:), pointer | :: | hfwd | => | null() |
Pointer to halos_fwd(:,1), simplifies call of parallel operators |
| real(kind=GP), | public, | dimension(:), pointer | :: | hbwd | => | null() |
Pointer to halos_bwd(:,1), simplifies call of parallel operators |
| final :: destructor |
| procedure , public :: get_ndim Interface | |
| procedure , public :: init => init_variable Interface | |
| procedure , public :: create_halos Interface | |
| procedure , public :: get_halo Interface | |
| procedure , public :: start_comm_halos Interface | |
| procedure , public :: finalize_comm_halos Interface | |
| procedure , public :: set_blob_toroidal Interface | |
| procedure , public :: set_blob_aligned Interface | |
| procedure , public :: write_netcdf => write_netcdf_variable Interface | |
| procedure , public :: read_netcdf => read_netcdf_variable Interface |