Creating Fortran-90 chemical mechanism modules for GEOS-Chem¶
Run the build_mechanism.sh script¶
Once you are satisfied with your custom mechanism specification you may now use KPP-for-GEOS-Chem to build the source code files for GEOS-Chem.
Return to the KPP folder containing
build_mechanism.sh and then type:
$ ./build_mechanism.sh custom
build_mechanism.sh script runs the
KPP-for-GEOS-Chem executable (which is named
gckpp.kpp configuration file. It also runs a python script to generate code for the OH reactivity diagnostic.
Once you run the
build_mechanism.sh script, you will see output similar to this:
This is KPP-X.Y.Z_gc. 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: - gckpp_Monitor KPP is generating the utility data: - gckpp_Util KPP is generating the global declarations: - gckpp_Main KPP is generating the ODE function: - gckpp_Function KPP is generating the ODE Jacobian: - gckpp_Jacobian - gckpp_JacobianSP KPP is generating the linear algebra routines: - gckpp_LinearAlgebra KPP is generating the utility functions: - gckpp_Util KPP is generating the rate laws: - gckpp_Rates KPP is generating the parameters: - gckpp_Parameters KPP is generating the global data: - gckpp_Global KPP is generating the driver from none.f90: - gckpp_Main KPP is starting the code post-processing. KPP has succesfully created the model "gckpp". Reactivity consists of 172 reactions Written to gckpp_Util.F90
X.Y.Z denotes the KPP-for-GEOS-Chem version that you are using.
If this process is successful, the
custom folder should now be
populated with several
.F90 source code files:
CMakeLists.txt* gckpp_Initialize.F90 gckpp_LinearAlgebra.F90 gckpp_Precision.F90 custom.eqn gckpp_Integrator.F90 gckpp.map gckpp_Rates.F90 gckpp_Function.F90 gckpp_Jacobian.F90 gckpp_Model.F90 gckpp_Util.F90 gckpp_Global.F90 gckpp_JacobianSP.F90 gckpp_Monitor.F90 Makefile_gckpp gckpp_HetRates.F90@ gckpp.kpp gckpp_Parameters.F90
These files contain optimized Fortran-90 instructions for solving the chemical mechanism that you have specified.