NOTICE TO USE NAHOON V. Wakelam Mai. 2006 Nahoon is a gas-phase chemical model, which computes the chemical evolution at a fixed temperature and density. The current version of the model uses the OSU chemical database but the model can be adapted to any network. In addition to this network, an approximation from Lee et al. (1996) is used to take into account the CO and H2 self-shielding in low visual extinction regions. Please, note that this is only an approximation and look at Lee et al. paper for any detail on the computation. The differential equations for the abundance evolutions are not explicitely writen but are computed in a loop. The solver is DLSODE from odepack (http://www.netlib.org/odepack/). In addition to the chemical model, an other procedure can be used to generate the files to compute the uncertainties in the species abundances. In this notice, I try to explain how to use these tools but if some information is missing or unclear, please contact me. HOW TO USE THE CHEMICAL MODEL: Six input files are needed: - osu.2005_unc is the list of reactions. - cond_initial.dat contains the initial conditions. The abundance species are compared to total H. - input_parameter.dat contains some of the model parameters such as the gas temperature and density. - timeres.dat is the list of times at which the abundances will be given in the plot.dat file. - random.dat is used by the uncertainty calculation. Must be present even if empty. - Self_Shielding_data contains the parameters to compute the CO and H2 self- shielding factors. ALLWAYS RESPECT THE FORMAT OF THE INPOUT FILES. There are 4 output files: - Kout.dat gives you the rate coefficient for each reaction, very useful for the uncertainties. - plot.dat gives you the species abundances at the times listed in timeres.dat. - verif.dat gives you the balance of positive and negative charges and the elemental abundances at selected times indicated in the main program (the ITEST table). The main rates and reactions of formation and destruction for each species at selected times are also given. The reactions are indicated by the number of the reaction in osu.2005_unc. To compile and run the model: g77 -c nahoon.f g77 -c dlsode.f g77 -o nahoon nahoon.o dlsode.o nahoon or ./nahoon depending on the system you are using TO MODIFY THE CHEMICAL DATABASE: If you want to change the number of reactions: - Change: NRTOT=4423 1 time in nahoon.f. - Change: NRBIS2=4423 3 times in nahoon.f. - Change: NR=4423 1 time in run_unc.f if you run the uncertainties. If you want to change the number of species: - Change: NS=453 1 time in nahoon.f. - Change: NS2=453 1 time in nahoon.f. If you are adding changing the number of elements: - Of course, change the cond_initial.dat file. - Change: NELEM=14 which represent the number of elements + 1 (charge) - Change the format 1 in nahoon.f. If you are changing the number of times for the output in timeres.dat: - Change NTIME=124 in nahoon.f. - Change format 8 and 9 in nahoon.f. HOW TO RUN THE UNCERTAINTIES? See Wakelam et al. (2005, A&A 444, 883) for the details of the method. You will not have to change anything inside the main program. You only have to change the first line of the input_parameter.dat file and say 'Y'. Two external other programs are however required: - script_unc is a script which run the loop. In this file, nrun is the number of runs you want to make. For each run, it will rename the output files plot.dat and Kout.dat files with the number of the run. It also write a number in a file "num". - run_unc.f computes the random numbers you will need. This procedure will read the uncertainty factors in the list of reactions. It will also read the number in "num". Since the srand fortran function may depend on the compiler, ALWAYS CHECK THE PROFILES OF THE RANDOM NUMBERS GENERATED BY THIS PROCEDURE. In this program, you can choose to vary also the gas temperature and density. Be careful that if you are in the uncertainty mode the gas temperature and density has to be written in this file. This program writes a file "random.dat" which contains the gas density and temperature, the random numbers and the uncertainty factor for each reaction. The number of reactions is also in this procedure. To start the computation: g77 -c nahoon.f g77 -c dlsode.f g77 -o nahoon nahoon.o dlsode.o g77 -o run_unc run_unc.f ./script >&liste& It is going to be long ! Ok, now that you have your thousands of plotxxxx.dat files, the first thing is to check the distribution of the rate coefficients and/or gas temperature and density. For that, you can use the IDL procedures. THE IDL PROCEDURES - plot_ab.pro plots the abundance of a selected species as a function of time from the one single output file (plot.dat) of the chemical model. The other procedures are useful for the computation of the uncertainties (N being the number of runs you have done): - verif_dist.pro is a procedure that check the distributions of the parameters you have randomly chosen (histogram_ez.pro is used here). - read_plot.pro plots the same figure a number of abundances of one selected species form the plot_xxx.dat files. - species_file.pro creates for each species one file which contains the abundances of all the N runs (from the plot_xxx.dat files) as a function of time. For instance H2O.dat (species.dat) will contain all the abundances of H2O. - read_ab.pro plots the abundances of one selected species from the species.dat file. - error_auto.pro computes the error bars from the species.dat files. Using this procedure for all the species can take one day. ADVICE TO USE THE IDL PROCEDURES TO COMPUTE THE ERROR BARS: Create three directories, one in which you put the results of the modeling plot_xxxx.dat, one in which you will put the species abundances (species.dat) and one in which you will put the files of the error bars. For the moment, the two last files have the same name (species.dat) so it is important to put them in two different directories. You can use for instance: results/ to put the Koutxxxx.dat and plotxxxx.dat files ab_spec/ the files with all the abundances for each species Error/ the files with the error bars. The files containing the error bars has the following format: Column 1: log of the time Column 2: mean abundance Column 3: minimum error bar Column 4: maximum error bar Column 5: (maximum-minimum)/2 Column 6: 2 sigma error of a gaussian fit