V3FIT
|
Defines the base class of the type signal_class. More...
Data Types | |
type | signal_class |
Base class representing a signal. More... | |
interface | signal_construct |
Interface for the construction of signal_class types using signal_construct_magnetic, signal_construct_sxrem, signal_construct_intpol, signal_construct_thomson, signal_construct_extcurz, signal_construct_mse, signal_construct_ece, signal_construct_limiter, signal_construct_prior_gaussian, signal_construct_feedback, signal_construct_combination or signal_construct_diagnostic_netcdf. More... | |
type | signal_pointer |
Pointer to a signal object. Used for creating arrays of signal pointers. This is needed because fortran does not allow arrays of pointers directly. More... | |
Functions/Subroutines | |
subroutine | signal_construct_new (this, s_name, l_name, units, observed, sigma, weight, s_index, o_index) |
Construct new signal_class object. More... | |
subroutine | signal_construct_diagnostic_netcdf (this, mdsig_iou, observed, sigma, weight, s_index, o_index) |
Construct a signal_class containing a diagnostic object. More... | |
subroutine | signal_destruct (this) |
Deconstruct a signal_class object. More... | |
real(rprec) function, dimension(4) | signal_get_modeled_signal_cache (this, a_model, sigma, use_cache, last_value) |
Calculates the modeled signal. More... | |
real(rprec) function, dimension(4) | signal_get_modeled_signal_last (this, a_model, sigma, last_value) |
Calculates the modeled signal. More... | |
real(rprec) function | signal_get_observed_signal (this, a_model) |
Calculates the observed signal. More... | |
real(rprec) function | signal_get_g2 (this, a_model, use_cache, last_value) |
Calculates the g^2 contribution of a signal. More... | |
real(rprec) function | signal_get_e (this, a_model, use_cache, last_value) |
Calculates the e contribution of a signal. More... | |
real(rprec) function | signal_get_sigma2 (this) |
Calculates the total sigma^2 of a signal. More... | |
character(len=data_name_length) function | signal_get_type (this) |
Gets a discription of the signal type. More... | |
subroutine | signal_get_header (this, header) |
Gets a discription of the model and model sigma array indices. More... | |
real(rprec) function | signal_get_gp_i (this, a_model, i, flags) |
Gets the guassian process kernel for a signal and a position. More... | |
real(rprec) function | signal_get_gp_s (this, a_model, signal, flags) |
Gets the guassian process kernel for a signal and a signal. More... | |
real(rprec) function | signal_get_gp_x (this, a_model, x_cart, flags) |
Gets the guassian process kernel for a signal and cartesian position. More... | |
subroutine | signal_scale_and_offset (this, a_model, value) |
Apply scale and offset to the value. More... | |
character(len=data_short_name_length) function | signal_make_short_name (name, index) |
Generate a short name by appending an index. More... | |
subroutine | signal_write (this, iou, index, a_model) |
Write out the signal information to an output file. More... | |
subroutine | signal_write_header (this, iou) |
Write out the signal header information to an output file. More... | |
subroutine | signals_write_auxiliary (this, iou, index, a_model) |
Write out any auxiliary signal information to an output file. More... | |
subroutine | signal_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. More... | |
subroutine | signal_sync_child (this, index, recon_comm) |
Syncronize a child signal state to the parent. More... | |
Defines the base class of the type signal_class.
subroutine signal::signal_construct_diagnostic_netcdf | ( | class (signal_class), intent(inout) | this, |
integer, intent(in) | mdsig_iou, | ||
real(rprec), intent(in) | observed, | ||
real(rprec), intent(in) | sigma, | ||
real(rprec), intent(in) | weight, | ||
integer, intent(in) | s_index, | ||
integer, intent(in) | o_index | ||
) |
Construct a signal_class containing a diagnostic object.
Reads the s_name, l_name and units from a netcdf file. Used for constructing the magnetic objects.
[in,out] | signal_class | An instance of a signal_class. |
[in] | mdsig_iou | NetCDF id of the opened mdsig file. |
[in] | observed | Observed value of the signal. |
[in] | sigma | Observed sigma of the signal. |
[in] | weight | Weight factor of the signal. |
[in] | s_index | Index of the model signal scale factor. |
[in] | o_index | Index of the model signal offset factor. |
subroutine signal::signal_construct_new | ( | class (signal_class), intent(inout) | this, |
character(len=*), intent(in) | s_name, | ||
character(len=*), intent(in) | l_name, | ||
character(len=*), intent(in) | units, | ||
real(rprec), intent(in) | observed, | ||
real(rprec), intent(in) | sigma, | ||
real(rprec), intent(in) | weight, | ||
integer, intent(in) | s_index, | ||
integer, intent(in) | o_index | ||
) |
Construct new signal_class object.
Allocates memory and initializes a signal_class object.
[in,out] | this | An instance of a signal_class. |
[in] | s_name | The short name of the signal. |
[in] | l_name | The short name of the signal. |
[in] | units | The units of the signal. |
[in] | observed | Observed value of the signal. |
[in] | sigma | Observed sigma of the signal. |
[in] | weight | Weight factor of the signal. |
[in] | s_index | Index of the model signal scale factor. |
[in] | o_index | Index of the model signal offset factor. |
subroutine signal::signal_destruct | ( | type (signal_class), intent(inout) | this | ) |
Deconstruct a signal_class object.
Deallocates memory and uninitializes a signal_class object.
[in,out] | this | A signal_class instance. |
real (rprec) function signal::signal_get_e | ( | class (signal_class), intent(inout) | this, |
type (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. |
real (rprec) function signal::signal_get_g2 | ( | class (signal_class), intent(inout) | this, |
type (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. |
real (rprec) function signal::signal_get_gp_i | ( | class (signal_class), intent(in) | this, |
type (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. |
real (rprec) function signal::signal_get_gp_s | ( | class (signal_class), intent(in) | this, |
type (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. |
real (rprec) function signal::signal_get_gp_x | ( | class (signal_class), intent(in) | this, |
type (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. |
subroutine signal::signal_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. |
real (rprec) function, dimension(4) signal::signal_get_modeled_signal_cache | ( | class (signal_class), intent(inout) | this, |
type (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. |
real (rprec) function, dimension(4) signal::signal_get_modeled_signal_last | ( | class (signal_class), intent(inout) | this, |
type (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. |
real (rprec) function signal::signal_get_observed_signal | ( | class (signal_class), intent(in) | this, |
type (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. |
real (rprec) function signal::signal_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. |
character (len=data_name_length) function signal::signal_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. |
character (len=data_short_name_length) function signal::signal_make_short_name | ( | character (len=*), intent(in) | name, |
integer, intent(in) | index | ||
) |
Generate a short name by appending an index.
Returns an appended string with no leading spaces. This check the number of digits in the index then chooses the appropriate formatting.
[in] | name | A name of a signal to append to. |
[in] | index | A index of a signal to append. |
subroutine signal::signal_scale_and_offset | ( | class (signal_class), intent(in) | this, |
type (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. |
subroutine signal::signal_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. |
subroutine signal::signal_write | ( | class (signal_class), intent(inout) | this, |
integer, intent(in) | iou, | ||
integer, intent(in) | index, | ||
type (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. |
subroutine signal::signal_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. |
subroutine signal::signal_write_step_data | ( | class (signal_class), intent(inout) | this, |
type (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. |
subroutine signal::signals_write_auxiliary | ( | class (signal_class), intent(in) | this, |
integer, intent(in) | iou, | ||
integer, intent(in) | index, | ||
type (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. |