source: palm/trunk/UTIL/chemistry/gasphase_preproc/kpp/util/Template_Jac_Chem.m @ 3606

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

Merge of branch palm4u into trunk

File size: 1.0 KB
Line 
1
2% Wrapper for calling the sparse ODE Jacobian routine
3% in a format required by Matlab's ODE integrators
4
5function J =  KPP_ROOT_Jac_Chem(T, Y)   
6 
7  global TIME FIX RCONST
8%  To call the mex file uncomment one of the following lines:
9%     1) LU prefix if SPARSE_LU_ROW option was used in code generation
10%  global LU_IROW LU_ICOL
11%     2) if SPARSE_ROW option was used in code generation
12%  global IROW ICOL
13 
14  Told = TIME;
15  TIME = T;
16  KPP_ROOT_Update_SUN;
17  KPP_ROOT_Update_RCONST;
18 
19%  This line calls the Matlab ODE Jacobian routine 
20  J = KPP_ROOT_Jac_SP( Y, FIX, RCONST );
21 
22%  To call the mex routine instead, comment the line above and uncomment one of the following lines:
23%     1) LU prefix if SPARSE_LU_ROW option was used in code generation
24%  J = sparse( LU_IROW, LU_ICOL, ...
25%        KPP_ROOT_mex_Jac_SP( Y, FIX, RCONST ), KPP_NVAR, KPP_NVAR);
26%     2) if SPARSE_ROW option was used in code generation
27%  J = sparse( IROW, ICOL, ...
28%        KPP_ROOT_mex_Jac_SP( Y, FIX, RCONST ), KPP_NVAR, KPP_NVAR);
29
30  TIME = Told;
31 
32return             
Note: See TracBrowser for help on using the repository browser.