Go to the documentation of this file.
14 integer,
allocatable,
dimension(:,:) ::
minmax
59 character(*),
intent(in) :: net_source
61 integer :: i,sunet,read_stat
64 info_entry(
"load_network")
73 read(sunet,
"(2a5)",iostat=read_stat) dummy
74 if (read_stat /= 0)
exit
78 if (verbose_level.ge.1)
then
97 info_exit(
"load_network")
131 select case(reac%group)
155 if (reac%parts(i) .ne. 0)
then
156 if (.not. s_prod)
then
190 character(len=*),
intent(inout) :: str
193 del = iachar(
'a') - iachar(
'A')
194 do i = 1, len_trim(str)
195 if (lge(str(i:i),
'A') .and. lle(str(i:i),
'Z'))
then
196 str(i:i) = achar(iachar(str(i:i)) + del)
226 character*4,
dimension(2) :: wnam
227 character*5,
dimension(2),
intent(out) :: rnam
232 wnam(i)=adjustr(wnam(i))
233 if(wnam(i).eq.
' h1')wnam(i)=
' p'
234 if(wnam(i).eq.
' H1')wnam(i)=
' p'
235 if(wnam(i).eq.
' n01')wnam(i)=
' n'
236 if(wnam(i).eq.
' N01')wnam(i)=
' n'
250 function benam(name)
result (name_index)
253 character(len=5),
intent(in) :: name
254 integer :: name_index
261 if (trim(adjustl(name)) .eq. trim(adjustl(
net_names(i))))
then
282 integer,
intent(in) :: index
283 logical,
intent(in),
optional :: trimmed
287 if(index.lt.1 .or. (index.gt.
net_size))
then
308 integer,
intent(in) :: length_rate_array
310 integer :: i, j, k, l, m
314 info_entry(
"getcoefficients")
316 do i=1,length_rate_array
317 rate_array(i)%one_over_n_fac = 1.d0
321 if ((rate_array(i)%source.eq.
'fiss').or.(rate_array(i)%source.eq.
'ms99') &
322 .or.(rate_array(i)%source.eq.
'sfis')) cycle
324 rate_array(i)%ch_amount = 0.d0
325 select case (rate_array(i)%group)
328 rate_array(i)%ch_amount(1) = -1.d0
331 if (rate_array(i)%parts(j).ne.0) rate_array(i)%ch_amount(j) = 1.d0
335 rate_array(i)%ch_amount(1:2) = -1.d0
337 if (rate_array(i)%parts(j).ne.0) rate_array(i)%ch_amount(j) = 1.d0
340 if (rate_array(i)%parts(1).eq.rate_array(i)%parts(2)) &
341 rate_array(i)%one_over_n_fac = 1.d0/2.d0
344 rate_array(i)%ch_amount(1:3) = -1.d0
346 if (rate_array(i)%parts(j).ne.0) rate_array(i)%ch_amount(j) = 1.d0
349 if ((rate_array(i)%parts(1).eq.rate_array(i)%parts(2)) .and. &
350 (rate_array(i)%parts(2).eq.rate_array(i)%parts(3)))
then
351 rate_array(i)%one_over_n_fac = 1.d0/6.d0
356 else if ((rate_array(i)%parts(1).eq.rate_array(i)%parts(2)) .or. &
357 (rate_array(i)%parts(2).eq.rate_array(i)%parts(3)) .or. &
358 (rate_array(i)%parts(1).eq.rate_array(i)%parts(3)))
then
359 rate_array(i)%one_over_n_fac = 1.d0/2.d0
363 rate_array(i)%ch_amount(1:4) = -1.d0
365 if (rate_array(i)%parts(j).ne.0) rate_array(i)%ch_amount(j) = 1.d0
374 if (rate_array(i)%parts(k)==rate_array(i)%parts(j))
then
379 if ((rate_array(i)%parts(k)==rate_array(i)%parts(j)) .and. &
380 (rate_array(i)%parts(k)==rate_array(i)%parts(m)))
then
385 if ((rate_array(i)%parts(k)==rate_array(i)%parts(j)) .and. &
386 (rate_array(i)%parts(k)==rate_array(i)%parts(m)) .and. &
387 (rate_array(i)%parts(k)==rate_array(i)%parts(l)))
then
395 rate_array(i)%one_over_n_fac = 1.d0/dcount
403 info_exit(
"getcoefficients")
425 character(len=*),
intent(in) :: path
426 integer :: i, alloc_stat
435 if (verbose_level.ge.1)
then
441 if ( alloc_stat /= 0)
call raise_exception(
'Allocation of "net_names" failed.',&
442 "read_binary_network_data",110001)
449 if (alloc_stat .ne. 0)
call raise_exception(
"Could not allocate partition function "//&
450 "temperature grid",
"read_binary_network_data",&
462 if ( alloc_stat /= 0)
call raise_exception(
'Allocation of "isotope" failed.',&
463 "read_binary_network_data",110001)
467 allocate(
isotope(i)%part_func(
ntgp),stat=alloc_stat)
468 if (alloc_stat .ne. 0)
call raise_exception(
"Could not allocate grid for partition functions."&
469 ,
"read_binary_network_data",&
480 read(file_id)
isotope(i)%mass_exc
481 read(file_id)
isotope(i)%part_func
504 character(len=*),
intent(in) :: path
508 info_entry(
"output_binary_network_data")
534 write(file_id)
isotope(i)%mass_exc
535 write(file_id)
isotope(i)%part_func
540 info_exit(
"output_binary_network_data")
565 integer :: winvn, htpf
566 integer :: alloc_stat
569 info_entry(
"get_nuclear_properties")
574 if ( alloc_stat /= 0)
call raise_exception(
'Allocation of "isotope" failed.',&
575 "get_nuclear_properties",110001)
589 if (alloc_stat .ne. 0)
call raise_exception(
"Could not allocate partition function "//&
590 "temperature grid",
"get_nuclear_properties",&
595 allocate(
isotope(i)%part_func(
ntgp),stat=alloc_stat)
596 if (alloc_stat .ne. 0)
call raise_exception(
"Could not allocate grid for partition functions."&
597 ,
"get_nuclear_properties",&
624 info_exit(
"get_nuclear_properties")
646 info_entry(
"get_nuclear_properties")
654 info_exit(
"get_nuclear_properties")
678 integer,
intent(in) :: winvn
679 integer :: i, j , read_stat
680 character(5) :: name, tempname
681 character(5),
dimension(:),
allocatable :: data_names
688 real(
r_kind),
dimension(24) :: pf
690 info_entry(
"read_winvn")
694 read (winvn,
"(23f3.2,f3.1)") (
t9_data(j),j=1,24)
697 read (winvn,
"(a5)") name
699 read (winvn,
"(a5)",iostat = read_stat) tempname
700 if (read_stat /= 0)
call raise_exception(
"Problem reading winvn file. Check the winvn.",&
701 "get_nuclear_properties",&
706 if (tempname == name)
exit
712 allocate(data_names(data_cnt))
717 read(winvn,
"(a5)") data_names(i)
722 deallocate (data_names)
726 read (winvn,
my_format(4),iostat = read_stat)name,za,zp,zn,sp,bi
727 if (read_stat /= 0)
exit
729 read (winvn,*) (pf(j),j=1,24)
739 isotope(i)%part_func(1:24) = pf
744 info_exit(
"read_winvn")
759 character(5),
dimension(:),
intent(in) :: ref_array
760 integer,
dimension(:),
allocatable :: chk
761 integer :: ref_len, net_len
763 character(500) :: e_message
764 character(5) :: net_name_tmp
766 info_entry(
"sunet_check")
768 ref_len =
size(ref_array)
771 allocate(chk(net_len))
779 if(trim(adjustl(net_name_tmp)).eq.trim(adjustl(ref_array(j))))
then
786 if(any(chk.eq.0))
then
789 if(chk(i).eq.0) e_message = trim(adjustl(e_message))//
net_names(i)//&
790 " not in isotopes database (winvn)."//new_line(
"A")
792 call raise_exception(trim(adjustl(e_message))//
"Problem reading sunet file. Check the sunet.",&
797 info_exit(
"sunet_check")
831 integer,
intent(in) :: source
834 character*5 :: namtmp
835 character*69 :: dummy
836 real*8,
dimension(48) :: pftmp
838 integer,
dimension(:),
allocatable :: check
840 info_entry(
"read_htpf")
849 read(source,
'(a69,es5.0)')dummy,
t9_data(i)
854 read(source,
'(a5,t19,48es10.2)',iostat=stat)namtmp,pftmp
855 if(stat.ne.0)
exit out
856 namtmp = adjustr(namtmp)
858 if(namtmp.eq.
isotope(i)%name)
then
859 isotope(i)%part_func(25:72) = pftmp(1:48)
867 if(check(i).ne.1)
then
873 info_exit(
"read_htpf")
889 integer,
intent(in) :: ai
890 integer,
intent(in) :: zi
922 info_entry(
"get_minmax")
936 if (
isotope(i)%p_nr.eq.0) cycle
939 if (
minmax(ind,1).eq.0)
then
949 info_exit(
"get_minmax")
984 character(len=*),
intent(in) :: filename
986 real(
r_kind) :: qnuloss_tmp
987 character(len=5) :: name
992 info_entry(
"read_neutrino_loss")
998 if (stat .ne. 0)
then
1000 "read_neutrino_loss",110001)
1008 read(file_id,*,iostat=stat) name, qnuloss_tmp
1009 if (stat .ne. 0)
exit
1011 if (trim(adjustl(name)) .eq. trim(adjustl(
isotope(i)%name)))
then
1021 info_exit(
"read_neutrino_loss")
1038 subroutine ident(z1,n1,z2,n2,nam1,nam2,ind1,ind2,err)
1044 integer :: z1,z2,n1,n2
1045 character(5),
intent(out) :: nam1,nam2
1046 integer,
intent(out) :: ind1,ind2
1047 integer,
intent(out) :: err
1055 integer :: zt,nt,indt
1056 character(5) :: namt
1079 if((i.gt.3).and.(
isotope(i)%p_nr.gt.zt))
exit out
1098 if (inv .eq. 1)
then
1116 end subroutine ident
logical use_prepared_network
Use a prepared folder with all necessary data in binary format.
character *5, dimension(:), allocatable, public net_names
list of isotopes contained in the network
subroutine, private read_ascii_network_data()
Reads nuclear properties (name,a,n,z,spin,mass excess,partition functions) from file 'winvn' and htpf...
integer, public ipro
index of alphas, neutrons and protons
integer function, public findaz(ai, zi)
Finds an isotope index in the network table, given its A and Z. In case it was not found,...
subroutine, private read_htpf(source)
Read the file with high-temperature partition function (normally datafile2.dat). An example of the fi...
real(r_kind), dimension(:), allocatable, public t9_data
temperatures at which partition functions are given [GK]
integer function, public benam(name)
Returns the index number of isotope 'name'.
character(50) function, public reaction_string(reac)
Return a string to represent a given reaction.
logical use_neutrino_loss_file
Use a file with Qnu values?
character(:) function, allocatable, public int_to_str(num)
Converts a given integer to a string.
subroutine, public raise_exception(msg, sub, error_code)
Raise a exception with a given error message.
subroutine, private read_winvn(winvn)
Reads nuclear properties (name,a,n,z,spin,mass excess,partition functions) from file 'winvn' and writ...
integer, public ntgp
(24/72) Number of temp grid points for the partition functions
subroutine, private read_binary_network_data(path)
Read the general network information from a binary file.
type(isotope_type), dimension(:), allocatable, public isotope
all nuclides used in the network
subroutine, public write_data_to_std_out(str_msg, value_str, unit)
Write data to the standard output (usually OUT)
subroutine, public output_binary_network_data(path)
Save the general network information to a binary file.
Module with helper functions such as rate tabulation, partition functions, and theoretical weak rates...
logical use_htpf
Use high temperature partition functions or not.
integer, dimension(:,:), allocatable minmax
TODO: add description.
character(max_fname_len) isotopes_file
properties of all isotopes in the network: masses, partition functions etc. (winvn)
character(len= *), parameter, private network_binary_name
real(r_kind), dimension(:), allocatable, public qnuloss
Qnu for decay of each isotope [MeV].
character(max_fname_len) htpf_file
high-temperature partition functions (htpf.dat)
integer, public net_size
total number of isotopes (network size)
Provide some basic file-handling routines.
logical function, public is_stable(Z, N)
Function to decide whether a given isotope is stable or not.
subroutine, private load_network(net_source)
Reads isotope names from file 'net_source' and saves them in net_names(). Returns number of isotopes ...
subroutine lowercase(str)
Returns lowercase of input string. Numbers are not changed.
subroutine, public get_nuclear_properties()
Reads nuclear properties (name,a,n,z,spin,mass excess,partition functions) from file 'winvn' and htpf...
subroutine, public get_minmax()
Returns Amin and Amax for each isotopic chain in minmax.
character(max_fname_len) neutrino_loss_file
Path to a file containing Qnu values.
integer function, public open_infile(file_name)
Same for reading (input file)
subroutine, public convert(wnam, rnam)
Converts isotope names of weak-table format to the ones in reaclib.
Contains types and objects shared between multiple modules.
character(:) function, allocatable, public get_net_name(index, trimmed)
Getter of net_names, translating indices to a nucleus name.
character(max_fname_len) net_source
list of isotopes included in the network (sunet)
subroutine, public close_io_file(unit_no, file_name)
Close an external file.
integer function, public open_unformatted_outfile(file_name)
Shorthand for opening a new unformatted file for writing (output file)
subroutine, public ident(z1, n1, z2, n2, nam1, nam2, ind1, ind2, err)
Identifies the nuclide names and indices corresponding to z,n combinations (z1,n1),...
integer function open_unformatted_infile(file_name)
Open an unformatted file for reading.
subroutine, private sunet_check(ref_array)
Checks if sunet file contains valid isotope names.
character(max_fname_len) prepared_network_path
Prepared network folder.
Contains all runtime parameters as well as phys and math constants.
subroutine, private read_neutrino_loss(filename)
Read a file with neutrino loss energy.
subroutine, public getcoefficients(rate_array, length_rate_array)
Returns the 1/n! factor where n is the number of equal isotopes entering a reaction....
Subroutines needed to initialise the network.