V3FIT
v3fit_params.f
Go to the documentation of this file.
1 !*******************************************************************************
4 !
5 ! Note separating the Doxygen comment block here so detailed decription is
6 ! found in the Module not the file.
7 !
9 !*******************************************************************************
10 
11  MODULE v3fit_params
12 
13  USE stel_kinds, only: rprec
14  USE data_parameters
15  USE model
16 
17  IMPLICIT NONE
18 
19 !*******************************************************************************
20 ! param module parameters
21 !*******************************************************************************
23  INTEGER, PARAMETER :: param_range_no_type = -1
25  INTEGER, PARAMETER :: param_range_value_type = 0
27  INTEGER, PARAMETER :: param_range_infinity_type = 1
29  INTEGER, PARAMETER :: param_range_parameter_type = 2
30 
32  INTEGER, PARAMETER :: param_max_increment_steps = 5
34  INTEGER, PARAMETER :: param_div_factor = 10.0
35 
36 !*******************************************************************************
37 ! DERIVED-TYPE DECLARATIONS
38 ! 1) parameter base class
39 !
40 !*******************************************************************************
41 !-------------------------------------------------------------------------------
44 !-------------------------------------------------------------------------------
48  REAL (rprec) :: vrnc = 0.0
49 
50 ! Parameter ranges
57  INTEGER, DIMENSION(2) :: range_type = param_range_no_type
62  INTEGER, DIMENSION(2) :: range_id = data_no_id
66  INTEGER, DIMENSION(2,data_max_indices) :: range_indices = 0
69  REAL (rprec), DIMENSION(2) :: range_value = 0.0
70 
74  REAL (rprec) :: delta
75 
77  REAL (rprec), DIMENSION(:), POINTER :: sem => null()
78  END TYPE
79 
80 !-------------------------------------------------------------------------------
84 !-------------------------------------------------------------------------------
87  INTEGER, DIMENSION(:), POINTER :: ids => null()
89  INTEGER, DIMENSION(:,:), POINTER :: indices => null()
90  END TYPE
91 
92 !-------------------------------------------------------------------------------
95 !-------------------------------------------------------------------------------
99  INTEGER :: param_id = data_no_id
102  INTEGER, DIMENSION(data_max_indices) :: indices = 0
103 
105  TYPE (param_recon_class), POINTER :: recon => null()
107  TYPE (param_locking_class), POINTER :: locks => null()
108 
112  REAL (rprec) :: sigma = 0.0
115  REAL (rprec), DIMENSION(:), POINTER :: correlation => null()
116  END TYPE
117 
118 !-------------------------------------------------------------------------------
121 !-------------------------------------------------------------------------------
125  TYPE (param_class), POINTER :: p => null()
126  END TYPE
127 
128 !*******************************************************************************
129 ! INTERFACE BLOCKS
130 !*******************************************************************************
131 !-------------------------------------------------------------------------------
134 !-------------------------------------------------------------------------------
135  INTERFACE param_construct
136  MODULE PROCEDURE param_construct_basic, &
139  END INTERFACE
140 
141 !-------------------------------------------------------------------------------
144 !-------------------------------------------------------------------------------
146  MODULE PROCEDURE param_write_step_data_1, &
148  END INTERFACE
149 
150  CONTAINS
151 !*******************************************************************************
152 ! CONSTRUCTION SUBROUTINES
153 !*******************************************************************************
154 !-------------------------------------------------------------------------------
168 !-------------------------------------------------------------------------------
169  FUNCTION param_construct_basic(a_model, param_name, indices, &
170  & num_params)
171 
172  IMPLICIT NONE
173 
174 ! Declare Arguments
175  TYPE (param_class), POINTER :: param_construct_basic
176  TYPE (model_class), INTENT(in) :: a_model
177  CHARACTER (len=*), INTENT(in) :: param_name
178  INTEGER, DIMENSION(2), INTENT(in) :: indices
179  INTEGER, INTENT(in) :: num_params
180 
181 ! local variables
182  REAL (rprec) :: start_time
183 
184 ! Start of executable code
185  start_time = profiler_get_start_time()
186 
187  ALLOCATE(param_construct_basic)
188 
189  param_construct_basic%param_id = &
190  & model_get_param_id(a_model, trim(param_name))
191 
192  ALLOCATE(param_construct_basic%correlation(num_params))
193  param_construct_basic%correlation = 0.0
194 
195  param_construct_basic%indices = indices
196 
197  CALL profiler_set_stop_time('param_construct_basic', start_time)
198 
199  END FUNCTION
200 
201 !-------------------------------------------------------------------------------
228 !-------------------------------------------------------------------------------
229  FUNCTION param_construct_recon(a_model, param_name, indices, &
230  & vrnc, range_type, range_indices, &
231  & range_value, num_signals, &
232  & num_params)
233  USE v3_utilities
234 
235  IMPLICIT NONE
236 
237 ! Declare Arguments
238  TYPE (param_class), POINTER :: param_construct_recon
239  TYPE (model_class), INTENT(in) :: a_model
240  CHARACTER (len=*), INTENT(in) :: param_name
241  INTEGER, DIMENSION(2), INTENT(in) :: indices
242  REAL (rprec), INTENT(in) :: vrnc
243  CHARACTER (len=*), DIMENSION(2), INTENT(in) :: range_type
244  INTEGER, DIMENSION(2,2), INTENT(in) :: range_indices
245  REAL (rprec), DIMENSION(2), INTENT(in) :: range_value
246  INTEGER, INTENT(in) :: num_signals
247  INTEGER, INTENT(in) :: num_params
248 
249 ! local variables
250  REAL (rprec) :: value
251  REAL (rprec) :: start_time
252 
253 ! Start of executable code
254  start_time = profiler_get_start_time()
255 
256  param_construct_recon => param_construct(a_model, param_name, &
257  & indices, num_params)
258 
259  IF (.not.model_is_recon_param(a_model, &
260  & param_construct_recon%param_id)) THEN
261  CALL err_fatal('param_construct: ' // trim(param_name) // &
262  & ' is an invalid reconstruction ' // &
263  & 'parameter')
264  END IF
265 
266  ALLOCATE(param_construct_recon%recon)
267  param_construct_recon%recon%vrnc = vrnc
268 
269  SELECT CASE (trim(range_type(1)))
270 
271  CASE ('value')
272  param_construct_recon%recon%range_type(1) = &
274  param_construct_recon%recon%range_value(1) = &
275  & range_value(1)
276 
277  CASE ('infinity')
278  param_construct_recon%recon%range_type(1) = &
280 
281  CASE DEFAULT
282  param_construct_recon%recon%range_type(1) = &
284  param_construct_recon%recon%range_id(1) = &
285  & model_get_param_id(a_model, trim(range_type(1)))
286  param_construct_recon%recon%range_indices(1,:) = &
287  & range_indices(1,:)
288 
289  END SELECT
290 
291  SELECT CASE (trim(range_type(2)))
292 
293  CASE ('value')
294  param_construct_recon%recon%range_type(2) = &
296  param_construct_recon%recon%range_value(2) = &
297  & range_value(2)
298 
299  CASE ('infinity')
300  param_construct_recon%recon%range_type(2) = &
302 
303  CASE DEFAULT
304  param_construct_recon%recon%range_type(2) = &
306  param_construct_recon%recon%range_id(2) = &
307  & model_get_param_id(a_model, trim(range_type(2)))
308  param_construct_recon%recon%range_indices(2,:) = &
309  & range_indices(2,:)
310 
311  END SELECT
312 
313  ALLOCATE(param_construct_recon%recon%sem(num_signals))
314  param_construct_recon%recon%sem = 0.0
315 
316 ! Check if the inital parameter value is in range.
317  value = param_get_value(param_construct_recon, a_model)
319  & a_model, value), &
320  & trim(param_get_name(param_construct_recon, a_model)) &
321  & // ' inital value is outside reconstruction parameter' &
322  & //' lower bound.')
323 
325  & a_model, value), &
326  & trim(param_get_name(param_construct_recon, a_model)) &
327  & // ' inital value is outside reconstruction parameter' &
328  & // ' upper bound.')
329 
330  CALL profiler_set_stop_time('param_construct_recon', start_time)
331 
332  END FUNCTION
333 
334 !-------------------------------------------------------------------------------
351 !-------------------------------------------------------------------------------
352  FUNCTION param_construct_locking(a_model, param_name, indices, &
353  & set, set_indices, set_coeff, &
354  & eq_comm)
355  USE v3_utilities
356 
357  IMPLICIT NONE
358 
359 ! Declare Arguments
360  TYPE (param_class), POINTER :: param_construct_locking
361  TYPE (model_class), INTENT(inout) :: a_model
362  CHARACTER (len=*), INTENT(in) :: param_name
363  INTEGER, DIMENSION(2), INTENT(in) :: indices
364  CHARACTER (len=*), DIMENSION(:), INTENT(in) :: set
365  INTEGER, DIMENSION(:,:), INTENT(in) :: set_indices
366  REAL (rprec), DIMENSION(:), INTENT(in) :: set_coeff
367  INTEGER, INTENT(in) :: eq_comm
368 
369 ! local variables
370  INTEGER :: i
371  REAL (rprec) :: start_time
372 
373 ! Start of executable code
374  start_time = profiler_get_start_time()
375 
376  param_construct_locking => param_construct(a_model, param_name, &
377  & indices, SIZE(set))
378 
379  IF (.not.model_is_recon_param(a_model, &
380  & param_construct_locking%param_id)) THEN
381  CALL err_fatal('param_construct: ' // trim(param_name) // &
382  & ' is an invalid locking parameter')
383  END IF
384 
385  ALLOCATE(param_construct_locking%locks)
386 
387  ALLOCATE(param_construct_locking%locks%ids(SIZE(set)))
388  DO i = 1, SIZE(set)
389  param_construct_locking%locks%ids(i) = &
390  & model_get_param_id(a_model, trim(set(i)))
391  END DO
392 
393  ALLOCATE(param_construct_locking%locks%indices(SIZE(set), &
394  & data_max_indices))
395  param_construct_locking%locks%indices = set_indices
396 
397 ! Use the correlation array as the array to hold the set coefficients. This
398 ! array was allocated by param_construct.
399  param_construct_locking%correlation = set_coeff
400 
401 ! Set the inital value of the locked parameter.
403  & eq_comm)
404 
405  CALL profiler_set_stop_time('param_construct_locking', start_time)
406 
407  END FUNCTION
408 
409 !*******************************************************************************
410 ! DESTRUCTION SUBROUTINES
411 !*******************************************************************************
412 !-------------------------------------------------------------------------------
418 !-------------------------------------------------------------------------------
419  SUBROUTINE param_destruct(this)
420 
421  IMPLICIT NONE
422 
423 ! Declare Arguments
424  TYPE (param_class), POINTER :: this
425 
426 ! Start of executable code
427  this%param_id = data_no_id
428  this%indices = 0
429 
430  IF (ASSOCIATED(this%recon)) THEN
431 
432  IF (ASSOCIATED(this%recon%sem)) THEN
433  DEALLOCATE(this%recon%sem)
434  this%recon%sem => null()
435  END IF
436 
437  DEALLOCATE(this%recon)
438  this%recon => null()
439  END IF
440 
441  IF (ASSOCIATED(this%locks)) THEN
442 
443  IF (ASSOCIATED(this%locks%ids)) THEN
444  DEALLOCATE(this%locks%ids)
445  this%locks%ids => null()
446  END IF
447 
448  IF (ASSOCIATED(this%locks%indices)) THEN
449  DEALLOCATE(this%locks%indices)
450  this%locks%indices => null()
451  END IF
452 
453  DEALLOCATE(this%locks)
454  this%locks => null()
455  END IF
456 
457  IF (ASSOCIATED(this%correlation)) THEN
458  DEALLOCATE(this%correlation)
459  this%correlation => null()
460  END IF
461 
462  DEALLOCATE(this)
463 
464  END SUBROUTINE
465 
466 !*******************************************************************************
467 ! SETTER SUBROUTINES
468 !*******************************************************************************
469 !-------------------------------------------------------------------------------
490 !-------------------------------------------------------------------------------
491  SUBROUTINE param_set_value(this, a_model, value, eq_comm, &
492  & is_central)
493 
494  IMPLICIT NONE
495 
496 ! Declare Arguments
497  TYPE (param_class), INTENT(in) :: this
498  TYPE (model_class), INTENT(inout) :: a_model
499  REAL (rprec), INTENT(in) :: value
500  INTEGER, INTENT(in) :: eq_comm
501  LOGICAL, INTENT(in) :: is_central
502 
503 ! Local variables
504  REAL (rprec) :: set_value
505  REAL (rprec) :: off_set_value
506  REAL (rprec) :: upper_value
507  REAL (rprec) :: lower_value
508  REAL (rprec) :: start_time
509 
510 ! Start of executable code
511  start_time = profiler_get_start_time()
512 
513  set_value = value
514 
515  IF (is_central) THEN
516  off_set_value = this%recon%vrnc/2.0
517  ELSE
518  off_set_value = 0.0
519  END IF
520 
521 ! Check if the value is within the lower range. If the value is outside,
522 ! truncate the value to the lower range.
523  IF (this%recon%range_type(1) .ne. param_range_infinity_type) THEN
524  lower_value = param_get_lower_range_value(this, a_model)
525 
526  IF (set_value - off_set_value .lt. lower_value) THEN
527 
528 ! The set value must be at least the lower value plus the offset value. When
529 ! not using central differencing, the the offset is zero.
530  set_value = lower_value + off_set_value
531 
532 ! Need to check the upper range if using central differencing.
533  IF (is_central .and. (this%recon%range_type(2) .ne. &
535 
536  upper_value = param_get_upper_range_value(this, a_model)
537 
538  IF (set_value + off_set_value .gt. upper_value) THEN
539 ! Both bounds are two narrow to fit the new value. Split the difference.
540  set_value = (upper_value + lower_value)/2.0
541  END IF
542  END IF
543 
544  CALL model_set_param(a_model, this%param_id, &
545  & this%indices(1), this%indices(2), &
546  & set_value, eq_comm)
547 
548  CALL profiler_set_stop_time('profiler_get_start_time', &
549  & start_time)
550  RETURN
551  END IF
552  END IF
553 
554 ! The value is in the lower range. Check upper range. If the value is outside,
555 ! truncate the value to the upper range.
556  IF (this%recon%range_type(2) .ne. param_range_infinity_type) THEN
557  upper_value = param_get_upper_range_value(this, a_model)
558 
559  IF (set_value + off_set_value .gt. upper_value) THEN
560 
561 ! The set value must be no more than the upper value minus the offset value.
562 ! When not using central differencing, the the offset is zero. There is no need
563 ! to check the lower range because it has already been confirmed that the lower
564 ! range is negative infinity.
565  set_value = upper_value - off_set_value
566 
567  CALL model_set_param(a_model, this%param_id, &
568  & this%indices(1), this%indices(2), &
569  & set_value, eq_comm)
570 
571  CALL profiler_set_stop_time('profiler_get_start_time', &
572  & start_time)
573  RETURN
574  END IF
575  END IF
576 
577 ! The value is in range. Set the value to this.
578  CALL model_set_param(a_model, this%param_id, &
579  & this%indices(1), this%indices(2), &
580  & set_value, eq_comm)
581 
582  CALL profiler_set_stop_time('profiler_get_start_time', start_time)
583 
584  END SUBROUTINE
585 
586 !-------------------------------------------------------------------------------
595 !-------------------------------------------------------------------------------
596  SUBROUTINE param_set_lock_value(this, a_model, eq_comm)
597 
598  IMPLICIT NONE
599 
600 ! Declare Arguments
601  TYPE (param_class), INTENT(in) :: this
602  TYPE (model_class), INTENT(inout) :: a_model
603  INTEGER, INTENT(in) :: eq_comm
604 
605 ! Local variables
606  INTEGER :: i
607  REAL (rprec) :: temp
608  REAL (rprec) :: inital_value
609  REAL (rprec) :: start_time
610 
611 ! Start of executable code
612  start_time = profiler_get_start_time()
613 
614  inital_value = model_get_param_value(a_model, this%param_id, &
615  & this%indices(1), &
616  & this%indices(2))
617 
618  temp = 0.0
619  DO i = 0, SIZE(this%locks%ids)
620  temp = temp + this%correlation(i) &
621  & * model_get_param_value(a_model, &
622  & this%locks%ids(i), &
623  & this%locks%indices(i,1), &
624  & this%locks%indices(i,2))
625  END DO
626 
627 ! Only update the lock value if that value changed.
628  IF (inital_value .ne. temp) THEN
629  CALL model_set_param(a_model, this%param_id, &
630  & this%indices(1), this%indices(2), &
631  & temp, eq_comm)
632  END iF
633 
634  CALL profiler_set_stop_time('param_set_lock_value', start_time)
635 
636  END SUBROUTINE
637 
638 !*******************************************************************************
639 ! GETTER SUBROUTINES
640 !*******************************************************************************
641 !-------------------------------------------------------------------------------
650 !-------------------------------------------------------------------------------
651  FUNCTION param_get_value(this, a_model)
652 
653  IMPLICIT NONE
654 
655 ! Declare Arguments
656  REAL (rprec) :: param_get_value
657  TYPE (param_class), INTENT(in) :: this
658  TYPE (model_class), INTENT(in) :: a_model
659 
660 ! local variables
661  REAL (rprec) :: start_time
662 
663 ! Start of executable code
664  start_time = profiler_get_start_time()
665 
667  & this%param_id, &
668  & this%indices(1), &
669  & this%indices(2))
670 
671  CALL profiler_set_stop_time('param_get_value', start_time)
672 
673  END FUNCTION
674 
675 !-------------------------------------------------------------------------------
684 !-------------------------------------------------------------------------------
685  FUNCTION param_get_name(this, a_model)
686 
687  IMPLICIT NONE
688 
689 ! Declare Arguments
690  CHARACTER (len=data_name_length) :: param_get_name
691  TYPE (param_class), INTENT(in) :: this
692  TYPE (model_class), INTENT(in) :: a_model
693 
694 ! local variables
695  REAL (rprec) :: start_time
696 
697 ! Start of executable code
698  start_time = profiler_get_start_time()
699 
700  param_get_name = model_get_param_name(a_model, this%param_id)
701 
702  CALL profiler_set_stop_time('param_get_name', start_time)
703 
704  END FUNCTION
705 
706 !-------------------------------------------------------------------------------
715 !-------------------------------------------------------------------------------
716  FUNCTION param_get_lower_range_value(this, a_model)
717 
718  IMPLICIT NONE
719 
720 ! Declare Arguments
721  REAL (rprec) :: param_get_lower_range_value
722  TYPE (param_class), INTENT(in) :: this
723  TYPE (model_class), INTENT(in) :: a_model
724 
725 ! local variables
726  REAL (rprec) :: start_time
727 
728 ! Start of executable code
729  start_time = profiler_get_start_time()
730 
731  SELECT CASE (this%recon%range_type(1))
732 
733  CASE DEFAULT
734  param_get_lower_range_value = this%recon%range_value(1)
735 
738  & model_get_param_value(a_model, this%recon%range_id(1), &
739  & this%recon%range_indices(1,1), &
740  & this%recon%range_indices(1,2))
741 
742  END SELECT
743 
744  CALL profiler_set_stop_time('param_get_lower_range_value', &
745  & start_time)
746 
747  END FUNCTION
748 
749 !-------------------------------------------------------------------------------
758 !-------------------------------------------------------------------------------
759  FUNCTION param_get_upper_range_value(this, a_model)
760 
761  IMPLICIT NONE
762 
763 ! Declare Arguments
764  REAL (rprec) :: param_get_upper_range_value
765  TYPE (param_class), INTENT(in) :: this
766  TYPE (model_class), INTENT(in) :: a_model
767 
768 ! local variables
769  REAL (rprec) :: start_time
770 
771 ! Start of executable code
772  start_time = profiler_get_start_time()
773 
774  SELECT CASE (this%recon%range_type(2))
775 
776  CASE DEFAULT
777  param_get_upper_range_value = this%recon%range_value(2)
778 
781  & model_get_param_value(a_model, this%recon%range_id(2), &
782  & this%recon%range_indices(2,1), &
783  & this%recon%range_indices(2,2))
784 
785  END SELECT
786 
787  CALL profiler_set_stop_time('param_get_upper_range_value', &
788  & start_time)
789 
790  END FUNCTION
791 
792 !-------------------------------------------------------------------------------
800 !-------------------------------------------------------------------------------
801  FUNCTION param_get_lower_range_type(this, a_model)
802 
803  IMPLICIT NONE
804 
805 ! Declare Arguments
806  CHARACTER (len=data_name_length) :: param_get_lower_range_type
807  TYPE (param_class), INTENT(in) :: this
808  TYPE (model_class), INTENT(in) :: a_model
809 
810 ! local variables
811  REAL (rprec) :: start_time
812 
813 ! Start of executable code
814  start_time = profiler_get_start_time()
815 
816  SELECT CASE (this%recon%range_type(1))
817 
818  CASE DEFAULT
819  param_get_lower_range_type = 'No Type'
820 
823 
825  param_get_lower_range_type = 'infinity'
826 
829  & model_get_param_name(a_model, this%recon%range_id(1))
830 
831  END SELECT
832 
833  CALL profiler_set_stop_time('param_get_lower_range_type', &
834  & start_time)
835 
836  END FUNCTION
837 
838 !-------------------------------------------------------------------------------
846 !-------------------------------------------------------------------------------
847  FUNCTION param_get_upper_range_type(this, a_model)
848 
849  IMPLICIT NONE
850 
851 ! Declare Arguments
852  CHARACTER (len=data_name_length) :: param_get_upper_range_type
853  TYPE (param_class), INTENT(in) :: this
854  TYPE (model_class), INTENT(in) :: a_model
855 
856 ! local variables
857  REAL (rprec) :: start_time
858 
859 ! Start of executable code
860  start_time = profiler_get_start_time()
861 
862  SELECT CASE (this%recon%range_type(2))
863 
864  CASE DEFAULT
865  param_get_upper_range_type = 'No Type'
866 
869 
871  param_get_upper_range_type = 'infinity'
872 
875  & model_get_param_name(a_model, this%recon%range_id(2))
876 
877  END SELECT
878 
879  CALL profiler_set_stop_time('param_get_upper_range_type', &
880  & start_time)
881 
882  END FUNCTION
883 
884 !*******************************************************************************
885 ! QUERY SUBROUTINES
886 !*******************************************************************************
887 !-------------------------------------------------------------------------------
897 !-------------------------------------------------------------------------------
898  FUNCTION param_is_in_lower_range(this, a_model, value)
899 
900  IMPLICIT NONE
901 
902 ! Declare Arguments
903  LOGICAL :: param_is_in_lower_range
904  TYPE (param_class), INTENT(in) :: this
905  TYPE (model_class), INTENT(in) :: a_model
906  REAL (rprec), INTENT(in) :: value
907 
908 ! local variables
909  REAL (rprec) :: start_time
910 
911 ! Start of executable code
912  start_time = profiler_get_start_time()
913 
914  param_is_in_lower_range = .true.
915  IF (this%recon%range_type(1) .ne. param_range_infinity_type) THEN
917  & value .ge. param_get_lower_range_value(this, a_model)
918  END IF
919 
920  CALL profiler_set_stop_time('param_is_in_lower_range', start_time)
921 
922  END FUNCTION
923 
924 !-------------------------------------------------------------------------------
934 !-------------------------------------------------------------------------------
935  FUNCTION param_is_in_upper_range(this, a_model, value)
936 
937  IMPLICIT NONE
938 
939 ! Declare Arguments
940  LOGICAL :: param_is_in_upper_range
941  TYPE (param_class), INTENT(in) :: this
942  TYPE (model_class), INTENT(in) :: a_model
943  REAL (rprec), INTENT(in) :: value
944 
945 ! local variables
946  REAL (rprec) :: start_time
947 
948 ! Start of executable code
949  start_time = profiler_get_start_time()
950 
951  param_is_in_upper_range = .true.
952  IF (this%recon%range_type(2) .ne. param_range_infinity_type) THEN
954  & value .le. param_get_upper_range_value(this, a_model)
955  END IF
956 
957  CALL profiler_set_stop_time('param_is_in_upper_range', start_time)
958 
959  END FUNCTION
960 
961 !*******************************************************************************
962 ! UTILITY SUBROUTINES
963 !*******************************************************************************
964 !-------------------------------------------------------------------------------
984 !-------------------------------------------------------------------------------
985  SUBROUTINE param_increment(this, a_model, eq_comm, is_central)
986  USE v3_utilities, only: err_fatal
987 
988  IMPLICIT NONE
989 
990 ! Declare Arguments
991  TYPE (param_class), INTENT(inout) :: this
992  TYPE (model_class), INTENT(inout) :: a_model
993  INTEGER, INTENT(in) :: eq_comm
994  LOGICAL, INTENT(in) :: is_central
995 
996 ! local variables
997  REAL (rprec) :: new_value
998  REAL (rprec) :: value
999  REAL (rprec) :: step
1000  INTEGER :: itry
1001  REAL (rprec) :: start_time
1002 
1003 ! Start of executable code
1004  start_time = profiler_get_start_time()
1005 
1006  value = param_get_value(this, a_model)
1007 
1008 ! Take the absolute value here to control the direction of the step.
1009  IF (is_central) THEN
1010  step = abs(this%recon%vrnc)/2.0
1011  ELSE
1012  step = abs(this%recon%vrnc)
1013  END IF
1014 
1015  DO itry = 1, param_max_increment_steps
1016 
1017 ! Test to make sure there is a step
1018  IF (step .eq. 0.0) THEN
1019  CALL err_fatal('param_increment: tried to take a ' // &
1020  & 'step size of 0')
1021  END IF
1022 
1023  IF (is_central) THEN
1024 ! Test both upper and lower range.
1025  IF (param_is_in_upper_range(this, a_model, &
1026  & value + step) .and. &
1027  & param_is_in_lower_range(this, a_model, &
1028  & value - step)) THEN
1029  new_value = value + step
1030 
1031 ! Store the actual change in value.
1032  this%recon%delta = step
1033  EXIT
1034  END IF
1035 
1036  ELSE
1037 
1038 ! Try a step in the positive direction. If the parameter is still in range set
1039 ! otherwise.
1040  new_value = value + step
1041  IF (param_is_in_upper_range(this, a_model, new_value)) THEN
1042 ! Store the actual change in value.
1043  this%recon%delta = step
1044  EXIT
1045  END IF
1046 
1047 ! Try a step in the negative direction.
1048  new_value = value - step
1049  IF (param_is_in_lower_range(this, a_model, new_value)) THEN
1050 ! Store the actual change in value.
1051  this%recon%delta = -step
1052  EXIT
1053  END IF
1054  END IF
1055 
1056 ! Decrease the step and try again.
1057  step = step/param_div_factor
1058  END DO
1059 
1060  CALL model_set_param(a_model, this%param_id, this%indices(1), &
1061  & this%indices(2), new_value, eq_comm)
1062 
1063  IF (itry .gt. param_max_increment_steps) THEN
1064  CALL err_fatal('param_increment: failed to change ' // &
1065  & 'reconstruction. Try decreaing rp_vrnc ' // &
1066  & 'or expanding the range.')
1067  END IF
1068 
1069  CALL profiler_set_stop_time('param_increment', start_time)
1070 
1071  END SUBROUTINE
1072 
1073 !-------------------------------------------------------------------------------
1082 !-------------------------------------------------------------------------------
1083  SUBROUTINE param_decrement(this, a_model, eq_comm)
1085  IMPLICIT NONE
1086 
1087 ! Declare Arguments
1088  TYPE (param_class), INTENT(inout) :: this
1089  TYPE (model_class), INTENT(inout) :: a_model
1090  INTEGER, INTENT(in) :: eq_comm
1091 
1092 ! local variables
1093  REAL (rprec) :: value
1094  REAL (rprec) :: start_time
1095 
1096 ! Start of executable code
1097  start_time = profiler_get_start_time()
1098 
1099  value = param_get_value(this, a_model)
1100  value = value - this%recon%delta
1101 
1102  CALL model_set_param(a_model, this%param_id, this%indices(1), &
1103  & this%indices(2), value, eq_comm)
1104 
1105  CALL profiler_set_stop_time('param_decrement', start_time)
1106 
1107  END SUBROUTINE
1108 
1109 !-------------------------------------------------------------------------------
1120 !-------------------------------------------------------------------------------
1121  SUBROUTINE param_write(this, iou, index, a_model)
1123  IMPLICIT NONE
1124 
1125 ! Declare Arguments
1126  TYPE (param_class), INTENT(in) :: this
1127  INTEGER, INTENT(in) :: iou
1128  INTEGER, INTENT(in) :: index
1129  TYPE (model_class), INTENT(in) :: a_model
1130 
1131 ! local variables
1132  REAL (rprec) :: start_time
1133 
1134 ! Start of executable code
1135  start_time = profiler_get_start_time()
1136 
1137  WRITE (iou,1000) index, &
1138  & param_get_name(this, a_model), &
1139  & this%indices(1), this%indices(2), &
1140  & param_get_value(this, a_model), &
1141  & this%sigma, this%recon%vrnc, &
1142  & param_get_upper_range_type(this, a_model), &
1143  & param_get_lower_range_type(this, a_model), &
1144  & param_get_upper_range_value(this, a_model), &
1145  & param_get_lower_range_value(this, a_model), &
1146  & this%recon%range_indices(2,:), &
1147  & this%recon%range_indices(1,:)
1148 1000 FORMAT(i3,2x,a18,2(1x,i4),3(2x,es12.5),2(2x,a13),2(2x,es12.5), &
1149  & 2(2x,i8,1x,i8))
1150 
1151  CALL profiler_set_stop_time('param_write', start_time)
1152 
1153  END SUBROUTINE
1154 
1155 !-------------------------------------------------------------------------------
1165 !-------------------------------------------------------------------------------
1166  SUBROUTINE param_write_short(this, iou, index, a_model)
1168  IMPLICIT NONE
1169 
1170 ! Declare Arguments
1171  TYPE (param_class), INTENT(in) :: this
1172  INTEGER, INTENT(in) :: iou
1173  INTEGER, INTENT(in) :: index
1174  TYPE (model_class), INTENT(in) :: a_model
1175 
1176 ! local variables
1177  REAL (rprec) :: start_time
1178 
1179 ! Start of executable code
1180  start_time = profiler_get_start_time()
1181 
1182  WRITE (iou,1000) index, &
1183  & param_get_name(this, a_model), &
1184  & this%indices(1), this%indices(2), &
1185  & param_get_value(this, a_model), this%sigma
1186 1000 FORMAT(i3,2x,a18,2(1x,i4),2(2x,es12.5))
1187 
1188  CALL profiler_set_stop_time('param_write_short', start_time)
1189 
1190  END SUBROUTINE
1191 
1192 !-------------------------------------------------------------------------------
1201 !-------------------------------------------------------------------------------
1202  SUBROUTINE param_write_header(iou)
1204  IMPLICIT NONE
1205 
1206 ! Declare Arguments
1207  INTEGER, INTENT(in) :: iou
1208 
1209 ! local variables
1210  REAL (rprec) :: start_time
1211 
1212 ! Start of executable code
1213  start_time = profiler_get_start_time()
1214 
1215  WRITE (iou,*)
1216  WRITE (iou,*) ' *** Reconstruction parameters'
1217  WRITE (iou,1000)
1218 
1219  CALL profiler_set_stop_time('param_write_header', start_time)
1220 
1221 1000 FORMAT ('irp',2x,'p_type',13x,'inx1',1x,'inx2',2x,'value',9x, &
1222  & 'sigma',9x,'vrnc',10x,'range_type_h',3x,'range_type_l',3x, &
1223  & 'r_value_h',5x,'r_value_l',5x, &
1224  & 'r_inx1_h',1x,'r_inx2_h',2x,'r_inx1_l',1x,'r_inx2_l')
1225 
1226  END SUBROUTINE
1227 
1228 !-------------------------------------------------------------------------------
1237 !-------------------------------------------------------------------------------
1238  SUBROUTINE param_write_header_short(iou)
1240  IMPLICIT NONE
1241 
1242 ! Declare Arguments
1243  INTEGER, INTENT(in) :: iou
1244 
1245 ! local variables
1246  REAL (rprec) :: start_time
1247 
1248 ! Start of executable code
1249  start_time = profiler_get_start_time()
1250 
1251  WRITE (iou,*)
1252  WRITE (iou,*) ' *** Derived parameters'
1253  WRITE (iou,1000)
1254 
1255  CALL profiler_set_stop_time('param_write_header_short', &
1256  & start_time)
1257 
1258 1000 FORMAT ('irp',2x,'p_type',13x,'inx1',1x,'inx2',2x,'value',9x, &
1259  & 'sigma')
1260 
1261  END SUBROUTINE
1262 
1263 !-------------------------------------------------------------------------------
1273 !-------------------------------------------------------------------------------
1274  SUBROUTINE param_write_correlation(this, iou, a_model)
1276  IMPLICIT NONE
1277 
1278 ! Declare Arguments
1279  TYPE (param_class), INTENT(in) :: this
1280  INTEGER, INTENT(in) :: iou
1281  TYPE (model_class), INTENT(in) :: a_model
1282 
1283 ! local variables
1284  CHARACTER (len=20) :: row_format
1285  REAL (rprec) :: start_time
1286 
1287 ! Start of executable code
1288  start_time = profiler_get_start_time()
1289 
1290  WRITE (row_format,1000) SIZE(this%correlation)
1291  WRITE (iou,row_format) param_get_name(this, a_model), &
1292  & this%correlation
1293 
1294  CALL profiler_set_stop_time('param_write_correlation', start_time)
1295 
1296 1000 FORMAT ('(a12,',i3,'(2x,es12.5))')
1297 
1298  END SUBROUTINE
1299 
1300 !*******************************************************************************
1301 ! NETCDF SUBROUTINES
1302 !*******************************************************************************
1303 !-------------------------------------------------------------------------------
1325 !-------------------------------------------------------------------------------
1326  SUBROUTINE param_write_step_data_1(this, a_model, result_ncid, &
1327  & current_step, index, &
1328  & param_value_id, param_sigma_id, &
1329  & param_corr_id, param_sem_id)
1330  USE ezcdf
1331 
1332  IMPLICIT NONE
1333 
1334 ! Declare Arguments
1335  TYPE (param_class), INTENT(in) :: this
1336  TYPE (model_class), INTENT(in) :: a_model
1337  INTEGER, INTENT(in) :: result_ncid
1338  INTEGER, INTENT(in) :: current_step
1339  INTEGER, INTENT(in) :: index
1340  INTEGER, INTENT(in) :: param_value_id
1341  INTEGER, INTENT(in) :: param_sigma_id
1342  INTEGER, INTENT(in) :: param_corr_id
1343  INTEGER, INTENT(in) :: param_sem_id
1344 
1345 ! local variables
1346  INTEGER :: status
1347  REAL (rprec) :: start_time
1348 
1349 ! Start of executable code
1350  start_time = profiler_get_start_time()
1351 
1352  CALL param_write_step_data(this, a_model, result_ncid, &
1353  & current_step, index, &
1354  & param_value_id, param_sigma_id, &
1355  & param_corr_id)
1356 
1357  status = nf_put_vara_double(result_ncid, param_sem_id, &
1358  & (/ 1, index, current_step /), &
1359  & (/ SIZE(this%recon%sem), 1, 1 /), &
1360  & this%recon%sem)
1361 
1362  CALL profiler_set_stop_time('param_write_step_data_1', start_time)
1363 
1364  END SUBROUTINE
1365 
1366 !-------------------------------------------------------------------------------
1385 !-------------------------------------------------------------------------------
1386  SUBROUTINE param_write_step_data_2(this, a_model, result_ncid, &
1387  & current_step, index, &
1388  & param_value_id, param_sigma_id, &
1389  & param_corr_id)
1390  USE ezcdf
1391 
1392  IMPLICIT NONE
1393 
1394 ! Declare Arguments
1395  TYPE (param_class), INTENT(in) :: this
1396  TYPE (model_class), INTENT(in) :: a_model
1397  INTEGER, INTENT(in) :: result_ncid
1398  INTEGER, INTENT(in) :: current_step
1399  INTEGER, INTENT(in) :: index
1400  INTEGER, INTENT(in) :: param_value_id
1401  INTEGER, INTENT(in) :: param_sigma_id
1402  INTEGER, INTENT(in) :: param_corr_id
1403 
1404 ! local variables
1405  INTEGER :: status
1406  REAL (rprec) :: start_time
1407 
1408 ! Start of executable code
1409  start_time = profiler_get_start_time()
1410 
1411  status = nf_put_var1_double(result_ncid, param_value_id, &
1412  & (/ index, current_step /), &
1413  & param_get_value(this, a_model))
1414  CALL assert_eq(status, nf_noerr, nf_strerror(status))
1415 
1416  status = nf_put_var1_double(result_ncid, param_sigma_id, &
1417  & (/ index, current_step /), &
1418  & this%sigma)
1419  CALL assert_eq(status, nf_noerr, nf_strerror(status))
1420 
1421  status = nf_put_vara_double(result_ncid, param_corr_id, &
1422  & (/ 1, index, current_step /), &
1423  & (/ SIZE(this%correlation), 1, 1 /), &
1424  & this%correlation)
1425  CALL assert_eq(status, nf_noerr, nf_strerror(status))
1426 
1427  CALL profiler_set_stop_time('param_write_step_data_2', start_time)
1428 
1429  END SUBROUTINE
1430 
1431 !-------------------------------------------------------------------------------
1452 !-------------------------------------------------------------------------------
1453  SUBROUTINE param_restart(this, a_model, result_ncid, current_step, &
1454  & index, param_value_id, param_sigma_id, &
1455  & param_corr_id, eq_comm, is_central)
1456  USE ezcdf
1457 
1458  IMPLICIT NONE
1459 
1460 ! Declare Arguments
1461  TYPE (param_class), INTENT(inout) :: this
1462  TYPE (model_class), INTENT(inout) :: a_model
1463  INTEGER, INTENT(in) :: result_ncid
1464  INTEGER, INTENT(in) :: current_step
1465  INTEGER, INTENT(in) :: index
1466  INTEGER, INTENT(in) :: param_value_id
1467  INTEGER, INTENT(in) :: param_sigma_id
1468  INTEGER, INTENT(in) :: param_corr_id
1469  INTEGER, INTENT(in) :: eq_comm
1470  LOGICAL, INTENT(in) :: is_central
1471 
1472 ! local variables
1473  INTEGER :: status
1474  REAL (rprec) :: temp_value
1475  REAL (rprec) :: start_time
1476 
1477 ! Start of executable code
1478  start_time = profiler_get_start_time()
1479 
1480  status = nf_get_var1_double(result_ncid, param_value_id, &
1481  & (/ index, current_step /), temp_value)
1482  CALL assert_eq(status, nf_noerr, nf_strerror(status))
1483  CALL param_set_value(this, a_model, temp_value, eq_comm, &
1484  & is_central)
1485 
1486  status = nf_put_var1_double(result_ncid, param_sigma_id, &
1487  & (/ index, current_step /), &
1488  & this%sigma)
1489  CALL assert_eq(status, nf_noerr, nf_strerror(status))
1490 
1491  status = nf_put_vara_double(result_ncid, param_corr_id, &
1492  & (/ 1, index, current_step /), &
1493  & (/ SIZE(this%correlation), 1, 1 /), &
1494  & this%correlation)
1495  CALL assert_eq(status, nf_noerr, nf_strerror(status))
1496 
1497  CALL profiler_set_stop_time('param_restart', start_time)
1498 
1499  END SUBROUTINE
1500 
1501 !*******************************************************************************
1502 ! MPI SUBROUTINES
1503 !*******************************************************************************
1504 !-------------------------------------------------------------------------------
1516 !-------------------------------------------------------------------------------
1517  SUBROUTINE param_sync_value(this, a_model, recon_comm, eq_comm, &
1518  & is_central)
1520  IMPLICIT NONE
1521 
1522 ! Declare Arguments
1523  TYPE (param_class), INTENT(inout) :: this
1524  TYPE (model_class), INTENT(inout) :: a_model
1525  INTEGER, INTENT(in) :: recon_comm
1526  INTEGER, INTENT(in) :: eq_comm
1527  LOGICAL, INTENT(in) :: is_central
1528 
1529 #if defined(MPI_OPT)
1530 ! local variables
1531  INTEGER :: error
1532  REAL (rprec) :: value
1533  INTEGER :: mpi_rank
1534  REAL (rprec) :: start_time
1535 
1536 ! Start of executable code
1537  start_time = profiler_get_start_time()
1538 
1539  CALL mpi_comm_rank(recon_comm, mpi_rank, error)
1540 
1541  IF (mpi_rank .eq. 0) THEN
1542  value = param_get_value(this, a_model)
1543  END IF
1544 
1545  CALL mpi_bcast(value, 1, mpi_real8, 0, recon_comm, error)
1546 
1547  IF (mpi_rank .gt. 0) THEN
1548  CALL param_set_value(this, a_model, value, eq_comm, is_central)
1549  END IF
1550 
1551  CALL profiler_set_stop_time('param_sync_value', start_time)
1552 
1553 #endif
1554 
1555  END SUBROUTINE
1556 
1557 !-------------------------------------------------------------------------------
1566 !-------------------------------------------------------------------------------
1567  SUBROUTINE param_send_delta(this, index, recon_comm)
1569  IMPLICIT NONE
1570 
1571 ! Declare Arguments
1572  TYPE (param_class), INTENT(inout) :: this
1573  INTEGER, INTENT(in) :: index
1574  INTEGER, INTENT(in) :: recon_comm
1575 
1576 #if defined(MPI_OPT)
1577 ! local variables
1578  INTEGER :: error
1579  INTEGER :: mpi_size
1580  INTEGER :: mpi_request
1581  REAL (rprec) :: start_time
1582 
1583 ! Start of executable code
1584  start_time = profiler_get_start_time()
1585 
1586  CALL mpi_comm_size(recon_comm, mpi_size, error)
1587 
1588 ! Must use a non blocking send here because we are sending messages from the
1589 ! main process to itself or need to send multiple sends before the first
1590 ! recieve. Other wise it could block until a recieve request is called.
1591  CALL mpi_isend(this%recon%delta, 1, mpi_real8, 0, index, &
1592  & recon_comm, mpi_request, error)
1593 
1594  CALL profiler_set_stop_time('param_send_delta', start_time)
1595 #endif
1596 
1597  END SUBROUTINE
1598 
1599 !-------------------------------------------------------------------------------
1608 !-------------------------------------------------------------------------------
1609  SUBROUTINE param_recv_delta(this, index, recon_comm)
1611  IMPLICIT NONE
1612 
1613 ! Declare Arguments
1614  TYPE (param_class), INTENT(inout) :: this
1615  INTEGER, INTENT(in) :: index
1616  INTEGER, INTENT(in) :: recon_comm
1617 
1618 #if defined(MPI_OPT)
1619 ! local variables
1620  INTEGER :: error
1621  REAL (rprec) :: start_time
1622 
1623 ! Start of executable code
1624  start_time = profiler_get_start_time()
1625 
1626  CALL mpi_recv(this%recon%delta, 1, mpi_real8, mpi_any_source, &
1627  & index, recon_comm, mpi_status_ignore, error)
1628 
1629  CALL profiler_set_stop_time('param_recv_delta', start_time)
1630 
1631 #endif
1632 
1633  END SUBROUTINE
1634 
1635 !-------------------------------------------------------------------------------
1643 !-------------------------------------------------------------------------------
1644  SUBROUTINE param_sync_delta(this, recon_comm)
1646  IMPLICIT NONE
1647 
1648 ! Declare Arguments
1649  TYPE (param_class), INTENT(inout) :: this
1650  INTEGER, INTENT(in) :: recon_comm
1651 
1652 #if defined(MPI_OPT)
1653 ! local variables
1654  INTEGER :: error
1655  REAL (rprec) :: start_time
1656 
1657 ! Start of executable code
1658  start_time = profiler_get_start_time()
1659 
1660  CALL mpi_bcast(this%recon%delta, 1, mpi_real8, 0, recon_comm, &
1661  & error)
1662 
1663  CALL profiler_set_stop_time('param_sync_delta', start_time)
1664 
1665 #endif
1666 
1667  END SUBROUTINE
1668 
1669 !-------------------------------------------------------------------------------
1682 !-------------------------------------------------------------------------------
1683  SUBROUTINE param_sync_child(this, a_model, index, recon_comm, &
1684  & eq_comm, is_central)
1686  IMPLICIT NONE
1687 
1688 ! Declare Arguments
1689  TYPE (param_class), INTENT(inout) :: this
1690  TYPE (model_class), INTENT(inout) :: a_model
1691  INTEGER, INTENT(in) :: index
1692  INTEGER, INTENT(in) :: recon_comm
1693  INTEGER, INTENT(in) :: eq_comm
1694  LOGICAL, INTENT(in) :: is_central
1695 
1696 #if defined(MPI_OPT)
1697 ! local variables
1698  INTEGER :: error
1699  REAL (rprec) :: value
1700  INTEGER :: mpi_rank
1701  REAL (rprec) :: start_time
1702 
1703 ! Start of executable code
1704  start_time = profiler_get_start_time()
1705 
1706  CALL mpi_comm_rank(recon_comm, mpi_rank, error)
1707 
1708  IF (mpi_rank .eq. index) THEN
1709  value = param_get_value(this, a_model)
1710  CALL mpi_ssend(value, 1, mpi_real8, 0, mpi_rank, recon_comm, &
1711  & error)
1712  ELSE IF (mpi_rank .eq. 0) THEN
1713  CALL mpi_recv(value, 1, mpi_real8, index, index, recon_comm, &
1714  & mpi_status_ignore, error)
1715  CALL param_set_value(this, a_model, value, eq_comm, is_central)
1716  END IF
1717 
1718  CALL profiler_set_stop_time('param_sync_child', start_time)
1719 
1720 #endif
1721 
1722  END SUBROUTINE
1723 
1724  END MODULE
v3fit_params::param_div_factor
integer, parameter param_div_factor
Division factor to decrease the step size.
Definition: v3fit_params.f:34
v3fit_params::param_is_in_lower_range
logical function param_is_in_lower_range(this, a_model, value)
Checks if the value is in the lower range.
Definition: v3fit_params.f:899
v3fit_params::param_write_correlation
subroutine param_write_correlation(this, iou, a_model)
Writes out a parameter covariance matrix row.
Definition: v3fit_params.f:1275
model
Defines the base class of the type model_class. The model contains information not specific to the eq...
Definition: model.f:59
v3fit_params::param_pointer
Pointer to a parameter object. Used for creating arrays of signal pointers. This is needed because fo...
Definition: v3fit_params.f:122
v3fit_params::param_increment
subroutine param_increment(this, a_model, eq_comm, is_central)
Increments the parameter value.
Definition: v3fit_params.f:986
v3fit_params::param_send_delta
subroutine param_send_delta(this, index, recon_comm)
Sends the delta used.
Definition: v3fit_params.f:1568
v3fit_params::param_get_lower_range_type
character(len=data_name_length) function param_get_lower_range_type(this, a_model)
Gets the lower boundary type description.
Definition: v3fit_params.f:802
v3_utilities::assert
Definition: v3_utilities.f:55
v3fit_params::param_recon_class
Class to hold variables needed when a parameter is a reconstruction parameter.
Definition: v3fit_params.f:45
v3fit_params::param_class
Base class representing a reconstructed parameter. An upper and lower bound may be set for the parame...
Definition: v3fit_params.f:96
v3fit_params::param_write_step_data_2
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.
Definition: v3fit_params.f:1390
data_parameters::data_max_indices
integer, parameter data_max_indices
Max number of parameter indicies.
Definition: data_parameters.f:29
v3fit_params::param_write_header_short
subroutine param_write_header_short(iou)
Writes out parameter header information to an output file.
Definition: v3fit_params.f:1239
model::model_get_param_value
real(rprec) function model_get_param_value(this, id, i_index, j_index)
Gets the value of a model parameter.
Definition: model.f:970
model::model_get_param_id
integer function model_get_param_id(this, param_name)
Get the id for a parameter.
Definition: model.f:885
v3fit_params::param_sync_delta
subroutine param_sync_delta(this, recon_comm)
Sync the delta used.
Definition: v3fit_params.f:1645
v3fit_params::param_range_value_type
integer, parameter param_range_value_type
Parameter value is bounded by a value.
Definition: v3fit_params.f:25
model::model_class
Base class representing a model.
Definition: model.f:141
v3fit_params::param_destruct
subroutine param_destruct(this)
Deconstruct a param_class object.
Definition: v3fit_params.f:420
v3fit_params::param_get_value
real(rprec) function param_get_value(this, a_model)
Gets the parameter value.
Definition: v3fit_params.f:652
v3fit_params::param_sync_child
subroutine param_sync_child(this, a_model, index, recon_comm, eq_comm, is_central)
Sync the parameter value from a child to the parent.
Definition: v3fit_params.f:1685
v3fit_params::param_locking_class
Class to hold variables needed when a parameter is a locking parameter. The locking parameter coeffic...
Definition: v3fit_params.f:85
data_parameters::data_no_id
integer, parameter data_no_id
Default parameter id specifiying no id.
Definition: data_parameters.f:26
v3fit_params::param_write
subroutine param_write(this, iou, index, a_model)
Writes out a parameter to an output file.
Definition: v3fit_params.f:1122
v3fit_params::param_recv_delta
subroutine param_recv_delta(this, index, recon_comm)
Receives the delta used.
Definition: v3fit_params.f:1610
v3fit_params::param_set_lock_value
subroutine param_set_lock_value(this, a_model, eq_comm)
Sets the locking parameter value.
Definition: v3fit_params.f:597
v3fit_params::param_get_lower_range_value
real(rprec) function param_get_lower_range_value(this, a_model)
Gets the lower boundary value.
Definition: v3fit_params.f:717
v3fit_params::param_range_parameter_type
integer, parameter param_range_parameter_type
Parameter value is bounded by another parameter.
Definition: v3fit_params.f:29
v3fit_params::param_set_value
subroutine param_set_value(this, a_model, value, eq_comm, is_central)
Sets the parameter value.
Definition: v3fit_params.f:493
v3fit_params::param_get_upper_range_type
character(len=data_name_length) function param_get_upper_range_type(this, a_model)
Gets the upper boundary type description.
Definition: v3fit_params.f:848
data_parameters
This modules contains parameters used by equilibrium models.
Definition: data_parameters.f:10
v3fit_params::param_range_no_type
integer, parameter param_range_no_type
No bounding type specified.
Definition: v3fit_params.f:23
v3fit_params::param_write_header
subroutine param_write_header(iou)
Writes out parameter header information to an output file.
Definition: v3fit_params.f:1203
model::model_set_param
subroutine model_set_param(this, id, i_index, j_index, value, eq_comm)
Sets the value of a reconstruction model parameter.
Definition: model.f:658
v3fit_params::param_restart
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.
Definition: v3fit_params.f:1456
model::model_is_recon_param
logical function model_is_recon_param(this, id)
Determines if a parameter id is a reconstruction parameter.
Definition: model.f:2603
v3fit_params::param_is_in_upper_range
logical function param_is_in_upper_range(this, a_model, value)
Checks if the value is in the upper range.
Definition: v3fit_params.f:936
v3fit_params::param_get_name
character(len=data_name_length) function param_get_name(this, a_model)
Gets the parameter name.
Definition: v3fit_params.f:686
model::model_get_param_name
character(len=data_name_length) function model_get_param_name(this, id)
Gets the name of a model parameter.
Definition: model.f:1081
v3fit_params::param_sync_value
subroutine param_sync_value(this, a_model, recon_comm, eq_comm, is_central)
Syncronize the param value to children.
Definition: v3fit_params.f:1519
v3fit_params
Defines the base class of the type param_class.
Definition: v3fit_params.f:11
v3fit_params::param_decrement
subroutine param_decrement(this, a_model, eq_comm)
Decrements the parameter value.
Definition: v3fit_params.f:1084
v3fit_params::param_construct_basic
type(param_class) function, pointer param_construct_basic(a_model, param_name, indices, num_params)
Construct a param_class object.
Definition: v3fit_params.f:171
v3fit_params::param_get_upper_range_value
real(rprec) function param_get_upper_range_value(this, a_model)
Gets the upper boundary value.
Definition: v3fit_params.f:760
v3fit_params::param_construct_recon
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.
Definition: v3fit_params.f:233
v3fit_params::param_construct
Interface for the construction of param_class types using param_construct_basic or param_construct_re...
Definition: v3fit_params.f:135
v3fit_params::param_construct_locking
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.
Definition: v3fit_params.f:355
v3fit_params::param_max_increment_steps
integer, parameter param_max_increment_steps
Maximum number of attemps to change the parameter increment size.
Definition: v3fit_params.f:32
v3fit_params::param_write_short
subroutine param_write_short(this, iou, index, a_model)
Writes out a parameter to an output file.
Definition: v3fit_params.f:1167
v3fit_params::param_range_infinity_type
integer, parameter param_range_infinity_type
Parameter value is unbounded.
Definition: v3fit_params.f:27
v3fit_params::param_write_step_data
Interface for the writting of param_class data to the result file using param_write_step_data_1 or pa...
Definition: v3fit_params.f:145
v3fit_params::param_write_step_data_1
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.
Definition: v3fit_params.f:1330