From 2a6b3fa2cc2b3016dcf27f530e04995ddd85fc73 Mon Sep 17 00:00:00 2001 From: Bob Yantosca Date: Thu, 19 Dec 2024 16:42:04 -0500 Subject: [PATCH 1/4] Now inline "INLINED RCONST" at the top of routine "UPDATE_RCONST" src/gen.c - Modified routine GenerateUpdateRconst so that the INLINED RCONST contents will be placed immedately after the start of the UPDATE_RCONST subroutine, and to place F90 variable declarations etc. immediately after that. This will prevent compile-time errors if a USE statement is included via "INLINED RCONST", as USE statements must come before variable declarationas and other statements. - Updated comments CHANGELOG.md - Updated accordingly Signed-off-by: Bob Yantosca --- CHANGELOG.md | 1 + src/gen.c | 91 ++++++++++++++++++++++++++++++++++++++++------------ 2 files changed, 71 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4c5ef1..45177ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Added `char* rootFileName` to functions and function prototypes for `Use_C`, `Use_F`, `Use_F90`, `Use_MATLAB`, and `Generate` - Updated `docs/requirements.txt` to use `jinja2==3.1.4` (fixes a security issue) +- Updated `gen.c` to write the `INLINED RCONST` section at the top of routine `UPDATE_RCONST`. This will prevent compilation errors when `INLINED_RCONST` contains F90 `USE` statements (as these must precede other F90 statements). ## [3.1.1] - 2024-04-30 ### Changed diff --git a/src/gen.c b/src/gen.c index 8b728df..7e3d172 100644 --- a/src/gen.c +++ b/src/gen.c @@ -2167,21 +2167,38 @@ void GenerateUpdateRconst() { int i; int UPDATE_RCONST; -int YIN,Y; +int YIN, Y; UseFile( rateFile ); if (useLang==F90_LANG) { - // F90: Declare function with optional YIN argument and local Y variable. - YIN = DefvElmO( "YIN", real, -NVAR, "Optional input concentrations of variable species" ); - UPDATE_RCONST = DefFnc( "Update_RCONST", 1, "function to update rate constants"); - - FunctionBegin( UPDATE_RCONST, YIN ); - Y = DefvElm( "Y", real, -NSPEC, "Concentrations of species (local)" ); - Declare(Y); + // + // SPECIAL HANDLING FOR F90: + // ------------------------- + // Write the INLINED RCONST section immediately after the start of the + // subroutine UPDATE_RCONST. This will avoid compile-time errors if a + // "USE" statement is included via INLINED RCONST. Recall that F90 + // "USE" statements must precede variable declarations or any other + // executable statements. + // + // The FunctionBegin() routine writes the variable declaration + // statements immediately after the subroutine declaration line. + // Therefore, we will not be able to use FunctionBegin() to declare + // the UPDATE_RCONST subroutine. Instead, we will manually write + // "SUBROUTINE UPDATE_RCONST ( YIN )" here. + // + // Also note, because we are not using FunctionBegin, we do not + // need to declare the "int UPDATE_RCONST;" variable if we are + // generating F90 output. Move that to the else block. + // + // -- Bob Yantosca (19 Dec 2024) + // + bprintf("SUBROUTINE Update_RCONST ( YIN )"); NewLines(1); } else { + // // For other languages, declare function w/o any arguments + // UPDATE_RCONST = DefFnc( "Update_RCONST", 0, "function to update rate constants"); FunctionBegin( UPDATE_RCONST ); } @@ -2189,16 +2206,6 @@ int YIN,Y; F77_Inline(" INCLUDE '%s_Global.h'", rootFileName); MATLAB_Inline("global SUN TEMP RCONST"); - switch( useLang ){ - case F90_LANG: - WriteComment("Ensure local Y array is filled with variable and constant concentrations"); - bprintf(" Y(1:NSPEC) = C(1:NSPEC)\n"); - NewLines(1); - WriteComment("Update local Y array if variable concentrations are provided"); - bprintf(" if (present(YIN)) Y(1:NVAR) = YIN(1:NVAR)\n"); - break; - } - if ( useLang==F77_LANG ) IncludeCode( "%s/util/UserRateLaws_FcnHeader", Home ); @@ -2223,6 +2230,35 @@ int YIN,Y; NewLines(1); WriteComment("End INLINED RCONST"); NewLines(1); + // + // SPECIAL HANDLING FOR F90: + // ------------------------- + // Write F90 variable declarations after the INLINED RCONST section. + // This will avoid compile-time errors if a USE statement is placed + // into the INLINED RCONST section, as described above. + // + // -- Bob Yantosca (19 Dec 2024) + // + if (useLang == F90_LANG) { + + // Declare optional YIN argument + YIN = DefvElmO( "YIN", real, -NVAR, "Optional input concentrations of variable species" ); + Declare(YIN); + NewLines(1); + + // Declare local Y variable + Y = DefvElm( "Y", real, -NSPEC, "Concentrations of species (local)" ); + Declare(Y); + NewLines(1); + + // Copy values of YIN to Y if YIN is present + WriteComment("Ensure local Y array is filled with variable and constant concentrations"); + bprintf(" Y(1:NSPEC) = C(1:NSPEC)\n"); + NewLines(1); + WriteComment("Update local Y array if variable concentrations are provided"); + bprintf(" if (present(YIN)) Y(1:NVAR) = YIN(1:NVAR)\n"); + NewLines(2); + } for( i = 0; i < EqnNr; i++) { /* mz_rs_20220701+ */ @@ -2242,9 +2278,22 @@ int YIN,Y; } MATLAB_Inline(" RCONST = RCONST(:);"); - - FunctionEnd( UPDATE_RCONST ); - FreeVariable( UPDATE_RCONST ); + // + // SPECIAL HANDLING FOR F90: + // ------------------------- + // Manually write the "END SUBROUTINE UPDATE_RCONST" line when + // generating F90 output. But if generating C, F77, MatLab output, + // then close the UPDATE_CONST routine as we normally would. + // -- Bob Yantosca (19 Dec 2024) + // + if (useLang == F90_LANG) { + NewLines(1); + bprintf("END SUBROUTINE UPDATE_RCONST"); + NewLines(1); + } else { + FunctionEnd( UPDATE_RCONST ); + FreeVariable( UPDATE_RCONST ); + } } From 0da69839b67bb64b8db2e11b877dc2980938bd24 Mon Sep 17 00:00:00 2001 From: Bob Yantosca Date: Thu, 19 Dec 2024 17:01:21 -0500 Subject: [PATCH 2/4] Updated comments in src/gen.c src/gen.c - Removed leftover comment about "int UPDATE_RCONST;" variable - Fixed typo Signed-off-by: Bob Yantosca --- src/gen.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/gen.c b/src/gen.c index 7e3d172..b19c819 100644 --- a/src/gen.c +++ b/src/gen.c @@ -2187,10 +2187,6 @@ int YIN, Y; // the UPDATE_RCONST subroutine. Instead, we will manually write // "SUBROUTINE UPDATE_RCONST ( YIN )" here. // - // Also note, because we are not using FunctionBegin, we do not - // need to declare the "int UPDATE_RCONST;" variable if we are - // generating F90 output. Move that to the else block. - // // -- Bob Yantosca (19 Dec 2024) // bprintf("SUBROUTINE Update_RCONST ( YIN )"); @@ -2283,7 +2279,7 @@ int YIN, Y; // ------------------------- // Manually write the "END SUBROUTINE UPDATE_RCONST" line when // generating F90 output. But if generating C, F77, MatLab output, - // then close the UPDATE_CONST routine as we normally would. + // then close the UPDATE_RCONST routine as we normally would. // -- Bob Yantosca (19 Dec 2024) // if (useLang == F90_LANG) { From bd4745fff76100ecdff3ffdf7cabb4bc2f065e5c Mon Sep 17 00:00:00 2001 From: Bob Yantosca Date: Fri, 20 Dec 2024 12:00:12 -0500 Subject: [PATCH 3/4] Added new #INLINE F90_RCONST_USE option for F90 USE statements src/gdata.h - Declare F90_RCONST_USE as a variable of type "enum inl_code" src/scanner.c - Added F90_RCONST_USE to InlineKeys[] src/gen.c - In routine GenerateUpdateRconst we now proceed in this order: 1. Manually write the "SUBROUTINE UPDATE_RCONST ( YIN )" line 2. Inline code from the "#INLINE F90_RCONST_USE" section 3. Declare YIN optional argument and Y local variable 4. Copy values of YIN to Y (if necessary) 5. Inline code from the "#INLINE F90_RCONST" section 6. Manually write the "END SUBROUTINE UPDATE_RCONST" line .gitignore - Now ignore executable files in MCM example folders CHANGELOG.md - Updated accordingly Signed-off-by: Bob Yantosca --- .gitignore | 3 ++- CHANGELOG.md | 7 ++++- src/gdata.h | 10 +++---- src/gen.c | 75 ++++++++++++++++++++++++--------------------------- src/scanner.c | 1 + 5 files changed, 49 insertions(+), 47 deletions(-) diff --git a/.gitignore b/.gitignore index 00cec10..da5f2ba 100644 --- a/.gitignore +++ b/.gitignore @@ -67,5 +67,6 @@ docs/build/* # Other files/dirs to exclude *.pdf -/examples/mcm/__pycache__ +/examples/mcm*/__pycache__ +/examples/mcm*/*.exe diff --git a/CHANGELOG.md b/CHANGELOG.md index 45177ec..d372552 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,14 +9,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] - TBD +### Added +- Added new inline key `F90_RCONST_USE` in `src/gdata.h` and `src/scanner.c` + ### Changed - Updated `Update_RCONST` to use `Y` instead of `C` to account for updated variable species concentrations - Updated C-I tests to print the compiler versions that are used +- Updated routine `GenerateUpdateRconst` to manually write the `SUBROUTINE` and `END SUBROUTINE` lines (F90 only) +- Updated routine `GenerateUpdateRconst` to inline code from `#INLINE F90_RCONST_USE` before any other F90 variable declarations or statements +- Updated `.gitignore` to ignore executables in the MCM example folders ### Fixed - Added `char* rootFileName` to functions and function prototypes for `Use_C`, `Use_F`, `Use_F90`, `Use_MATLAB`, and `Generate` - Updated `docs/requirements.txt` to use `jinja2==3.1.4` (fixes a security issue) -- Updated `gen.c` to write the `INLINED RCONST` section at the top of routine `UPDATE_RCONST`. This will prevent compilation errors when `INLINED_RCONST` contains F90 `USE` statements (as these must precede other F90 statements). ## [3.1.1] - 2024-04-30 ### Changed diff --git a/src/gdata.h b/src/gdata.h index 333412b..435337b 100644 --- a/src/gdata.h +++ b/src/gdata.h @@ -92,11 +92,11 @@ enum krtypes { NUMBER, EXPRESION, PHOTO }; enum table_modes { F_TEXT, FC_TEXT, C_TEXT, S_TEXT }; enum lang { NO_LANG, C_LANG, F77_LANG, F90_LANG, MATLAB_LANG }; enum inl_code { - F77_GLOBAL, F77_INIT, F77_DATA, F77_UTIL, F77_RATES, - F77_RCONST, F90_GLOBAL, F90_INIT, F90_DATA, F90_UTIL, - F90_RATES, F90_RCONST, C_GLOBAL, C_INIT, C_DATA, - C_UTIL, C_RATES, C_RCONST, MATLAB_GLOBAL, MATLAB_INIT, - MATLAB_DATA, MATLAB_UTIL, MATLAB_RATES, MATLAB_RCONST, + F77_GLOBAL, F77_INIT, F77_DATA, F77_UTIL, F77_RATES, + F77_RCONST, F90_GLOBAL, F90_INIT, F90_DATA, F90_UTIL, + F90_RATES, F90_RCONST, F90_RCONST_USE, C_GLOBAL, C_INIT, + C_DATA, C_UTIL, C_RATES, C_RCONST, MATLAB_GLOBAL, + MATLAB_INIT, MATLAB_DATA, MATLAB_UTIL, MATLAB_RATES, MATLAB_RCONST, INLINE_OPT }; diff --git a/src/gen.c b/src/gen.c index b19c819..eeeb5c3 100644 --- a/src/gen.c +++ b/src/gen.c @@ -2175,22 +2175,45 @@ int YIN, Y; // // SPECIAL HANDLING FOR F90: // ------------------------- - // Write the INLINED RCONST section immediately after the start of the - // subroutine UPDATE_RCONST. This will avoid compile-time errors if a - // "USE" statement is included via INLINED RCONST. Recall that F90 - // "USE" statements must precede variable declarations or any other - // executable statements. - // - // The FunctionBegin() routine writes the variable declaration - // statements immediately after the subroutine declaration line. - // Therefore, we will not be able to use FunctionBegin() to declare - // the UPDATE_RCONST subroutine. Instead, we will manually write - // "SUBROUTINE UPDATE_RCONST ( YIN )" here. + // Manually write the "SUBROUTINE RCONST ( YIN )" line instead of + // using the FunctionBegin( UPDATE_RCONST ). This will allow us + // to add any inlined F90 use statements immediately afterwards. + // Recall that F90 "USE" statements must precede variable + // declarations or any other executable statements, or else a + // compilation error will be generated. // // -- Bob Yantosca (19 Dec 2024) // bprintf("SUBROUTINE Update_RCONST ( YIN )"); + NewLines(2); + + // Inline USE statements right after the subroutine declaration + WriteComment("Begin INLINED RCONST - F90 USE STATEMENTS"); + NewLines(1); + bprintf( InlineCode[ F90_RCONST_USE ].code ); + FlushBuf(); NewLines(1); + WriteComment("End INLINED RCONST - F90 USE STATEMENTS"); + NewLines(1); + + // Declare optional YIN argument + YIN = DefvElmO( "YIN", real, -NVAR, "Optional input concentrations of variable species" ); + Declare(YIN); + NewLines(1); + + // Declare local Y variable + Y = DefvElm( "Y", real, -NSPEC, "Concentrations of species (local)" ); + Declare(Y); + NewLines(1); + + // Copy values of YIN to Y if YIN is present + WriteComment("Ensure local Y array is filled with variable and constant concentrations"); + bprintf(" Y(1:NSPEC) = C(1:NSPEC)\n"); + NewLines(1); + WriteComment("Update local Y array if variable concentrations are provided"); + bprintf(" if (present(YIN)) Y(1:NVAR) = YIN(1:NVAR)\n"); + NewLines(2); + } else { // // For other languages, declare function w/o any arguments @@ -2207,6 +2230,7 @@ int YIN, Y; NewLines(1); + // Inline code from {C,F77,F90_MATLAB}_RCONST inline keys NewLines(1); WriteComment("Begin INLINED RCONST"); NewLines(1); @@ -2226,35 +2250,6 @@ int YIN, Y; NewLines(1); WriteComment("End INLINED RCONST"); NewLines(1); - // - // SPECIAL HANDLING FOR F90: - // ------------------------- - // Write F90 variable declarations after the INLINED RCONST section. - // This will avoid compile-time errors if a USE statement is placed - // into the INLINED RCONST section, as described above. - // - // -- Bob Yantosca (19 Dec 2024) - // - if (useLang == F90_LANG) { - - // Declare optional YIN argument - YIN = DefvElmO( "YIN", real, -NVAR, "Optional input concentrations of variable species" ); - Declare(YIN); - NewLines(1); - - // Declare local Y variable - Y = DefvElm( "Y", real, -NSPEC, "Concentrations of species (local)" ); - Declare(Y); - NewLines(1); - - // Copy values of YIN to Y if YIN is present - WriteComment("Ensure local Y array is filled with variable and constant concentrations"); - bprintf(" Y(1:NSPEC) = C(1:NSPEC)\n"); - NewLines(1); - WriteComment("Update local Y array if variable concentrations are provided"); - bprintf(" if (present(YIN)) Y(1:NVAR) = YIN(1:NVAR)\n"); - NewLines(2); - } for( i = 0; i < EqnNr; i++) { /* mz_rs_20220701+ */ diff --git a/src/scanner.c b/src/scanner.c index abeaf52..06ca034 100644 --- a/src/scanner.c +++ b/src/scanner.c @@ -79,6 +79,7 @@ INLINE_KEY InlineKeys[] = { { F77_GLOBAL, APPEND, "F77_GLOBAL" }, { F90_UTIL, APPEND, "F90_UTIL" }, { F90_RATES, APPEND, "F90_RATES" }, { F90_RCONST, APPEND, "F90_RCONST" }, + { F90_RCONST_USE, APPEND, "F90_RCONST_USE"}, { C_GLOBAL, APPEND, "C_GLOBAL" }, { C_INIT, APPEND, "C_INIT" }, { C_DATA, APPEND, "C_DATA" }, From 2f978250e23f346a710dfafb659f1105a89933c0 Mon Sep 17 00:00:00 2001 From: Bob Yantosca Date: Fri, 20 Dec 2024 15:26:42 -0500 Subject: [PATCH 4/4] Add minor fixes to PR #120 suggested by @RolfSander .gitignore - Ignore all *.exe files src/gen.c - Updated commments where inlined code is added to be more descriptive (referencing F90_RCONST_USE and F90_RCONST) docs/source/using_kpp/04_input_for_kpp.rst - Added documentation for F90_RCONST_USE CHANGELOG.md - Updated accordingly Signed-off-by: Bob Yantosca --- .gitignore | 2 +- CHANGELOG.md | 5 +- docs/source/using_kpp/04_input_for_kpp.rst | 81 ++++++++++++---------- src/gen.c | 10 +-- 4 files changed, 56 insertions(+), 42 deletions(-) diff --git a/.gitignore b/.gitignore index da5f2ba..6a87b70 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ # from compiler: *.mod *.o +*.exe # results from ci-tests: /ci-tests/**/*.m @@ -68,5 +69,4 @@ docs/build/* # Other files/dirs to exclude *.pdf /examples/mcm*/__pycache__ -/examples/mcm*/*.exe diff --git a/CHANGELOG.md b/CHANGELOG.md index d372552..6244891 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,13 +11,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] - TBD ### Added - Added new inline key `F90_RCONST_USE` in `src/gdata.h` and `src/scanner.c` +- Added documentation about `F90_RCONST_USE` for ReadTheDocs ### Changed - Updated `Update_RCONST` to use `Y` instead of `C` to account for updated variable species concentrations - Updated C-I tests to print the compiler versions that are used - Updated routine `GenerateUpdateRconst` to manually write the `SUBROUTINE` and `END SUBROUTINE` lines (F90 only) - Updated routine `GenerateUpdateRconst` to inline code from `#INLINE F90_RCONST_USE` before any other F90 variable declarations or statements -- Updated `.gitignore` to ignore executables in the MCM example folders +- Updated `.gitignore` to ignore all executable files +- Changed `Begin INLINED RCONST - F90 USE STATEMENTS` to `Begin inlined code from F90_RCONST_USE` in `src/gen.c` +- Changed `Begin INLINED RCONST` to `Begin inlined code from F90_RCONST` in `src/gen.c` ### Fixed - Added `char* rootFileName` to functions and function prototypes for `Use_C`, `Use_F`, `Use_F90`, `Use_MATLAB`, and `Generate` diff --git a/docs/source/using_kpp/04_input_for_kpp.rst b/docs/source/using_kpp/04_input_for_kpp.rst index 92502a4..01a4559 100644 --- a/docs/source/using_kpp/04_input_for_kpp.rst +++ b/docs/source/using_kpp/04_input_for_kpp.rst @@ -790,26 +790,28 @@ by :code:`C`, or :code:`matlab`, respectively. .. table:: KPP inlined types :align: center - +-----------------+-------------------+---------------------+---------------------+ - | Inline_type | File | Placement | Usage | - +=================+===================+=====================+=====================+ - | **F90_DATA** | :ref:`Monitor` | specification | (obsolete) | - | | | section | | - +-----------------+-------------------+---------------------+---------------------+ - | **F90_GLOBAL** | :ref:`Global` | specification | global variables | - | | | section | | - +-----------------+-------------------+---------------------+---------------------+ - | **F90_INIT** | :ref:`Initialize` | subroutine | integration | - | | | | parameters | - +-----------------+-------------------+---------------------+---------------------+ - | **F90_RATES** | :ref:`Rates` | executable section | rate law functions | - +-----------------+-------------------+---------------------+---------------------+ - | **F90_RCONST** | :ref:`Rates` | subroutine | statements and | - | | | | definitions of rate | - | | | | coefficients | - +-----------------+-------------------+---------------------+---------------------+ - | **F90_UTIL** | :ref:`Util` | executable section | utility functions | - +-----------------+-------------------+---------------------+---------------------+ + +--------------------+-------------------+---------------------+---------------------+ + | Inline_type | File | Placement | Usage | + +====================+===================+=====================+=====================+ + | **F90_DATA** | :ref:`Monitor` | specification | (obsolete) | + | | | section | | + +--------------------+-------------------+---------------------+---------------------+ + | **F90_GLOBAL** | :ref:`Global` | specification | global variables | + | | | section | | + +--------------------+-------------------+---------------------+---------------------+ + | **F90_INIT** | :ref:`Initialize` | subroutine | integration | + | | | | parameters | + +--------------------+-------------------+---------------------+---------------------+ + | **F90_RATES** | :ref:`Rates` | executable section | rate law functions | + +--------------------+-------------------+---------------------+---------------------+ + | **F90_RCONST** | :ref:`Rates` | subroutine | rate coefficient | + | | | | definitions | + +--------------------+-------------------+---------------------+---------------------+ + | **F90_RCONST_USE** | :ref:`Rates` | subroutine | rate coefficient | + | | | | definitions | + +--------------------+-------------------+---------------------+---------------------+ + | **F90_UTIL** | :ref:`Util` | executable section | utility functions | + +--------------------+-------------------+---------------------+---------------------+ .. _f90-data: @@ -909,29 +911,38 @@ F90_RCONST ---------- This inline type can be used to define time-dependent values of rate -coefficients. You may inline :code:`USE` statements that reference -modules where rate coefficients are computed, e.g.: +coefficients. You may inline variables directly, e.g.: .. code-block:: fortran #INLINE F90_RCONST - USE MyRateFunctionModule + k_DMS_OH = 1.E-9*EXP(5820./temp)*C(ind_O2)/ & + (1.E30+5.*EXP(6280./temp)*C(ind_O2)) #ENDINLINE -or define variables directly, e.g.: +The inlined code will be placed directly into the subroutines +:code:`UPDATE_RCONST` and :code:`UPDATE_PHOTO` in the :ref:`Rates` file. + +.. _f90-rconst-use: + +F90_RCONST_USE +-------------- + +Similar to :ref:`f90-rconst`, but allows you to inline Fortran-90 +:code:`USE` statements referencing modules where rate coefficients are +computed, such as: .. code-block:: fortran #INLINE F90_RCONST - k_DMS_OH = 1.E-9*EXP(5820./temp)*C(ind_O2)/ & - (1.E30+5.*EXP(6280./temp)*C(ind_O2)) + USE MyRateFunctionModule #ENDINLINE - -Note that the :code:`USE` statements must precede any variable -definitions. - + The inlined code will be placed directly into the subroutines -:code:`UPDATE_RCONST` and :code:`UPDATE_PHOTO` in the :ref:`Rates` file. +:code:`UPDATE_RCONST` in the :ref:`Rates` file. :code:`USE` +statements will be placed before Fortran variable definitions and +executable statements, as is required by the Fortran-90 language +standard. .. _f90-util: @@ -1078,7 +1089,7 @@ List of symbols replaced by the substitution preprocessor +--------------------------+-------------------------------+----------------------------+ .. _icntrl-rcntrl: - + ================================================================= Controlling the Integrator with :code:`ICNTRL` and :code:`RCNTRL` ================================================================= @@ -1226,13 +1237,13 @@ ICNTRL g.: .. code-block:: console - + HSO3m + HSO5m + Hp = 2 HSO4m + Hp : k_aqueous( C(ind_Hp) ); - + This ensures that the concentration :code:`C(ind_Hp)` at the specific integration time is used when the reaction rate coefficient is updated within the integrator. - + .. option:: ICNTRL(16) Treatment of negative concentrations: diff --git a/src/gen.c b/src/gen.c index eeeb5c3..98630c3 100644 --- a/src/gen.c +++ b/src/gen.c @@ -2188,12 +2188,12 @@ int YIN, Y; NewLines(2); // Inline USE statements right after the subroutine declaration - WriteComment("Begin INLINED RCONST - F90 USE STATEMENTS"); + WriteComment("Begin inlined code from F90_RCONST_USE"); NewLines(1); bprintf( InlineCode[ F90_RCONST_USE ].code ); FlushBuf(); NewLines(1); - WriteComment("End INLINED RCONST - F90 USE STATEMENTS"); + WriteComment("End inlined code from F90_RCONST_USE"); NewLines(1); // Declare optional YIN argument @@ -2212,7 +2212,7 @@ int YIN, Y; NewLines(1); WriteComment("Update local Y array if variable concentrations are provided"); bprintf(" if (present(YIN)) Y(1:NVAR) = YIN(1:NVAR)\n"); - NewLines(2); + NewLines(1); } else { // @@ -2232,7 +2232,7 @@ int YIN, Y; // Inline code from {C,F77,F90_MATLAB}_RCONST inline keys NewLines(1); - WriteComment("Begin INLINED RCONST"); + WriteComment("Begin inlined code from F90_RCONST"); NewLines(1); switch( useLang ) { @@ -2248,7 +2248,7 @@ int YIN, Y; FlushBuf(); NewLines(1); - WriteComment("End INLINED RCONST"); + WriteComment("End inlined code from F90_RCONST"); NewLines(1); for( i = 0; i < EqnNr; i++) {