Skip to content
Snippets Groups Projects
Commit f32b5661 authored by WAUTELET Philippe's avatar WAUTELET Philippe
Browse files

Philippe 23/03/2021: budgets: add ALL, LIST_AVAIL and LIST_ALL special strings...

Philippe 23/03/2021: budgets: add ALL, LIST_AVAIL and LIST_ALL special strings for budget source terms
parent 68ec7005
No related branches found
No related tags found
No related merge requests found
...@@ -4419,12 +4419,68 @@ subroutine Sourcelist_scan( tpbudget, hbulist ) ...@@ -4419,12 +4419,68 @@ subroutine Sourcelist_scan( tpbudget, hbulist )
character(len=:), allocatable :: yline character(len=:), allocatable :: yline
character(len=:), allocatable :: ysrc character(len=:), allocatable :: ysrc
character(len=:), dimension(:), allocatable :: ymsg
integer :: idx integer :: idx
integer :: igroup integer :: igroup
integer :: igroup_idx integer :: igroup_idx
integer :: ipos integer :: ipos
integer :: istart
integer :: ji integer :: ji
istart = 1
! Case 'LIST_AVAIL': list all the available source terms
if ( Size( hbulist ) > 0 ) then
if ( Trim( hbulist(1) ) == 'LIST_AVAIL' ) then
Allocate( character(len=65) :: ymsg(tpbudget%nsources + 1) )
ymsg(1) = '---------------------------------------------------------------------'
ymsg(2) = 'Available source terms for budget ' // Trim( tpbudget%cname )
Write( ymsg(3), '( A32, " ", A32 )' ) 'Name', 'Long name'
idx = 3
do ji = 1, tpbudget%nsources
if ( All( tpbudget%tsources(ji)%cmnhname /= [ 'INIF' , 'ENDF', 'AVEF' ] ) ) then
idx = idx + 1
Write( ymsg(idx), '( A32, " ", A32 )' ) tpbudget%tsources(ji)%cmnhname, tpbudget%tsources(ji)%clongname
end if
end do
ymsg(tpbudget%nsources + 1 ) = '---------------------------------------------------------------------'
call Print_msg_multi( NVERB_WARNING, 'BUD', 'Sourcelist_scan', ymsg )
!To not read the 1st line again
istart = 2
end if
end if
! Case 'LIST_ALL': list all the source terms
if ( Size( hbulist ) > 0 ) then
if ( Trim( hbulist(1) ) == 'LIST_ALL' ) then
Allocate( character(len=65) :: ymsg(tpbudget%nsourcesmax + 1) )
ymsg(1) = '---------------------------------------------------------------------'
ymsg(2) = 'Source terms for budget ' // Trim( tpbudget%cname )
Write( ymsg(3), '( A32, " ", A32 )' ) 'Name', 'Long name'
idx = 3
do ji = 1, tpbudget%nsourcesmax
if ( All( tpbudget%tsources(ji)%cmnhname /= [ 'INIF' , 'ENDF', 'AVEF' ] ) ) then
idx = idx + 1
Write( ymsg(idx), '( A32, " ", A32 )' ) tpbudget%tsources(ji)%cmnhname, tpbudget%tsources(ji)%clongname
end if
end do
ymsg(tpbudget%nsourcesmax + 1 ) = '---------------------------------------------------------------------'
call Print_msg_multi( NVERB_WARNING, 'BUD', 'Sourcelist_scan', ymsg )
!To not read the 1st line again
istart = 2
end if
end if
! Case 'ALL': enable all available source terms
if ( Size( hbulist ) > 0 ) then
if ( Trim( hbulist(1) ) == 'ALL' ) then
do ji = 1, tpbudget%nsources
tpbudget%tsources(ji)%ngroup = 1
end do
return
end if
end if
!Always enable INIF, ENDF and AVEF terms !Always enable INIF, ENDF and AVEF terms
ipos = Source_find( tpbudget, 'INIF' ) ipos = Source_find( tpbudget, 'INIF' )
if ( ipos < 1 ) call Print_msg( NVERB_FATAL, 'BUD', 'Sourcelist_scan', 'source term ' // Trim( tpbudget%cname ) & if ( ipos < 1 ) call Print_msg( NVERB_FATAL, 'BUD', 'Sourcelist_scan', 'source term ' // Trim( tpbudget%cname ) &
...@@ -4444,7 +4500,7 @@ subroutine Sourcelist_scan( tpbudget, hbulist ) ...@@ -4444,7 +4500,7 @@ subroutine Sourcelist_scan( tpbudget, hbulist )
!igroup_idx start at 2 because 1 is reserved for individually stored source terms !igroup_idx start at 2 because 1 is reserved for individually stored source terms
igroup_idx = 2 igroup_idx = 2
do ji = 1, Size( hbulist ) do ji = istart, Size( hbulist )
if ( Len_trim( hbulist(ji) ) > 0 ) then if ( Len_trim( hbulist(ji) ) > 0 ) then
! Scan the line and separate the different sources (separated by + signs) ! Scan the line and separate the different sources (separated by + signs)
yline = Trim(hbulist(ji)) yline = Trim(hbulist(ji))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment