Initialize parameters bounds for optimization
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=xp), | intent(in), | dimension(dim_v) | :: | line | spectrum |
|
integer, | intent(in) | :: | n_gauss | number of Gaussian |
||
integer, | intent(in) | :: | dim_v | dimension along v axis |
||
real(kind=xp), | intent(inout), | dimension(3*n_gauss) | :: | lb | lower bounds |
|
real(kind=xp), | intent(inout), | dimension(3*n_gauss) | :: | ub | upper bounds |
subroutine init_bounds(line, n_gauss, dim_v, lb, ub)
!! Initialize parameters bounds for optimization
implicit none
integer, intent(in) :: n_gauss !! number of Gaussian
integer, intent(in) :: dim_v !! dimension along v axis
real(xp), intent(in), dimension(dim_v) :: line !! spectrum
real(xp), intent(inout), dimension(3*n_gauss) :: lb !! lower bounds
real(xp), intent(inout), dimension(3*n_gauss) :: ub !! upper bounds
integer :: i
real(xp) :: max_line
max_line = 0._xp
max_line = maxval(line)
do i=1, n_gauss
! amplitude bounds
lb(1+(3*(i-1))) = 0._xp;
ub(1+(3*(i-1))) = max_line;
! mean bounds
lb(2+(3*(i-1))) = 0._xp;
ub(2+(3*(i-1))) = dim_v;
! sigma bounds
lb(3+(3*(i-1))) = 0.001_xp;
ub(3+(3*(i-1))) = 100._xp;
end do
end subroutine init_bounds