[2696] | 1 | #!/bin/ksh |
---|
| 2 | # |
---|
[2699] | 3 | # run_kpp4palm - script for running gasphase preprocessor |
---|
| 4 | |
---|
| 5 | #------------------------------------------------------------------------------# |
---|
| 6 | # This file is part of the PALM model system. |
---|
[2696] | 7 | # |
---|
[2699] | 8 | # PALM is free software: you can redistribute it and/or modify it under the terms |
---|
| 9 | # of the GNU General Public License as published by the Free Software Foundation, |
---|
| 10 | # either version 3 of the License, or (at your option) any later version. |
---|
| 11 | # |
---|
| 12 | # PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
| 13 | # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
| 14 | # A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
| 15 | # |
---|
| 16 | # You should have received a copy of the GNU General Public License along with |
---|
| 17 | # PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
| 18 | # |
---|
[2718] | 19 | # Copyright 2017-2018 Klaus Ketelsen and MPI-CH (April 2007) |
---|
| 20 | # Copyright 2017-2018 Karlsruhe Institute of Technology |
---|
| 21 | # Copyright 2017-2018 Leibniz Universitaet Hannover |
---|
[2699] | 22 | #------------------------------------------------------------------------------# |
---|
| 23 | # |
---|
[2696] | 24 | # Current revisions: |
---|
| 25 | # ------------------ |
---|
| 26 | # |
---|
| 27 | # |
---|
| 28 | # Former revisions: |
---|
| 29 | # ----------------- |
---|
[2699] | 30 | # $Id: run_kpp4palm.ksh 2718 2018-01-02 08:49:38Z hellstea $ |
---|
| 31 | # Initial revision |
---|
| 32 | # |
---|
| 33 | # |
---|
[2696] | 34 | # |
---|
[2699] | 35 | # |
---|
| 36 | # Other notes: |
---|
| 37 | # ------------ |
---|
[2696] | 38 | # Small adaptations (added MECH as argument, re-introduced relative path, |
---|
| 39 | # adaption to changing kp4 to kpp4palm) |
---|
| 40 | # filename changed from run_kp4.ksh to run_kpp4palm.ksh |
---|
| 41 | # |
---|
| 42 | # Nov. 2016: Initial Version of KPP chemistry by Klaus Ketelsen |
---|
| 43 | # |
---|
| 44 | |
---|
| 45 | echo "\$1 = " $1 |
---|
| 46 | |
---|
| 47 | if [[ $1 == "clean" ]] |
---|
| 48 | then |
---|
| 49 | cd kpp |
---|
| 50 | make distclean |
---|
| 51 | cd .. |
---|
| 52 | |
---|
| 53 | cd kpp4palm |
---|
| 54 | make distclean |
---|
| 55 | cd .. |
---|
| 56 | exit |
---|
| 57 | fi |
---|
| 58 | |
---|
| 59 | export PATH=$PATH:`pwd`/kpp4palm/bin |
---|
| 60 | |
---|
| 61 | # build kpp |
---|
| 62 | |
---|
| 63 | cp mechanisms/UserRateLaws.f90 kpp/util |
---|
| 64 | cd kpp |
---|
| 65 | make |
---|
| 66 | cd .. |
---|
| 67 | |
---|
| 68 | # build kpp4palm.exe |
---|
| 69 | |
---|
| 70 | cd kpp4palm |
---|
| 71 | make install |
---|
| 72 | cd .. |
---|
| 73 | |
---|
| 74 | # run kpp4palm with default Setup |
---|
| 75 | # -d DEFDIR=$OPTARG;; # directory of definition files |
---|
| 76 | # -i DE_INDEX="YES";; # if set, deindexing |
---|
| 77 | # -f DE_INDEX_FAST="YES";; # if set, fast deindexing |
---|
[2699] | 78 | # -k KEEP="NO";; # keep Working directory |
---|
[2696] | 79 | # -o OUTDIR=$OPTARG;; # Output directory of Geneated Code |
---|
| 80 | # -p PREFIX=$OPTARG;; # Name Prefix |
---|
| 81 | # -s KPP_SOLVER=$OPTARG;; # Name Prefix |
---|
| 82 | |
---|
| 83 | |
---|
| 84 | echo $PATH |
---|
| 85 | # use smog mechnism as default |
---|
| 86 | MECH=smog |
---|
| 87 | |
---|
[2699] | 88 | while getopts m:k opt # get options |
---|
[2696] | 89 | do case $opt in |
---|
| 90 | m) MECH=$OPTARG;; # mechanism name as part of mechanisms/def_[mechanism_name] |
---|
| 91 | |
---|
[2699] | 92 | k) KEEP="-k";; # keep Working directory |
---|
| 93 | |
---|
[2696] | 94 | \?) print ${0##*/} "unknown option:" $OPTARG |
---|
[2699] | 95 | print "USAGE: ${0##*/} [ -m mechanism_name] [ -k] " |
---|
[2696] | 96 | exit 1;; |
---|
| 97 | esac |
---|
| 98 | done |
---|
| 99 | echo $MECH |
---|
| 100 | |
---|
[2699] | 101 | kpp4palm.ksh -d `pwd`/mechanisms/def_$MECH $KEEP |
---|