V3FIT
Data Types | Functions/Subroutines | Variables
v3fit_params Module Reference

Defines the base class of the type param_class. More...

Data Types

type  param_class
 Base class representing a reconstructed parameter. An upper and lower bound may be set for the parameter value. More...
 
interface  param_construct
 Interface for the construction of param_class types using param_construct_basic or param_construct_recon. More...
 
type  param_locking_class
 Class to hold variables needed when a parameter is a locking parameter. The locking parameter coefficents are stored in the correlation array of the parent type. More...
 
type  param_pointer
 Pointer to a parameter object. Used for creating arrays of signal pointers. This is needed because fortran does not allow arrays of pointers directly. More...
 
type  param_recon_class
 Class to hold variables needed when a parameter is a reconstruction parameter. More...
 
interface  param_write_step_data
 Interface for the writting of param_class data to the result file using param_write_step_data_1 or param_write_step_data_2. More...
 

Functions/Subroutines

type(param_class) function, pointer param_construct_basic (a_model, param_name, indices, num_params)
 Construct a param_class object. More...
 
type(param_class) function, pointer param_construct_recon (a_model, param_name, indices, vrnc, range_type, range_indices, range_value, num_signals, num_params)
 Construct a param_class object. More...
 
type(param_class) function, pointer param_construct_locking (a_model, param_name, indices, set, set_indices, set_coeff, eq_comm)
 Construct a param_class object. More...
 
subroutine param_destruct (this)
 Deconstruct a param_class object. More...
 
subroutine param_set_value (this, a_model, value, eq_comm, is_central)
 Sets the parameter value. More...
 
subroutine param_set_lock_value (this, a_model, eq_comm)
 Sets the locking parameter value. More...
 
real(rprec) function param_get_value (this, a_model)
 Gets the parameter value. More...
 
character(len=data_name_length) function param_get_name (this, a_model)
 Gets the parameter name. More...
 
real(rprec) function param_get_lower_range_value (this, a_model)
 Gets the lower boundary value. More...
 
real(rprec) function param_get_upper_range_value (this, a_model)
 Gets the upper boundary value. More...
 
character(len=data_name_length) function param_get_lower_range_type (this, a_model)
 Gets the lower boundary type description. More...
 
character(len=data_name_length) function param_get_upper_range_type (this, a_model)
 Gets the upper boundary type description. More...
 
logical function param_is_in_lower_range (this, a_model, value)
 Checks if the value is in the lower range. More...
 
logical function param_is_in_upper_range (this, a_model, value)
 Checks if the value is in the upper range. More...
 
subroutine param_increment (this, a_model, eq_comm, is_central)
 Increments the parameter value. More...
 
subroutine param_decrement (this, a_model, eq_comm)
 Decrements the parameter value. More...
 
subroutine param_write (this, iou, index, a_model)
 Writes out a parameter to an output file. More...
 
subroutine param_write_short (this, iou, index, a_model)
 Writes out a parameter to an output file. More...
 
subroutine param_write_header (iou)
 Writes out parameter header information to an output file. More...
 
subroutine param_write_header_short (iou)
 Writes out parameter header information to an output file. More...
 
subroutine param_write_correlation (this, iou, a_model)
 Writes out a parameter covariance matrix row. More...
 
subroutine param_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. More...
 
subroutine param_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. More...
 
subroutine param_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. More...
 
subroutine param_sync_value (this, a_model, recon_comm, eq_comm, is_central)
 Syncronize the param value to children. More...
 
subroutine param_send_delta (this, index, recon_comm)
 Sends the delta used. More...
 
subroutine param_recv_delta (this, index, recon_comm)
 Receives the delta used. More...
 
subroutine param_sync_delta (this, recon_comm)
 Sync the delta used. More...
 
subroutine param_sync_child (this, a_model, index, recon_comm, eq_comm, is_central)
 Sync the parameter value from a child to the parent. More...
 

Variables

integer, parameter param_range_no_type = -1
 No bounding type specified.
 
integer, parameter param_range_value_type = 0
 Parameter value is bounded by a value.
 
integer, parameter param_range_infinity_type = 1
 Parameter value is unbounded.
 
integer, parameter param_range_parameter_type = 2
 Parameter value is bounded by another parameter.
 
integer, parameter param_max_increment_steps = 5
 Maximum number of attemps to change the parameter increment size.
 
integer, parameter param_div_factor = 10.0
 Division factor to decrease the step size.
 

Detailed Description

Defines the base class of the type param_class.

Function/Subroutine Documentation

◆ param_construct_basic()

type (param_class) function, pointer v3fit_params::param_construct_basic ( type (model_class), intent(in)  a_model,
character (len=*), intent(in)  param_name,
integer, dimension(2), intent(in)  indices,
integer, intent(in)  num_params 
)

Construct a param_class object.

Allocates memory and initializes a param_class object. Parameters are converted from strings to an internal id representation by either the model or the equilibrium. This version is used to construct basic parameters.

Parameters
[in]a_modelAn instance of a model object.
[in]param_nameThe name of the parameter.
[in]indicesThe array indices of the parameter.
[in]num_paramsNumber of parameters. USed to determine the size of the param_class::correlation arrays.
Returns
A pointer to a constructed param_class object.

Definition at line 171 of file v3fit_params.f.

◆ param_construct_locking()

type (param_class) function, pointer v3fit_params::param_construct_locking ( type (model_class), intent(inout)  a_model,
character (len=*), intent(in)  param_name,
integer, dimension(2), intent(in)  indices,
character (len=*), dimension(:), intent(in)  set,
integer, dimension(:,:), intent(in)  set_indices,
real (rprec), dimension(:), intent(in)  set_coeff,
integer, intent(in)  eq_comm 
)

Construct a param_class object.

Allocates memory and initializes a param_class object. Parameters are converted from strings to an internal id representation by either the model or the equilibrium. This version is used to construct locking parameters.

Parameters
[in]a_modelAn instance of a model object.
[in]param_nameThe name of the parameter.
[in]indicesThe array indices of the parameter.
[in]setArray of parameters to lock to.
[in]set_indicesArray of parameters indices for parameters to lock to.
[in]set_coeffCoefficients for the parameters to lock to.
[in]eq_commMPI communicator for the child equilibrium processes.
Returns
A pointer to a constructed param_class object.

Definition at line 355 of file v3fit_params.f.

◆ param_construct_recon()

type (param_class) function, pointer v3fit_params::param_construct_recon ( type (model_class), intent(in)  a_model,
character (len=*), intent(in)  param_name,
integer, dimension(2), intent(in)  indices,
real (rprec), intent(in)  vrnc,
character (len=*), dimension(2), intent(in)  range_type,
integer, dimension(2,2), intent(in)  range_indices,
real (rprec), dimension(2), intent(in)  range_value,
integer, intent(in)  num_signals,
integer, intent(in)  num_params 
)

Construct a param_class object.

Allocates memory and initializes a param_class object. Parameters are converted from strings to an internal id representation by either the model or the equilibrium. This version is used to construct reconstruction parameters.

Parameter boundaries are specified by a range type. This range type may be one of three types. 'infinity' represents an unbounded case. 'value' represents a bounds by a fixed value. By specifying another parameter name, the boundary will be bounded by a fixed or varying parameter. The bounding parameter string is converted into an internal id representation.

Parameters
[in]a_modelAn instance of a model object.
[in]param_nameThe name of the parameter.
[in]indicesThe array indices of the parameter.
[in]vrncThe maximum incremental step size.
[in]range_typeRange type of the bounds. Values can be 'infinity', 'value' or the name of a parameter.
[in]range_indicesThe array indices of the boundary parameter.
[in]range_valueValue of a boundary.
[in]num_signalsNumber of signals. Used to determine the size of the param_recon_class::sem arrays.
[in]num_paramsNumber of parameters. Used to determine the size of the param_class::correlation arrays.
Returns
A pointer to a constructed param_class object.

Definition at line 233 of file v3fit_params.f.

◆ param_decrement()

subroutine v3fit_params::param_decrement ( type (param_class), intent(inout)  this,
type (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.

Parameters
[in]thisA param_class instance.
[in]a_modelA model instance.
[in]eq_commMPI communicator for the child equilibrium processes.

Definition at line 1084 of file v3fit_params.f.

◆ param_destruct()

subroutine v3fit_params::param_destruct ( type (param_class), pointer  this)

Deconstruct a param_class object.

Deallocates memory and uninitializes a param_class object.

Parameters
[in,out]thisA param_class instance.

Definition at line 420 of file v3fit_params.f.

◆ param_get_lower_range_type()

character (len=data_name_length) function v3fit_params::param_get_lower_range_type ( type (param_class), intent(in)  this,
type (model_class), intent(in)  a_model 
)

Gets the lower boundary type description.

Gets lower boundary type description.

Parameters
[in]thisA param_class instance.
[in]a_modelA model instance.
Returns
A string description of the lower boundary type.

Definition at line 802 of file v3fit_params.f.

◆ param_get_lower_range_value()

real (rprec) function v3fit_params::param_get_lower_range_value ( type (param_class), intent(in)  this,
type (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.

Parameters
[in]thisA param_class instance.
[in]a_modelA model instance.
Returns
The lower bounding value.

Definition at line 717 of file v3fit_params.f.

◆ param_get_name()

character (len=data_name_length) function v3fit_params::param_get_name ( type (param_class), intent(in)  this,
type (model_class), intent(in)  a_model 
)

Gets the parameter name.

Converts the parameter id from either the model or the equilibrium.

Parameters
[in]thisA param_class instance.
[in]a_modelA model instance.
Returns
The parameter name.

Definition at line 686 of file v3fit_params.f.

◆ param_get_upper_range_type()

character (len=data_name_length) function v3fit_params::param_get_upper_range_type ( type (param_class), intent(in)  this,
type (model_class), intent(in)  a_model 
)

Gets the upper boundary type description.

Gets upper boundary type description.

Parameters
[in]thisA param_class instance.
[in]a_modelA model instance.
Returns
A string description of the upper boundary type.

Definition at line 848 of file v3fit_params.f.

◆ param_get_upper_range_value()

real (rprec) function v3fit_params::param_get_upper_range_value ( type (param_class), intent(in)  this,
type (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.

Parameters
[in]thisA param_class instance.
[in]a_modelA model instance.
Returns
The upper bounding value.

Definition at line 760 of file v3fit_params.f.

◆ param_get_value()

real (rprec) function v3fit_params::param_get_value ( type (param_class), intent(in)  this,
type (model_class), intent(in)  a_model 
)

Gets the parameter value.

Gets the current parameter value from either the model or the equilibrium.

Parameters
[in]thisA param_class instance.
[in]a_modelA model instance.
Returns
The parameter value.

Definition at line 652 of file v3fit_params.f.

◆ param_increment()

subroutine v3fit_params::param_increment ( type (param_class), intent(inout)  this,
type (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.

Parameters
[in]thisA param_class instance.
[in]a_modelA model instance.
[in]eq_commMPI communicator for the child equilibrium processes.
[in]is_centralCentral differencing is being used.

Definition at line 986 of file v3fit_params.f.

◆ param_is_in_lower_range()

logical function v3fit_params::param_is_in_lower_range ( type (param_class), intent(in)  this,
type (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.

Parameters
[in]thisA param_class instance.
[in]a_modelA model instance.
[in]valueA parameter value to check.
Returns
True for in range and false for out of range.

Definition at line 899 of file v3fit_params.f.

◆ param_is_in_upper_range()

logical function v3fit_params::param_is_in_upper_range ( type (param_class), intent(in)  this,
type (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.

Parameters
[in]thisA param_class instance.
[in]a_modelA model instance.
[in]valueA parameter value to check.
Returns
True for in range and false for out of range.

Definition at line 936 of file v3fit_params.f.

◆ param_recv_delta()

subroutine v3fit_params::param_recv_delta ( type (param_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.

Parameters
[in,out]thisA param_class instance.
[in]indexIndex of the reconstruction parameter.
[in]recon_commA MPI recon_comm handle.

Definition at line 1610 of file v3fit_params.f.

◆ param_restart()

subroutine v3fit_params::param_restart ( type (param_class), intent(inout)  this,
type (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.

Parameters
[in,out]thisA param_class instance.
[in]a_modelThe equilibrium model.
[in]result_ncidNetcdf if for the result file.
[in]current_stepStep number to restart from.
[in]indexA index of a parameter.
[in]param_value_idNetCDF variable id of the parameter value.
See also
v3fit_context
Parameters
[in]param_sigma_idNetCDF variable id of the parameter sigma.
See also
v3fit_context
Parameters
[in]param_corr_idNetCDF variable id of the parameter correlation.
See also
v3fit_context
Parameters
[in]eq_commMPI communicator for the child equilibrium processes.
[in]is_centralCentral differencing is being used.

Definition at line 1456 of file v3fit_params.f.

◆ param_send_delta()

subroutine v3fit_params::param_send_delta ( type (param_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.

Parameters
[in,out]thisA param_class instance.
[in]indexIndex of the reconstruction parameter.
[in]recon_commA MPI intra_comm handle.

Definition at line 1568 of file v3fit_params.f.

◆ param_set_lock_value()

subroutine v3fit_params::param_set_lock_value ( type (param_class), intent(in)  this,
type (model_class), intent(inout)  a_model,
integer, intent(in)  eq_comm 
)

Sets the locking parameter value.

Sets the value of a locking parameter. These parameters are locked to a linear combination of other set parameters.

Parameters
[in]thisA param_class instance.
[in,out]a_modelA model instance.
[in]eq_commMPI communicator for the child equilibrium processes.

Definition at line 597 of file v3fit_params.f.

◆ param_set_value()

subroutine v3fit_params::param_set_value ( type (param_class), intent(in)  this,
type (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 ethier 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.

Parameters
[in]thisA param_class instance.
[in,out]a_modelA model instance.
[in]valueThe value to set the parameter to.
[in]eq_commMPI communicator for the child equilibrium processes.
[in]is_centralCentral differencing is being used.

Definition at line 493 of file v3fit_params.f.

◆ param_sync_child()

subroutine v3fit_params::param_sync_child ( type (param_class), intent(inout)  this,
type (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.

Parameters
[in,out]thisA param_class instance.
[in,out]a_modelA model instance.
[in]indexIndex of the reconstruction parameter.
[in]recon_commA MPI intra_comm handle.
[in]eq_commMPI communicator for the child equilibrium processes.
[in]is_centralCentral differencing is being used.

Definition at line 1685 of file v3fit_params.f.

◆ param_sync_delta()

subroutine v3fit_params::param_sync_delta ( type (param_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.

Parameters
[in,out]thisA param_class instance.
[in]recon_commA MPI recon_comm handle.

Definition at line 1645 of file v3fit_params.f.

◆ param_sync_value()

subroutine v3fit_params::param_sync_value ( type (param_class), intent(inout)  this,
type (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.

Parameters
[in,out]thisA param_class instance.
[in,out]a_modelA model instance.
[in]recon_commA MPI intra_comm handle.
[in]eq_commMPI communicator for the child equilibrium processes.
[in]is_centralCentral differencing is being used.

Definition at line 1519 of file v3fit_params.f.

◆ param_write()

subroutine v3fit_params::param_write ( type (param_class), intent(in)  this,
integer, intent(in)  iou,
integer, intent(in)  index,
type (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.

Parameters
[in]thisA param_class instance.
[in]iouInput/output unit representing the file to write to.
[in]indexThe index of a parameter.
[in]a_modelA model instance.
Note
Eventually parameter range informarion will be added as well.

Definition at line 1122 of file v3fit_params.f.

◆ param_write_correlation()

subroutine v3fit_params::param_write_correlation ( type (param_class), intent(in)  this,
integer, intent(in)  iou,
type (model_class), intent(in)  a_model 
)

Writes out a parameter covariance matrix row.

Each parameter contains the row for it's covariance matrix. This write it out formatted as the name of the parameter up to 12 characters. This followed by each value spearated by 2 spaces and a 12 character number.

Parameters
[in]thisA param_class instance.
[in]iouInput/output unit representing the file to write to.
[in]a_modelA model instance.

Definition at line 1275 of file v3fit_params.f.

◆ param_write_header()

subroutine v3fit_params::param_write_header ( integer, intent(in)  iou)

Writes out parameter header information 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. This is implmented as a static method and does not require a parameter instance. This should only be called once to produce a single header.

Parameters
[in]iouA input/output representing the file to write to.

Definition at line 1203 of file v3fit_params.f.

◆ param_write_header_short()

subroutine v3fit_params::param_write_header_short ( integer, intent(in)  iou)

Writes out parameter header information to an output file.

Parameter information is formated as the index, name, index 1, index2, value and sigma. This is implmented as a static method and does not require a parameter instance. This should only be called once to produce a single header.

Parameters
[in]iouA input/output representing the file to write to.

Definition at line 1239 of file v3fit_params.f.

◆ param_write_short()

subroutine v3fit_params::param_write_short ( type (param_class), intent(in)  this,
integer, intent(in)  iou,
integer, intent(in)  index,
type (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 and sigma.

Parameters
[in]thisA param_class instance.
[in]iouInput/output unit representing the file to write to.
[in]indexThe index of a parameter.
[in]a_modelA model instance.

Definition at line 1167 of file v3fit_params.f.

◆ param_write_step_data_1()

subroutine v3fit_params::param_write_step_data_1 ( type (param_class), intent(in)  this,
type (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.

Parameters
[in]thisA param_class instance.
[in]a_modelThe equilibrium model.
[in]result_ncidA NetCDF id of the result file.
[in]current_stepThe surrent reconstruction step.
[in]indexA index of a parameter.
[in]param_value_idNetCDF variable id of the parameter value.
See also
v3fit_context
Parameters
[in]param_sigma_idNetCDF variable id of the parameter sigma.
See also
v3fit_context
Parameters
[in]param_corr_idNetCDF variable id of the parameter correlation.
See also
v3fit_context
Parameters
[in]param_sem_idNetCDF variable id of the parameter signal effectiveness.
Note
This assumes that the parameter sigma has already been calculated. Name and index information is written when the result file is first created by v3fit_context::v3fit_context_write_step_data.

Definition at line 1330 of file v3fit_params.f.

◆ param_write_step_data_2()

subroutine v3fit_params::param_write_step_data_2 ( type (param_class), intent(in)  this,
type (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 
)

Write out the parameter data for a step to the result netcdf file.

Writes out the parameter value and sigma to the result file.

Parameters
[in]thisA param_class instance.
[in]a_modelThe equilibrium model.
[in]result_ncidA NetCDF id of the result file.
[in]current_stepThe surrent reconstruction step.
[in]indexA index of a parameter.
[in]param_value_idNetCDF variable id of the parameter value.
See also
v3fit_context
Parameters
[in]param_sigma_idNetCDF variable id of the parameter sigma.
See also
v3fit_context
Parameters
[in]param_corr_idNetCDF variable id of the parameter correlation.
See also
v3fit_context
Note
This assumes that the parameter sigma has already been calculated. Name and index information is written when the result file is first created by v3fit_context::v3fit_context_write_step_data.

Definition at line 1390 of file v3fit_params.f.