KineticPreProcessor / KPP

The KPP kinetic preprocessor is a software tool that assists the computer simulation of chemical kinetic systems
GNU General Public License v3.0
19 stars 11 forks source link

Add a C-I test for the MCM minimal example; Update F90 Makefiles to specify an external module #83

Closed yantosca closed 7 months ago

yantosca commented 7 months ago

Overview

This PR does the following:

  1. Adds a C-I test for the MCM minimal example to the existing C-I scripts.

    • NOTE: Due to memory limitations, the C-I test for the MCM cannot run on Azure Dev Pipelines. It can be run manually, however.
  2. Updates the util/Makefile_f90 and util/Makefile_upper_F90 to allow the user to pass an environment variable (EXTERNAL_RATES_F90 ) to specify an external module to be USE-d via F90_RCONST

  3. Adds #UPPERCASEF90 to the examples/mcm/mcm.kpp file to allow the user to let KPP build source code with either .f90 or .F90 suffixes. Default is #UPPERCASEF90 OFF.

  4. Removed the examples/mcm/Makefile; we can now let KPP build the Makefile.

  5. Migrated examples/mcm/README -> /examples/mcm/README.md (with Markdown)

See issue #4

Output

>>>>>>>> Generating mcm mechanism with KPP <<<<<<<<

This is KPP-3.0.2.

KPP is parsing the equation file.
KPP is computing Jacobian sparsity structure.
KPP is starting the code generation.
KPP is initializing the code generation.
KPP is generating the monitor data:
    - mcm_Monitor
KPP is generating the utility data:
    - mcm_Util
KPP is generating the global declarations:
    - mcm_Main
KPP is generating the ODE function:
    - mcm_Function
KPP is generating the ODE Jacobian:
    - mcm_Jacobian
    - mcm_JacobianSP
KPP is generating the linear algebra routines:
    - mcm_LinearAlgebra
KPP is generating the utility functions:
    - mcm_Util
KPP is generating the rate laws:
    - mcm_Rates
KPP is generating the parameters:
    - mcm_Parameters
KPP is generating the global data:
    - mcm_Global
KPP is generating the driver from ./driver_mcm.f90:
    - mcm_Main
KPP is starting the code post-processing.

KPP has successfully created the model "mcm".

>>>>>>>> Building the mcm test executable <<<<<<<<<

gfortran -cpp -O -g  -c mcm_Precision.f90
gfortran -cpp -O -g  -c mcm_Parameters.f90
gfortran -cpp -O -g  -c mcm_Monitor.f90
gfortran -cpp -O -g  -c mcm_Global.f90
gfortran -cpp -O -g  -c constants_mcm.f90
gfortran -cpp -O -g  -c mcm_Function.f90
gfortran -cpp -O -g  -c mcm_JacobianSP.f90
gfortran -cpp -O -g  -c mcm_Rates.f90
gfortran -cpp -O -g  -c mcm_Initialize.f90
gfortran -cpp -O -g  -c mcm_Util.f90
gfortran -cpp -O -g  -c mcm_Jacobian.f90
gfortran -cpp -O -g  -c mcm_LinearAlgebra.f90
gfortran -cpp -O -g  -c mcm_Integrator.f90
gfortran -cpp -O -g  -c mcm_Model.f90
gfortran -cpp -O -g  -c mcm_Main.f90
gfortran -cpp -O -g  mcm_Precision.o    mcm_Parameters.o mcm_Global.o       constants_mcm.o mcm_Function.o mcm_JacobianSP.o mcm_Jacobian.o   mcm_Rates.o   mcm_Util.o   mcm_Monitor.o mcm_LinearAlgebra.o mcm_Main.o          mcm_Initialize.o mcm_Integrator.o    mcm_Model.o  -o mcm.exe

>>>>>>>> Running the mcm test <<<<<<<<

>>>>>>>> mcm test was successful! <<<<<<<<

Complete log file from C-I test:

yantosca commented 7 months ago

Maybe we need to tell the user that with this solution, the constants_mcm.f90 file may have USE mcm_Precision, USE mcm_Parameters and USE mcm_Global, but no other USE ... commands. If a user adds additional dependencies, they will have to adjust the Makefile.

Thanks @RolfSander. I can update the README.md file accordingly.

yantosca commented 7 months ago

Although it is good to allow users to use upper-case suffixes, I'm a bit worried about backward compatibility. The command #UPPERCASEF90 did not exist before KPP 2.5.0. Of course, here in the git repo it is fine to have the new command. However, when we offer the MCM developers a minimal working example, I'd prefer a mcm.kpp file without #UPPERCASEF90. I think that most MCM users still haven't upgraded to KPP >= 2.5.0.

Duly noted.