Changeset 3458 for palm/trunk/UTIL/chemistry/gasphase_preproc/kpp4palm
- Timestamp:
- Oct 30, 2018 2:51:23 PM (6 years ago)
- Location:
- palm/trunk/UTIL/chemistry/gasphase_preproc/kpp4palm
- Files:
-
- 2 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/UTIL/chemistry/gasphase_preproc/kpp4palm/Makefile
r2696 r3458 28 28 29 29 distclean: clean 30 rm -f $(bindir)/kp 4.exe30 rm -f $(bindir)/kpp4palm.exe 31 31 32 32 # ---------------------------------------------- -
palm/trunk/UTIL/chemistry/gasphase_preproc/kpp4palm/bin/kpp4palm.ksh
r3298 r3458 40 40 # ----------------- 41 41 # $Id$ 42 # forkel 30. Oktober 2018: Integrating contents of kp4_compress into chem_gasphase_mod.f90 42 43 # forkel 25. September 2018: Added cat for $MECH to pass mechanism name to kpp4palm 43 44 # ketelsen 18. September 2018: Added cat for '#INLINE F90_GLOBAL' … … 121 122 k) KEEP="YES";; # keep Working directory 122 123 123 o) OUTDIR=$OPTARG;; # Output directory of Generated Code 124 125 p) PREFIX=$OPTARG;; # Name Prefix 126 127 s) KPP_SOLVER=$OPTARG;; # Update sample f90 code in the def_MECH directory 128 129 u) UPDT="YES";; # keep Working directory 124 o) OUTDIR=$OPTARG;; # Output directory of Generated Code = 125 # SOURCE directory (do not change) 126 127 p) PREFIX=$OPTARG;; # Name Prefix (chem_gasphase_mod, do not change) 128 129 s) KPP_SOLVER=$OPTARG;; # Chosen solver (only Rosebrock solvers work for vector mode) 130 131 u) UPDT="YES";; # update mechanisms/def_$MECH/chem_gasphase_mod.f90 130 132 131 133 v) MODE="vector";; # Set to vector Mode … … 163 165 164 166 KPP_FILE_LIST="Initialize Integrator LinearAlgebra Jacobian Function Rates Util" 165 167 if [[ $MODE = "vector" ]] 168 then 169 KPP_FILE_LIST="$KPP_FILE_LIST kp4_compress_subroutines" 170 fi 166 171 167 172 KPP_SUBROUTINE_LIST="Initialize" … … 189 194 # get vector Solver 190 195 cp $BASE/templates/${KPP_SOLVER}_vec.f90 ${KPP_SOLVER}.f90 196 cp $BASE/templates/kp4_compress_header ${PREFIX}_kp4_compress_header.f90 197 cp $BASE/templates/kp4_compress_subroutines ${PREFIX}_kp4_compress_subroutines.f90 191 198 fi 192 199 … … 207 214 KPP_SUBROUTINE_LIST="$KPP_SUBROUTINE_LIST Rosenbrock FunTemplate JacTemplate" 208 215 KPP_INTERFACE_IGNORE="WAXPY" 216 209 217 else 210 218 KPP_SUBROUTINE_LIST="$KPP_SUBROUTINE_LIST FunTemplate JacTemplate" 219 KPP_SUBROUTINE_LIST="$KPP_SUBROUTINE_LIST kco_initialize kco_compress kco_finalize" 211 220 fi;; 212 221 … … 246 255 247 256 KPP_INCLUDE_LIST="Parameters Global JacobianSP Monitor" 257 if [[ $MODE = "vector" ]] 258 then 259 KPP_INCLUDE_LIST="$KPP_INCLUDE_LIST kp4_compress_header" 260 fi 248 261 249 262 #Get definition Files … … 309 322 done 310 323 311 echo start kp 4.exe with arguments324 echo start kpp4palm.exe with arguments 312 325 echo $PREFIX $MODE $VLEN $DE_INDEX $DE_INDEX_FAST 313 326 -
palm/trunk/UTIL/chemistry/gasphase_preproc/kpp4palm/src/create_kpp_module.C
r3298 r3458 12 12 //Current revisions: 13 13 //------------------ 14 / 15 / 14 // 15 // 16 16 //Former revisions: 17 17 //----------------- 18 //$Id: create_kpp_module.C 2470 2017-09-14 13:56:42Z forkel $ 19 // forkel 25.09.2018: added automatic line with meechanism name (read mech_list) 20 // forkel 20.09.2018: added vl_glo = size(tempi,1) 21 // ketelsen 18.09.2018: Removed creation of fill_ Subroutine and creation of calls thereof 22 // 23 // forkel 12.09.2018: Fix in order not to loose the values of qvap and fakt 24 // 25 // forkel 03.09.2018: Bug fix: moved kppi.add_line(" CALL initialize after fakt = fakti(is) 26 // forkel June 2018: added qvap and fakt, re-established original uppercase/lowercase 27 // Deleted definition of qvap,fakt in create_kpp_integrate again 28 // 29 // ketelsen July 2018: Changes for vector mode (edit_WAXPY, edit_FunTemplate, edit_JacTemplate, 30 // some cleanup of comments, various changes in create_kpp_integrate) 31 // 32 // forkel June 2018: Added qvap and fakt, re-established original uppercase/lowercase 33 // 34 // 35 / 2017-09-14 13:56:42Z forkel $ 36 // Removed preprocessor directive __chem again 37 // 38 // 2017-09-14 13:56:42Z forkel $ 39 // 18 //$Id: create_kpp_module.C 3453 2018-10-30 13:21:51Z forkel $ 19 // exclude kco_compress from handling by global_variables2vector (30.10.2018, forkel) 20 // 21 // Added automatic line with mechanism name (read mech_list) (25.09.2018, forkel) 22 // 23 // Added vl_glo = size(tempi,1) (20.09.2018, forkel) 24 // 25 // Removed creation of fill_ Subroutine and creation of calls thereof (18.09.2018, ketelsen) 26 // 27 // Fix in order not to loose the values of qvap and fakt (12.09.2018, forkel) 28 // 29 // Bug fixes: moved kppi.add_line(" CALL initialize after fakt = fakti(is) 30 // Deleted definition of qvap,fakt in create_kpp_integrate again (03.09.2018, forkel) 31 // 32 // Changes for vector mode (edit_WAXPY, edit_FunTemplate, edit_JacTemplate, 33 // some cleanup of comments, various changes in create_kpp_integrate) (July 2018, ketelsen) 34 // 35 // 36 // Added qvap and fakt (June 2018, forkel) 37 // --> Change in module_header: qvap, fakt added (June 2018, forkel) 38 // 39 // re-established original uppercase/lowercase (June 2018, forkel) 40 // --> Change in module_header: reset case in Initialize, Integrate, and 41 // Update_rconst (June 2018, forkel) 42 // 43 // Removed preprocessor directive __chem again (2017-09-14, forkel) 40 44 // 41 //added phot 42 //change of some output to lowercase with uppercase Fortran 43 // 44 // Nov 2016: Intial version of KP4 adapted to PALM (Klaus Ketelsen) 45 // 46 45 // Added phot (2017-09-14, forkel) 46 // --> Change in module_header: Variables for photolyis added (2017-09-14, forkel) 47 // 48 // change of some output to lowercase with uppercase Fortran (2017, forkel) 49 // 50 // Intial version of KP4 adapted to PALM (Nov. 2016, ketelsen) 51 // 47 52 #include <stdio.h> 48 // mz_rs_20090111+49 53 // stdlib is necessary to define getenv: 50 54 #include <stdlib.h> 51 // mz_rs_20090111-52 55 53 56 #include "create_kpp_module.h" … … 131 134 } 132 135 133 // Change global variables to vector 136 // Change global variables to vector (except for kp4_compress, which has already the right form) 134 137 135 138 for(it=kpp_subroutines.begin();it!=kpp_subroutines.end();it++) { 136 it->global_variables2vector (global_variable_list); 139 if(it->get_name() != "kco_compress" ) { 140 it->global_variables2vector (global_variable_list); 141 } 137 142 } 138 143 … … 162 167 } 163 168 } 164 // cout << "## after Edit individual subroutines " <<endl;165 166 169 } 167 170 -
palm/trunk/UTIL/chemistry/gasphase_preproc/kpp4palm/src/create_kpp_module.h
r3298 r3458 1 1 #ifndef mecca 2 #define mecca 1 3 // 4 // ############################################################################ 5 // 6 // create_mz_kpp_module 7 // 8 // create scalar code from .f90 sources created by KPP to be used in MESSy 9 // 10 // COPYRIGHT Klaus Ketelsen and MPI-CH April 2007 11 // 12 // ############################################################################ 13 // 14 //Current revisions: 15 //------------------ 16 // 17 // 18 // Former revisions: 19 // ----------------------- 20 // $Id$ 2 21 // ketelsen 18.09.2018: Removed create_fill_routine 3 4 #include <iostream> 5 #include <fstream> 6 7 #include <string> 8 #include <list> 9 #include <vector> 10 11 #include "fortran_file.h" 12 #include "expand_decomp.h" 13 14 // Class to create module which contains code generated by kpp. 15 16 / 17 / 18 // ketelsen 18.09.2018: Removed create_fill_routine 22 // 23 // initial version (Nov. 2016, ketelsen) 24 // 19 25 20 26 #include <iostream> -
palm/trunk/UTIL/chemistry/gasphase_preproc/kpp4palm/src/expand_decomp.C
r3298 r3458 9 9 // 10 10 // ############################################################################ 11 //Current revisions: 12 //------------------ 13 // 14 // 15 // Former revisions: 16 // ----------------------- 17 // $Id: expand_decomp.C 3327 2018-10-09 19:55:00Z forkel $ 18 // 19 // initial version (Nov. 2016, ketelsen) 20 11 21 12 22 #include <fstream> -
palm/trunk/UTIL/chemistry/gasphase_preproc/kpp4palm/src/expand_decomp.h
r2696 r3458 11 11 // 12 12 // ############################################################################ 13 //Current revisions: 14 //------------------ 15 // 16 // 17 // Former revisions: 18 // ----------------------- 19 // $Id: expand_decomp.h 3327 2018-10-09 19:55:00Z forkel $ 20 // 21 // initial version (Nov. 2016, ketelsen) 22 13 23 14 24 #include <iostream> -
palm/trunk/UTIL/chemistry/gasphase_preproc/kpp4palm/src/fortran_file.C
r3298 r3458 13 13 //Current revisions: 14 14 //------------------ 15 / 16 / 15 // 16 // 17 17 //Former revisions: 18 18 //----------------- 19 //$Id: fortran_file.C 2470 2017-09-14 13:56:42Z forkel $ 20 // ketelsen 18.09.2018: (Rev 3260) added vector switch and creation of dimension statement 21 // forkel Sept.2018: 'fill_' routine applied to qvap and fakt 22 // removal of unnecessary variables (LOOKAT, monitor etc. from Fortran code) 23 // forkel June 2018: Moved adaption to PALM conventions to the end of the process 24 // in order to make future use of vector code adaptations possible 25 // forkel 20.04.2018: Replace Roundoff = WLAMCH('E') by Roundoff = epsilon(one) 19 //$Id: 20 // 21 // Added vector switch and creation of dimension statement (rev. 3260, 18.09.2018, ketelsen) 26 22 // 23 // removal of unnecessary variables (LOOKAT, monitor etc. from Fortran code) (Sept.2018, forkel) 27 24 // 25 // Replace Roundoff = WLAMCH('E') by Roundoff = epsilon(one) (20.04.2018, forkel) 28 26 // 29 / 2017-09-14 13:56:42Z forkel $ 27 // Moved adaption to PALM conventions to the end of the processing kpp output 28 // in order to make future use of vector code adaptations possible (June 2018, forkel) 29 // 30 // changed KPP-generated code to lowercase with uppercase Fortran expressions 31 // added photolysis variables (2017-09-14, forkel) 30 32 // 31 // 32 //changed KPP-generated code to lowercase with uppercase Fortran expressions 33 //added photolysis variables 34 // 35 // 36 // 37 // 38 // Nov 2016: Intial version of KP4 adapted to PALM (Klaus Ketelsen) 33 // Initial version of KP4 adapted to PALM (Nov 2016, ketelsen) 39 34 // 40 35 -
palm/trunk/UTIL/chemistry/gasphase_preproc/kpp4palm/src/fortran_file.h
r3298 r3458 14 14 //Current revisions: 15 15 //------------------ 16 /17 /18 //Former revisions:19 //-----------------20 // Nov 2016: Intial version of KP4 adapted to PALM (Klaus Ketelsen)21 // forkel Sept.2018: added edit_Initialize22 // forkel : added global_subtolower23 16 // 24 / Intial version of KP4 25 17 // 18 // Former revisions: 19 // ----------------------- 20 // $Id: fortran_file.h 3327 2018-10-09 19:55:00Z forkel $ 21 // 22 // added edit_Initialize (Sept.2018, forkel) 23 // 24 // added global_subtolower (forkel) 25 // initial version (Nov. 2016, ketelsen) 26 26 27 27 #include <iostream> -
palm/trunk/UTIL/chemistry/gasphase_preproc/kpp4palm/src/fortran_file_vec.C
r3298 r3458 9 9 // 10 10 // ############################################################################ 11 // 11 12 //Current revisions: 12 13 //------------------ 13 / 14 / 14 // 15 // 15 16 //Former revisions: 16 //----------------- 17 //$Id: fortran_file.C 2470 2017-09-14 13:56:42Z forkel $ 18 // ketelsen 18.09.2018: Line 112: do k=is,ie bydo k=1,vl; line 156 ff: replaced index k by j 19 // 20 // forkel Sept.2018: added edit_Initialize 21 // changed loop direction for update_rconst in edit_Update_RCONST 22 / 2017-09-14 13:56:42Z forkel $ 23 // 24 // 25 // Nov 2016: Intial version of KP4 adapted to PALM (Klaus Ketelsen) 26 // 27 17 //----------------------- 18 //$Id: fortran_file_vec.C 3327 2018-10-09 19:55:00Z forkel $ 19 // Line 112: do k=is,ie bydo k=1,vl; line 156 ff: replaced index k by j (18.09.2018, ketelsen) 20 // 21 // added edit_Initialize, changed loop direction for update_rconst in edit_Update_RCONST (Sept. 2018, forkel) 22 // 23 // initial version (Nov. 2016, ketelsen) 24 // 28 25 29 26 #include <fstream> -
palm/trunk/UTIL/chemistry/gasphase_preproc/kpp4palm/src/main.C
r2696 r3458 9 9 // 10 10 // ############################################################################ 11 // 12 //Current revisions: 13 //------------------ 14 // 15 // 16 // Former revisions: 17 // ----------------------- 18 // $Id: main.C 3327 2018-10-09 19:55:00Z forkel $ 19 // 20 // initial version (Nov. 2016, ketelsen) 21 // 11 22 12 23 // mz_rs_20090111+ -
palm/trunk/UTIL/chemistry/gasphase_preproc/kpp4palm/src/program_line.C
r3298 r3458 9 9 // 10 10 // ############################################################################ 11 // 12 //Current revisions: 13 //------------------ 14 // 15 // 16 // Former revisions: 17 // ----------------------- 18 // $Id: program_line.C 3327 2018-10-09 19:55:00Z forkel $ 19 // 20 // global_subtolower (June 2018, forkel) 21 // 22 // initial version (Nov. 2016, ketelsen) 23 // 24 11 25 12 26 #include "program_line.h" -
palm/trunk/UTIL/chemistry/gasphase_preproc/kpp4palm/src/program_line.h
r3298 r3458 12 12 // ############################################################################ 13 13 // 14 // forkel June 2018: added void global_subtolower(string &line); 14 //Current revisions: 15 //------------------ 16 // 17 // 18 // Former revisions: 19 // ----------------------- 20 // $Id: program_line.h 3327 2018-10-09 19:55:00Z forkel $ 21 // 22 // added void global_subtolower(string &line); (June 2018, forkel) 23 // 24 // initial version (Nov. 2016, ketelsen) 15 25 16 26 #include <iostream> -
palm/trunk/UTIL/chemistry/gasphase_preproc/kpp4palm/src/utils.C
r2696 r3458 9 9 // 10 10 // ############################################################################ 11 // 12 //Current revisions: 13 //------------------ 14 // 15 // 16 // Former revisions: 17 // ----------------------- 18 // $Id: utils.C 3327 2018-10-09 19:55:00Z forkel $ 19 // 20 // initial version (Nov. 2016, ketelsen) 21 11 22 12 23 // mz_rs_20090111+ -
palm/trunk/UTIL/chemistry/gasphase_preproc/kpp4palm/src/utils.h
r2696 r3458 11 11 // 12 12 // ############################################################################ 13 // 14 //Current revisions: 15 //------------------ 16 // 17 // 18 // Former revisions: 19 // ----------------------- 20 // $Id: utils.h 3327 2018-10-09 19:55:00Z forkel $ 21 // 22 // initial version (Nov. 2016, ketelsen) 23 // 13 24 14 25 #include <string> -
palm/trunk/UTIL/chemistry/gasphase_preproc/kpp4palm/templates/Rosenbrock_vec.f90
r3298 r3458 2 2 ! and can only be used with KP4. 3 3 ! 4 !Current revisions: 5 !------------------ 6 ! 7 ! 8 ! Former revisions: 9 ! ----------------------- 10 ! $Id$ 11 ! commented USE kp4_compress (30.10.2018, forkel) 12 ! 13 ! initial version (Rev. 3185) (June 2018, ketelsen) 14 ! 15 4 16 SUBROUTINE Rosenbrock(N,Y,Tstart,Tend, & 5 17 AbsTol,RelTol, & … … 358 370 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 359 371 360 361 372 ! USE kp4_compress, ONLY: kco_initialize, kco_compress, & 373 ! kco_finalize, cell_done 362 374 IMPLICIT NONE 363 375 -
palm/trunk/UTIL/chemistry/gasphase_preproc/kpp4palm/templates/module_header
r3298 r3458 40 40 !--------------------------------------------------------------------------------! 41 41 ! 42 ! Current revisions:43 ! ------------------44 !45 !46 ! Former revisions:47 ! -----------------48 ! $Id: module_header 2460 2017-09-13 14:47:48Z forkel $49 ! forkel June 2018: qvap, fakt added50 ! forkel June 2018: reset case in Initialize, Integrate, Update_rconst51 !52 !53 ! 2460 2017-09-13 14:47:48Z forkel54 42 ! 55 ! forkel Sept. 2017: Variables for photolyis added43 ! MODULE HEADER TEMPLATE 56 44 ! 57 ! 58 ! Nov. 2016: Intial version (Klaus Ketelsen) 59 ! 60 !------------------------------------------------------------------------------! 61 ! 62 45 ! Initial version (Nov. 2016, ketelsen), for later modifications of module_header 46 ! see comments in kpp4palm/src/create_kpp_module.C 63 47 64 48 ! Set kpp Double Precision to PALM Default Precision
Note: See TracChangeset
for help on using the changeset viewer.