![]() |
Stellarator-Tools
|
Class to hold variables needed when a parameter is a reconstruction parameter. More...
Public Member Functions | |
| FINAL | param_recon_destruct (this) |
| Deconstruct a param_recon_class object. | |
| procedure | set_value (this, a_model, value, eq_comm, is_central) |
| Sets the parameter value. | |
| procedure | get_lower_range_value (this, a_model) |
| Gets the lower boundary value. | |
| procedure | get_upper_range_value (this, a_model) |
| Gets the upper boundary value. | |
| procedure | get_lower_range_type (this, a_model) |
| Gets the lower boundary type description. | |
| procedure | get_upper_range_type (this, a_model) |
| Gets the upper boundary type description. | |
| procedure | is_in_lower_range (this, a_model, value) |
| Checks if the value is in the lower range. | |
| procedure | is_in_upper_range (this, a_model, value) |
| Checks if the value is in the upper range. | |
| procedure | increment (this, a_model, eq_comm, is_central) |
| Increments the parameter value. | |
| procedure | decrement (this, a_model, eq_comm) |
| Decrements the parameter value. | |
| procedure | write (this, iou, index, a_model) |
| Writes out a parameter to an output file. | |
| procedure | write_step_data_1 (this, a_model, result_ncid, current_step, index, param_value_id, param_sigma_id, param_corr_id, param_sem_id) |
| Write out the parameter data for a step to the result netcdf file. | |
| GENERIC | write_step_data write_step_data_1 |
| procedure | restart (this, a_model, result_ncid, current_step, index, param_value_id, param_sigma_id, param_corr_id, eq_comm, is_central) |
| Restart the parameter. | |
| procedure | sync_value (this, a_model, recon_comm, eq_comm, is_central) |
| Syncronize the param value to children. | |
| procedure | send_delta (this, index, recon_comm) |
| Sends the delta used. | |
| procedure | recv_delta (this, index, recon_comm) |
| Receives the delta used. | |
| procedure | sync_delta (this, recon_comm) |
| Sync the delta used. | |
| procedure | sync_child (this, a_model, index, recon_comm, eq_comm, is_central) |
| Sync the parameter value from a child to the parent. | |
Public Member Functions inherited from v3fit_params::param_class | |
| FINAL | param_destruct (this) |
| Deconstruct a param_class object. | |
| procedure | get_value (this, a_model) |
| Gets the parameter value. | |
| procedure | get_name (this, a_model) |
| Gets the parameter name. | |
| procedure | write_short (this, iou, index, a_model) |
| Writes out a parameter to an output file. | |
| procedure | write_correlation (this, iou, a_model) |
| Writes out a parameter covariance matrix row. | |
| procedure | write_step_data_2 (this, a_model, result_ncid, current_step, index, param_value_id, param_sigma_id, param_corr_id) |
| Write out the parameter data for a step to the result netcdf file. | |
| GENERIC | write_step_data write_step_data_2 |
Public Attributes | |
| real(rprec) | vrnc = 0.0 |
| The maximum increment size of the parameter for calculating the jacobian. | |
| integer, dimension(2) | range_type = param_range_no_type |
| Type descriptor of the boundry type for the lower(1) and upper(2) ranges. | |
| integer, dimension(2) | range_id = data_no_id |
| If the param_recon_class::range_type is param_range_parameter_type, this holds the parameter id's of the lower(1) and upper(2) boundary. Id's are provided by either the model or the equilibrium. | |
| integer, dimension(2, data_max_indices) | range_indices = 0 |
| If the param_recon_class::range_type is param_range_parameter_type, this holds the parameter indices of the lower(1,:) and upper(2,:) boundary. | |
| real(rprec), dimension(2) | range_value = 0.0 |
| If the param_recon_class::range_type is param_range_value_type, this holds the value of the lower(1) and upper(2) boundary. | |
| real(rprec) | delta |
| The contraints can change the normalization size of the patarameter when incrementing it. Store the actual change in parameter here for normalization. This value is set by param_increment. | |
| real(rprec), dimension(:), pointer | sem => null() |
| Stored row of the signal effectiveness matrix. | |
Public Attributes inherited from v3fit_params::param_class | |
| integer | param_id = data_no_id |
| Id number of the parameter. Id's are provided by either the model or the equilibrium. | |
| integer, dimension(data_max_indices) | indices = 0 |
| The i and j indices of the parameter. These are only used if the parameter is the element of an array. | |
| real(rprec) | sigma = 0.0 |
| Stored value of the parameter uncertainty for the current reconstruction step. This value is calculated by reconstruction::reconstruction_eval_sem. | |
| real(rprec), dimension(:), pointer | correlation => null() |
| Stored row of the correlation matrix. When the parameter is interpreted as a locking parameter, this array contains the parameter coefficents. | |
Class to hold variables needed when a parameter is a reconstruction parameter.
| procedure v3fit_params::param_recon_class::decrement | ( | class (param_recon_class), intent(inout) | this, |
| class (model_class), intent(inout) | a_model, | ||
| integer, intent(in) | eq_comm | ||
| ) |
Decrements the parameter value.
The value is decremented by the delta. The incrementing function has already performed the bounds checking so there is no need to do that here.
| [in] | this | A param_class instance. |
| [in] | a_model | A model instance. |
| [in] | eq_comm | MPI communicator for the child equilibrium processes. |
| procedure v3fit_params::param_recon_class::get_lower_range_type | ( | class (param_recon_class), intent(in) | this, |
| class (model_class), intent(in) | a_model | ||
| ) |
Gets the lower boundary type description.
Gets lower boundary type description.
| [in] | this | A param_recon_class instance. |
| [in] | a_model | A model instance. |
| procedure v3fit_params::param_recon_class::get_lower_range_value | ( | class (param_recon_class), intent(in) | this, |
| class (model_class), intent(in) | a_model | ||
| ) |
Gets the lower boundary value.
Gets lower boundary value. The results of this function are invalid if the bounding type is param_range_infinity_type or param_range_no_type.
| [in] | this | A param_recon_class instance. |
| [in] | a_model | A model instance. |
| procedure v3fit_params::param_recon_class::get_upper_range_type | ( | class (param_recon_class), intent(in) | this, |
| class (model_class), intent(in) | a_model | ||
| ) |
Gets the upper boundary type description.
Gets upper boundary type description.
| [in] | this | A param_recon_class instance. |
| [in] | a_model | A model instance. |
| procedure v3fit_params::param_recon_class::get_upper_range_value | ( | class (param_recon_class), intent(in) | this, |
| class (model_class), intent(in) | a_model | ||
| ) |
Gets the upper boundary value.
Gets upper boundary value. The results of this function are invalid if the bounding type is param_range_infinity_type or param_range_no_type.
| [in] | this | A param_recon_class instance. |
| [in] | a_model | A model instance. |
| procedure v3fit_params::param_recon_class::increment | ( | class (param_recon_class), intent(inout) | this, |
| class (model_class), intent(inout) | a_model, | ||
| integer, intent(in) | eq_comm, | ||
| logical, intent(in) | is_central | ||
| ) |
Increments the parameter value.
The value is incremented by the vrnc. The incremented value is then checked if the new value is in range. If the value is out of range, the value is incremented in the opposite direction. If the incremented value is outside of both ranges, the step size value is halved and the procedure is repeated. Five attempts are made until the function quits with an error. If successful, the actual step size used is cached in param_recon_class::delta for normalization purposes.
If central differencing is used, both the upper and lower bounds must be checked. Starting with half the parameter vrnc, the change in parameter is divided until the change in parameter fits into both the upper and lower bounds.
| [in] | this | A param_recon_class instance. |
| [in] | a_model | A model instance. |
| [in] | eq_comm | MPI communicator for the child equilibrium processes. |
| [in] | is_central | Central differencing is being used. |
| procedure v3fit_params::param_recon_class::is_in_lower_range | ( | class (param_recon_class), intent(in) | this, |
| class (model_class), intent(in) | a_model, | ||
| real (rprec), intent(in) | value | ||
| ) |
Checks if the value is in the lower range.
If the value is less than the bounding value, the parameter value is out of range.
| [in] | this | A param_recon_class instance. |
| [in] | a_model | A model instance. |
| [in] | value | A parameter value to check. |
| procedure v3fit_params::param_recon_class::is_in_upper_range | ( | class (param_recon_class), intent(in) | this, |
| class (model_class), intent(in) | a_model, | ||
| real (rprec), intent(in) | value | ||
| ) |
Checks if the value is in the upper range.
If the value is greater than the bounding value, the parameter value is out of range.
| [in] | this | A param_recon_class instance. |
| [in] | a_model | A model instance. |
| [in] | value | A parameter value to check. |
|
final |
Deconstruct a param_recon_class object.
Deallocates memory and uninitializes a param_recon_class object.
| [in,out] | this | A param_recon_class object. |
| procedure v3fit_params::param_recon_class::recv_delta | ( | class (param_recon_class), intent(inout) | this, |
| integer, intent(in) | index, | ||
| integer, intent(in) | recon_comm | ||
| ) |
Receives the delta used.
Receives the value of delta used in the child process. If MPI support is not compiled in this subroutine reduces to a no op.
| [in,out] | this | A param_recon_class instance. |
| [in] | index | Index of the reconstruction parameter. |
| [in] | recon_comm | A MPI recon_comm handle. |
| procedure v3fit_params::param_recon_class::restart | ( | class (param_recon_class), intent(inout) | this, |
| class (model_class), intent(inout) | a_model, | ||
| integer, intent(in) | result_ncid, | ||
| integer, intent(in) | current_step, | ||
| integer, intent(in) | index, | ||
| integer, intent(in) | param_value_id, | ||
| integer, intent(in) | param_sigma_id, | ||
| integer, intent(in) | param_corr_id, | ||
| integer, intent(in) | eq_comm, | ||
| logical, intent(in) | is_central | ||
| ) |
Restart the parameter.
Restarts a parameter from the result file. This reloads and sets the value, sigma and correlation. All other values are set when the namelist input file was read.
| [in,out] | this | A param_recon_class instance. |
| [in] | a_model | The equilibrium model. |
| [in] | result_ncid | Netcdf if for the result file. |
| [in] | current_step | Step number to restart from. |
| [in] | index | A index of a parameter. |
| [in] | param_value_id | NetCDF variable id of the parameter value. |
| [in] | param_sigma_id | NetCDF variable id of the parameter sigma. |
| [in] | param_corr_id | NetCDF variable id of the parameter correlation. |
| [in] | eq_comm | MPI communicator for the child equilibrium processes. |
| [in] | is_central | Central differencing is being used. |
| procedure v3fit_params::param_recon_class::send_delta | ( | class (param_recon_class), intent(inout) | this, |
| integer, intent(in) | index, | ||
| integer, intent(in) | recon_comm | ||
| ) |
Sends the delta used.
Sends the value of delta used in the child process to the parent process. If MPI support is not compiled in this subroutine reduces to a no op.
| [in,out] | this | A param_recon_class instance. |
| [in] | index | Index of the reconstruction parameter. |
| [in] | recon_comm | A MPI intra_comm handle. |
| procedure v3fit_params::param_recon_class::set_value | ( | class (param_recon_class), intent(in) | this, |
| class (model_class), intent(inout) | a_model, | ||
| real (rprec), intent(in) | value, | ||
| integer, intent(in) | eq_comm, | ||
| logical, intent(in) | is_central | ||
| ) |
Sets the parameter value.
Sets the value of a reconstruction parameter. If the parameter is outside one of the bounding parameters, the value is clamped to the bounding value. The resulting bounded parameter value is set by ether the model or the equilibrium.
If central differencing is used, both the upper and lower bounds must be checked. In this case both the upper and lower bounds need to be with in half the vrnc values. This ensures there is enough room to increment and decrement the values. If the bounds are so narrow such that the set value plus/minus half the vrnc is out of range of both bounds, then split the difference.
| [in] | this | A param_recon_class instance. |
| [in,out] | a_model | A model instance. |
| [in] | value | The value to set the parameter to. |
| [in] | eq_comm | MPI communicator for the child equilibrium processes. |
| [in] | is_central | Central differencing is being used. |
| procedure v3fit_params::param_recon_class::sync_child | ( | class (param_recon_class), intent(inout) | this, |
| class (model_class), intent(inout) | a_model, | ||
| integer, intent(in) | index, | ||
| integer, intent(in) | recon_comm, | ||
| integer, intent(in) | eq_comm, | ||
| logical, intent(in) | is_central | ||
| ) |
Sync the parameter value from a child to the parent.
Syncs the value of delta from a child process to the parent. If MPI support is not compiled in this subroutine reduces to a no op.
| [in,out] | this | A param_recon_class instance. |
| [in,out] | a_model | A model instance. |
| [in] | index | Index of the reconstruction parameter. |
| [in] | recon_comm | A MPI intra_comm handle. |
| [in] | eq_comm | MPI communicator for the child equilibrium processes. |
| [in] | is_central | Central differencing is being used. |
| procedure v3fit_params::param_recon_class::sync_delta | ( | class (param_recon_class), intent(inout) | this, |
| integer, intent(in) | recon_comm | ||
| ) |
Sync the delta used.
Syncs the value of delta from the parent process to the child. If MPI support is not compiled in this subroutine reduces to a no op.
| [in,out] | this | A param_recon_class instance. |
| [in] | recon_comm | A MPI recon_comm handle. |
| procedure v3fit_params::param_recon_class::sync_value | ( | class (param_recon_class), intent(inout) | this, |
| class (model_class), intent(inout) | a_model, | ||
| integer, intent(in) | recon_comm, | ||
| integer, intent(in) | eq_comm, | ||
| logical, intent(in) | is_central | ||
| ) |
Syncronize the param value to children.
Syncs data between the parent and child processes. If MPI support is not compiled in this subroutine reduces to a no op.
| [in,out] | this | A param_recon_class instance. |
| [in,out] | a_model | A model instance. |
| [in] | recon_comm | A MPI intra_comm handle. |
| [in] | eq_comm | MPI communicator for the child equilibrium processes. |
| [in] | is_central | Central differencing is being used. |
| procedure v3fit_params::param_recon_class::write | ( | class (param_recon_class), intent(in) | this, |
| integer, intent(in) | iou, | ||
| integer, intent(in) | index, | ||
| class (model_class), intent(in) | a_model | ||
| ) |
Writes out a parameter to an output file.
Parameter information is formated as the index, name, index 1, index2, value, sigma, vrnc, upper and lower range types, values, and range indices.
| [in] | this | A param_recon_class instance. |
| [in] | iou | Input/output unit representing the file to write to. |
| [in] | index | The index of a parameter. |
| [in] | a_model | A model instance. |
| procedure v3fit_params::param_recon_class::write_step_data_1 | ( | class (param_recon_class), intent(in) | this, |
| class (model_class), intent(in) | a_model, | ||
| integer, intent(in) | result_ncid, | ||
| integer, intent(in) | current_step, | ||
| integer, intent(in) | index, | ||
| integer, intent(in) | param_value_id, | ||
| integer, intent(in) | param_sigma_id, | ||
| integer, intent(in) | param_corr_id, | ||
| integer, intent(in) | param_sem_id | ||
| ) |
Write out the parameter data for a step to the result netcdf file.
Writes out the parameter value, sigma and signal effectiveness matrix to the result file.
| [in] | this | A param_recon_class instance. |
| [in] | 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 parameter. |
| [in] | param_value_id | NetCDF variable id of the parameter value. |
| [in] | param_sigma_id | NetCDF variable id of the parameter sigma. |
| [in] | param_corr_id | NetCDF variable id of the parameter correlation. |
| [in] | param_sem_id | NetCDF variable id of the parameter signal effectiveness. |
| integer, dimension(2) v3fit_params::param_recon_class::range_type = param_range_no_type |
Type descriptor of the boundry type for the lower(1) and upper(2) ranges.
| real (rprec) v3fit_params::param_recon_class::vrnc = 0.0 |
The maximum increment size of the parameter for calculating the jacobian.