V3FIT
|
Contains the main routines for V3FIT. More...
Go to the source code of this file.
Functions/Subroutines | |
program | v3fit |
V3FIT is a code for reconstructing 3D equilibria. V3FIT determined the optimal parameters of a 3D equilibrium by minimizing the missmatch between modeled and observed signals. V3FIT has been created with contributions from. More... | |
subroutine | task_equilibrium (context) |
Solves the equilibrium. More... | |
subroutine | task_v3post (context) |
Solves the equilibrium and calculates the modeled signals. More... | |
subroutine | task_reconstruct (context) |
Reconstructs the equilibrium. More... | |
subroutine | task_child_recon (context) |
Child task to compute jacobian. More... | |
subroutine | task_child_equilibrium (context) |
Child task to compute equilibrium. More... | |
subroutine | task_gsq_on_grid (context) |
Computes the g^2 value on a grid. More... | |
subroutine | task_unit_tests |
Run unit tests. More... | |
subroutine | init_equilibrium (context) |
Initialize an equilibrium. More... | |
subroutine | init_vmec_equilibrium (context, force_solve) |
Initialize a vmec equilibrium. More... | |
subroutine | init_vacuum_equilibrium (context, force_solve) |
Initialize a vacuum equilibrium. More... | |
subroutine | init_siesta_equilibrium (context, force_solve) |
Initialize a siests equilibrium. More... | |
subroutine | init_signals (context) |
Constructs the signal array. More... | |
subroutine | init_magnetic_signals (context, signals_created) |
Constructs magnetic signals. More... | |
subroutine | init_sxrem_signals (context, signals_created) |
Constructs sxrem signals. More... | |
subroutine | init_intpol_signals (context, signals_created) |
Constructs intpol signals. More... | |
subroutine | init_thomson_signals (context, signals_created) |
Constructs thomson signals. More... | |
subroutine | init_extcurz_signals (context, signals_created) |
Constructs the extcurz signal. More... | |
subroutine | init_mse_signals (context, signals_created) |
Constructs mse signals. More... | |
subroutine | init_ece_signals (context, signals_created) |
Constructs ece signals. More... | |
subroutine | init_limiter_signals (context, signals_created) |
Constructs limiter signals. More... | |
subroutine | init_prior_signals (context, signals_created) |
Constructs prior signals. More... | |
subroutine | init_sxrem_ratio_signals (context, signals_created) |
Constructs sxrem_ratio signals. More... | |
subroutine | init_combination_signals (context, signals_created) |
Constructs signal::combination_class signals. More... | |
subroutine | init_parameters (context) |
Constructs the v3fit_context::v3fit_context_class::params array. More... | |
subroutine | init_gaussian_process (context) |
Constructs the v3fit_context::v3fit_context_class::gp array. More... | |
subroutine | init_reconstruction (context) |
Initialize Reconstruction. More... | |
subroutine | config_parallelism (context) |
Configure Parallelism. More... | |
subroutine | cleanup_parallelism (context) |
Cleanup Parallelism. More... | |
Contains the main routines for V3FIT.
Definition in file v3fita.f.
subroutine cleanup_parallelism | ( | type (v3fit_context_class), intent(inout) | context | ) |
Cleanup Parallelism.
Cleans up resources needed for parallelism.
[in,out] | context | An instance of a v3fit_context object. |
subroutine config_parallelism | ( | type (v3fit_context_class), intent(inout) | context | ) |
Configure Parallelism.
When using OpenMP, this sets the maximum number of threads to use. Threads operate within a process and share memory with the main thread. With in parallel constructs, it's important to ensure that all code is thread safe to avoid unexpected behavior and race conditions. The maximum number of threads is controled using the -para
command line argument. An argument of a negative values specifies to use the default behavior.
When using MPI, this sets and configures the processes. A unique directory needs to be generated for each process to avoid overwriting output files.
The default way is to create and distribute the threads externally. In this case, the number of processes is fixed. Each process will need to be reassigned a working directory. One process will be used like a parent process. The remaining processed will be retasked as child processes.
The second way is to spawn sub processes from a single parent process. In this case, the parent process will spawn subprocesses to operate the child task in a sub directory. The number of sub processes can be configured automatically or manually.
[in,out] | context | An instance of a v3fit_context object. |
subroutine init_combination_signals | ( | type (v3fit_context_class), intent(inout) | context, |
integer, intent(inout) | signals_created | ||
) |
Constructs signal::combination_class signals.
[in,out] | context | An instance of a v3fit_context object. |
[in,out] | signals_created | Count of the current number of signals constructed. |
subroutine init_ece_signals | ( | type (v3fit_context_class), intent(inout) | context, |
integer, intent(inout) | signals_created | ||
) |
Constructs ece signals.
This constructs all ece signals from the specified v3fit_input::ece_dot_filename.
[in,out] | context | An instance of a v3fit_context object. |
[in,out] | signals_created | Count of the current number of signals constructed. |
subroutine init_equilibrium | ( | type (v3fit_context_class), intent(inout) | context | ) |
Initialize an equilibrium.
This constructs and initializes an equilibrium. Currently only vmec_equilibium, vacuum_equilibium and siesta_equilibium are supported.
[in,out] | context | An instance of a v3fit_context object. |
subroutine init_extcurz_signals | ( | type (v3fit_context_class), intent(inout) | context, |
integer, intent(inout) | signals_created | ||
) |
Constructs the extcurz signal.
This constructs the extcurz signal from v3fit_input::extcurz_s0 and v3fit_input::extcurz_u0.
[in,out] | context | An instance of a v3fit_context object. |
[in,out] | signals_created | Count of the current number of signals constructed. |
subroutine init_gaussian_process | ( | type (v3fit_context_class), intent(inout) | context | ) |
Constructs the v3fit_context::v3fit_context_class::gp array.
This constructs all reconstruction guassian_process::gaussp_class objects.
[in,out] | context | An instance of a v3fit_context object. |
subroutine init_intpol_signals | ( | type (v3fit_context_class), intent(inout) | context, |
integer, intent(inout) | signals_created | ||
) |
Constructs intpol signals.
This constructs all intpol signals from the specified v3fit_input::ipch_dot_filename.
[in,out] | context | An instance of a v3fit_context object. |
[in,out] | signals_created | Count of the current number of signals constructed. |
subroutine init_limiter_signals | ( | type (v3fit_context_class), intent(inout) | context, |
integer, intent(inout) | signals_created | ||
) |
Constructs limiter signals.
Constructs all iso and grid based limiters.
[in,out] | context | An instance of a v3fit_context object. |
[in,out] | signals_created | Count of the current number of signals constructed. |
subroutine init_magnetic_signals | ( | type (v3fit_context_class), intent(inout) | context, |
integer, intent(inout) | signals_created | ||
) |
Constructs magnetic signals.
This constructs all magnetic signals from the specified v3fit_input::mdsig_list_filename.
[in,out] | context | An instance of a v3fit_context object. |
[in,out] | signals_created | Count of the current number of signals constructed. |
subroutine init_mse_signals | ( | type (v3fit_context_class), intent(inout) | context, |
integer, intent(inout) | signals_created | ||
) |
Constructs mse signals.
This constructs all mse signals from the specified v3fit_input::mse_dot_filename.
[in,out] | context | An instance of a v3fit_context object. |
[in,out] | signals_created | Count of the current number of signals constructed. |
subroutine init_parameters | ( | type (v3fit_context_class), intent(inout) | context | ) |
Constructs the v3fit_context::v3fit_context_class::params array.
This constructs all reconstruction v3fit_params::param_class and derived v3fit_params::param_class objects.
[in,out] | context | An instance of a v3fit_context object. |
subroutine init_prior_signals | ( | type (v3fit_context_class), intent(inout) | context, |
integer, intent(inout) | signals_created | ||
) |
Constructs prior signals.
For now only prior_gaussian signals are constructed.
[in,out] | context | An instance of a v3fit_context object. |
[in,out] | signals_created | Count of the current number of signals constructed. |
subroutine init_reconstruction | ( | type (v3fit_context_class), intent(inout) | context | ) |
Initialize Reconstruction.
[in,out] | context | An instance of a v3fit_context object. |
subroutine init_siesta_equilibrium | ( | type (v3fit_context_class), intent(inout) | context, |
logical, intent(in) | force_solve | ||
) |
Initialize a siests equilibrium.
This constructs and initializes a siesta_equilibrium.
[in,out] | context | An instance of a v3fit_context object. |
[in] | force_solve | If true, forces the equilbirum to resolve every time. |
subroutine init_signals | ( | type (v3fit_context_class), intent(inout) | context | ) |
Constructs the signal array.
This constructs all v3fit_context::v3fit_context_class::signals.
[in,out] | context | An instance of a v3fit_context object. |
subroutine init_sxrem_ratio_signals | ( | type (v3fit_context_class), intent(inout) | context, |
integer, intent(inout) | signals_created | ||
) |
Constructs sxrem_ratio signals.
This constructs all sxrem_ratio signals from the specified v3fit_input::sxrem_ratio_dot_filename.
[in,out] | context | An instance of a v3fit_context object. |
[in,out] | signals_created | Count of the current number of signals constructed. |
subroutine init_sxrem_signals | ( | type (v3fit_context_class), intent(inout) | context, |
integer, intent(inout) | signals_created | ||
) |
Constructs sxrem signals.
This constructs all sxrem signals from the specified v3fit_input::sxrch_dot_filename.
[in,out] | context | An instance of a v3fit_context object. |
[in,out] | signals_created | Count of the current number of signals constructed. |
subroutine init_thomson_signals | ( | type (v3fit_context_class), intent(inout) | context, |
integer, intent(inout) | signals_created | ||
) |
Constructs thomson signals.
This constructs all thomson signals from the specified v3fit_input::thscte_dot_filename.
[in,out] | context | An instance of a v3fit_context object. |
[in,out] | signals_created | Count of the current number of signals constructed. |
subroutine init_vacuum_equilibrium | ( | type (v3fit_context_class), intent(inout) | context, |
logical, intent(in) | force_solve | ||
) |
Initialize a vacuum equilibrium.
This constructs and initializes a vacuum_equilibrium.
[in,out] | context | An instance of a v3fit_context object. |
[in] | force_solve | If true, forces the equilbirum to resolve every time. |
subroutine init_vmec_equilibrium | ( | type (v3fit_context_class), intent(inout) | context, |
logical, intent(in) | force_solve | ||
) |
Initialize a vmec equilibrium.
This constructs and initializes a vmec_equilibrium.
[in,out] | context | An instance of a v3fit_context object. |
[in] | force_solve | If true, forces the equilbirum to resolve every time. |
subroutine task_child_equilibrium | ( | type (v3fit_context_class), intent(inout) | context | ) |
Child task to compute equilibrium.
Task to compute the equilibrium in a sub process for parallelism.
[in,out] | context | An instance of a v3fit_context object. |
subroutine task_child_recon | ( | type (v3fit_context_class), intent(inout) | context | ) |
Child task to compute jacobian.
Task to compute the jacobian in a sub process for parallelism.
[in,out] | context | An instance of a v3fit_context object. |
subroutine task_equilibrium | ( | type (v3fit_context_class), intent(inout) | context | ) |
Solves the equilibrium.
Task to just solve the equilibrium. This task is choosen by setting v3fit_input::my_task to 'equilibrium'.
[in,out] | context | An instance of a v3fit_context object. |
subroutine task_gsq_on_grid | ( | type (v3fit_context_class), intent(inout) | context | ) |
Computes the g^2 value on a grid.
Task to map out the chi^2 over a range of reconstruction parameters. This task is choosen by setting v3fit_input::my_task to 'gsq_on_grid'.
[in,out] | context | An instance of a v3fit_context object. |
subroutine task_reconstruct | ( | type (v3fit_context_class), intent(inout) | context | ) |
Reconstructs the equilibrium.
Task to perform an equilibrium reconstruction. This task is choosen by setting v3fit_input::my_task to 'reconstruct'.
[in,out] | context | An instance of a v3fit_context object. |
subroutine task_unit_tests |
Run unit tests.
This task is choosen by setting v3fit_input::my_task to 'unit_test'. Or by using the -test command line flag.
subroutine task_v3post | ( | type (v3fit_context_class), intent(inout) | context | ) |
Solves the equilibrium and calculates the modeled signals.
Task to just compute modeled signals from an equilibrium. This task is choosen by setting v3fit_input::my_task to 'v3post'.
[in,out] | context | An instance of a v3fit_context object. |
program v3fit |
V3FIT is a code for reconstructing 3D equilibria. V3FIT determined the optimal parameters of a 3D equilibrium by minimizing the missmatch between modeled and observed signals. V3FIT has been created with contributions from.
The theory behind V3FIT is outlined in Hanson et. al. doi:10.1088/0029-5515/49/7/075031
Below is a brief discription of the major top level objects of the code. For discriptions of lower level objects consult the referenced top level objects.
model defines the equilibrium model. signal defined the interface to the signals. reconstruction contain the minimization algorithm. data_parameters defined the various fixed parameters utility functions used throughout. v3fit_input Defines the V3FIT namelist input file. v3fit_context defined the main pointer to all allocated memory and objects. commandline_parser defines and parses commandline arguments.
V3FIT main program.
Highest level V3FIT routine.