Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=:), | public, | allocatable | :: | type_name |
Name of the specific implementation |
||
logical, | public | :: | initialised | = | .false. |
Has this instance been initialised |
|
logical, | public | :: | has_full_theta_range | = | .false. |
Does this implementation have the full or half theta grid? If only half then we assume up-down symmetry and use this to set gradients etc. |
|
integer, | public | :: | nr |
Typically the number of radial and theta grid points. |
|||
integer, | public | :: | nt |
Typically the number of radial and theta grid points. |
|||
real, | public | :: | psi_0 | ||||
real, | public | :: | psi_a | ||||
real, | public | :: | B_T | ||||
real, | public | :: | beta_0 | ||||
real, | public | :: | R_mag | ||||
real, | public | :: | Z_mag | ||||
real, | public | :: | aminor | ||||
real, | public, | allocatable, dimension(:,:) | :: | R_psi |
2D map of co-ordinates to R, Z or B |
||
real, | public, | allocatable, dimension(:,:) | :: | Z_psi |
2D map of co-ordinates to R, Z or B |
||
real, | public, | allocatable, dimension(:,:) | :: | B_psi |
2D map of co-ordinates to R, Z or B |
||
real, | public, | allocatable, dimension(:,:) | :: | eqth |
2D maps of theta and eqpsi |
||
real, | public, | allocatable, dimension(:,:) | :: | eqpsi_2d |
2D maps of theta and eqpsi |
||
real, | public, | allocatable, dimension (:,:,:) | :: | dpcart |
Minor radius gradient in cylindrical coordinates |
||
real, | public, | allocatable, dimension (:,:,:) | :: | dtcart |
Theta gradient in cylindrical coordinates |
||
real, | public, | allocatable, dimension (:,:,:) | :: | dbcart |
B gradient in cylindrical coordinates |
||
real, | public, | allocatable, dimension (:,:,:) | :: | dpbish |
Minor radius gradient in Bishop coordinates |
||
real, | public, | allocatable, dimension (:,:,:) | :: | dtbish |
Theta gradient in Bishop coordinates |
||
real, | public, | allocatable, dimension (:,:,:) | :: | dbbish |
B gradient in Bishop coordinates |
||
real, | public, | allocatable, dimension(:) | :: | eqpsi |
Equilibrium psi (not normalised) and pressure grids |
||
real, | public, | allocatable, dimension(:) | :: | pressure |
Equilibrium psi (not normalised) and pressure grids |
||
real, | public, | allocatable, dimension(:) | :: | psi_bar |
Normalised psi, fp, q, beta, diameter and R_centre values on grid |
||
real, | public, | allocatable, dimension(:) | :: | fp |
Normalised psi, fp, q, beta, diameter and R_centre values on grid |
||
real, | public, | allocatable, dimension(:) | :: | qsf |
Normalised psi, fp, q, beta, diameter and R_centre values on grid |
||
real, | public, | allocatable, dimension(:) | :: | beta |
Normalised psi, fp, q, beta, diameter and R_centre values on grid |
||
real, | public, | allocatable, dimension(:) | :: | diam |
Normalised psi, fp, q, beta, diameter and R_centre values on grid |
||
real, | public, | allocatable, dimension(:) | :: | rc |
Normalised psi, fp, q, beta, diameter and R_centre values on grid |
||
character(len=EQFILE_LENGTH), | public | :: | filename | ||||
type(spline), | public | :: | btori_spl | ||||
type(spline), | public | :: | qsf_spl | ||||
type(spline), | public | :: | pressure_spl | ||||
type(spline), | public | :: | beta_spl | ||||
type(spline), | public | :: | diam_spl | ||||
type(spline), | public | :: | rcenter_spl | ||||
integer, | public | :: | nw | ||||
integer, | public | :: | nh | ||||
real, | public, | allocatable, dimension(:) | :: | thetab | |||
real, | public, | allocatable, dimension(:) | :: | r_bound | |||
real, | public, | allocatable, dimension(:) | :: | eq_R | |||
real, | public, | allocatable, dimension(:) | :: | eq_Z | |||
type(periodic_spline), | public | :: | rbound_spl | ||||
real, | private, | allocatable, dimension(:) | :: | rho_mid | |||
real, | private, | allocatable, dimension(:) | :: | psi_mid | |||
type(spline), | private | :: | rho_spl |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_geo_type), | intent(inout) | :: | self | |||
type(geo_input_type), | intent(in) | :: | inputs | |||
real, | intent(out) | :: | psi_0_out | |||
real, | intent(out) | :: | psi_a_out | |||
real, | intent(out) | :: | rmaj | |||
real, | intent(out) | :: | B_T0 | |||
real, | intent(out) | :: | avgrmid |
Calculate the derivative of rp w.r.t. R and Z and return the modulus sqrt(drp/dR ^ 2 + drp/dZ^2). I.e. return |grad rp|. Parameters are: - rgrid: Submodule radial grid (r_circ for EFIT, rp otherwise) - theta: grid of theta - gradf(:,1): |grad psi| - gradf(:,2): 0.0 - char: if char = 'R', return |grad pressure| instead - char: if char = 'T', then return theta gradient in bishop form - gradf(:,1): (dtheta/dZ d rp/dR - dtheta/dR drp/dZ)/ |grad rp| - gradf(:,2): (dtheta/dR d rp/dR + dtheta/dZ drp/dZ)/ |grad rp| - rp: value of rp on the flux surface where we want the grad - nth: number of theta points - ntgrid: lower index of theta array is -ntgrid
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_geo_type), | intent(in) | :: | self | |||
real, | intent(in), | dimension (-ntm:) | :: | rgrid | ||
real, | intent(in), | dimension (-ntm:) | :: | theta | ||
real, | intent(out), | dimension (-ntm:,:) | :: | grad | ||
character(len=1), | intent(in) | :: | char | |||
real, | intent(in) | :: | rp | |||
integer, | intent(in) | :: | nth_used | |||
integer, | intent(in) | :: | ntm | |||
logical, | intent(in) | :: | use_bishop |
Given theta, R, Z, B and psi on 2D grids calculate the index space derivatives in the two grid dimensions and use these to find gradients in cartesian and Bishop space.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_geo_type), | intent(inout) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_geo_type), | intent(in) | :: | self | |||
real, | intent(in) | :: | r | |||
real, | intent(in) | :: | theta |
Convert gradients of a function f w.r.t. R,Z into bishop form.
Note that dbish(1, :, :)
is not valid
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_geo_type), | intent(in) | :: | self | |||
real, | intent(in), | dimension(:, :, :) | :: | dcart |
dcart(:,:,1) is gradient of f w.r.t. R; dcart(:,:,2) is gradient of f w.r.t. Z |
|
real, | intent(in), | dimension(:, :, :) | :: | dpcart |
dcart(:,:,1) is gradient of f w.r.t. R; dcart(:,:,2) is gradient of f w.r.t. Z |
|
real, | intent(out), | dimension(:, :, :) | :: | dbish |
dbish(:,:,1) is set to (df/dR dpsi/dR + df/dZ dpsi/dZ)/|grad psi|; dbish(:,:,2) is set to (-df/dR dpsi/dZ + df/dZ dpsi/dR)/|grad psi|. Note that in the special case where f=psi: dbish(:,:,1) is |grad psi|; dbish(:,:,2) is 0 |
Converts derivatives w.r.t. (psi_index,theta_index) to derivatives
w.r.t. (R,Z). Note that dfcart(1, :, :)
is not valid
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_geo_type), | intent(in) | :: | self | |||
real, | intent(in), | dimension (:,:,:) | :: | dfm |
dfm(:,:,1) is deriv w.r.t. psi_index (i.e. (df/dpsi)_theta * delta psi); dfm(:,:,2) is deriv w.r.t. theta_index |
|
real, | intent(in), | dimension (:,:,:) | :: | drm |
dfm(:,:,1) is deriv w.r.t. psi_index (i.e. (df/dpsi)_theta * delta psi); dfm(:,:,2) is deriv w.r.t. theta_index |
|
real, | intent(in), | dimension (:,:,:) | :: | dzm |
dfm(:,:,1) is deriv w.r.t. psi_index (i.e. (df/dpsi)_theta * delta psi); dfm(:,:,2) is deriv w.r.t. theta_index |
|
real, | intent(out), | dimension (:,:,:) | :: | dfcart |
dfcart(:,:,1) is deriv w.r.t. R; dfcart(:,:,2) is deriv w.r.t. Z |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_geo_type), | intent(inout) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_geo_type), | intent(inout) | :: | self |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_geo_type), | intent(in) | :: | self | |||
real, | intent(in) | :: | a |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_geo_type), | intent(inout) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_geo_type), | intent(inout) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_geo_type), | intent(inout) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_eqfile_geo_type), | intent(inout) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_eqfile_geo_type), | intent(inout) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_eqfile_geo_type), | intent(inout) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_eqfile_geo_type), | intent(inout) | :: | self |
at the given normalised
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_eqfile_geo_type), | intent(in) | :: | self | |||
real, | intent(in) | :: | pbar |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_eqfile_geo_type), | intent(in) | :: | self | |||
real, | intent(in) | :: | pbar |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_eqfile_geo_type), | intent(in) | :: | self | |||
real, | intent(in) | :: | pbar |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_eqfile_geo_type), | intent(in) | :: | self | |||
real, | intent(in) | :: | pbar |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_eqfile_geo_type), | intent(in) | :: | self | |||
real, | intent(in) | :: | pbar |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_eqfile_geo_type), | intent(in) | :: | self | |||
real, | intent(in) | :: | pbar |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_eqfile_cart_geo_type), | intent(inout) | :: | self | |||
integer, | intent(in) | :: | nw_in | |||
integer, | intent(in) | :: | nh_in | |||
real, | intent(in), | dimension(:) | :: | spsi_bar | ||
real, | intent(in), | dimension(:) | :: | sefit_R | ||
real, | intent(in), | dimension(:) | :: | sefit_Z | ||
real, | intent(in), | dimension(:) | :: | f | ||
real, | intent(in), | dimension(:) | :: | p | ||
real, | intent(in), | dimension(:) | :: | q | ||
real, | intent(in), | dimension(:, :) | :: | sefit_psi | ||
integer, | intent(in) | :: | nbbbs | |||
real, | intent(inout), | dimension(:) | :: | rbbbs | ||
real, | intent(inout), | dimension(:) | :: | zbbbs | ||
real, | intent(in) | :: | bcentr | |||
real, | intent(in) | :: | rleft | |||
real, | intent(in) | :: | rwid | |||
real, | intent(in) | :: | zoffset | |||
real, | intent(in) | :: | zhei | |||
integer, | intent(in) | :: | big | |||
logical, | intent(in) | :: | calc_aminor |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_eqfile_cart_geo_type), | intent(in) | :: | self | |||
real, | intent(in) | :: | x1 | |||
real, | intent(in) | :: | x2 | |||
real, | intent(in) | :: | rootval | |||
real, | intent(in) | :: | thetroot | |||
real, | intent(in) | :: | tol |
Returns the distance to the magnetic axis as a function of rp (the normalised poloidal flux variable) and theta.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_eqfile_cart_geo_type), | intent(in) | :: | self | |||
real, | intent(in) | :: | r | |||
real, | intent(in) | :: | theta |
Find the value of the major radius on the plasma boundary at given geometric theta.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_eqfile_cart_geo_type), | intent(in) | :: | self | |||
real, | intent(in) | :: | theta |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_eqfile_cart_geo_type), | intent(in) | :: | self | |||
real, | intent(in) | :: | r | |||
real, | intent(in) | :: | theta |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_eqfile_cart_geo_type), | intent(in) | :: | self | |||
real, | intent(in) | :: | r | |||
real, | intent(in) | :: | theta |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_eqfile_cart_geo_type), | intent(in) | :: | self | |||
real, | intent(in) | :: | r | |||
real, | intent(in) | :: | theta |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_eqfile_cart_geo_type), | intent(in) | :: | self | |||
real, | intent(in) | :: | rp |
fstar is f(R,Z) interpolated at the values (r,thetain). The parameter r is the distance to the magnetic axis.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_eqfile_cart_geo_type), | intent(in) | :: | self | |||
real, | intent(in) | :: | r_in | |||
real, | intent(in) | :: | theta_in | |||
real, | intent(in), | dimension(:, :) | :: | f | ||
character(len=1), | intent(in) | :: | char |
Calculate the derivative of f w.r.t. R, Z - dfm(:,:,1) is deriv w.r.t. R - dfm(:,:,2) is deriv w.r.t. Z
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_eqfile_cart_geo_type), | intent(in) | :: | self | |||
real, | intent(in), | dimension(:,:) | :: | f | ||
real, | intent(out), | dimension(:,:,:) | :: | dfm | ||
character(len=1), | intent(in) | :: | char |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(deq_type), | intent(inout) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(deq_type), | intent(inout) | :: | self |
This subroutine reads an DFIT output file containing the axisymmetric magnetic field geometry on a rectangular domain defined by the coordinates (R,Z).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(deq_type), | intent(inout) | :: | self | |||
type(geo_input_type), | intent(in) | :: | inputs |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(deq_type), | intent(inout) | :: | self |
type, extends(abstract_eqfile_cart_geo_type) :: deq_type
private
real, allocatable, dimension(:) :: rho_mid, psi_mid
type(spline) :: rho_spl
contains
procedure :: read_and_set, setup_special_splines, delete_special_splines
procedure :: rcenter, rhofun, dealloc_special_arrays
end type deq_type