theta_grid_file Module

Use output from rungridgen



Contents


Variables

Type Visibility Attributes Name Initial
character(len=run_name_size), private :: gridout_file
real, private :: shat_input
real, private :: drhodpsi_input
real, private :: kxfac_input
real, private :: qval_input
logical, private :: no_geo_info = .false.
integer, public :: ntheta
integer, public :: nperiod
integer, public :: ntgrid
integer, public :: nbset
logical, private :: exist
logical, private :: initialized = .false.
type(theta_grid_file_config_type), private :: theta_grid_file_config

Derived Types

type, public, extends(abstract_config_type) ::  theta_grid_file_config_type

Used to represent the input configuration of theta_grid

Components

Type Visibility Attributes Name Initial
logical, public :: exist = .false.

Does the related namelist exist in the target input file?

integer, public :: index = 0

Used to hold the specific index of numbered namelists

logical, public :: skip_read = .false.

Do we want to skip the read step in init?

logical, public :: skip_broadcast = .false.

Do we want to skip the broadcast step in init?

character(len=run_name_size), public :: gridout_file = "grid.out"

Name of file with output from rungridgen.

logical, public :: no_geo_info = .false.

If false, read Rplot, Rprime, Zplot, Zprime, aplot, aprime from gridout_file.

Type-Bound Procedures

procedure , public , :: is_initialised => is_initialised_generic Function
procedure , public , :: init => init_generic Subroutine
procedure , public , :: setup => setup_generic Subroutine
procedure , public , :: write_namelist_header Subroutine
procedure , public , :: get_name => get_name_generic Function
procedure , public , :: get_requires_index => get_requires_index_generic Function
procedure , public , nopass :: write_namelist_footer Subroutine
generic, public , :: write_key_val => write_key_val_string, write_key_val_real, write_key_val_complex, write_key_val_integer, write_key_val_logical, write_key_val_real_array, write_key_val_complex_array, write_key_val_integer_array
procedure , public :: read => read_theta_grid_file_config Subroutine
procedure , public :: write => write_theta_grid_file_config Subroutine
procedure , public :: reset => reset_theta_grid_file_config Subroutine
procedure , public :: broadcast => broadcast_theta_grid_file_config Subroutine
procedure , public , nopass :: get_default_name => get_default_name_theta_grid_file_config Function
procedure , public , nopass :: get_default_requires_index => get_default_requires_index_theta_grid_file_config Function

Functions

public function get_theta_grid_file_config()

Get the module level config instance

Arguments

None

Return Value type(theta_grid_file_config_type)

Gets the default name for this namelist

Arguments

None

Return Value character(len=CONFIG_MAX_NAME_LEN)

Gets the default requires index for this namelist

Arguments

None

Return Value logical


Subroutines

public subroutine wnml_theta_grid_file(unit)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: unit

public subroutine check_theta_grid_file(report_unit)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: report_unit

public subroutine check_theta_grid_file_nc(report_unit)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: report_unit

public subroutine init_theta_grid_file(theta_grid_file_config_in)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
type(theta_grid_file_config_type), intent(in), optional :: theta_grid_file_config_in

public subroutine finish_theta_grid_file()

FIXME : Add documentation

Arguments

None

private subroutine read_parameters(theta_grid_file_config_in)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
type(theta_grid_file_config_type), intent(in), optional :: theta_grid_file_config_in

public subroutine file_get_sizes()

FIXME : Add documentation

Arguments

None

public subroutine file_nc_get_sizes()

FIXME : Add documentation

Arguments

None

public subroutine file_get_grids(nperiod, ntheta, ntgrid, nbset, theta, bset, bmag, gradpar, gbdrift, gbdrift0, cvdrift, cvdrift0, cdrift, cdrift0, gds2, gds21, gds22, gds23, gds24, gds24_noq, grho, Rplot, Zplot, Rprime, Zprime, aplot, aprime, shat, drhodpsi, kxfac, qval, gb_to_cv, Bpol, surfarea, dvdrhon, rhoc)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nperiod
integer, intent(inout) :: ntheta
integer, intent(inout) :: ntgrid
integer, intent(inout) :: nbset
real, intent(out), dimension (-ntgrid:ntgrid) :: theta
real, intent(out), dimension (nbset) :: bset
real, intent(out), dimension (-ntgrid:ntgrid) :: bmag
real, intent(out), dimension (-ntgrid:ntgrid) :: gradpar
real, intent(out), dimension (-ntgrid:ntgrid) :: gbdrift
real, intent(out), dimension (-ntgrid:ntgrid) :: gbdrift0
real, intent(out), dimension (-ntgrid:ntgrid) :: cvdrift
real, intent(out), dimension (-ntgrid:ntgrid) :: cvdrift0
real, intent(out), dimension (-ntgrid:ntgrid) :: cdrift
real, intent(out), dimension (-ntgrid:ntgrid) :: cdrift0
real, intent(out), dimension (-ntgrid:ntgrid) :: gds2
real, intent(out), dimension (-ntgrid:ntgrid) :: gds21
real, intent(out), dimension (-ntgrid:ntgrid) :: gds22
real, intent(out), dimension (-ntgrid:ntgrid) :: gds23
real, intent(out), dimension (-ntgrid:ntgrid) :: gds24
real, intent(out), dimension (-ntgrid:ntgrid) :: gds24_noq
real, intent(out), dimension (-ntgrid:ntgrid) :: grho
real, intent(out), dimension (-ntgrid:ntgrid) :: Rplot
real, intent(out), dimension (-ntgrid:ntgrid) :: Zplot
real, intent(out), dimension (-ntgrid:ntgrid) :: Rprime
real, intent(out), dimension (-ntgrid:ntgrid) :: Zprime
real, intent(out), dimension (-ntgrid:ntgrid) :: aplot
real, intent(out), dimension (-ntgrid:ntgrid) :: aprime
real, intent(out) :: shat
real, intent(out) :: drhodpsi
real, intent(out) :: kxfac
real, intent(out) :: qval
logical, intent(in) :: gb_to_cv
real, intent(out), dimension (-ntgrid:ntgrid) :: Bpol
real, intent(out) :: surfarea
real, intent(out) :: dvdrhon
real, intent(out) :: rhoc

public subroutine file_nc_get_grids(nperiod, ntheta, ntgrid, nbset, theta, bset, bmag, gradpar, gbdrift, gbdrift0, cvdrift, cvdrift0, cdrift, cdrift0, gds2, gds21, gds22, gds23, gds24, gds24_noq, grho, Rplot, Zplot, Rprime, Zprime, aplot, aprime, shat, drhodpsi, kxfac, qval, gb_to_cv, Bpol, surfarea, dvdrhon, rhoc)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nperiod
integer, intent(inout) :: ntheta
integer, intent(inout) :: ntgrid
integer, intent(inout) :: nbset
real, intent(out), dimension (-ntgrid:ntgrid) :: theta
real, intent(out), dimension (nbset) :: bset
real, intent(out), dimension (-ntgrid:ntgrid) :: bmag
real, intent(out), dimension (-ntgrid:ntgrid) :: gradpar
real, intent(out), dimension (-ntgrid:ntgrid) :: gbdrift
real, intent(out), dimension (-ntgrid:ntgrid) :: gbdrift0
real, intent(out), dimension (-ntgrid:ntgrid) :: cvdrift
real, intent(out), dimension (-ntgrid:ntgrid) :: cvdrift0
real, intent(out), dimension (-ntgrid:ntgrid) :: cdrift
real, intent(out), dimension (-ntgrid:ntgrid) :: cdrift0
real, intent(out), dimension (-ntgrid:ntgrid) :: gds2
real, intent(out), dimension (-ntgrid:ntgrid) :: gds21
real, intent(out), dimension (-ntgrid:ntgrid) :: gds22
real, intent(out), dimension (-ntgrid:ntgrid) :: gds23
real, intent(out), dimension (-ntgrid:ntgrid) :: gds24
real, intent(out), dimension (-ntgrid:ntgrid) :: gds24_noq
real, intent(out), dimension (-ntgrid:ntgrid) :: grho
real, intent(out), dimension (-ntgrid:ntgrid) :: Rplot
real, intent(out), dimension (-ntgrid:ntgrid) :: Zplot
real, intent(out), dimension (-ntgrid:ntgrid) :: Rprime
real, intent(out), dimension (-ntgrid:ntgrid) :: Zprime
real, intent(out), dimension (-ntgrid:ntgrid) :: aplot
real, intent(out), dimension (-ntgrid:ntgrid) :: aprime
real, intent(out) :: shat
real, intent(out) :: drhodpsi
real, intent(out) :: kxfac
real, intent(out) :: qval
logical, intent(in) :: gb_to_cv
real, intent(out), dimension (-ntgrid:ntgrid) :: Bpol
real, intent(out) :: surfarea
real, intent(out) :: dvdrhon
real, intent(out) :: rhoc

public subroutine set_theta_grid_file_config(theta_grid_file_config_in)

Set the module level config type Will abort if the module has already been initialised to avoid inconsistencies.

Arguments

Type IntentOptional Attributes Name
type(theta_grid_file_config_type), intent(in), optional :: theta_grid_file_config_in

private subroutine read_theta_grid_file_config(self)

Reads in the theta_grid_file_knobs namelist and populates the member variables

Arguments

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

private subroutine write_theta_grid_file_config(self, unit)

Writes out a namelist representing the current state of the config object

Arguments

Type IntentOptional Attributes Name
class(theta_grid_file_config_type), intent(in) :: self
integer, intent(in), optional :: unit

private subroutine reset_theta_grid_file_config(self)

Resets the config object to the initial empty state

Arguments

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

private subroutine broadcast_theta_grid_file_config(self)

Broadcasts all config parameters so object is populated identically on all processors

Arguments

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