|
V3FIT
|
Go to the documentation of this file.
14 USE stel_kinds,
only: rprec
51 REAL(rprec),
DIMENSION(:),
POINTER :: a
107 INTEGER,
INTENT(in) :: n_signals
108 CHARACTER (len=combination_type_length),
INTENT(in) ::
110 INTEGER,
INTENT(IN) :: wgt_index
113 REAL (rprec) :: start_time
116 start_time = profiler_get_start_time()
125 SELECT CASE (combination_type)
137 IF (n_signals .gt. 2)
THEN
143 CALL profiler_set_stop_time(
'combination_construct', start_time)
145 1000
FORMAT(
'More than two signals specified for weighted average. &
146 & Only using the first two.')
167 TYPE (combination_class),
INTENT(inout) :: this
176 IF (
ASSOCIATED(this%signals))
THEN
177 DO i = 1,
SIZE(this%signals)
178 this%signals(i)%p => null()
180 this%signals => null()
182 IF (
ASSOCIATED(this%a))
THEN
212 INTEGER,
INTENT(in) :: index
213 REAL (rprec),
INTENT(in) :: a
216 REAL (rprec) :: start_time
219 start_time = profiler_get_start_time()
222 this%signals(index)%p =>
signal
224 CALL profiler_set_stop_time(
'combination_set_signal', start_time)
244 TYPE (model_class),
INTENT(in) :: a_model
247 REAL (rprec) :: start_time
249 this%a(1) = a_model%coosig_wgts(this%wgt_index)
250 this%a(2) = 1.0 - this%a(1)
252 CALL profiler_set_stop_time(
'combination_set_signal', start_time)
281 REAL (rprec),
DIMENSION(4),
INTENT(out) :: sigma
282 REAL (rprec),
DIMENSION(4),
INTENT(in) :: last_value
287 REAL (rprec),
DIMENSION(4) :: sigma_local
288 REAL (rprec) :: start_time
291 start_time = profiler_get_start_time()
295 temp_signal => this%signals(1)%p
298 & temp_signal%get_modeled_signal(a_model, sigma, .true.,
301 SELECT CASE(this%type)
303 DO i = 2,
SIZE(this%signals)
304 temp_signal => this%signals(i)%p
307 & temp_signal%get_modeled_signal(a_model,
312 sigma = sigma + sigma_local
316 DO i = 2,
SIZE(this%signals)
317 temp_signal => this%signals(i)%p
320 & temp_signal%get_modeled_signal(a_model, sigma_local,
321 & .true., last_value) *
323 sigma = max(sigma, sigma_local)
327 DO i = 2,
SIZE(this%signals)
328 temp_signal => this%signals(i)%p
331 & temp_signal%get_modeled_signal(a_model, sigma_local,
332 & .true., sigma_local) *
334 sigma = min(sigma, sigma_local)
342 temp_signal => this%signals(2)%p
345 & temp_signal%get_modeled_signal(a_model, sigma_local,
346 & .true., last_value) *
349 sigma = sigma + this%a(2)*sigma_local
356 CALL this%scale_and_offset(a_model,
359 CALL profiler_set_stop_time(
'combination_get_modeled_signal',
382 REAL (rprec) :: start_time
385 start_time = profiler_get_start_time()
387 SELECT CASE (this%type)
402 CALL profiler_set_stop_time(
'combination_get_type', start_time)
423 CHARACTER (len=data_name_length),
DIMENSION(7),
INTENT(inout) ::
427 REAL (rprec) :: start_time
430 start_time = profiler_get_start_time()
432 header(1) =
'model(2)'
433 header(2) =
'model(3)'
434 header(3) =
'model(4)'
435 header(4) =
'model_sig(1)'
436 header(5) =
'model_sig(2)'
437 header(6) =
'model_sig(3)'
438 header(7) =
'model_sig(4)'
440 CALL profiler_set_stop_time(
'combination_get_header', start_time)
463 INTEGER,
INTENT(in) :: iou
464 INTEGER,
INTENT(in) :: index
465 TYPE (model_class),
INTENT(in) :: a_model
469 REAL (rprec) :: start_time
472 start_time = profiler_get_start_time()
475 WRITE (iou,1000) index, this%get_type()
477 WRITE (iou,1001) this%wgt_index
481 DO i = 1,
SIZE(this%signals)
482 WRITE (iou,1003) i, this%signals(i)%p%s_name, this%a(i)
485 CALL profiler_set_stop_time(
'combination_write_auxiliary',
488 1000
FORMAT(
'Signal',1x,i4,1x,
489 &
'is a combination of other signals, type: ',a)
490 1001
FORMAT(
'Weighted Average Index: ',i4)
491 1002
FORMAT(
'term #',2x,
's_name',16x,
'Coefficient')
492 1003
FORMAT(2x,i4,2x,a20,2x,es12.5)
Defines the base class of the type combination_class.
integer, parameter combination_sum
Type descriptor for combination type sum.
Defines the base class of the type model_class. The model contains information not specific to the eq...
subroutine combination_set_weight(this, a_model)
Sets the weight factors from from the weight index.
integer, parameter combination_wavg
Type descriptor for combination type weighted average.
integer, parameter combination_type_length
Maximum length of the combination type descritpion string.
subroutine combination_get_header(this, header)
Gets a discription of the model and model sigma array indices.
subroutine combination_write_auxiliary(this, iou, index, a_model)
Write out auxiliary signal information to an output file.
integer, parameter combination_max
Type descriptor for combination type max.
character(len=data_name_length) function combination_get_type(this)
Gets a discription of the combination type.
integer, parameter combination_none
Type descriptor for combination type no type.
Base class representing a combination signal.
Base class representing a model.
real(rprec) function, dimension(4) combination_get_modeled_signal(this, a_model, sigma, last_value)
Calculates the modeled signal.
subroutine combination_set_signal(this, signal, a, index)
Set the object and coefficient for an index.
This modules contains parameters used by equilibrium models.
Pointer to a signal object. Used for creating arrays of signal pointers. This is needed because fortr...
integer, parameter combination_min
Type descriptor for combination type min.
Base class representing a signal.
subroutine combination_destruct(this)
Deconstruct a combination_class object.
type(combination_class) function, pointer combination_construct(n_signals, combination_type, wgt_index)
Construct a combination_class.
Defines the base class of the type signal_class.