![]() |
Stellarator-Tools
|
Base class representing a signal. More...
Public Member Functions | |
procedure | get_modeled_signal_cache (this, a_model, sigma, use_cache, last_value) |
Calculates the modeled signal. | |
procedure | get_modeled_signal_last (this, a_model, sigma, last_value) |
Calculates the modeled signal. | |
GENERIC | get_modeled_signal get_modeled_signal_cache, get_modeled_signal_last |
procedure | get_observed_signal (this, a_model) |
Calculates the observed signal. | |
procedure | get_g2 (this, a_model, use_cache, last_value) |
Calculates the g^2 contribution of a signal. | |
procedure | get_e (this, a_model, use_cache, last_value) |
Calculates the e contribution of a signal. | |
procedure | get_sigma2 (this) |
Calculates the total sigma^2 of a signal. | |
procedure | get_type (this) |
Gets a discription of the signal type. | |
procedure | get_header (this, header) |
Gets a discription of the model and model sigma array indices. | |
procedure | get_gp_i (this, a_model, i, flags) |
Gets the guassian process kernel for a signal and a position. | |
procedure | get_gp_s (this, a_model, signal, flags) |
Gets the guassian process kernel for a signal and a signal. | |
procedure | get_gp_x (this, a_model, x_cart, flags) |
Gets the guassian process kernel for a signal and cartesian position. | |
GENERIC | get_gp get_gp_i, get_gp_s, get_gp_x |
procedure | scale_and_offset (this, a_model, value) |
Apply scale and offset to the value. | |
procedure | sync_child (this, index, recon_comm) |
Syncronize a child signal state to the parent. | |
procedure | write_header (this, iou) |
Write out the signal header information to an output file. | |
procedure | write (this, iou, index, a_model) |
Write out the signal information to an output file. | |
procedure | write_auxiliary (this, iou, index, a_model) |
Write out any auxiliary signal information to an output file. | |
procedure | write_step_data (this, a_model, result_ncid, current_step, index, signal_model_value_id, signal_sigma_value_id) |
Write out the signal data for a step to the result netcdf file. | |
FINAL | signal_destruct (this) |
Deconstruct a signal_class object. | |
Public Attributes | |
character(len=data_short_name_length) | s_name |
Short name of the signal. | |
character(len=data_name_length) | l_name |
Long name of the signal. | |
character(len=data_short_name_length) | units |
Physical units the signal measures. | |
real(rprec) | observed |
Eperimentally measured signal value. | |
real(rprec) | observed_sigma |
Eperimentally measured signal uncertainty. | |
real(rprec) | weight |
Weighting parameter of the signal. | |
real(rprec), dimension(4) | modeled |
Cached value of the modeled signal. | |
real(rprec), dimension(4) | modeled_sigma |
Cached value of the modeled sigma. | |
integer | scale_index |
Scale factor index. | |
integer | offset_index |
Offset factor index. | |
Base class representing a signal.
procedure signal::signal_class::get_e | ( | class (signal_class), intent(inout) | this, |
class (model_class), pointer | a_model, | ||
logical, intent(in) | use_cache, | ||
real (rprec), dimension(4), intent(in) | last_value | ||
) |
Calculates the e contribution of a signal.
Gets the e contribution of an individual signal. e = SQRT(W)*(O - M)/SQRT(sigma_o^2 + sigma_m^2)
[in,out] | this | A diagnostic_class instance. |
[in,out] | a_model | A model instance. |
[in] | use_cache | If the signals have been already calculated this should be false. Otherwise set to true. |
[in] | last_value | Last good value in case the signal did not change. |
procedure signal::signal_class::get_g2 | ( | class (signal_class), intent(inout) | this, |
class (model_class), pointer | a_model, | ||
logical, intent(in) | use_cache, | ||
real (rprec), dimension(4), intent(in) | last_value | ||
) |
Calculates the g^2 contribution of a signal.
Gets the g^2 contribution of an individual signal. g^2 = W*(O - M)^2/(sigma_o^2 + sigma_m^2) = e*e
[in,out] | this | A diagnostic_class instance. |
[in,out] | a_model | A model instance. |
[in] | use_cache | If the signals have been already calculated this should be false. Otherwise set to true. |
[in] | last_value | Last good value in case the signal did not change. |
procedure signal::signal_class::get_gp_i | ( | class (signal_class), intent(in) | this, |
class (model_class), pointer | a_model, | ||
integer, intent(in) | i, | ||
integer, intent(in) | flags | ||
) |
Gets the guassian process kernel for a signal and a position.
This method is meant to be overwritten by a subclass method. As a result, returns the get_gp_i method of the subclass instance signal_class was constructed with.
[in] | this | A signal_class instance. |
[in] | a_model | A model_class instance. |
[in] | i | Index of the position for the kernel. |
[in] | flags | State flags to send to the kernel. |
procedure signal::signal_class::get_gp_s | ( | class (signal_class), intent(in) | this, |
class (model_class), pointer | a_model, | ||
class (signal_class), pointer | signal, | ||
integer, intent(in) | flags | ||
) |
Gets the guassian process kernel for a signal and a signal.
This method is meant to be overwritten by a subclass method. As a result, returns the get_gp_s method of the subclass instance signal_class was constructed with. The second signal is cast to a void pointer so it can be send to the subclass instance.
[in] | this | A signal_class instance. |
[in] | a_model | A model_class instance. |
[in] | signal | A signal_class instance for the second signal. |
[in] | flags | State flags to send to the kernel. |
procedure signal::signal_class::get_gp_x | ( | class (signal_class), intent(in) | this, |
class (model_class), pointer | a_model, | ||
real (rprec), dimension(3), intent(in) | x_cart, | ||
integer, intent(in) | flags | ||
) |
Gets the guassian process kernel for a signal and cartesian position.
This method is meant to be overwritten by a subclass method. As a result, returns the get_gp_x method of the subclass instance signal_class was constructed with.
[in] | this | A signal_class instance. |
[in] | a_model | A model_class instance. |
[in] | x_cart | The cartesian position of to get the kernel at. |
[in] | flags | State flags to send to the kernel. |
procedure signal::signal_class::get_header | ( | class (signal_class), intent(in) | this, |
character (len=data_name_length), dimension(7), intent(inout) | header | ||
) |
Gets a discription of the model and model sigma array indices.
This method is meant to be overwritten by a subclass method. As a result, returns the get_header method of the subclass instance signal_class was constructed with.
[in] | this | A signal_class instance. |
[in,out] | header | Buffer arrays to write header strings to. |
procedure signal::signal_class::get_modeled_signal_cache | ( | class (signal_class), intent(inout) | this, |
class (model_class), pointer | a_model, | ||
real (rprec), dimension(:), intent(out) | sigma, | ||
logical, intent(in) | use_cache, | ||
real (rprec), dimension(4), intent(in) | last_value | ||
) |
Calculates the modeled signal.
This method is checks if the cached vales should be used first otherwise calls the subclass method.
[in,out] | this | A diagnostic_class instance. |
[in] | a_model | A model instance. |
[out] | sigma | The modeled sigma. |
[in] | use_cache | If false calculate the signal and sigma and write them to the cache. Otherwise read from the cache without recalculating the signal. |
[in] | last_value | Last good value in case the signal did not change. |
procedure signal::signal_class::get_modeled_signal_last | ( | class (signal_class), intent(inout) | this, |
class (model_class), pointer | a_model, | ||
real (rprec), dimension(4), intent(out) | sigma, | ||
real (rprec), dimension(4), intent(in) | last_value | ||
) |
Calculates the modeled signal.
This method is meant to be overwritten by a subclass method. As a result, returns the get_modeled_signal method of the subclass instance signal_class was constructed with unless the signal is read from the cached value. Read from the cached value when the signal doesn't need to be recalulated. If the signal is to be recalculated, write these to the cache.
[in,out] | this | A signal_class instance. |
[in] | a_model | A model instance. |
[out] | sigma | The modeled sigma. |
[in] | last_value | Last good value in case the signal did not change. |
procedure signal::signal_class::get_observed_signal | ( | class (signal_class), intent(in) | this, |
class (model_class), intent(in) | a_model | ||
) |
Calculates the observed signal.
This method is meant to be overwritten by a subclass method. As a result, returns the get_modeled_signal method of the subclass instance signal_class was constructed with. All signals expect feed back signals use a fixed observed value.
[in] | this | A diagnostic_class instance. |
[in] | a_model | A model instance. |
procedure signal::signal_class::get_sigma2 | ( | class (signal_class), intent(in) | this | ) |
Calculates the total sigma^2 of a signal.
Gets the total sigma^2 of an individual signal. sigma^2 = sigma_o^2 + sigma_m^2
[in] | this | A diagnostic_class instance. |
procedure signal::signal_class::get_type | ( | class (signal_class), intent(in) | this | ) |
Gets a discription of the signal type.
This method is meant to be overwritten by a subclass method. As a result, returns the get_type method of the subclass instance signal_class was constructed with.
[in] | this | A signal_class instance. |
procedure signal::signal_class::scale_and_offset | ( | class (signal_class), intent(in) | this, |
class (model_class), intent(in) | a_model, | ||
real (rprec), intent(inout) | value | ||
) |
Apply scale and offset to the value.
Modeled signals can contain an extra scaling and offset. Apply these to the value. These are obtained from the model.
[in] | this | A intpol_class instance. |
[in] | a_model | A model instance. |
[in,out] | value | The value to scale and offset. |
|
final |
Deconstruct a signal_class object.
Deallocates memory and uninitializes a signal_class object.
[in,out] | this | A signal_class instance. |
procedure signal::signal_class::sync_child | ( | class (signal_class), intent(inout) | this, |
integer, intent(in) | index, | ||
integer, intent(in) | recon_comm | ||
) |
Syncronize a child signal state to the parent.
Syncs data between a child and the parent process. If MPI support is not compiled in this subroutine reduces to a no op.
[in,out] | this | A signal_class instance. |
[in] | index | Reconstruction rank to sync. |
[in] | recon_comm | MPI communicator for the reconstruction processes. |
procedure signal::signal_class::write | ( | class (signal_class), intent(inout) | this, |
integer, intent(in) | iou, | ||
integer, intent(in) | index, | ||
class (model_class), pointer | a_model | ||
) |
Write out the signal information to an output file.
Signals information is formated as the index, signal type, s_name, g^2, weight, observed value, observed sigma, modeled value and modeled sigma.
[in,out] | this | A signal_class instance. |
[in] | iou | A input/output representing the file to write to. |
[in] | index | A index of a signal. |
[in,out] | a_model | The equilibrium model. |
procedure signal::signal_class::write_auxiliary | ( | class (signal_class), intent(in) | this, |
integer, intent(in) | iou, | ||
integer, intent(in) | index, | ||
class (model_class), intent(in) | a_model | ||
) |
Write out any auxiliary signal information to an output file.
This method is meant to be overwritten by a subclass method if need be. As a result, returns the write_auxiliary method of the subclass instance signal_class was constructed with. Otherwise uses the default. nothing is written.
[in] | this | A signal_class instance. |
[in] | iou | A input/output representing the file to write to. |
[in] | index | A index of a signal. |
[in] | a_model | The equilibrium model. |
procedure signal::signal_class::write_header | ( | class (signal_class), intent(in) | this, |
integer, intent(in) | iou | ||
) |
Write out the signal header information to an output file.
Signals information is formated as a the index, signal type, s_name, g^2, weight, observed value, observed sigma, modeled value and modeled sigma.
[in] | this | A signal_class instance. |
[in] | iou | A input/output representing the file to write to. |
procedure signal::signal_class::write_step_data | ( | class (signal_class), intent(inout) | this, |
class (model_class), pointer | a_model, | ||
integer, intent(in) | result_ncid, | ||
integer, intent(in) | current_step, | ||
integer, intent(in) | index, | ||
integer, intent(in) | signal_model_value_id, | ||
integer, intent(in) | signal_sigma_value_id | ||
) |
Write out the signal data for a step to the result netcdf file.
Writes out the observed, modeled and total sigma value of the signal.
[in,out] | this | A diagnostic_class instance. |
[in,out] | a_model | The equilibrium model. |
[in] | result_ncid | A NetCDF id of the result file. |
[in] | current_step | The surrent reconstruction step. |
[in] | index | A index of a signal. |
[in] | signal_model_value_id | NetCDF variable id of the model value. |
[in] | signal_sigma_value_id | NetCDF variable id of the total sigma. |