source: palm/trunk/UTIL/chemistry/gasphase_preproc/kpp/drv/exact.c @ 2776

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

Merge of branch palm4u into trunk

File size: 1.1 KB
Line 
1void main()
2{
3KPP_REAL dval[NSPEC];
4FILE * fp;
5int i;
6 
7/* ---- TIME VARIABLES ------------------ */
8
9  RTOLS = 1e-6;
10  TSTART = 3600*12;
11  TEND = TSTART + 3600*24*5;
12  DT = 3600.;
13  TEMP = 236.21;
14
15  Initialize();
16     
17  for( i = 0; i < NVAR; i++ ) {
18    RTOL[i] = RTOLS;
19    ATOL[i] = 1;
20  }
21  STEPMIN = 0.01;
22  STEPMAX = 900;
23     
24/* ********** TIME LOOP **************************** */
25
26  InitSaveData();
27
28  printf("\n%7s %7s   ", "done[%]", "Time[h]");
29  for( i = 0; i < NMONITOR; i++ ) 
30    printf( "%8s  ", SPC_NAMES[MONITOR[i]] );
31  for( i = 0; i < NMASS; i++ ) 
32    printf( "(%6s)  ", SMASS[i] );
33 
34  TIME = TSTART;
35  while (TIME <= TEND) {
36    GetMass( C, dval );
37    printf("\n%6.1f%% %7.2f   ", (TIME-TSTART)/(TEND-TSTART)*100, TIME/3600 );
38    for( i = 0; i < NMONITOR; i++ ) 
39      printf( "%8.2e  ", C[ MONITOR[i] ]/CFACTOR );
40    for( i = 0; i < NMASS; i++ ) 
41      printf( "%8.2e  ", dval[i]/CFACTOR );
42   
43    SaveData();
44
45    Update_SUN(); 
46    Update_RCONST();
47
48    INTEGRATE( DT );
49  }
50
51/* *********** END TIME LOOP *********************** */
52
53  printf("\n");
54  CloseSaveData();
55  GenerateMatlab("");
56}
Note: See TracBrowser for help on using the repository browser.