
a net is defined by a set of isotopes and a set of reactions.
these sets are specified in a net definition file.

a net definition file contains a sequence of commands.
   can have any number of the following commands in any order.

include 'net_filename'
   this lets you break up a definition into several files.
   e.g., one net can defined as an extension of another.
   this first tries to open 'net_filename' in current directory.
   if that fails, it tries in mesa/data/net_data/nets/

add_isos(isos_list)
   for each iso in isos_list, 
      add it to the current set of isos in the net
   note: it really is a set, so multiple add's are okay.

remove_isos(isos_list)
   for each iso in isos_list, 
      remove it from the current set of isos in the net

add_reactions(reactions_list)
   for each reaction in reactions_list, 
      add it to the current set of reactions in the net
   note: it really is a set, so multiple add's are okay.

remove_reactions(reactions_list)
   for each reaction in reactions_list, 
      remove it from the current set of reactions in the net
   note: it really is a set, so multiple add's are okay.

finally, there is a command that will automatically add reactions.

add_isos_and_reactions(isos_list)
   for each iso in isos_list, 
      add the iso to the current set,
      and add reactions linking it to other isos in current set
         (see below for a discussion of what reactions are added)

isos_list = sequence of iso_spec's optionally separated by commas

iso_spec = either iso_name or element_name A_lo A_hi

   iso_name is something like h1 or he4 defined in chem
   
   element_name is something like h or he defined in chem
      A_lo and A_hi define the range of A values to add for the element 
      e.g., if iso_spec is he 3 4, then adds he3 and he4.
      
reactions_list = sequence of reaction_handle's optionally separated by commas

reaction_handle = 

   a reaction name defined in reactions.list or
   
   a reaction name derived from the input and output isos as follows 
      
      p,a,n capture reactions and photodisintegrations
         r_x_pg_y       where x and y are iso_names; e.g., r_c12_pg_n13
         r_y_gp_x
         r_x_ag_y
         r_y_ga_x
         r_x_ng_y
         r_y_gn_x
         
      p,a,n exchanges
         r_x_ap_y
         r_y_pa_x
         r_x_np_y
         r_y_pn_x
         r_x_na_y
         r_y_an_x
         
      standard 1-to-1 weak reactions
         r_x_wk_y       positron emission or electron capture
         r_x_wk-minus_y electron emission or positron capture
         
      other weak reactions (not in weaklib)
         r_x_wk_h1_y    beta decay with products h1 and y
         r_x_wk_he4_y   beta decay with products he4 and y
         r_h1_h1_ec_h2  electron capture
         r_h1_h1_wk_h2  beta decay
         r_he3_ec_h3
         r_be7_ec_li7
         r_h1_h1_wk_h2
         r_h1_he3_wk_he4
         
      other reactions
         r_<inputs>_to_<outputs>
         where <inputs> and <outputs> are iso_name's separated by '_'
         if the same iso appears 2 or more times, repeat the name that many times.
         e.g., triple alpha is r_he4_he4_he4_to_c12
         iso's ordered by increasing Z and N. e.g., r_h3_be7_to_neut_h1_he4_he4


reactions automatically added by the add_isos_and_reactions command
      
   p,a,n capture reactions and photodisintegrations (e.g., r_x_pg_y)
   p,a,n exchanges (e.g., r_x_ap_y)
   standard 1-to-1 weak reactions (e.g., r_x_wk_y)
   other weak reactions (e.g., r_x_wk_h1_y)
   
   it also checks if there are special cases to be added.      
   here's an incomplete list.
   
      r_h1_h1_wk_h2
      r_h1_h1_ec_h2
      r_h2_h2_to_h1_h3, r_h1_h3_to_h2_h2
      r_he3_ec_h3
      r_h2_h2_to_neut_he3, r_neut_he3_to_h2_h2
      r_neut_neut_he4_to_h3_h3, r_h1_h1_he4_to_he3_he3
      r_h3_he3_to_h2_he4, r_h2_he4_to_h3_he3
      r_li6_to_neut_h1_he4, r_neut_h1_he4_to_li6
      r_h1_li7_to_h2_li6, r_h2_li6_to_h1_li7
      r_he4_he4_he4_to_c12, r_c12_to_he4_he4_he4
      r_c12_c12_to_he4_ne20, r_he4_ne20_to_c12_c12
      r_neut_mg23_to_c12_c12, r_c12_c12_to_neut_mg23
      r_c12_ne20_to_h1_p31, r_h1_p31_to_c12_ne20
      r_s27_wk_h1_h1_al25
      r_he4_ca36_to_h1_h1_ca38, r_h1_h1_ca38_to_he4_ca36
      r_pd89_to_h1_h1_ru87, r_h1_h1_ru87_to_pd89


change rates for existing reactions

   create a file of (T8, rate) pairs as in data/rates_data/rates
   add the file name to reactions.list 
      (you can have a local copy of reactions.list as well as rates directory)


add a new reaction with rate give by table of (T8, rate) pairs
   
   get a name for the reaction by calling reaclib_create_handle
   then proceed same as for changing rate of an existing reaction
   use the reaction in a net in same way as for existing reactions.



selecting rates for reactions   [THIS NEEDS WORK]
   
   reactions in reactions.list have various rates available such as NACRE, REACLIB, or CF88.
      several reactions have other options as well: see rates_def.f for listing of choices
   
   other reactions use rates from weaklib or reaclib.
   
   also can provide a table of values for any reaction.
      arbitrarily many pairs of temperatures and rates; piecewise monotonic cubic interpolation.   
      specify files for rate tables in rate_list.txt



advanced topics -- experts only

to add a reaction
   1) add to reactions.list
   2) add to rates_def
   3) add to rates_names
   4) add to raw_rates
   
   for a weak rate, add 1/2 life and Qneu to weak_info.list in weaklib_data
      if possible, get 1/2 life = log(2)/exp(c1) with c1 from reaclib

to get the reaction added automatically
   add it to init_special_case_reaction_info in net_initialize

