t_boundaryFromFile Derived Type

type, public :: t_boundaryFromFile


Inherits

type~~t_boundaryfromfile~~InheritsGraph type~t_boundaryfromfile t_boundaryFromFile type~t_ncfile t_ncfile type~t_boundaryfromfile->type~t_ncfile nc

Components

Type Visibility Attributes Name Initial
logical, public :: initialized = .FALSE.

set to true in init, set to false in free

integer, public :: nfp

number of field periods

integer, public :: m_max

maximum number of fourier modes of the boundary in theta direction

integer, public :: n_max

maximum number of fourier modes of the boundary in zeta direction (one field period only!)

integer, public :: ntheta

number of interpolation points in theta and zeta (one field period, half grid!!)

integer, public :: nzeta

number of interpolation points in theta and zeta (one field period, half grid!!)

integer, public :: lasym

=0: symmetric, =1: asymmetric fourier series

real(kind=wp), public, ALLOCATABLE :: theta(:)

theta positions [0,2pi), should be half grid!

real(kind=wp), public, ALLOCATABLE :: zeta(:)

zeta positions [0,2pi/nfp) should be on half grid!

real(kind=wp), public, ALLOCATABLE :: X(:,:)

boundary data X/Y positions X[i, j]=X(theta[i],zeta[j]), Y[i, j]=Y(theta[i],zeta[j]), i=0...ntheta-1,j=0...nzeta-1

real(kind=wp), public, ALLOCATABLE :: Y(:,:)

boundary data X/Y positions X[i, j]=X(theta[i],zeta[j]), Y[i, j]=Y(theta[i],zeta[j]), i=0...ntheta-1,j=0...nzeta-1

class(t_ncfile), public, ALLOCATABLE :: nc

container for netcdf-file

character(len=1024), public :: ncfile = " "

name of netcdf file with axis information


Type-Bound Procedures

procedure, public :: init => bff_init

  • private subroutine bff_init(sf, fileString)

    initialize class: read file and save data to class structure

    Arguments

    Type IntentOptional Attributes Name
    class(t_boundaryFromFile), intent(inout) :: sf

    self

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

procedure, public :: convert_to_modes => bff_convert_to_modes

  • private subroutine bff_convert_to_modes(sf, x1_fbase_in, x2_fbase_in, X1_b, X2_b, scale_minor_radius)

    convert from interpolation points X=> X1_b, Y=> X2_b to fourier modes, given from the input fbase convert to maximum allowable number of modes (ntheta>=2m_max+1, nzeta>=2n_max+1) the final m_max/n_max can be smaller or larger. If larger, a change of base is necessary

    Arguments

    Type IntentOptional Attributes Name
    class(t_boundaryFromFile), intent(inout) :: sf

    self

    type(t_fBase), intent(in) :: x1_fbase_in
    type(t_fBase), intent(in) :: x2_fbase_in
    real(kind=wp), intent(inout) :: X1_b(x1_fbase_in%modes)
    real(kind=wp), intent(inout) :: X2_b(x2_fbase_in%modes)
    real(kind=wp), intent(in) :: scale_minor_radius

procedure, public :: free => bff_free

  • private subroutine bff_free(sf)

    Arguments

    Type IntentOptional Attributes Name
    class(t_boundaryFromFile), intent(inout) :: sf

    self

Source Code

TYPE                 :: t_boundaryFromFile
  !---------------------------------------------------------------------------------------------------------------------------------
  LOGICAL              :: initialized=.FALSE.      !! set to true in init, set to false in free
  !---------------------------------------------------------------------------------------------------------------------------------
  INTEGER              :: nfp           !! number of field periods
  INTEGER              :: m_max         !! maximum number of fourier modes of the boundary in theta direction
  INTEGER              :: n_max         !! maximum number of fourier modes of the boundary in zeta direction (one field period only!)
  INTEGER              :: ntheta,nzeta  !! number of interpolation points in theta and zeta (one field period, half grid!!)
  INTEGER              :: lasym         !! =0: symmetric, =1: asymmetric fourier series
  REAL(wp),ALLOCATABLE :: theta(:)      !! theta positions [0,2pi), should be half grid!
  REAL(wp),ALLOCATABLE :: zeta(:)       !! zeta positions [0,2pi/nfp) should be on half grid!
  REAL(wp),ALLOCATABLE :: X(:,:) ,Y(:,:)!! boundary data X/Y positions X[i, j]=X(theta[i],zeta[j]),
                                        !!    Y[i, j]=Y(theta[i],zeta[j]), i=0...ntheta-1,j=0...nzeta-1
  CLASS(t_ncfile),ALLOCATABLE  :: nc  !! container for netcdf-file
  CHARACTER(LEN=1024)   :: ncfile=" " !! name of netcdf file with axis information
  CONTAINS

  PROCEDURE :: init       => bff_init
  PROCEDURE :: convert_to_modes => bff_convert_to_modes
  PROCEDURE :: free        => bff_free
END TYPE t_boundaryFromFile