Skip to content

Commit

Permalink
Merge pull request #54 from jimmielin/misc_cleanup
Browse files Browse the repository at this point in the history
Remove Vdotout functionality
  • Loading branch information
jimmielin committed Jul 7, 2022
2 parents 49092b6 + e5684af commit 7607565
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 24 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- C-lanugage updates
- C-language updates
- Restored driver programs `general.c` and `general_adj.c`
- Updated rate-law functions in `util/UserRateLaws.c`
- Added C-I tests for C-language integrators (using the
Expand Down Expand Up @@ -41,6 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed
- bibtex.json (no longer needed w/ Sphinx 3.5.4)
- Fun() no longer uses Vdotout since it can be retrieved from `Vdot`

## [2.6.0]

Expand Down Expand Up @@ -74,6 +75,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Make sure to inline parameter "sp" into the _Global.F90 file
when the "#DOUBLE off" option is used.


### Changed
- Code updates
- Rewrote code to remove compiler warnings
Expand Down
7 changes: 1 addition & 6 deletions docs/source/using_kpp/05_output_from_kpp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ first the vector :code:`A` of reaction rates and then the vector
species, fixed species, and the rate coefficients,
respectively. :code:`A` and :code:`Vdot` may be returned to the
calling program (for diagnostic purposes) with optional ouptut
arguments :code:`Aout` and :code:`Vdotout`. Below is the Fortran90
argument :code:`Aout`. Below is the Fortran90
code generated by KPP for the ODE function of our
:program:`small_strato` example.

Expand All @@ -352,8 +352,6 @@ code generated by KPP for the ODE function of our
REAL(kind=dp) :: Vdot(NVAR)
! Aout - Optional argument to return equation rate constants
REAL(kind=dp), OPTIONAL :: Aout(NREACT)
! Vdotout - Optional argument to return time derivative of variable species
REAL(kind=dp), OPTIONAL :: Vdotout(NVAR)
! Computation of equation rates
Expand All @@ -380,9 +378,6 @@ code generated by KPP for the ODE function of our
Vdot(4) = -A(8)+A(9)+A(10)
Vdot(5) = A(8)-A(9)-A(10)
!### Use Vdotout to return time deriv. of variable species
IF ( PRESENT( Vdotout ) ) Vdotout = V
END SUBROUTINE Fun
.. _Jacobian-and-JacobianSP:
Expand Down
26 changes: 9 additions & 17 deletions src/gen.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ int DC;
int ARP, JVRP, NJVRP, CROW_JVRP, IROW_JVRP, ICOL_JVRP;
int V, F, VAR, FIX;
int RCONST, RCT;
int Vdot, P_VAR, D_VAR, Aout, Vdotout;
int Vdot, P_VAR, D_VAR, Aout;
int StoichNum;
int KR, A, BV, BR, IV, RR;
int JV, UV, JUV, JTUV, JVS;
Expand Down Expand Up @@ -302,9 +302,6 @@ int i,j;
Aout = DefvElmO( "Aout", real, -NREACT,
"Optional argument to return equation rate constants" );

Vdotout = DefvElmO( "Vdotout", real, -NVAR,
"Optional argument to return time derivative of variable species" );

/* Elements of Stochastic simulation*/
NMLCV = DefvElm( "NmlcV", INT, -NVAR, "No. molecules of variable species" );
NMLCF = DefvElm( "NmlcF", INT, -NFIX, "No. molecules of fixed species" );
Expand Down Expand Up @@ -662,7 +659,10 @@ int F_VAR, FSPLIT_VAR;
if (useLang != MATLAB_LANG) /* Matlab generates an additional file per function */
UseFile( functionFile );

F_VAR = DefFnc( "Fun", 6,
// Note: When changing the FunctionBegin declarations below,
// the number of arguments minus one must be changed in DefFnc here
// as well. (hplin, 7/6/22)
F_VAR = DefFnc( "Fun", 5,
"time derivatives of variables - Aggregate form");

FSPLIT_VAR = DefFnc( "Fun_SPLIT", 7,
Expand All @@ -673,8 +673,10 @@ int F_VAR, FSPLIT_VAR;
// time derivative of variable species from Fun via optional arguments
// Aout and VdotOut (when z_useAggregate=1)
// -- Bob Yantosca (03 May 2022)
//
// Vdotout functionality can be accomplished using Vdot (hplin, 7/6/22)
if( z_useAggregate ) {
FunctionBegin( F_VAR, V, F, RCT, Vdot, Aout, Vdotout );
FunctionBegin( F_VAR, V, F, RCT, Vdot, Aout );
}
else {
FunctionBegin( FSPLIT_VAR, V, F, RCT, Vdot, P_VAR, D_VAR, Aout );
Expand Down Expand Up @@ -745,14 +747,6 @@ int F_VAR, FSPLIT_VAR;
Assign( Elm( Vdot, i ), sum );
}

// Add code to return time derivative of variable species (Vdotout)
// -- Bob Yantosca (03 May 2022)
NewLines(1);
if ( useLang == F90_LANG ) {
fprintf(functionFile, " !### Use Vdotout to return time deriv. of variable species\n");
fprintf(functionFile, " IF ( PRESENT( Vdotout ) ) Vdotout = Vdot\n");
}

} else {

NewLines(1);
Expand Down Expand Up @@ -801,9 +795,7 @@ int F_VAR, FSPLIT_VAR;
}
}

if( z_useAggregate )
MATLAB_Inline("\n Vdotout = Vdot(:);\n");
else
if( !z_useAggregate )
MATLAB_Inline("\n P_VAR = P_VAR(:);\n D_VAR = D_VAR(:);\n");

if( z_useAggregate )
Expand Down

0 comments on commit 7607565

Please sign in to comment.