From 016e9c82f7ad33e7c91f72147d3f7a506bf20b47 Mon Sep 17 00:00:00 2001 From: Rolf Sander Date: Wed, 3 Jan 2024 10:15:07 +0100 Subject: [PATCH 1/6] limits increased to allow using the complete MCM --- src/code_f90.c | 2 +- src/gdata.h | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/code_f90.c b/src/code_f90.c index b8feeaa..86b36ff 100644 --- a/src/code_f90.c +++ b/src/code_f90.c @@ -120,7 +120,7 @@ int first; int crtident; /* if MAX_NO_OF_LINES is too small, KPP will split lines incorrectly */ -int number_of_lines = 1, MAX_NO_OF_LINES = 250; +int number_of_lines = 1, MAX_NO_OF_LINES = 2000; /* Operator Mapping: 0xaa = '*' | 0xab = '+' | 0xac = ',' 0xad = '-' | 0xae ='.' | 0xaf = '/' */ diff --git a/src/gdata.h b/src/gdata.h index 1826a2d..58bba4c 100644 --- a/src/gdata.h +++ b/src/gdata.h @@ -57,11 +57,14 @@ // problems on MacOS then consider reducing MAX_EQN and MAX_SPECIES // to smaller values than are listed below. // -- Bob Yantosca (03 May 2022) +// (3) The large value of MAX_EQN = 18000 is necessary to run the +// complete MCM mechanism in KPP. +// -- Rolf Sander (2024-01-03) #ifdef MACOS #define MAX_EQN 2000 // Max number of equations (MacOS only) #define MAX_SPECIES 1000 // Max number of species (MacOS only) #else -#define MAX_EQN 11000 // Max number of equations +#define MAX_EQN 18000 // Max number of equations #define MAX_SPECIES 6000 // Max number of species #endif #define MAX_SPNAME 30 // Max char length of species name From 9468efdd7d1a8ac637348a463029c26668448b56 Mon Sep 17 00:00:00 2001 From: Rolf Sander Date: Wed, 3 Jan 2024 11:04:21 +0100 Subject: [PATCH 2/6] gfortran needs -frecursive --- util/Makefile_f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/Makefile_f90 b/util/Makefile_f90 index 6804424..d4014fd 100644 --- a/util/Makefile_f90 +++ b/util/Makefile_f90 @@ -36,7 +36,7 @@ FC_HPUX = f90 FOPT_HPUX = -O -u +Oall +check=on FC_GFORTRAN = gfortran -FOPT_GFORTRAN = -cpp -O -g +FOPT_GFORTRAN = -cpp -O -g -frecursive # define FULL_ALGEBRA for non-sparse integration FC = $(FC_$(COMPILER)) From ceb0f860399e6eca67a6cd279501c276d46171a8 Mon Sep 17 00:00:00 2001 From: Rolf Sander Date: Fri, 8 Mar 2024 09:16:00 +0100 Subject: [PATCH 3/6] mention that INLINE F90_RCONST is also copied to UPDATE_PHOTO --- docs/source/using_kpp/04_input_for_kpp.rst | 4 ++-- examples/mcm/README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/using_kpp/04_input_for_kpp.rst b/docs/source/using_kpp/04_input_for_kpp.rst index 172d16e..427b311 100644 --- a/docs/source/using_kpp/04_input_for_kpp.rst +++ b/docs/source/using_kpp/04_input_for_kpp.rst @@ -929,8 +929,8 @@ or define variables directly, e.g.: Note that the :code:`USE` statements must precede any variable definitions. -The inlined code will be placed directly into the :code:`UPDATE_RCONST` -routine in the :ref:`Rates` function. +The inlined code will be placed directly into the subroutines +:code:`UPDATE_RCONST` and :code:`UPDATE_PHOTO` in the :ref:`Rates` file. .. _f90-util: diff --git a/examples/mcm/README.md b/examples/mcm/README.md index c636a7d..e973e79 100644 --- a/examples/mcm/README.md +++ b/examples/mcm/README.md @@ -12,8 +12,8 @@ degradation mechanism is used as an example. 1. Browse through the [MCM](https://mcm.york.ac.uk/MCM/browse) and select a Subset of the mechanism. -2. Go to the [export page](https://mcm.york.ac.uk/MCM/export) and - choose KPP as the output format. +2. Go to the [export page](https://mcm.york.ac.uk/MCM/export) and choose + KPP as the output format. 3. Click on the `Download` button and rename the downloaded file to `mcm_isoprene.eqn`. From 6407859ecf07919b3445a01fb579fac33ea1ac90 Mon Sep 17 00:00:00 2001 From: Bob Yantosca Date: Thu, 14 Mar 2024 15:15:01 -0400 Subject: [PATCH 4/6] Update Python packages for ReadTheDocs builds .readthedocs.yaml - Now request Python 3.12 for ReadTheDocs builds docs/requirements.txt - Update to more recent Python package versions for ReadTheDocs builds CHANGELOG.md - Updated accordingly Signed-off-by: Bob Yantosca --- .readthedocs.yaml | 2 +- CHANGELOG.md | 5 +++++ docs/requirements.txt | 21 +++++++++++++-------- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 6d3e7ae..eb05e5c 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -14,7 +14,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.7" + python: "3.12" nodejs: "14" rust: "1.55" golang: "1.17" diff --git a/CHANGELOG.md b/CHANGELOG.md index 7991421..9647544 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,11 @@ All notable changes to this project will be documented in this file. 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 +### Changed +- Updated Python package versions for ReadTheDocs in `docs/requirements.txt` +- Now request Python 3.12 for ReadTheDocs builds in `.readthedocs.yaml` + ## [3.1.0] - 2023-12-20 diff --git a/docs/requirements.txt b/docs/requirements.txt index ab7d93b..60b3987 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,10 +1,15 @@ -# Requirements for building the KPP documentation +# ====================================================================== +# ReadTheDocs requirements file # -# These Python package versions have been proven to work: +# If you wish to install the dependencies for building the ReadTheDocs +# ReadTheDocs documentation from PyPI (the Python Package Index), use: # -sphinx==3.5.4 -sphinx_rtd_theme==0.5.2 -sphinxcontrib-bibtex==2.2.0 -recommonmark -docutils==0.16 -jinja2==3.0.3 +# $ pip install -r requirements.txt +# ====================================================================== +sphinx==7.2.6 +sphinx_rtd_theme==2.0.0 +sphinxcontrib-bibtex==2.6.2 +sphinx-autobuild==2021.3.14 +recommonmark==0.7.1 +docutils==0.20.1 +jinja2==3.1.3 From 013d5ded60051b2643655d6a627ca149aed2d4d6 Mon Sep 17 00:00:00 2001 From: Bob Yantosca Date: Tue, 30 Apr 2024 10:54:01 -0400 Subject: [PATCH 5/6] Add Aout as an extra argument to Fun only for F90 src/gen.c - Implement the fix proposed by @jimmielin in PR #56. We now declare FUN and FUN_SPLIT with an extra argument (Aout) only for F90. CHANGELOG.md - Updated accordingly Signed-off-by: Bob Yantosca --- CHANGELOG.md | 3 +++ src/gen.c | 34 ++++++++++++++++++++++++++-------- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9647544..13edcc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated Python package versions for ReadTheDocs in `docs/requirements.txt` - Now request Python 3.12 for ReadTheDocs builds in `.readthedocs.yaml` +### Fixed +- Now only add tha extra `Aout` argument to `Fun` and `Fun_Split` for F90 (see issues #56, #96) + ## [3.1.0] - 2023-12-20 diff --git a/src/gen.c b/src/gen.c index e848049..d491362 100644 --- a/src/gen.c +++ b/src/gen.c @@ -652,12 +652,20 @@ int F_VAR, FSPLIT_VAR; // 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, - "time derivatives of variables - Split form"); - + // + // For F90, add an extra argument to Fun and Fun_Split to return + // the Aout array. (hplin, bmy, 30 Apr 2024) + if (useLang == F90_LANG) { + F_VAR = DefFnc("Fun", 5, + "time derivatives of variables - Aggregate form"); + FSPLIT_VAR = DefFnc("Fun_SPLIT", 7, + "time derivatives of variables - Split form"); + } else { + F_VAR = DefFnc("Fun", 4, + "time derivatives of variables - Aggregate form"); + FSPLIT_VAR = DefFnc("Fun_SPLIT", 6, + "time derivatives of variables - Split form"); + } // We have added the capability to return equation rates and the // time derivative of variable species from Fun via optional arguments @@ -665,11 +673,21 @@ int F_VAR, FSPLIT_VAR; // -- Bob Yantosca (03 May 2022) // // Vdotout functionality can be accomplished using Vdot (hplin, 7/6/22) + // + // F90 needs Fun to have an extra argument for Aout (hplin, bmy, 30 Apr 2024) if( z_useAggregate ) { - FunctionBegin( F_VAR, V, F, RCT, Vdot, Aout ); + if (useLang == F90_LANG) { + FunctionBegin( F_VAR, V, F, RCT, Vdot, Aout );\ + } else { + FunctionBegin( F_VAR, V, F, RCT, Vdot ); + } } else { - FunctionBegin( FSPLIT_VAR, V, F, RCT, Vdot, P_VAR, D_VAR, Aout ); + if (useLang == F90_LANG) { + FunctionBegin( FSPLIT_VAR, V, F, RCT, Vdot, P_VAR, D_VAR, Aout ); + } else { + FunctionBegin( FSPLIT_VAR, V, F, RCT, Vdot, P_VAR, D_VAR ); + } } if ( (useLang==MATLAB_LANG)&&(!z_useAggregate) ) From 68d4014848ad33c565ef4af6464c485f53f5ebac Mon Sep 17 00:00:00 2001 From: Bob Yantosca Date: Tue, 30 Apr 2024 15:16:39 -0400 Subject: [PATCH 6/6] Update version numbers, doc, and CHANGELOG for 3.1.1 release CHANGELOG.md - Updated with info for version 3.1.1 - Updated version number to 3.1.1 docs/source/conf.py docs/source/gdata.h - Update version numbers to 3.1.1 docs/source/getting_started/00_revision_history.rst - Added new features/fixes in versions 3.1.0 and 3.1.1 --- CHANGELOG.md | 4 ++- docs/source/conf.py | 2 +- .../getting_started/00_revision_history.rst | 25 +++++++++++++++++++ src/gdata.h | 2 +- 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13edcc3..11fb6ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,10 +8,12 @@ All notable changes to this project will be documented in this file. 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 +## [3.1.1] - 2024-04-30 ### Changed - Updated Python package versions for ReadTheDocs in `docs/requirements.txt` - Now request Python 3.12 for ReadTheDocs builds in `.readthedocs.yaml` +- Updated `MAX_NO_OF_LINES` to 2000 to parse the MCM mechanism +- Updaeed `MAX_EQN` to 18000 to parse the MCM mechanism ### Fixed - Now only add tha extra `Aout` argument to `Fun` and `Fun_Split` for F90 (see issues #56, #96) diff --git a/docs/source/conf.py b/docs/source/conf.py index 6ea04cf..6272ce4 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -25,7 +25,7 @@ # The full version, including alpha/beta/rc tags # (version numbers must be synchronized in CHANGELOG.md, src/gdata.h, # and docs/source/conf.py) -release = "3.1.0" +release = "3.1.1" # -- General configuration --------------------------------------------------- diff --git a/docs/source/getting_started/00_revision_history.rst b/docs/source/getting_started/00_revision_history.rst index 9ec1d00..c248f32 100644 --- a/docs/source/getting_started/00_revision_history.rst +++ b/docs/source/getting_started/00_revision_history.rst @@ -8,6 +8,31 @@ Only the major new features are listed here. For a detailed description of the changes, read `CHANGELOG.md `_. +.. _kpp311: + +========= +KPP 3.1.1 +========= + +.. _kpp310: +- Use newer Python packages to build ReadTheDocs documentation (see + :file:`docs/requirements.txt`) +- Increased :code:`MAX_NO_OF_LINES` and :code:`MAX_EQN` in order to + parse the entire MCM mechanism +- Now only add the extra `Aout` argument to `Fun` and `Fun_Split` for + target language :literal:`Fortran90`. This fixes a Matlab build error. + +========= +KPP 3.1.0 +========= + +- Added :literal:`#AUTOREDUCE` to the list of KPP commands in the + ReadTheDocs documentaton +- Added :file:`examples/mcm` folder with minimal example for the + Master Chemical Mechanism +- Added C-I test for MCM, based on the minimal example +- Removed obsolete input options from the code and documentation + .. _kpp302: ========= diff --git a/src/gdata.h b/src/gdata.h index 58bba4c..a732f0c 100644 --- a/src/gdata.h +++ b/src/gdata.h @@ -31,7 +31,7 @@ // Version numbers must be synchronized in CHANGELOG.md, src/gdata.h, // and docs/source/conf.py -#define KPP_VERSION "3.1.0" +#define KPP_VERSION "3.1.1" #ifndef _GDATA_H_ #define _GDATA_H_