I. Prepare jcddata: ###in ~ osu1991/gas-grain/oldgg/surfrates in ~osu1991/gg-stoch/surfrates ------------------------------------------------------------------ 1. surfdata.in input file with all the barriers and reactions example: .... H 1 350. 100. 3.0E+01 from Katz et al, dpr * +51.63 J 1 350. 200. 3.0E+01 TA H2Oice, dEb=WT(H2O) * +51.63 J 1 450. 150. 3.0E+01 SA93 H2Oice,Theor+Ebguess* +51.63 H2 2 450. 135. 7.0e+00 TA H2Oice, dEb=WT(H2O) * 0.00 .... H H H2 0.00E+00 * H O OH 0. AR * H OH H2O 0. AR * H CO HCO 2.50E+03 WOON priv commun -DPR * H HCO H2CO 0. AR 87kcal/mol exoth * H H2CO CH2OH 2.50E+03 Eric NI* H CH2OH CH3OH 0. AR * H C CH 0. AR * H CH CH2 0. AR * H CH2 CH3 0. AR * H CH3 CH4 0. AR * H N NH 0. AR * H NH NH2 0. AR * H NH2 NH3 0. AR * O O O2 0.00E+00 AR * O CO CO2 1.00E+03 d'Hendecourt etal * O HCO CO2 H 0. M84 and Eric/gas chem * EOF end of file end of list 0. * .... Note: J in the species denotes dummy. The list of reactions: diffusion. To add more check the old files in ./surfdata/ ------------------------------------------------------------------ 2. jcd.sp.order input file with the species order !ATTN: use entries from surfdata.in, so that the species' names are identical example: !ATTENTION: entries must be 22 characters long! H HE C C2 C2H C2H2 .... etc... Note: to add more species check with the old files in ./sporder/ ------------------------------------------------------------------ 3. srates.in input file with parameters: example: ngs nns ngr njs ndiffr 455 196 4218 196 17 description: ngs: number of gas species in jcddata nns: number of neutral species in jcddata ngr: number of gas reactions in jcddata njs: number of surface species in jcddata ndiffr: number of diffusion reactions in jcddata ------------------------------------------------------------------ 4. jcd.sp.mod input file with information relevant to modified rates example: 15 H C C2O CH CH2 CH2OH CH3 CH4 CO H2 H2CO HCO O O2 OH list limited to those species which react on the surface no need to include species which are only produced on the surface Description: 15 = number of species that will eventually be modified H : name of species .... ------------------------------------------------------------------ 5. "./srates" prepare files with the rates if there is no executable, make one by: "make srates" Example of typical dialogue for "./srates" : --- Welcome to surfacerates, for calculation of surface reaction, evaporation and desorption rates. You will be prompted for input/output file names. Optional output of jcddata format is available. You can also select whether the output is approp for Model 1 ED(H)/Eb(H)=373/200 or for Model 2 ED(H)/Eb(H)=373/287 or alternate This version of the prog (6/15/00) may be altered to provide rates for H-rxns as QT not TH. Enter input filename surfdata.in Enter output filename surfdata.out Do you want jcddata output made? (0=n,1=y) 1 Enter jcddata output filename jcd.new If using surf.00.m1.in, but want M2 or other Enter 1 to use ED/Eb as in file - no changes Enter 2 to use M2 = 0.77 * Ed/Eb(Model1) Enter 3 for an alternative ratio 1 Do you wish to alter gas/dust temperature? (0=n,1=y) 0 For H enter 0 - for thermal hopping only 1 - quantum tunelling only 2 - for both 2 Total number of species read = 372 4 pai factor was ignored in Ri Total number of reactions read = 17 Used thop this many times= 0.E+0 392 0 STOP executed at line 651 in Fortran routine 'SURFACERATES' CPU: 0.216s, Wallclock: 53.050s Memory HWM: 276254, Stack HWM: 29175, Stack segment expansions: 0 --- ------------------------------------------------------------------ 6. jcd.new output file produced from srates It contains the surface information in format ready for jcddata Example: rate coeffs are for thermal hopping 1/2 rate if two product channels set all HOC and CHOH to zero JH JH JH2 1.03E+05 1.00E+00 0.00E+0014 1 *4219* JH JO JOH 5.14E+04 1.00E+00 0.00E+0014 2 *4220* JH JOH JH2O 5.14E+04 1.00E+00 0.00E+0014 3 *4221* JH JCO JHCO 1.12E-04 2.17E-09 2.50E+0314 4 *4222* JH JHCO JH2CO 5.14E+04 1.00E+00 0.00E+0014 5 *4223* JH JH2CO JCH2OH 1.09E-04 2.12E-09 2.50E+0314 6 *4224* JH JCH2OH JCH3OH 5.14E+04 1.00E+00 0.00E+0014 7 *4225* etc.... ------------------------------------------------------------------ in ~osu1991/gg-stoch/ ------------------------------------------------------------------ 7. modify jcddata: -- make a back up copy of jcddata: jcddata.old -- save the initial conditions in file: init_cond.dat -- remove the explanatory lines from jcd.new -- remove all the surface reactions from jcddata -- append jcd.new to jcddata -- append init_cond.dat to jcddata ------------------------------------------------------------------ 8. --> follow instructions to make new jcddata (deb.newexe 1.) 0) save init condtion in init.cond (or init_cond.dat) i) call jcddata cdd ii) add blank line at the end of spec list (before REFER...and XNT) iii)"./fixjcddata.new" !Note: if there is no executable fix* create it by: "make fix" iv)add initial conditions: cat init.cond >> jcddata.new v)call jcddata.new jcddata ------------------------------------------------------------------ 9. ./fixjcddata.new ------------------------------------------------------------------ 10. cat init_cond.dat >> jcddata.new ------------------------------------------------------------------ 11. mv jcddata.new jcddata ------------------------------------------------------------------ ------------------------------------------------------------------ ------------------------------------------------------------------ II. Write the equations: ####in ~osu1991/gas-grain/ in ~osu1991/gg-stoch/ ------------------------------------------------------------------ 1. jeqwrt.f modify the parameters to be consistent with jcddata replace NKMAX=$oldNoreactions with NKMAX=$newNoreactions replace NSMAx=$oldNospecies with NSMAX=$newNospecies Note: NSMAX could be either equal to the actual species, or the species plus probabilities - it does not matter ------------------------------------------------------------------ 2. "make jeq" create an executable ------------------------------------------------------------------ 3. "./fixeq" run jeq and write the rate equations standard rate equation Note: check for errors: "./check" In the output on the screen: There should be no improper and symb things in DISK7 and DISK23 Adjust calls to FCHM in jchnsmc.f to equal those in DISK23 Adjust calls to RATS in DISK23 to equal total number of RATS ------------------------------------------------------------------ ------------------------------------------------------------------ in ./eqwrt/ ------------------------------------------------------------------ 4. stochdata input file with the stochastic info Note: only the probabilistic species with their cuts are necessary. If you want to add a normal species - its cut should be set to 0. Example: name stcut /0- normal species/ JH 2 JO 2 JOH 1 JHCO 1 JCH2OH 1 JC 2 JCH 1 JCH2 1 JCH3 1 JN 2 JNH 1 JNH2 1 ------------------------------------------------------------------ 5. "./crstin.pl" Description: run program to create stochastic input files Requires input: stochdata and jcddata Note: the program must know where jcddata is located! The directory for jcddata is hard-coded into crstin.pl Example line: open (INPUT, "../jcddata") or die "can't open jcddata! \n"; Note: default sumcut is 3. To change: modify the program. Example line: $sumcut = 3; Output: produces the files "species" and "reactions" that are required input for the equation writer eqwrt2.c ------------------------------------------------------------------ 6. Create libeqwrt.a Description: Necessary library for eqwrt2.c program - "cd libsrcd" : change into library directory - "make all" : compile the source code - "cd .." : change back into the eqwrt/ directory - "make lib" : make the library Note: Make sure you have the appropriate Makefile with all the command instructions! 7. eqwrt2.c Description: Writes the surface equations for the stochastic model Requires: library file "libeqwrt.a" The header files reac.h stoch.h etc. are in libsrc/ (If you change the location of header files - change the OUTRULE in Makefile) - "make eq2" : create the executable from eqwrt2.c - check eq.com if it points to the right directory and file - "sh run.com" : run eq2 in batch - after run: check eq.log for error messages Output: - stoch_surf.h - stochastic parameters necessary in jchnsmc.f and jscdfr.f - fchem.h - future jscdfr.h header file - init.f - subroutine with the initial conditions for the probability - fchem.f - subroutine with the equations - aver.f - subroutine that calculates the averages of the surface species ------------------------------------------------------------------ ------------------------------------------------------------------ ------------------------------------------------------------------ III. Link stochastic equations with the gas-grain model: Must be in the directory with the main programs: in ~osu1991/gg-stoch/ ------------------------------------------------------------------ ATTN: this can be done later (make all) 0. "make gear.o" Create gear.o Single and double precisions of gear are in gears/ ATTN: on SV1 and COE use single precision gear with -dp flag. Otherwise, the calculations take forever! ------------------------------------------------------------------ 1. "./cpf" it copies the necessary files from the eqwrt/ into ./ creates jscdfr.h - necessary for jscdfr.f fchem.f - necessary for jscdfr.f stoch_surf.f - init.f + aver.f + fchem.f ------------------------------------------------------------------ ATTN: this can be done later (make all) 2. "make stoch.o" compile stoch_surf.f ------------------------------------------------------------------ 3. in jcddata: modify NEQ! (!!!) use stoch_surf.h as guide: neq = nqg + nq + ndmax (neq = gas eq + surf eq + prob eq.) ------------------------------------------------------------------ 4. "./modf.pl" - create jscdfr.f Description: modifies DISK23 and saves it as jscdfr.f Note: make sure it points to the correct directories and files! Note:modf.com - if run in batch (!!!) upgrade .com file Note: if you have run modf.pl once, you do not need to run it again unless the number of stochastic has changed, or DISK23 has changed ------------------------------------------------------------------ 5. Modify jchnsmc.h (!!!) NSMAX and NKMAX must be the same as in jscdfr.h Note: if the number of equations changes from 3-digit to 4 digit number or more, jchnsmc.f must be modified accordingly. Search for "100" line in the file - that is where the format is given. Currently there are two lines - one for number of equations less than 1000, and one for more than 1000 but less than 10 000. You can comment or uncomment the appropriate one. ------------------------------------------------------------------ ------------------------------------------------------------------ ------------------------------------------------------------------ IV. Compiling and linking: still in osu1991/gg-stoch/ ------------------------------------------------------------------ ATTN: To run a non-stochastic gas-grain model: - Omit steps II.4-7, - Omit steps III.1-5 - Rename DISK23 to jscdfr.f by "mv DISK23 jscdfr.h" !!! create Makefile to combine all steps 1-3, and possibly 4 ------------------------------------------------------------------ 1. qsub compile.job compile and create: gear.f gear.o stoch_surf.f stoch.o jscdfr.f jscdfr.o jchnsmc.f jchnsmc.o link: gear.o jscdfr.o jchnsmc.o stoch.o Note: if stoch_surf.f is not too big, the compilation can be done directly through the command: make all. Otherwise, it has to be run in batch. (Previously: f90 -dp -c gear.f make stoch.o sh Cd.com sh C.com sh L.com) ------------------------------------------------------------------ 2. qsub model.job (Previously: sh A.com you need B.com with the instructions run jschnsmc.e ATTN: make sure all *.com files point to the right directory and files. ) ------------------------------------------------------------------ Steps denoted by (!!!) to be modified later ! Last modified: Feb. 2, 2004