source: palm/trunk/UTIL/chemistry/gasphase_preproc/run_kpp4palm.ksh @ 3655

Last change on this file since 3655 was 3487, checked in by maronga, 6 years ago

processed comments from a previous revision, adjustments of palmrungui and palm.f90 to release 6.0

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 4.3 KB
Line 
1#!/bin/ksh
2#
3# run_kpp4palm - script for running gasphase preprocessor
4
5#------------------------------------------------------------------------------#
6# This file is part of the PALM model system.
7#
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#
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
22#------------------------------------------------------------------------------#
23#
24# Current revisions:
25# ------------------
26#
27#
28# Former revisions:
29# -----------------
30# $Id: run_kpp4palm.ksh 3487 2018-11-05 07:18:02Z knoop $
31# Some correctetion of comments
32#
33# 3458 2018-10-30 14:51:23Z kanani
34#  passed $MECH insted of $DEFDIR to kpp4palm.ksh                   forkel  25. Sept. 2018
35#  re-activaded  choice of deindexing method and vector mode        forkel  June 2018
36#
37# 2718 2018-01-02 08:49:38Z maronga
38# Initial revision
39#
40#
41#
42#
43# Other notes:
44# ------------
45# Small adaptations (added MECH as argument, re-introduced relative path,
46#                    adaption to changing kp4 to kpp4palm)
47# filename changed from run_kp4.ksh to run_kpp4palm.ksh
48#
49# Nov. 2016: Initial Version of KPP chemistry by Klaus Ketelsen
50#
51
52echo "\$1 = " $1 
53
54if [[ $1 == "clean" ]]
55then
56  cd kpp
57  make distclean
58  cd ..
59
60  cd kpp4palm
61  make distclean                 
62  cd ..
63  exit
64fi
65
66export PATH=$PATH:`pwd`/kpp4palm/bin
67
68# build kpp
69
70cp mechanisms/UserRateLaws.f90 kpp/util
71cd kpp
72make
73cd ..
74
75# build kpp4palm.exe
76
77cd kpp4palm
78make install                   
79cd ..
80
81# run kpp4palm/bin/kpp4palm.ksh with the following Setup
82#    -d   DEFDIR=$OPTARG;;          # directory of definition files
83#                                     (passed as `pwd`/mechanisms/def_$MECH)
84#    -m   MECH="smog";;             # chemical mechanism
85#                                     (smog, simple, simplep, cbm4, phstat, passive, passive1)
86#    -i   DE_INDEX=2;;              # deindexing method (0,1,2,3; 0=no deindexing)
87#    -v   MODE="-v";;               # vector mode on (not working completely yet)
88#    -l   VLEN=$OPTARG;;            # Set vector length (not working completely yet)
89#    -k   KEEP="NO";;               # if "yes" keep Working directory
90#    -u   UPDT="NO";;               # if "yes" update the existing f90 code in the def_MECH directory
91#                                   # Use "YES" with care as the existing sample file is overwritten
92#
93##   Further options (not passed as changing does not make sense to change these)
94##    -f   DE_INDEX_FAST="YES";;     # if set, fast deindexing
95##    -o   OUTDIR=$OPTARG;;          # Output directory of Generated Code
96##                                     (`pwd`/../../../SOURCE)
97##    -p   PREFIX=$OPTARG;;          # Name Prefix (chem_gasphase_mod)
98##    -s   KPP_SOLVER=$OPTARG;;      # Name Prefix (rosenbrock)
99
100 
101echo $PATH
102# use smog mechnism as default
103MECH=smog
104DEIN=2
105
106while  getopts m:i:kuvl:  opt   # get options
107do case $opt in
108      m)   MECH=$OPTARG;;          # mechanism name as part of mechanisms/def_[mechanism_name]
109
110      i)   DEIN=$OPTARG;;          # deindexing method (0,1,2,3; 0=no deindexing)
111
112      k)   KEEP="-k";;             # keep Working directory
113
114      u)   UPDT="-u";;             # update sample output file
115
116      v)   MODE="-v";;             # vector mode on
117
118      c)   COPY="-c";;             # copy output to def_MECH
119
120      l)   VLEN=$OPTARG;;          # Set vector length
121
122      \?)  print ${0##*/} "unknown option:" $OPTARG
123           print "USAGE: ${0##*/} [ -m mechanism_name] [ -i n (n=0,1,2,3)] [ -k] [ -u] [ -v] [ -l N (N=vector length)]"
124           exit 1;;
125   esac
126done
127echo Now do kpp4palm for $MECH
128
129# kpp4palm.ksh -d `pwd`/mechanisms/def_$MECH -i $DEIN $KEEP $UPDT $MODE -l $VLEN
130kpp4palm.ksh -m $MECH -i $DEIN $KEEP $UPDT $MODE -l $VLEN
Note: See TracBrowser for help on using the repository browser.