source: palm/trunk/UTIL/chemistry/gasphase_preproc/kpp/drv/main.c @ 3655

Last change on this file since 3655 was 2696, checked in by kanani, 7 years ago

Merge of branch palm4u into trunk

File size: 1.0 KB
Line 
1void INTEGRATE( double TIN, double TOUT );
2
3void main()
4{
5KPP_REAL rtols;
6KPP_REAL Tstart, Tend, DT;
7FILE * fp;
8int i;
9 
10/* ---- TIME VARIABLES ------------------ */
11
12  rtols = 1e-3;
13  for( i = 0; i < NVAR; i++ ) {
14    RTOL[i] = rtols;
15    ATOL[i] = 1E-18;
16  }
17     
18  Initialize();
19     
20  fp = fopen("Extrapd.m", "w");
21  fprintf( fp, "ed=[\n");
22       
23  Tstart = 3600*12;
24  Tend = Tstart + 3600*24*5;
25  STEPMIN = 0.001;
26  STEPMAX = 900;
27  DT = 3600.;
28  TEMP = 236.21;
29     
30/* -- BELOW THIS LIMIT USE TAYLOR INSTEAD OF EXP --- */
31/* ********** TIME LOOP **************************** */
32
33  TIME = Tstart;
34  while (TIME <= Tend) {
35
36    printf("\nMonitor: ");
37    for( i = 0; i < NMONITOR; i++ ) 
38      printf( "%12.8g  ", C[ MONITOR[i] ]/CFACTOR );
39
40    fprintf( fp, "\n%6.1f ", (TIME-Tstart)/3600.0 );
41    for( i = 0; i < NLOOKAT; i++ ) 
42      fprintf( fp, "%24.16e ", C[ LOOKAT[i] ]/CFACTOR );
43
44    INTEGRATE( DT );
45  }
46
47/* *********** END TIME LOOP *********************** */
48
49  fprintf(fp, "\n];");
50  fclose( fp );
51  printf("\n");
52}
Note: See TracBrowser for help on using the repository browser.