[mesa-users] bel as the output of get_op_mono_args()
Bill Paxton
paxton at kitp.ucsb.edu
Tue Jul 28 18:58:09 EDT 2015
On Jul 28, 2015, at 3:46 PM, Ehsan Moravveji wrote:
> Thanks Bill for you reply.
> Actually, I could not fully digest it, in between the loops and if conditions. That’s why I asked.
> Can you please explain very briefly?
Okay -- but this is about as basic as it gets for loops and conditions, so if you are unable to read this simple routine, you need to work on your programming skills before you tackle anything complicated.
do i=1,species
if (X(i) < min_X_to_include) cycle
cid = chem_id(i)
Z = chem_isos% Z(cid)
if (Z == 0) cycle
! change Z if necessary so that in op set
do j=num_op_mono_elements,1,-1
if (Z >= op_mono_element_Z(j)) then
Z = op_mono_element_Z(j)
exit
end if
end do
iel = 0
do j=1,nel
if (izzp(j) == Z) then
iel = j
exit
end if
end do
if (iel == 0) then
nel = nel+1
iel = nel
izzp(nel) = Z
end if
fap(iel) = fap(iel) + X(i)/dble(chem_isos% Z_plus_N(cid))
fac(iel) = chem_factors(i)
end do
it loops over the species in your current net.
if the mass fraction for the species is less than min_X_to_include, it is skipped
if the Z if 0 skip it (no neutrons please)
the 1st inner loop finds the matching Z from the op_mono elements
if that op_mono has not been added already, then add it now and increment nel.
finally it updates the arrays fap and fac for the op_mono element iel that was selected for the current species.
so at the end of the loop nel is the number of op_mono elements that have been added.
it cannot be more than the max available, but it can be less.
>
> Ehsan.
>
>> On 29 Jul 2015, at 00:44, Bill Paxton <paxton at kitp.ucsb.edu> wrote:
>>
>> The best place to look is the definition of get_op_mono_args in kap/public/kap_lib.f90. It sets nel. Just read the code.
>>
>>
>> On Jul 28, 2015, at 3:35 PM, Ehsan Moravveji wrote:
>>
>>> Hi all,
>>>
>>> Can someone help me understand the meaning of “nel” in the call to get_op_mono_args()?
>>> Should it always be exactly equal to the number of species available in OP, i.e. 17, or it can be different?
>>> What information does it bring back after the call?
>>>
>>> Thanks
>>> Ehsan.
>>> ------------------------------------------------------------------------------
>>> _______________________________________________
>>> mesa-users mailing list
>>> mesa-users at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/mesa-users
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> mesa-users mailing list
>> mesa-users at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/mesa-users
>
More information about the Mesa-users
mailing list