Initial commit, copying files from bitbicket

This commit is contained in:
hollorol 2017-02-13 11:05:00 +01:00
parent 560951fb3d
commit d45361d7a3
43 changed files with 2238 additions and 0 deletions

5
Documents/RMuso.aux Normal file
View File

@ -0,0 +1,5 @@
\relax
\catcode \string ``=12
\@writefile{toc}{\select@language{magyar} \contentsline {section}{\numberline {1}A csomag alapf\IeC {\"u}ggv\IeC {\'e}nyei}{1}}
\@writefile{toc}{\select@language{magyar} \contentsline {section}{\numberline {2}Tartalmazott f\IeC {\"u}ggv\IeC {\'e}ny-csoportok \IeC {\'a}ttekint\IeC {\'e}se}{1}}
\@writefile{toc}{\select@language{magyar} \contentsline {section}{\numberline {3}Haszn\IeC {\'a}lat}{2}}

589
Documents/RMuso.log Normal file
View File

@ -0,0 +1,589 @@
This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (preloaded format=pdflatex 2016.10.24) 2 NOV 2016 11:20
entering extended mode
restricted \write18 enabled.
file:line:error style messages enabled.
%&-line parsing enabled.
**\input RMuso.tex
(./RMuso.tex (/usr/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texmf-dist/tex/latex/base/size12.clo
File: size12.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
(/usr/share/texmf-dist/tex/latex/base/inputenc.sty
Package: inputenc 2014/04/30 v1.2b Input encoding file
\inpenc@prehook=\toks14
\inpenc@posthook=\toks15
(/usr/share/texmf-dist/tex/latex/base/utf8.def
File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
Now handling font encoding OML ...
... no UTF-8 mapping file for font encoding OML
Now handling font encoding T1 ...
... processing UTF-8 mapping file for font encoding T1
(/usr/share/texmf-dist/tex/latex/base/t1enc.dfu
File: t1enc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc
defining Unicode char U+00A1 (decimal 161)
defining Unicode char U+00A3 (decimal 163)
defining Unicode char U+00AB (decimal 171)
defining Unicode char U+00BB (decimal 187)
defining Unicode char U+00BF (decimal 191)
defining Unicode char U+00C0 (decimal 192)
defining Unicode char U+00C1 (decimal 193)
defining Unicode char U+00C2 (decimal 194)
defining Unicode char U+00C3 (decimal 195)
defining Unicode char U+00C4 (decimal 196)
defining Unicode char U+00C5 (decimal 197)
defining Unicode char U+00C6 (decimal 198)
defining Unicode char U+00C7 (decimal 199)
defining Unicode char U+00C8 (decimal 200)
defining Unicode char U+00C9 (decimal 201)
defining Unicode char U+00CA (decimal 202)
defining Unicode char U+00CB (decimal 203)
defining Unicode char U+00CC (decimal 204)
defining Unicode char U+00CD (decimal 205)
defining Unicode char U+00CE (decimal 206)
defining Unicode char U+00CF (decimal 207)
defining Unicode char U+00D0 (decimal 208)
defining Unicode char U+00D1 (decimal 209)
defining Unicode char U+00D2 (decimal 210)
defining Unicode char U+00D3 (decimal 211)
defining Unicode char U+00D4 (decimal 212)
defining Unicode char U+00D5 (decimal 213)
defining Unicode char U+00D6 (decimal 214)
defining Unicode char U+00D8 (decimal 216)
defining Unicode char U+00D9 (decimal 217)
defining Unicode char U+00DA (decimal 218)
defining Unicode char U+00DB (decimal 219)
defining Unicode char U+00DC (decimal 220)
defining Unicode char U+00DD (decimal 221)
defining Unicode char U+00DE (decimal 222)
defining Unicode char U+00DF (decimal 223)
defining Unicode char U+00E0 (decimal 224)
defining Unicode char U+00E1 (decimal 225)
defining Unicode char U+00E2 (decimal 226)
defining Unicode char U+00E3 (decimal 227)
defining Unicode char U+00E4 (decimal 228)
defining Unicode char U+00E5 (decimal 229)
defining Unicode char U+00E6 (decimal 230)
defining Unicode char U+00E7 (decimal 231)
defining Unicode char U+00E8 (decimal 232)
defining Unicode char U+00E9 (decimal 233)
defining Unicode char U+00EA (decimal 234)
defining Unicode char U+00EB (decimal 235)
defining Unicode char U+00EC (decimal 236)
defining Unicode char U+00ED (decimal 237)
defining Unicode char U+00EE (decimal 238)
defining Unicode char U+00EF (decimal 239)
defining Unicode char U+00F0 (decimal 240)
defining Unicode char U+00F1 (decimal 241)
defining Unicode char U+00F2 (decimal 242)
defining Unicode char U+00F3 (decimal 243)
defining Unicode char U+00F4 (decimal 244)
defining Unicode char U+00F5 (decimal 245)
defining Unicode char U+00F6 (decimal 246)
defining Unicode char U+00F8 (decimal 248)
defining Unicode char U+00F9 (decimal 249)
defining Unicode char U+00FA (decimal 250)
defining Unicode char U+00FB (decimal 251)
defining Unicode char U+00FC (decimal 252)
defining Unicode char U+00FD (decimal 253)
defining Unicode char U+00FE (decimal 254)
defining Unicode char U+00FF (decimal 255)
defining Unicode char U+0102 (decimal 258)
defining Unicode char U+0103 (decimal 259)
defining Unicode char U+0104 (decimal 260)
defining Unicode char U+0105 (decimal 261)
defining Unicode char U+0106 (decimal 262)
defining Unicode char U+0107 (decimal 263)
defining Unicode char U+010C (decimal 268)
defining Unicode char U+010D (decimal 269)
defining Unicode char U+010E (decimal 270)
defining Unicode char U+010F (decimal 271)
defining Unicode char U+0110 (decimal 272)
defining Unicode char U+0111 (decimal 273)
defining Unicode char U+0118 (decimal 280)
defining Unicode char U+0119 (decimal 281)
defining Unicode char U+011A (decimal 282)
defining Unicode char U+011B (decimal 283)
defining Unicode char U+011E (decimal 286)
defining Unicode char U+011F (decimal 287)
defining Unicode char U+0130 (decimal 304)
defining Unicode char U+0131 (decimal 305)
defining Unicode char U+0132 (decimal 306)
defining Unicode char U+0133 (decimal 307)
defining Unicode char U+0139 (decimal 313)
defining Unicode char U+013A (decimal 314)
defining Unicode char U+013D (decimal 317)
defining Unicode char U+013E (decimal 318)
defining Unicode char U+0141 (decimal 321)
defining Unicode char U+0142 (decimal 322)
defining Unicode char U+0143 (decimal 323)
defining Unicode char U+0144 (decimal 324)
defining Unicode char U+0147 (decimal 327)
defining Unicode char U+0148 (decimal 328)
defining Unicode char U+014A (decimal 330)
defining Unicode char U+014B (decimal 331)
defining Unicode char U+0150 (decimal 336)
defining Unicode char U+0151 (decimal 337)
defining Unicode char U+0152 (decimal 338)
defining Unicode char U+0153 (decimal 339)
defining Unicode char U+0154 (decimal 340)
defining Unicode char U+0155 (decimal 341)
defining Unicode char U+0158 (decimal 344)
defining Unicode char U+0159 (decimal 345)
defining Unicode char U+015A (decimal 346)
defining Unicode char U+015B (decimal 347)
defining Unicode char U+015E (decimal 350)
defining Unicode char U+015F (decimal 351)
defining Unicode char U+0160 (decimal 352)
defining Unicode char U+0161 (decimal 353)
defining Unicode char U+0162 (decimal 354)
defining Unicode char U+0163 (decimal 355)
defining Unicode char U+0164 (decimal 356)
defining Unicode char U+0165 (decimal 357)
defining Unicode char U+016E (decimal 366)
defining Unicode char U+016F (decimal 367)
defining Unicode char U+0170 (decimal 368)
defining Unicode char U+0171 (decimal 369)
defining Unicode char U+0178 (decimal 376)
defining Unicode char U+0179 (decimal 377)
defining Unicode char U+017A (decimal 378)
defining Unicode char U+017B (decimal 379)
defining Unicode char U+017C (decimal 380)
defining Unicode char U+017D (decimal 381)
defining Unicode char U+017E (decimal 382)
defining Unicode char U+200C (decimal 8204)
defining Unicode char U+2013 (decimal 8211)
defining Unicode char U+2014 (decimal 8212)
defining Unicode char U+2018 (decimal 8216)
defining Unicode char U+2019 (decimal 8217)
defining Unicode char U+201A (decimal 8218)
defining Unicode char U+201C (decimal 8220)
defining Unicode char U+201D (decimal 8221)
defining Unicode char U+201E (decimal 8222)
defining Unicode char U+2030 (decimal 8240)
defining Unicode char U+2031 (decimal 8241)
defining Unicode char U+2039 (decimal 8249)
defining Unicode char U+203A (decimal 8250)
defining Unicode char U+2423 (decimal 9251)
)
Now handling font encoding OT1 ...
... processing UTF-8 mapping file for font encoding OT1
(/usr/share/texmf-dist/tex/latex/base/ot1enc.dfu
File: ot1enc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc
defining Unicode char U+00A1 (decimal 161)
defining Unicode char U+00A3 (decimal 163)
defining Unicode char U+00B8 (decimal 184)
defining Unicode char U+00BF (decimal 191)
defining Unicode char U+00C5 (decimal 197)
defining Unicode char U+00C6 (decimal 198)
defining Unicode char U+00D8 (decimal 216)
defining Unicode char U+00DF (decimal 223)
defining Unicode char U+00E6 (decimal 230)
defining Unicode char U+00EC (decimal 236)
defining Unicode char U+00ED (decimal 237)
defining Unicode char U+00EE (decimal 238)
defining Unicode char U+00EF (decimal 239)
defining Unicode char U+00F8 (decimal 248)
defining Unicode char U+0131 (decimal 305)
defining Unicode char U+0141 (decimal 321)
defining Unicode char U+0142 (decimal 322)
defining Unicode char U+0152 (decimal 338)
defining Unicode char U+0153 (decimal 339)
defining Unicode char U+2013 (decimal 8211)
defining Unicode char U+2014 (decimal 8212)
defining Unicode char U+2018 (decimal 8216)
defining Unicode char U+2019 (decimal 8217)
defining Unicode char U+201C (decimal 8220)
defining Unicode char U+201D (decimal 8221)
)
Now handling font encoding OMS ...
... processing UTF-8 mapping file for font encoding OMS
(/usr/share/texmf-dist/tex/latex/base/omsenc.dfu
File: omsenc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc
defining Unicode char U+00A7 (decimal 167)
defining Unicode char U+00B6 (decimal 182)
defining Unicode char U+00B7 (decimal 183)
defining Unicode char U+2020 (decimal 8224)
defining Unicode char U+2021 (decimal 8225)
defining Unicode char U+2022 (decimal 8226)
)
Now handling font encoding OMX ...
... no UTF-8 mapping file for font encoding OMX
Now handling font encoding U ...
... no UTF-8 mapping file for font encoding U
defining Unicode char U+00A9 (decimal 169)
defining Unicode char U+00AA (decimal 170)
defining Unicode char U+00AE (decimal 174)
defining Unicode char U+00BA (decimal 186)
defining Unicode char U+02C6 (decimal 710)
defining Unicode char U+02DC (decimal 732)
defining Unicode char U+200C (decimal 8204)
defining Unicode char U+2026 (decimal 8230)
defining Unicode char U+2122 (decimal 8482)
defining Unicode char U+2423 (decimal 9251)
))
(/usr/share/texmf-dist/tex/generic/babel/babel.sty
Package: babel 2014/09/25 3.9l The Babel package
(/usr/share/texmf-dist/tex/generic/babel-hungarian/magyar.ldf
Language: magyar 2007/10/19 v1.5 Magyar support from the babel v3.7 system
(/usr/share/texmf-dist/tex/generic/babel/babel.def
File: babel.def 2014/09/25 3.9l Babel common definitions
\babel@savecnt=\count87
\U@D=\dimen103
)
Package babel Info: Making ` an active character on input line 2732.
\c@footnote@add=\count88
\c@footnote@ch=\count89
))
(/usr/share/texmf-dist/tex/latex/base/fontenc.sty
Package: fontenc 2005/09/27 v1.99g Standard LaTeX package
(/usr/share/texmf-dist/tex/latex/base/t1enc.def
File: t1enc.def 2005/09/27 v1.99g Standard LaTeX file
LaTeX Font Info: Redeclaring font encoding T1 on input line 43.
))
(/usr/share/texmf-dist/tex/latex/amsmath/amsmath.sty
Package: amsmath 2013/01/14 v2.14 AMS math features
\@mathmargin=\skip43
For additional information on amsmath, use the `?' option.
(/usr/share/texmf-dist/tex/latex/amsmath/amstext.sty
Package: amstext 2000/06/29 v2.01
(/usr/share/texmf-dist/tex/latex/amsmath/amsgen.sty
File: amsgen.sty 1999/11/30 v2.0
\@emptytoks=\toks16
\ex@=\dimen104
))
(/usr/share/texmf-dist/tex/latex/amsmath/amsbsy.sty
Package: amsbsy 1999/11/29 v1.2d
\pmbraise@=\dimen105
)
(/usr/share/texmf-dist/tex/latex/amsmath/amsopn.sty
Package: amsopn 1999/12/14 v2.01 operator names
)
\inf@bad=\count90
LaTeX Info: Redefining \frac on input line 210.
\uproot@=\count91
\leftroot@=\count92
LaTeX Info: Redefining \overline on input line 306.
\classnum@=\count93
\DOTSCASE@=\count94
LaTeX Info: Redefining \ldots on input line 378.
LaTeX Info: Redefining \dots on input line 381.
LaTeX Info: Redefining \cdots on input line 466.
\Mathstrutbox@=\box26
\strutbox@=\box27
\big@size=\dimen106
LaTeX Font Info: Redeclaring font encoding OML on input line 566.
LaTeX Font Info: Redeclaring font encoding OMS on input line 567.
\macc@depth=\count95
\c@MaxMatrixCols=\count96
\dotsspace@=\muskip10
\c@parentequation=\count97
\dspbrk@lvl=\count98
\tag@help=\toks17
\row@=\count99
\column@=\count100
\maxfields@=\count101
\andhelp@=\toks18
\eqnshift@=\dimen107
\alignsep@=\dimen108
\tagshift@=\dimen109
\tagwidth@=\dimen110
\totwidth@=\dimen111
\lineht@=\dimen112
\@envbody=\toks19
\multlinegap=\skip44
\multlinetaggap=\skip45
\mathdisplay@stack=\toks20
LaTeX Info: Redefining \[ on input line 2665.
LaTeX Info: Redefining \] on input line 2666.
)
(/usr/share/texmf-dist/tex/latex/amsfonts/amsfonts.sty
Package: amsfonts 2013/01/14 v3.01 Basic AMSFonts support
\symAMSa=\mathgroup4
\symAMSb=\mathgroup5
LaTeX Font Info: Overwriting math alphabet `\mathfrak' in version `bold'
(Font) U/euf/m/n --> U/euf/b/n on input line 106.
)
(/usr/share/texmf-dist/tex/latex/amsfonts/amssymb.sty
Package: amssymb 2013/01/14 v3.01 AMS font symbols
)
(/usr/share/texmf-dist/tex/latex/graphics/graphicx.sty
Package: graphicx 2014/04/25 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
(/usr/share/texmf-dist/tex/latex/graphics/keyval.sty
Package: keyval 2014/05/08 v1.15 key=value parser (DPC)
\KV@toks@=\toks21
)
(/usr/share/texmf-dist/tex/latex/graphics/graphics.sty
Package: graphics 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
(/usr/share/texmf-dist/tex/latex/graphics/trig.sty
Package: trig 1999/03/16 v1.09 sin cos tan (DPC)
)
(/usr/share/texmf-dist/tex/latex/latexconfig/graphics.cfg
File: graphics.cfg 2010/04/23 v1.9 graphics configuration of TeX Live
)
Package graphics Info: Driver file: pdftex.def on input line 91.
(/usr/share/texmf-dist/tex/latex/pdftex-def/pdftex.def
File: pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX
(/usr/share/texmf-dist/tex/generic/oberdiek/infwarerr.sty
Package: infwarerr 2010/04/08 v1.3 Providing info/warning/error messages (HO)
)
(/usr/share/texmf-dist/tex/generic/oberdiek/ltxcmds.sty
Package: ltxcmds 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
)
\Gread@gobject=\count102
))
\Gin@req@height=\dimen113
\Gin@req@width=\dimen114
)
(/usr/share/texmf-dist/tex/latex/geometry/geometry.sty
Package: geometry 2010/09/12 v5.6 Page Geometry
(/usr/share/texmf-dist/tex/generic/oberdiek/ifpdf.sty
Package: ifpdf 2011/01/30 v2.3 Provides the ifpdf switch (HO)
Package ifpdf Info: pdfTeX in PDF mode is detected.
)
(/usr/share/texmf-dist/tex/generic/oberdiek/ifvtex.sty
Package: ifvtex 2010/03/01 v1.5 Detect VTeX and its facilities (HO)
Package ifvtex Info: VTeX not detected.
)
(/usr/share/texmf-dist/tex/generic/ifxetex/ifxetex.sty
Package: ifxetex 2010/09/12 v0.6 Provides ifxetex conditional
)
\Gm@cnth=\count103
\Gm@cntv=\count104
\c@Gm@tempcnt=\count105
\Gm@bindingoffset=\dimen115
\Gm@wd@mp=\dimen116
\Gm@odd@mp=\dimen117
\Gm@even@mp=\dimen118
\Gm@layoutwidth=\dimen119
\Gm@layoutheight=\dimen120
\Gm@layouthoffset=\dimen121
\Gm@layoutvoffset=\dimen122
\Gm@dimlist=\toks22
)
No file RMuso.aux.
\openout1 = `RMuso.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 16.
LaTeX Font Info: ... okay on input line 16.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 16.
LaTeX Font Info: ... okay on input line 16.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 16.
LaTeX Font Info: ... okay on input line 16.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 16.
LaTeX Font Info: ... okay on input line 16.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 16.
LaTeX Font Info: ... okay on input line 16.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 16.
LaTeX Font Info: ... okay on input line 16.
LaTeX Warning: Please use \usepackage[latin2]{inputenc} with
\usepackage[magyar]{babel}.
(/usr/share/texmf-dist/tex/context/base/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count106
\scratchdimen=\dimen123
\scratchbox=\box28
\nofMPsegments=\count107
\nofMParguments=\count108
\everyMPshowfont=\toks23
\MPscratchCnt=\count109
\MPscratchDim=\dimen124
\MPnumerator=\count110
\makeMPintoPDFobject=\count111
\everyMPtoPDFconversion=\toks24
) (/usr/share/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
Package: pdftexcmds 2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO
)
(/usr/share/texmf-dist/tex/generic/oberdiek/ifluatex.sty
Package: ifluatex 2010/03/01 v1.3 Provides the ifluatex switch (HO)
Package ifluatex Info: LuaTeX not detected.
)
Package pdftexcmds Info: LuaTeX not detected.
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode found.
)
(/usr/share/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
Package: epstopdf-base 2010/02/09 v2.5 Base part for package epstopdf
(/usr/share/texmf-dist/tex/latex/oberdiek/grfext.sty
Package: grfext 2010/08/19 v1.1 Manage graphics extensions (HO)
(/usr/share/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty
Package: kvdefinekeys 2011/04/07 v1.3 Define keys (HO)
))
(/usr/share/texmf-dist/tex/latex/oberdiek/kvoptions.sty
Package: kvoptions 2011/06/30 v3.11 Key value format for package options (HO)
(/usr/share/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
Package: kvsetkeys 2012/04/25 v1.16 Key value parser (HO)
(/usr/share/texmf-dist/tex/generic/oberdiek/etexcmds.sty
Package: etexcmds 2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
Package etexcmds Info: Could not find \expanded.
(etexcmds) That can mean that you are not using pdfTeX 1.50 or
(etexcmds) that some package has redefined \expanded.
(etexcmds) In the latter case, load this package earlier.
)))
Package grfext Info: Graphics extension search list:
(grfext) [.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPE
G,.JBIG2,.JB2,.eps]
(grfext) \AppendGraphicsExtensions on input line 452.
(/usr/share/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg
File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv
e
))
*geometry* driver: auto-detecting
*geometry* detected driver: pdftex
*geometry* verbose mode - [ preamble ] result:
* driver: pdftex
* paper: a4paper
* layout: <same size as paper>
* layoutoffset:(h,v)=(0.0pt,0.0pt)
* modes:
* h-part:(L,W,R)=(56.9055pt, 483.69687pt, 56.9055pt)
* v-part:(T,H,B)=(56.9055pt, 731.23584pt, 56.9055pt)
* \paperwidth=597.50787pt
* \paperheight=845.04684pt
* \textwidth=483.69687pt
* \textheight=731.23584pt
* \oddsidemargin=-15.36449pt
* \evensidemargin=-15.36449pt
* \topmargin=-52.36449pt
* \headheight=12.0pt
* \headsep=25.0pt
* \topskip=12.0pt
* \footskip=30.0pt
* \marginparwidth=35.0pt
* \marginparsep=10.0pt
* \columnsep=10.0pt
* \skip\footins=10.8pt plus 4.0pt minus 2.0pt
* \hoffset=0.0pt
* \voffset=0.0pt
* \mag=1000
* \@twocolumnfalse
* \@twosidefalse
* \@mparswitchfalse
* \@reversemarginfalse
* (1in=72.27pt=25.4mm, 1cm=28.453pt)
(/usr/share/texmf-dist/tex/latex/base/article.cls
LaTeX Info: Redefining \cal on input line 506.
LaTeX Info: Redefining \mit on input line 507.
)
LaTeX Font Info: Try loading font information for U+msa on input line 17.
(/usr/share/texmf-dist/tex/latex/amsfonts/umsa.fd
File: umsa.fd 2013/01/14 v3.01 AMS symbols A
)
LaTeX Font Info: Try loading font information for U+msb on input line 17.
(/usr/share/texmf-dist/tex/latex/amsfonts/umsb.fd
File: umsb.fd 2013/01/14 v3.01 AMS symbols B
)
LaTeX Warning: No \author given.
LaTeX Font Info: Try loading font information for OMS+cmr on input line 23.
(/usr/share/texmf-dist/tex/latex/base/omscmr.fd
File: omscmr.fd 1999/05/25 v2.5h Standard LaTeX font definitions
)
LaTeX Font Info: Font shape `OMS/cmr/m/n' in size <12> not available
(Font) Font shape `OMS/cmsy/m/n' tried instead on input line 23.
[1
{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}]
Underfull \hbox (badness 10000) in paragraph at lines 53--57
[]
Underfull \hbox (badness 10000) in paragraph at lines 53--57
[]
./RMuso.tex:67: LaTeX Error: There's no line here to end.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.67 \newline
\newline
Your command was ignored.
Type I <command> <return> to replace it with another command,
or <return> to continue without it.
./RMuso.tex:67: LaTeX Error: There's no line here to end.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.67 \newline \newline
Your command was ignored.
Type I <command> <return> to replace it with another command,
or <return> to continue without it.
Underfull \hbox (badness 10000) in paragraph at lines 68--74
[]
[2] (./RMuso.aux) )
Here is how much of TeX's memory you used:
4613 strings out of 494011
64248 string characters out of 6160039
139041 words of memory out of 5000000
7925 multiletter control sequences out of 15000+600000
12103 words of font info for 34 fonts, out of 8000000 for 9000
600 hyphenation exceptions out of 8191
38i,6n,27p,336b,361s stack positions out of 5000i,500n,10000p,200000b,80000s
{/usr/share/texmf-dist/fonts/enc/dvips/cm-super/cm-super-t1.
enc}</usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb></usr/shar
e/texmf-dist/fonts/type1/public/cm-super/sfbx1200.pfb></usr/share/texmf-dist/fo
nts/type1/public/cm-super/sfbx1728.pfb></usr/share/texmf-dist/fonts/type1/publi
c/cm-super/sfrm1200.pfb></usr/share/texmf-dist/fonts/type1/public/cm-super/sfrm
1440.pfb></usr/share/texmf-dist/fonts/type1/public/cm-super/sfrm2074.pfb></usr/
share/texmf-dist/fonts/type1/public/cm-super/sfti1200.pfb>
Output written on RMuso.pdf (2 pages, 109426 bytes).
PDF statistics:
40 PDF objects out of 1000 (max. 8388607)
28 compressed objects within 1 object stream
0 named destinations out of 1000 (max. 500000)
1 words of extra memory for PDF output out of 10000 (max. 10000000)

BIN
Documents/RMuso.pdf Normal file

Binary file not shown.

75
Documents/RMuso.tex Normal file
View File

@ -0,0 +1,75 @@
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[magyar]{babel}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\frenchspacing
\title{Az RMuso csomag használata}
%\author{Hollós Roland}
\begin{document}
\maketitle
\section{A csomag alapfüggvényei}
Az R-muso csomag az alábbi fő függvényeket használja:
\begin{itemize}
\item muso.R
\item changecontent.R
\item setup.R
\item other\_usefull\_functions.R
\item getOutput.R
\end{itemize}
\section{Tartalmazott függvény-csoportok áttekintése}
\subsubsection*{setup.R}
Ebben az R fileban találhatjuk a \textit{setup()} függvényt, amelyben beállíthatjuk a fő paramétereket, mint például a végrehajtható fájl(muso.exe) neve/elérési útvonala, az outputfile-ok elérési helye.
\subsubsection*{muso.R}
Itt olyan fügvények találhatók, mint a \textit{rungetMuso()}, valamint a \textit{spinupMuso()} és a \textit{normalMuso()}. Az előbbi bekéri a bemeneti paramétereket.
\subsubsection*{chagecontent.R}
Itt definiáltuk azt a függvényt( \textit{changemulline()}), ami alkalmas arra, hogy adott fájlnak, adott sorait, adott tartalmakra cserélje.
\subsubsection*{other\_usefull\_functions.R}
Két függvényt tartalmaz: \textit{getyearlycum()} és \textit{getyearlymax()} Az előbbi éves összegzést végez a megfelelő változóra vonatkozóan, az utóbbi pedig meghatározza az éves maximumértéket.
\subsubsection*{getOutput.R}
Ez a file felelős az output adadok beolvasásáért, a \textit{getdailyout()}, a \textit{getmonthlyout()} és a \textit{getyearlyout()} függvények nevüknek megfelelő formátum szerint adják vissza a kimeneti értékeket.
\section{Használat}
\subsubsection*{setup()}
A függvény, mely beállítja a környezetet a MuSo számára összesen 8 paramétert fogad el, ezek sorban: executable, parallel, calibrationpar, outputloc, inputloc, metinput, ininput, epcinput. Ezekből 11 elemű lista képződik, amit a rungetMuso igényel. Részletesebben:
\begin{itemize}
\item \textbf{executable}: A muso/muso.exe file helye és neve.
\item \textbf{calibrationpar}: A kalibráláshoz kiválasztott változók sorszáma az epc file-ban.
\item \textbf{inputloc}: Az .ini file-ok helye.
\item \textbf{metinput}: A met. file-ok helye.
\item \textbf{epcinput}: Az epc file-ok helye.
\end{itemize}
Alapértelmezés szerint a végrehatjható fájl az ini, a met, és az epc fájlokkal megegyező helyen található.\\
\newline \newline
\textbf{Példa:}\\
settings=setup(executable = "executable", calibrationpar = c(,,,), inputloc = "inputloc", metimput = "metinput", ininput = "ininput", epcinput = "epcinput")
\subsubsection*{rungetMuso}
A rungetMuso az RMuso fő függvénye. 3 dolgot csinál: a felhasználó igényei alapján megváltoztatja a bemeneti paramétereket, futtatja spinup és normal módban a MuSo-t, kiírja a kimeneti fájlokat igény szerint. Elsődlegesen a képernyőre, de az könnyen átirányítható egy változóba. \par
Mindehhez az alábbi 3 bemenetre van szüksége:
\begin{itemize}
\item \textbf{settings}: ez egy 11 elemű lista, amit akár a setup() függvénnyel is legenerálhatunk.
\item \textbf{parameters}: ez a változó tartalmazza az új értékeket.
\item \textbf{timee}: A változó tartalmazza, hogy az output milyen felbontásban érkezzen. 3 értéke lehet: "d"(napi) ,"m" (havi),"y" (évi). Az évi az alapértelmezett.
\end{itemize}
\newline \newline
\textbf{Példa:}\newline \newline
I. mód:\newline
settings<-setup(...)\\
rungetMuso(settings,parameters,timee="y")\\
II.mód:\newline
rungetMuso(setup(..),parameters,timee="y")
\end{document}

BIN
RBBGCMuso.pdf Normal file

Binary file not shown.

75
RBBGCMuso.tex Normal file
View File

@ -0,0 +1,75 @@
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[magyar]{babel}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\frenchspacing
\title{Az RBBGCMuso csomag használata}
%\author{Hollós Roland}
\begin{document}
\maketitle
\section{A csomag alapfüggvényei}
Az R-muso csomag az alábbi fő függvényeket használja:
\begin{itemize}
\item muso.R
\item changecontent.R
\item setup.R
\item other\_usefull\_functions.R
\item getOutput.R
\end{itemize}
\section{Tartalmazott függvény-csoportok áttekintése}
\subsubsection*{setup.R}
Ebben az R fileban találhatjuk a \textit{setup()} függvényt, amelyben beállíthatjuk a fő paramétereket, mint például a végrehajtható fájl(muso.exe) neve/elérési útvonala, az outputfile-ok elérési helye.
\subsubsection*{muso.R}
Itt olyan fügvények találhatók, mint a \textit{rungetMuso()}, valamint a \textit{spinupMuso()} és a \textit{normalMuso()}. Az előbbi bekéri a bemeneti paramétereket.
\subsubsection*{chagecontent.R}
Itt definiáltuk azt a függvényt( \textit{changemulline()}), ami alkalmas arra, hogy adott fájlnak, adott sorait, adott tartalmakra cserélje.
\subsubsection*{other\_usefull\_functions.R}
Két függvényt tartalmaz: \textit{getyearlycum()} és \textit{getyearlymax()} Az előbbi éves összegzést végez a megfelelő változóra vonatkozóan, az utóbbi pedig meghatározza az éves maximumértéket.
\subsubsection*{getOutput.R}
Ez a file felelős az output adadok beolvasásáért, a \textit{getdailyout()}, a \textit{getmonthlyout()} és a \textit{getyearlyout()} függvények nevüknek megfelelő formátum szerint adják vissza a kimeneti értékeket.
\section{Használat}
\subsubsection*{setup()}
A függvény, mely beállítja a környezetet a MuSo számára összesen 8 paramétert fogad el, ezek sorban: executable, parallel, calibrationpar, outputloc, inputloc, metinput, ininput, epcinput. Ezekből 11 elemű lista képződik, amit a rungetMuso igényel. Részletesebben:
\begin{itemize}
\item \textbf{executable}: A muso/muso.exe file helye és neve.
\item \textbf{calibrationpar}: A kalibráláshoz kiválasztott változók sorszáma az epc file-ban.
\item \textbf{inputloc}: Az .ini file-ok helye.
\item \textbf{metinput}: A met. file-ok helye.
\item \textbf{epcinput}: Az epc file-ok helye.
\end{itemize}
Alapértelmezés szerint a végrehatjható fájl az ini, a met, és az epc fájlokkal megegyező helyen található.\\
\newline \newline
\textbf{Példa:}\\
settings=setup(executable = "executable", calibrationpar = c(,,,), inputloc = "inputloc", metimput = "metinput", ininput = "ininput", epcinput = "epcinput")
\subsubsection*{rungetMuso}
A rungetMuso az RMuso fő függvénye. 3 dolgot csinál: a felhasználó igényei alapján megváltoztatja a bemeneti paramétereket, futtatja spinup és normal módban a MuSo-t, kiírja a kimeneti fájlokat igény szerint. Elsődlegesen a képernyőre, de az könnyen átirányítható egy változóba. \par
Mindehhez az alábbi 3 bemenetre van szüksége:
\begin{itemize}
\item \textbf{settings}: ez egy 11 elemű lista, amit akár a setup() függvénnyel is legenerálhatunk.
\item \textbf{parameters}: ez a változó tartalmazza az új értékeket.
\item \textbf{timee}: A változó tartalmazza, hogy az output milyen felbontásban érkezzen. 3 értéke lehet: "d"(napi) ,"m" (havi),"y" (évi). Az évi az alapértelmezett.
\end{itemize}
\textbf{Példa:}\newline \newline
I. mód:\newline
settings<-setup(...)\\
rungetMuso(settings,parameters,timee="y")\\
II.mód:\newline
rungetMuso(setup(..),parameters,timee="y")
\end{document}

2
RBBGCMuso/.Rbuildignore Normal file
View File

@ -0,0 +1,2 @@
^.*\.Rproj$
^\.Rproj\.user$

11
RBBGCMuso/DESCRIPTION Normal file
View File

@ -0,0 +1,11 @@
Package: RBBGCMuso
Title: What the Package Does (one line, title case)
Version: 0.1.7
Authors@R: person("Roland", "Hollos", , "hollorol@gmail.com", role = c("aut", "cre"))
Description: What the package does (one paragraph)
License: GPL-2
LazyData: true
NeedsCompilation: no
Packaged: 2016-11-15 13:58:04 UTC; hollorol
Author: First Last [aut, cre]
Maintainer: First Last <first.last@example.com>

1
RBBGCMuso/NAMESPACE Normal file
View File

@ -0,0 +1 @@
exportPattern("^[^\\.]")

217
RBBGCMuso/R/#rungetmuso.R# Normal file
View File

@ -0,0 +1,217 @@
#' This runs the BBGC-MuSo model
#' @author Roland Hollós
#' @param filename Name of the initialisation files
#' @return No return, outputs are written to file
#' @usage The function works only, if ...
Linuxp <-(Sys.info()[1]=="Linux")
rungetMuso <- function(settings,parameters=NULL, timee="d", debugging=FALSE, logfilename=NULL, keepEpc=FALSE, export=FALSE, silent=FALSE, aggressive=FALSE){
#############################################################
############################spinup run############################
##########################################################
##Copy the variables from settings
inputloc <- settings$inputloc
executable <- settings$executable
ininput <- settings$ininput
epc <- settings$epcinput
calibrationpar <- settings$calibrationpar
##Sometimes a bug occure due to logfiles and controlfiles in the input loc directory
if(silent!=TRUE){
if(length(grep("(dayout$)|(log$)",list.files(inputloc)))>0){
cat(" \n \n WARMING: there is a log or dayout file nearby the ini files, that may cause problemes. \n \n If you want to avoid that possible problemes, please copy the log or dayout files into a save place, and after do a cleanupMuso(), or delete these manually, or run the rungetMuso(), with the agressive=TRUE parameter \n \n")
}
}
if(aggressive==TRUE){
cleanupMuso()
}
##change the epc file if and only if there are given parameters
if(!is.null(parameters)){
changemulline(filename=epc[2],calibrationpar,parameters)
}
##We change the working directory becase of the model, but we want to avoid sideeffects, so we save the current location and after that we will change everything to it.
whereAmI<-getwd()
## Set the working directory to the inputloc temporary.
setwd(inputloc)
##Run the model for the spinup run.
if(silent){#silenc mode
if(Linuxp){
#In this case, in linux machines
system(paste(executable,ininput[1],"> /dev/null",sep=" "))
} else {
#In windows machines there is a show.output.on.console option
system(paste(executable,ininput[1],sep=" "),show.output.on.console = FALSE)
}
} else {
system(paste(executable,ininput[1],sep=" "))
}
logspinup<-list.files(inputloc)[grep("log$",list.files(inputloc))]#load the logfiles
if(length(logspinup)==0){
return("Modell Failure")#in that case the modell did not create even a logfile
}
spincrash<-tail(readLines(paste(inputloc,logspinup,sep=""),-1),1)==0 #If the last line in the logfile is 0 There are mistakes so the spinup crashes
if(!spincrash){##If spinup did not crashed, run the normal run.
#####################################################################
###########################normal run#########################
#################################################################
##for the sake of safe we set the location again
setwd(inputloc)
if(silent){
if(Linuxp){
system(paste(executable,ininput[2],"> /dev/null",sep=" "))
} else {
system(paste(executable,ininput[2],sep=" "),show.output.on.console = FALSE)
}
} else {
system(paste(executable,ininput[2],sep=" "))
}
##read the output
switch(timee,
"d"=(Reva<-getdailyout(settings)),
"m"=(Reva<-getmonthlyout(settings)),
"y"=(Reva<-getyearlyout(settings))
)
}
logfiles <- list.files(inputloc)[grep("log$",list.files(inputloc))]#creating a vector for logfilenames
###############################################
#############LOG SECTION#######################
###############################################
perror<-as.numeric(as.vector(lapply(paste(inputloc,logfiles,sep=""),function(x) tail(readLines(x,-1),1)))) #vector of spinup and normalrun error
if((debugging=="stamplog")|(debugging==TRUE)){#If debugging option turned on
#If log or ERROR directory does not exists create it!
dirName<-paste(inputloc,"LOG",sep="")
dirERROR<-paste(inputloc,"ERROR",sep="")
if(!dir.exists(dirName)){
dir.create(dirName)
}
if(!dir.exists(dirERROR)){
dir.create(dirERROR)
}
}
##if errorsign is 1 there is error, if it is 0 everything ok
if(length(perror)>sum(perror)){
errorsign <- 1
} else {
errorsign <- 0
}
if(keepEpc){#if keepepc option tured on
if(length(unique(dirname(epc)))>1){
print("Why are you playing with my nervs? Seriously? You hold your epc-s in different folders?")
} else {
epcdir <- dirname(epc[1])
WRONGEPC<-paste(inputloc,"WRONGEPC",sep="")
EPCS<-paste(inputloc,"EPCS",sep="")
if(!dir.exists(WRONGEPC)){
dir.create(WRONGEPC)
}
if(!dir.exists(EPCS)){
dir.create(EPCS)
}
epcfiles <- list.files(epcdir)[grep("epc$",list.files(epcdir))]
stampnum<-stamp(EPCS)
lapply(epcfiles,function (x) file.copy(from = paste(epcdir,"/",x,sep=""),to=paste(EPCS,"/",(stampnum+1),"-",x,sep="")))
if(errorsign==1){
lapply(epcfiles,function (x) file.copy(from = paste(EPCS,"/",(stampnum+1),"-",x,sep=""), to=WRONGEPC))
}
}
}
if(debugging=="stamplog"){
stampnum<-stamp(dirName)
lapply( logfiles, function (x) file.rename(from=paste(inputloc,x, sep=""), to=paste(dirName, "/",(stampnum+1),"-",x,sep="")))
if(errorsign==1){
lapply( logfiles, function (x) file.copy(from=paste(dirName, "/",(stampnum+1),"-",x,sep=""), to=dirERROR ))}
} else { if(debugging){
if(is.null(logfilename)){
lapply( logfiles, function (x) file.rename(from=paste(inputloc,x, sep=""), to=paste(dirName,"/", x, sep="")))
if(errorsign==1){
lapply( logfiles, function (x) file.rename(from=paste(dirName,"/", x, sep=""), to=dirERROR))
}
} else {
lapply( logfiles, function (x) file.rename(from=paste(inputloc,x, sep=""), to=paste(dirName, "/",logfilename,"-",x,sep="")))
if(errorsign==1){
lapply( logfiles, function (x) file.rename(from=paste(dirName, "/",logfilename,"-",x,sep=""), to=dirERROR))
}
}
}}
cleanupMuso()
if(errorsign==1){
return("Modell Failure")
}
if(timee=="d"){
colnames(Reva) <- unlist(settings$outputvars[[1]])
} else {
if(timee=="y")
colnames(Reva) <- unlist(settings$outputvars[[2]])
}
if(export!=FALSE){
setwd(whereAmI)
## switch(fextension(export),
## "csv"=(write.csv(Reva,export)),
## "xlsx"=(),
## "odt"=
## )
} else{
setwd(whereAmI)
return(Reva)}
}

1
RBBGCMuso/R/.Rhistory Normal file
View File

@ -0,0 +1 @@
list.files()

View File

@ -0,0 +1,30 @@
#' This function calls the UNIX(-like) sed program to change specific line to other, using the row numbers.
#' @author Roland
#' @param The name of the file which is needed to be changed in some lines, the numbers of this lines(vector), and
#' the contents(vector).
#' @return void
changeSpecLine<-function(lineNumber,content,file){
TOT=readLines(file,-1)
TOT[lineNumber]<-content
writeLines(TOT,file)
}
changemulline <- function(filename,calibrationpar,contents){
#This is the function which is capable change multiple specific lines to other using their row numbers.
#The function uses the previous changspecline function to operate.
varnum <- length(calibrationpar)
if(length(contents)!=varnum)
{
cat("Error: number of the values is not the same as the number of the changed parameters")
}
TOT=readLines(filename,-1)
TOT[calibrationpar]<-contents
writeLines(TOT,filename)
}

55
RBBGCMuso/R/cleanup.R Normal file
View File

@ -0,0 +1,55 @@
cleanupMuso <- function(location=NULL,deep=FALSE){
whereAmI <- getwd()
if(!is.null(location)){
setwd(location)
}
if(deep){
if(dir.exists("LOG")){
setwd("LOG")
file.remove(
grep("(out$)|(endpoint$)|(log$)",
list.files(), value = T)
)}
if(dir.exists("../ERROR")){
setwd("../ERROR")
file.remove(
grep("(out$)|(endpoint$)|(log$)",
list.files(), value = T)
)}
if(dir.exists("../EPCS")){
setwd("../EPCS")
file.remove(
grep("(out$)|(endpoint$)|(log$)|(epc$)",
list.files(), value = T)
)}
if(dir.exists("../WRONGEPC")){
setwd("../WRONGEPC")
file.remove(
grep("(out$)|(endpoint$)|(log$)|(epc$)",
list.files(), value = T)
)}
setwd("..")
file.remove(
grep("(out$)|(endpoint$)|(log$)",
list.files(), value = T)
)
}
file.remove(
grep("(out$)|(endpoint$)|(log$)",
list.files(), value = T)
)
setwd(whereAmI)
}

39
RBBGCMuso/R/getOutput.R Normal file
View File

@ -0,0 +1,39 @@
getthewholedata<-function(settings){
f1<-settings$ininput[2]
filename = paste(settings$inputloc,settings$outputname,"_ann.txt",sep="")
alloutput<-read.table(filename,skip=22, header = FALSE)
return(alloutput)
}
getthespecdata<-function(settings,colnumbers){
filename<-paste(settings$inputloc,settings$outputname,"_ann.txt",sep="")
specoutput<-read.table(filename,skip=22, header = FALSE)[,colnumbers]
return(specoutput)
}
getdailyout<-function(settings){
binaryname<-paste(settings$inputloc,settings$outputname,".dayout",sep="")
d<-file(binaryname,"rb")
dayoutput<-matrix(readBin(d,"double",size=4,n=(settings$numdata[1])),(settings$numyears*365),byrow=TRUE)
close(d)
return(dayoutput)
}
getmonthlyout<-function(settings){
binaryname<-paste(settings$inputloc,settings$outputname,".monavgout",sep="")
d<-file(binaryname,"rb")
monoutput<-matrix(readBin(d,"double",size=4,n=(settings$numdata[2])),(settings$numyears*12),byrow=TRUE)
close(d)
return(monoutput)
}
getyearlyout<-function(settings){
binaryname<-paste(settings$inputloc,settings$outputname,".annout",sep="")
d<-file(binaryname,"rb")
yearoutput<-matrix(readBin(d,"double",size=4,n=(settings$numdata[3])),(settings$numyears),byrow=TRUE)
close(d)
return(yearoutput)
}

80
RBBGCMuso/R/musotime.R Normal file
View File

@ -0,0 +1,80 @@
isLeapyear <- function(year){
if(((year%%4==0)&(year%%100!=0))|(year%%400==0)){
return(TRUE)
} else {
return(FALSE)
}
}
dayOfMonths <- function(year){
dayMonths <- c(31,28,31,30,31,30,31,31,30,31,30,31)
if(isLeapyear(year)==TRUE){
dayMonths[2] <-29
}
return(dayMonths)
}
dayOfYears <- function(year){
if(isLeapyear(year)==TRUE){
return(366)
} else {
return(365)
}
}
sumDaysOfPeriod <- function(year, periodlen){
years <- year:(year+periodlen)
years100 <-length(which(years%%100==0))
years400 <-length(which(years%%400==0))
years4 <- length(which(years%%4==0))
numberOfLeapdays <- years4-years100+years400
days <- periodlen*365+numberOfLeapdays
return(days)
}
musoDate <- function(settings,timestep="d",combined=TRUE, corrigate=TRUE){
days <- sumDaysOfPeriod(settings$startyear,settings$numyears)
dates <- matrix(rep(NA,days*3),ncol=3)
dates[1,] <- c(settings$startyear,1,1)
for(i in 2:days){
dates[i,]<-dates[(i-1),]
if((dates[i-1,2]==12)&(dates[i-1,3]==31)){
dates[i,] <-c((dates[(i-1),1]+1),1,1)
} else {
if(dates[i-1,3]==(dayOfMonths(dates[(i-1),1])[dates[(i-1),2]] )){
dates[i,]<-c(dates[(i-1),1],(dates[(i-1),2]+1),1)
} else {
dates[i,3]<-dates[(i-1),3]+1
}
}
}
if(corrigate==TRUE){
if(comined==TRUE){
dates <- apply(dates,1,function(x) paste(x,collapse="."))[1:(settings$numyears*365)]
return(dates)
}
dates<-dates[(1:(settings$numyears*365)),]
}
if(comined==TRUE){
dates <- apply(dates,1,function(x) paste(x,collapse="."))
return(dates)
}
return(dates)
}

79
RBBGCMuso/R/normalmuso.R Normal file
View File

@ -0,0 +1,79 @@
normalMuso<- function(settings,parameters=c(" ECOPHYS"),timee="d",debugging=FALSE,logfilename=NULL){
changemulline(settings,parameters)
inputloc<-settings$inputloc
executable<-settings$executable
ininput<-settings$ininput
setwd(inputloc)
#normal run
system(paste(executable,ininput[2],sep=" "))
switch(timee,
"d"=(Reva<-getdailyout(settings)),
"m"=(Reva<-getmonthlyout(settings)),
"y"=(Reva<-getyearlyout(settings))
)
logfiles<-list.files(inputloc)[grep("log$",list.files(inputloc))]
#############LOG SECTION#######################
perror<-as.numeric(as.vector(lapply(paste(inputloc,logfiles,sep=""),function(x) tail(readLines(x,-1),1))))
dirName<-paste(inputloc,"/LOG",sep="")
dirERROR<-paste(inputloc,"/ERROR",sep="")
ERROR_EPC<-paste(inputloc,"/ERROR_EPC",sep="")
if(!dir.exists(dirName)){
dir.create(dirName)
}
if(!dir.exists(dirERROR)){
dir.create(dirERROR)
}
if(length(perror)>sum(perror)){
errorsign <- 1
} else {
errorsign <- 0
}
if(debugging=="stamplog"){
stampnum<-stamp(dirName)
lapply( logfiles, function (x) file.rename(from=paste(inputloc,x, sep=""), to=paste(dirName, "/",(stampnum+1),"-",x,sep="")))
if(errorsign==1){
lapply( logfiles, function (x) file.copy(from=paste(dirName, "/",(stampnum+1),"-",x,sep=""), to=dirERROR ))}
} else { if(debugging){
if(is.null(logfilename)){
lapply( logfiles, function (x) file.rename(from=paste(inputloc,x, sep=""), to=paste(dirName,"/", x, sep="")))
if(errorsign==1){
lapply( logfiles, function (x) file.rename(from=paste(dirName,"/", x, sep=""), to=dirERROR))
}
} else {
lapply( logfiles, function (x) file.rename(from=paste(inputloc,x, sep=""), to=paste(dirName, "/",logfilename,"-",x,sep="")))
if(errorsign==1){
lapply( logfiles, function (x) file.rename(from=paste(dirName, "/",logfilename,"-",x,sep=""), to=dirERROR))
}
}
}}
cleanupMuso()
if(errorsign==1){
return("Modell Failure")
}
return(Reva)
}

View File

@ -0,0 +1,53 @@
#' 'Funtion for getting cumulative yearly data from observations
#' @author Roland Hollós
#' @param A vector of the daily observations.
#' @return A vector of yearly data
getyearlycum<-function(daily_observations){
number_of_years<-length(daily_observations)/365
# daily_observations[is.na(daily_observations)]<-0 # 3+NA=NA
fr<-1
yearlycum<-rep(NA,number_of_years)
for(i in 1:number_of_years){
to<-i*365
yearlycum[i]<-sum(daily_observations[fr:to],na.rm = TRUE)
fr<-i*365+1
}
return(yearlycum)
}
#' 'Function for getting the maximum values of the years, from daily data
#' @author Roland Hollós
#' @param A vector of the daily observations
#' @return A vector of yearly data
getyearlymax<-function(daily_observations){
number_of_years<-length(daily_observations)/365
# daily_observations[is.na(daily_observations)]<-0 # 3+NA=NA
fr<-1
yearlycum<-rep(NA,number_of_years)
for(i in 1:number_of_years){
to<-i*365
yearlymax[i]<-max(daily_observations[fr:to],na.rm=TRUE)
fr<-i*365+1
}
return(yearlymax)
}
fextension <- function(x){
#this function gives back the given filenames extension
fextension <- tail(unlist(strsplit(x,"\\.")),1)
}
supportedMuso <- function(x="outputs"){
supportedFormats <- c("xls","xlsx","odt","csv","txt")
if(x=="outputs"){
#If you add new format supports, please expand the lists
return(supportedFormats)
}
if(x=="message"){
return(cat("Supported formats are ",supportedFormats,"If your fileformat is something else, we automaticle coerced it to csv.\n"))
}
}

File diff suppressed because one or more lines are too long

51
RBBGCMuso/R/plotMuso.R Normal file
View File

@ -0,0 +1,51 @@
plotMuso <- function(settings,
variable,
##compare,
##plotname,
parameters="ECOPHYS",
timee="d",
silent=TRUE,
debugging=FALSE,
keepEpc=FALSE,
logfilename=NULL,
export=FALSE){
musoData <- rungetMuso(settings=settings,
silent=silent,
timee=timee,
parameters=parameters,
debugging=debugging,
keepEpc=keepEpc,
logfilename=logfilename,
export=export)
xlab_muso<- switch(timee, "d"="days","y"="years","m"=months)
numVari <- ncol(musoData)
if(is.numeric(variable)){
if((variable>numVari)|(variable<1)){
return(print(paste("The variable parameter must be between 1 and ",numVari)))
}
plot(musoData[,variable],pch=20,col = "dark blue",xlab=xlab_muso,ylab=colnames(musoData)[variable])
} else {
if(variable=="all"){
musoData <- rbind((1:ncol(musoData)),musoData) #creating the column indexes
par(mfrow = c(2,numVari/2))
apply(musoData, 2, function(x) plot(x[2:length(x)],pch=20,col="dark blue",xlab=xlab_muso,ylab = colnames(musoData)[x[1]]))
return(print("Everything was Ok. ;)"))
} else {
return(print("The variable option is the coloumn number of the output data-matrix, so it must be numeric, of if you want to plot the whole data matrix set it \"all\""))
}
}
}

216
RBBGCMuso/R/rungetmuso.R Normal file
View File

@ -0,0 +1,216 @@
#' This runs the BBGC-MuSo model
#' @author Roland Hollós
#' @param filename Name of the initialisation files
#' @return No return, outputs are written to file
#' @usage The function works only, if ...
Linuxp <-(Sys.info()[1]=="Linux")
rungetMuso <- function(settings,parameters=NULL, timee="d", debugging=FALSE, logfilename=NULL, keepEpc=FALSE, export=FALSE, silent=FALSE, aggressive=FALSE){
#############################################################
############################spinup run############################
##########################################################
##Copy the variables from settings
inputloc <- settings$inputloc
executable <- settings$executable
ininput <- settings$ininput
epc <- settings$epcinput
calibrationpar <- settings$calibrationpar
##Sometimes a bug occure due to logfiles and controlfiles in the input loc directory
##alma
if(silent!=TRUE){
if(length(grep("(dayout$)|(log$)",list.files(inputloc)))>0){
cat(" \n \n WARMING: there is a log or dayout file nearby the ini files, that may cause problemes. \n \n If you want to avoid that possible problemes, please copy the log or dayout files into a save place, and after do a cleanupMuso(), or delete these manually, or run the rungetMuso(), with the agressive=TRUE parameter \n \n")
}
}
if(aggressive==TRUE){
cleanupMuso()
}
##change the epc file if and only if there are given parameters
if(!is.null(parameters)){
changemulline(filename=epc[2],calibrationpar,parameters)
}
##We change the working directory becase of the model, but we want to avoid sideeffects, so we save the current location and after that we will change everything to it.
whereAmI<-getwd()
## Set the working directory to the inputloc temporary.
setwd(inputloc)
##Run the model for the spinup run.
if(silent){#silenc mode
if(Linuxp){
#In this case, in linux machines
system(paste(executable,ininput[1],"> /dev/null",sep=" "))
} else {
#In windows machines there is a show.output.on.console option
system(paste(executable,ininput[1],sep=" "),show.output.on.console = FALSE)
}
} else {
system(paste(executable,ininput[1],sep=" "))
}
logspinup<-list.files(inputloc)[grep("log$",list.files(inputloc))]#load the logfiles
if(length(logspinup)==0){
return("Modell Failure")#in that case the modell did not create even a logfile
}
spincrash<-tail(readLines(paste(inputloc,logspinup,sep=""),-1),1)==0 #If the last line in the logfile is 0 There are mistakes so the spinup crashes
if(!spincrash){##If spinup did not crashed, run the normal run.
#####################################################################
###########################normal run#########################
#################################################################
##for the sake of safe we set the location again
setwd(inputloc)
if(silent){
if(Linuxp){
system(paste(executable,ininput[2],"> /dev/null",sep=" "))
} else {
system(paste(executable,ininput[2],sep=" "),show.output.on.console = FALSE)
}
} else {
system(paste(executable,ininput[2],sep=" "))
}
##read the output
switch(timee,
"d"=(Reva<-getdailyout(settings)),
"m"=(Reva<-getmonthlyout(settings)),
"y"=(Reva<-getyearlyout(settings))
)
}
logfiles <- list.files(inputloc)[grep("log$",list.files(inputloc))]#creating a vector for logfilenames
###############################################
#############LOG SECTION#######################
###############################################
perror<-as.numeric(as.vector(lapply(paste(inputloc,logfiles,sep=""),function(x) tail(readLines(x,-1),1)))) #vector of spinup and normalrun error
if((debugging=="stamplog")|(debugging==TRUE)){#If debugging option turned on
#If log or ERROR directory does not exists create it!
dirName<-paste(inputloc,"LOG",sep="")
dirERROR<-paste(inputloc,"ERROR",sep="")
if(!dir.exists(dirName)){
dir.create(dirName)
}
if(!dir.exists(dirERROR)){
dir.create(dirERROR)
}
}
##if errorsign is 1 there is error, if it is 0 everything ok
if(length(perror)>sum(perror)){
errorsign <- 1
} else {
errorsign <- 0
}
if(keepEpc){#if keepepc option tured on
if(length(unique(dirname(epc)))>1){
print("Why are you playing with my nervs? Seriously? You hold your epc-s in different folders?")
} else {
epcdir <- dirname(epc[1])
WRONGEPC<-paste(inputloc,"WRONGEPC",sep="")
EPCS<-paste(inputloc,"EPCS",sep="")
if(!dir.exists(WRONGEPC)){
dir.create(WRONGEPC)
}
if(!dir.exists(EPCS)){
dir.create(EPCS)
}
epcfiles <- list.files(epcdir)[grep("epc$",list.files(epcdir))]
stampnum<-stamp(EPCS)
lapply(epcfiles,function (x) file.copy(from = paste(epcdir,"/",x,sep=""),to=paste(EPCS,"/",(stampnum+1),"-",x,sep="")))
if(errorsign==1){
lapply(epcfiles,function (x) file.copy(from = paste(EPCS,"/",(stampnum+1),"-",x,sep=""), to=WRONGEPC))
}
}
}
if(debugging=="stamplog"){
stampnum<-stamp(dirName)
lapply( logfiles, function (x) file.rename(from=paste(inputloc,x, sep=""), to=paste(dirName, "/",(stampnum+1),"-",x,sep="")))
if(errorsign==1){
lapply( logfiles, function (x) file.copy(from=paste(dirName, "/",(stampnum+1),"-",x,sep=""), to=dirERROR ))}
} else { if(debugging){
if(is.null(logfilename)){
lapply( logfiles, function (x) file.rename(from=paste(inputloc,x, sep=""), to=paste(dirName,"/", x, sep="")))
if(errorsign==1){
lapply( logfiles, function (x) file.rename(from=paste(dirName,"/", x, sep=""), to=dirERROR))
}
} else {
lapply( logfiles, function (x) file.rename(from=paste(inputloc,x, sep=""), to=paste(dirName, "/",logfilename,"-",x,sep="")))
if(errorsign==1){
lapply( logfiles, function (x) file.rename(from=paste(dirName, "/",logfilename,"-",x,sep=""), to=dirERROR))
}
}
}}
cleanupMuso()
if(errorsign==1){
return("Modell Failure")
}
if(timee=="d"){
colnames(Reva) <- unlist(settings$outputvars[[1]])
} else {
if(timee=="y")
colnames(Reva) <- unlist(settings$outputvars[[2]])
}
if(export!=FALSE){
setwd(whereAmI)
## switch(fextension(export),
## "csv"=(write.csv(Reva,export)),
## "xlsx"=(),
## "odt"=
## )
} else{
setwd(whereAmI)
return(Reva)}
}

272
RBBGCMuso/R/setup.r Normal file
View File

@ -0,0 +1,272 @@
#' This runs the BBGC-MuSo model
#' @author Roland Hollós
#' @param calibrationpar vector with line numbers
#' @return No return, outputs are written to file
setup <- function(executable=NULL,
parallel = F,
calibrationpar =c(1),
outputloc=NULL,
inputloc=NULL,
metinput=NULL,
CO2input=NULL,
plantinput=NULL,
thininput=NULL,
mowinput=NULL,
grazinput=NULL,
harvinput=NULL,
plouginput=NULL,
fertinput=NULL,
irrinput=NULL,
nitinput=NULL,
ininput=NULL,
epcinput=NULL
){
Linuxp <-(Sys.info()[1]=="Linux")
if(is.null(inputloc)){
inputloc<- "./"
}
inp <- unlist(strsplit(inputloc,"")) #This is the charactervector of the given imput location
if(inp[length(inp)]!="/"){
inp<-c(inp,"/")
inputloc <- paste(inp,collapse = "")
rm(inp)
}# If inp not ends in / paste one at the end, then make a string, that will be the new inputloc
##Example: "a/b/c ==> a/b/c/"
if(is.null(outputloc)){
outputloc<-inputloc
}
if(is.null(ininput)){
spinups<-grep("s.ini$",list.files(inputloc),value=TRUE)
normals<-grep("n.ini$",list.files(inputloc),value=TRUE)
if(length(spinups)==1){
ininput[1]<-paste(inputloc,spinups,sep="")
} else {return(print("There are multiple or no spinup files, please choose"))}
if(length(normals)==1){
ininput[2]<-paste(inputloc,normals,sep="")
} else {return(print("There are multiple or no normal files, please choose"))}
}
##read the ini files for the further changes
inifiles<-lapply(ininput, function (x) readLines(x,-1))
if(is.null(epcinput)){
epcflag=TRUE
epcinput[1] <- unlist(strsplit(grep(" EPC file name",inifiles[[1]],value=TRUE),"[\ \t]"))[1]
epcinput[2] <- unlist(strsplit(grep(" EPC file name",inifiles[[2]],value=TRUE),"[\ \t]"))[1]
} else {
inifiles[[1]][grep(" EPC file name",inifiles[[1]])]<-paste(epcinput[1],"\t EPC file name",sep="")
if(length(epcinput)==2){
inifiles[[2]][grep(" EPC file name",inifiles[[2]])]<-paste(epcinput[2],"\t EPC file name",sep="")
}
}
if(is.null(metinput)){
metflag=TRUE
metinput[1] <- unlist(strsplit(grep(" met file name",inifiles[[1]],value=TRUE),"[\ \t]"))[1]
metinput[2] <- unlist(strsplit(grep(" met file name",inifiles[[2]],value=TRUE),"[\ \t]"))[1]
} else {
inifiles[[1]][grep(" met file name",inifiles[[1]])]<-paste(metinput[1],"\t met file name",sep="")
if(length(metinput)==2){
inifiles[[2]][grep(" met file name",inifiles[[2]])]<-paste(metinput[2],"\t EPC file name",sep="")
}}
if(is.null(CO2input)){
CO2flag=TRUE
CO2input[1] <- unlist(strsplit(grep(" CO2 file",inifiles[[1]],value=TRUE),"[\ \t]"))[1]
CO2input[2] <- unlist(strsplit(grep(" CO2 file",inifiles[[2]],value=TRUE),"[\ \t]"))[1]
} else {
inifiles[[1]][grep(" CO2 file",inifiles[[1]])]<-paste(CO2input[1],"\t CO2 file",sep="")
if(length(CO2input)==2){
inifiles[[2]][grep(" CO2 file",inifiles[[2]])]<-paste(CO2input[2],"\t CO2 file",sep="")
}}
if(is.null(nitinput)){
nitflag=TRUE
nitinput[1] <- unlist(strsplit(grep("N-dep file",inifiles[[1]],value=TRUE),"[\ \t]"))[1]
nitinput[2] <- unlist(strsplit(grep("N-dep file",inifiles[[2]],value=TRUE),"[\ \t]"))[1]
} else {
inifiles[[1]][grep("N-dep file",inifiles[[1]])]<-paste(nitinput[1],"N-dep file",sep="N-dep file")
if(length(epcinput)==2){
inifiles[[2]][grep("N-dep file",inifiles[[2]])]<-paste(nitinput[2],"N-dep file",sep="")
}}
if(is.null(thininput)){
thinflag=TRUE
thininput[1] <- unlist(strsplit(grep("do THINNING",inifiles[[1]],value=TRUE),"[\ \t]"))[1]
thininput[2] <- unlist(strsplit(grep("do THINNING",inifiles[[2]],value=TRUE),"[\ \t]"))[1]
} else {
inifiles[[1]][grep("do THINNING",inifiles[[1]])]<-paste(thininput[1],"do THINNING",sep="")
if(length(thininput)==2){
inifiles[[2]][grep("do THINNING",inifiles[[2]])]<-paste(thininput[2],"do THINNING",sep="")
}}
if(is.null(plantinput)){
plantflag=TRUE
plantinput[1] <- unlist(strsplit(grep("do PLANTING",inifiles[[1]],value=TRUE),"[\ \t]"))[1]
plantinput[2] <- unlist(strsplit(grep("do PLANTING",inifiles[[2]],value=TRUE),"[\ \t]"))[1]
} else {
inifiles[[1]][grep("do PLANTING",inifiles[[1]])]<-paste(plantinput[1],"do PLANTING",sep="")
if(length(plantinput)==2){
inifiles[[2]][grep("do PLANTING",inifiles[[2]])]<-paste(plantinput[2],"do PLANTING",sep="")
}}
if(is.null(mowinput)){
mowflag=TRUE
mowinput[1] <- unlist(strsplit(grep("do MOWING",inifiles[[1]],value=TRUE),"[\ \t]"))[1]
mowinput[2] <- unlist(strsplit(grep("do MOWING",inifiles[[2]],value=TRUE),"[\ \t]"))[1]
} else {
inifiles[[1]][grep("do MOWING",inifiles[[1]])]<-paste(mowinput[1],"do MOWING",sep="")
if(length(mowinput)==2){
inifiles[[2]][grep("do MOWING",inifiles[[2]])]<-paste(mowinput[2],"do MOWING",sep="")
}}
if(is.null(grazinput)){
grazflag=TRUE
grazinput[1] <- unlist(strsplit(grep("do GRAZING",inifiles[[1]],value=TRUE),"[\ \t]"))[1]
grazinput[2] <- unlist(strsplit(grep("do GRAZING",inifiles[[2]],value=TRUE),"[\ \t]"))[1]
} else {
inifiles[[1]][grep("do GRAZING",inifiles[[1]])]<-paste(grazinput[1],"do GRAZING",sep="")
if(length(grazinput)==2){
inifiles[[2]][grep("do GRAZING",inifiles[[2]])]<-paste(grazinput[2],"do GRAZING",sep="")
}}
if(is.null(harvinput)){
harvflag=TRUE
harvinput[1] <- unlist(strsplit(grep("do HARVESTING",inifiles[[1]],value=TRUE),"[\ \t]"))[1]
harvinput[2] <- unlist(strsplit(grep("do HARVESTING",inifiles[[2]],value=TRUE),"[\ \t]"))[1]
} else {
inifiles[[1]][grep("do HARVESTING",inifiles[[1]])]<-paste(harvinput[1],"do HARVESTING",sep="")
if(length(harvinput)==2){
inifiles[[2]][grep("do HARVESTING",inifiles[[2]])]<-paste(harvinput[2],"do HARVESTING",sep="")
}}
if(is.null(plouginput)){
plougflag=TRUE
plouginput[1] <- unlist(strsplit(grep("do PLOUGHING",inifiles[[1]],value=TRUE),"[\ \t]"))[1]
plouginput[2] <- unlist(strsplit(grep("do PLOUGHING",inifiles[[2]],value=TRUE),"[\ \t]"))[1]
} else {
inifiles[[1]][grep("do PLOUGHING",inifiles[[1]])]<-paste(plouginput[1],"do PLOUGHING",sep="")
if(length(plouginput)==2){
inifiles[[2]][grep("do PLOUGHING",inifiles[[2]])]<-paste(plouginput[2],"do PLOUGHING",sep="")
}}
if(is.null(fertinput)){
fertflag=TRUE
fertinput[1] <- unlist(strsplit(grep("do FERTILIZING",inifiles[[1]],value=TRUE),"[\ \t]"))[1]
fertinput[2] <- unlist(strsplit(grep("do FERTILIZING",inifiles[[2]],value=TRUE),"[\ \t]"))[1]
} else {
inifiles[[1]][grep("do FERTILIZING",inifiles[[1]])]<-paste(fertinput[1],"do FERTILIZING",sep="")
if(length(fertinput)==2){
inifiles[[2]][grep("do FERTILIZING",inifiles[[2]])]<-paste(fertinput[2],"do FERTILIZING",sep="")
}}
if(is.null(irrinput)){
irrflag=TRUE
irrinput[1] <- unlist(strsplit(grep("do IRRIGATION",inifiles[[1]],value=TRUE),"[\ \t]"))[1]
irrinput[2] <- unlist(strsplit(grep("do IRRIGATION",inifiles[[2]],value=TRUE),"[\ \t]"))[1]
} else {
inifiles[[1]][grep("do IRRIGATION",inifiles[[1]])]<-paste(irrinput[1],"do IRRIGATION",sep="")
if(length(irrinput)==2){
inifiles[[2]][grep("do IRRIGATION",inifiles[[2]])]<-paste(irrinput[2],"do IRRIGATION",sep="")
}}
c<-grep("DAILY_OUTPUT",inifiles[[2]])+1
numVar<-as.numeric(unlist(strsplit(inifiles[[2]][c],"[\ \t]"))[1])
dailyVarCodes<-inifiles[[2]][(c+1):(c+numVar)]
dailyVarnames<-lapply(dailyVarCodes, function(x) musoMapping(unlist(strsplit(x,"[\ \t]"))[1]))
c<-grep("ANNUAL_OUTPUT",inifiles[[2]])+1
numVar<-as.numeric(unlist(strsplit(inifiles[[2]][c],"[\ \t]"))[1])
annualVarCodes<-inifiles[[2]][(c+1):(c+numVar)]
annualVarnames<-lapply(annualVarCodes, function(x) musoMapping(unlist(strsplit(x,"[\ \t]"))[1]))
outputvars<-list(dailyVarnames,annualVarnames)
if(is.null(executable)){
if(Linuxp){
executable<-paste(inputloc,"muso",sep="")
} else {
executable<-paste(inputloc,"muso.exe",sep="")
}
} else {
file.copy(executable,inputloc)
if(Linuxp){
executable<-paste(inputloc,"muso",sep="")
} else {
executable<-paste(inputloc,"muso.exe",sep="")
}
}
5+4
outputname <- unlist(strsplit(grep("prefix for output files",inifiles[[2]],value=TRUE),"[\ \t]"))[1]
## outputname<-unlist(read.table(ininput[2],skip=93,nrows = 1))[1]
inputfiles<-c(ininput,epcinput,metinput)
numdata<-rep(NA,3)
numyears <- as.numeric(unlist(strsplit(grep("simulation years",inifiles[[2]],value=TRUE),"[\ \t]"))[1])
## numyears<-unlist(read.table(ininput[2],skip = 14,nrows = 1)[1])
numvalues <- as.numeric(unlist(strsplit(grep("number of daily output variables",inifiles[[2]],value=TRUE),"[\ \t]"))[1])
## numvalues<-unlist(read.table(ininput[2],skip=102,nrows = 1)[1])
startyear <- as.numeric(unlist(strsplit(grep("first simulation year",inifiles[[2]],value=TRUE),"[\ \t]"))[1])
numdata[1]<-numyears*numvalues*365
numdata[2]<-numyears*numvalues*12
numdata[3]<-numyears*numvalues
settings = list(executable = executable,
calibrationpar = calibrationpar,
outputloc=outputloc,
outputnames=outputname,
inputloc=inputloc,
ininput=ininput,
metinput=metinput,
epcinput=epcinput,
thininput=thininput,
CO2input=CO2input,
mowinput=mowinput,
grazinput=grazinput,
harvinput=harvinput,
plouginput=plouginput,
fertinput=fertinput,
irrinput=irrinput,
nitinput=nitinput,
inputfiles=inputfiles,
numdata=numdata,
startyear=startyear,
numyears=numyears,
outputvars=outputvars
)
if(!(epcflag&CO2flag&nitflag&thinflag&plantflag&mowflag&grazflag&harvflag&plougflag&fertflag&irrflag)){
writeLines(inifiles[[1]],ininput[[1]])
if(epcinput[1]!=epcinput[2]){
writeLines(inifiles[[2]],ininput[[2]])
}
}
return(settings)
}

1
RBBGCMuso/R/soilcalib.R Normal file
View File

@ -0,0 +1 @@
soilMatrix <- function(numberOfLayers=)

119
RBBGCMuso/R/spinupmuso.R Normal file
View File

@ -0,0 +1,119 @@
spinupMuso <- function(settings,parameters=NULL, timee="d", debugging=FALSE, logfilename=NULL, keepEpc=FALSE, silent=FALSE, aggressive=FALSE){
##Copy the variables from settings
inputloc <- settings$inputloc
executable <- settings$executable
ininput <- settings$ininput
epc <- settings$epcinput
calibrationpar <- settings$calibrationpar
##Sometimes a bug occure due to logfiles and controlfiles in the input loc directory
if(silent!=TRUE){
if(length(grep("(dayout$)|(log$)",list.files(inputloc)))>0){
cat(" \n \n WARMING: there is a log or dayout file nearby the ini files, that may cause problemes. \n \n If you want to avoid that possible problemes, please copy the log or dayout files into a save place, and after do a cleanupMuso(), or delete these manually, or run the rungetMuso(), with the agressive=TRUE parameter \n \n")
}
}
##With the aggressive option every unneeded file will deleted
if(aggressive==TRUE){
cleanupMuso()
}
##change the epc file if and only if there are given parameters
if(!is.null(parameters)){
changemulline(settings, parameters)
}
##We change the working directory becase of the model, but we want to avoid sideeffects, so we save the current location and after that we will change everything to it.
whereAmI<-getwd()
## Set the working directory to the inputloc temporary.
setwd(inputloc)
##Run the spinup
system(paste(executable,ininput[1],sep=" "))
logfiles<-list.files(inputloc)[grep("log$",list.files(inputloc))]
perror<-as.numeric(as.vector(lapply(paste(inputloc,logfiles,sep=""),function(x) tail(readLines(x,-1),1))))
dirName<-paste(inputloc,"/LOG",sep="")
dirERROR<-paste(inputloc,"/ERROR",sep="")
ERROR_EPC<-paste(inputloc,"/ERROR_EPC",sep="")
if(!dir.exists(dirName)){
dir.create(dirName)
}
if(!dir.exists(dirERROR)){
dir.create(dirERROR)
}
if(length(perror)>sum(perror)){
errorsign <- 1
} else {
errorsign <- 0
}
if(keepEpc){#if keepepc option tured on
if(length(unique(dirname(epc)))>1){
print("Why are you playing with my nervs? Seriously? You hold your epc-s in different folders?")
} else {
epcdir <- dirname(epc[1])
WRONGEPC<-paste(inputloc,"WRONGEPC",sep="")
EPCS<-paste(inputloc,"EPCS",sep="")
if(!dir.exists(WRONGEPC)){
dir.create(WRONGEPC)
}
if(!dir.exists(EPCS)){
dir.create(EPCS)
}
epcfiles <- list.files(epcdir)[grep("epc$",list.files(epcdir))]
stampnum<-stamp(EPCS)
lapply(epcfiles,function (x) file.copy(from = paste(epcdir,"/",x,sep=""),to=paste(EPCS,"/",(stampnum+1),"-",x,sep="")))
if(errorsign==1){
lapply(epcfiles,function (x) file.copy(from = paste(EPCS,"/",(stampnum+1),"-",x,sep=""), to=WRONGEPC))
}
}
}
if(debugging=="stamplog"){
stampnum<-stamp(dirName)
lapply( logfiles, function (x) file.rename(from=paste(inputloc,x, sep=""), to=paste(dirName, "/",(stampnum+1),"-",x,sep="")))
if(errorsign==1){
lapply( logfiles, function (x) file.copy(from=paste(dirName, "/",(stampnum+1),"-",x,sep=""), to=dirERROR ))}
} else { if(debugging){
if(is.null(logfilename)){
lapply( logfiles, function (x) file.rename(from=paste(inputloc,x, sep=""), to=paste(dirName,"/", x, sep="")))
if(errorsign==1){
lapply( logfiles, function (x) file.rename(from=paste(dirName,"/", x, sep=""), to=dirERROR))
}
} else {
lapply( logfiles, function (x) file.rename(from=paste(inputloc,x, sep=""), to=paste(dirName, "/",logfilename,"-",x,sep="")))
if(errorsign==1){
lapply( logfiles, function (x) file.rename(from=paste(dirName, "/",logfilename,"-",x,sep=""), to=dirERROR))
}
}
}}
cleanupMuso()
if(errorsign==1){
return("Modell Failure")
}
}

17
RBBGCMuso/R/stamp.R Normal file
View File

@ -0,0 +1,17 @@
numcut<-function(string){
#This function returns only the starting numbers of a string
unlist(strsplit(grep("^[0-9]",string,value = TRUE),"[aAzZ-]"))[1]
}
numcutall<-function(vector){
#numcall apply numcut for all elements of a string vector
as.numeric(unlist(apply(as.matrix(vector),1,numcut)))
}
stamp<-function(path="./"){
#It gives back a stamp wich is the maximum number of the output numcall
numbers<-numcutall(list.files(path))
if(length(numbers)==0){
return (0)} else {
return(max(numbers))}
}

16
RBBGCMuso/RBBGCMuso.Rproj Normal file
View File

@ -0,0 +1,16 @@
Version: 1.0
RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default
EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8
RnwWeave: Sweave
LaTeX: pdfLaTeX
BuildType: Package
PackageInstallArgs: --no-multiarch --with-keep.source

View File

@ -0,0 +1,88 @@
<TRASH FROM MUSO.R>
## runMuso <- function(settings, parameters=c(" ECOPHYS")){
## #changing section
## # for(i in changeinput){
## # changemulline(settings, parameters[[i]])
## # }
## changemulline(settings,parameters)
## #spinup run
## # changemulline(type=1,setup(), parameters[[2]])
## setwd(settings$inputloc)
## system(paste(settings$executable,settings$ininput[1],sep=" "))
## #normal run
## setwd(settings$inputloc)
## system(paste(settings$executable,settings$ininput[2],sep=" "))
## }
## rungetMusowc <- function(settings,parameters=c(" ECOPHYS"),timee="y",logfile=FALSE,logfilename=NULL){
## #spinup run
## # changemulline(type=1,setup(), parameters[[2]])
## changemulline(settings,parameters)
## setwd(settings$inputloc)
## system(paste(settings$executable,settings$ininput[1],sep=" "))
## #normal run
## setwd(settings$inputloc)
## system(paste(settings$executable,settings$ininput[2],sep=" "))
## switch(timee,
## "d"=(Reva<-getdailyout(settings)),
## "m"=(Reva<-getmonthlyout(settings)),
## "y"=(Reva<-getyearlyout(settings))
## )
## return(Reva)
## }
<TRASH FROM OTHER_USEFULL_FUNCTIONS.R>
##For this functions there is a built in dirname function in R, which do the same.
## splitstr <- function(string, sep){
## return(unlist(strsplit(string,sep)))
## }
## containerdir<-function(string){
## return(paste(splitstr(string,"/")[1:(length(splitstr(string,"/"))-1)],collapse = "/"))
##}
<TRASH FROM CHANGECONTENT.R>
## changspecline <- function(filename, line_number,content){
## #This function calls the UNIX(-like) sed program to change specific line to other, using the row numbers.
## for_command_line <- paste("sed -i '",line_number,"s/.*/",content,"/'"," ",filename, sep="")
## system(for_command_line)
## }
## changespecline<- function(filename,line_number,content){
## TOT=readLines(filename,-1)
## TOT[line_number]<-content
## writeLines(TOT,filename)
## }
## changemulline <- function(settings,contents){
## #This is the function which is capable change multiple specific lines to other using their row numbers.
## #The function uses the previous changspecline function to operate.
## varnum <- length(settings$calibrationpar)
## if(length(contents)!=varnum)
## {
## cat("Error: number of the values is not the same as the number of the changed parameters")
## }
## for(i in 1:varnum){
## changspecline(settings$epcinput,settings$calibrationpar[i], contents[i] )
## }
## }
## changmulline2 <- function(settings,contents){
## #This is the function which is capable change multiple specific lines to other using their row numbers.
## #The function uses the previous changspecline function to operate.
## varnum <- length(settings$calibrationpar)
## if(length(contents)!=varnum)
## {
## cat("Error: number of the values is not the same as the number of the changed parameters")
## }
## for(i in 1:varnum){
## changespecline(settings$epcinput,settings$calibrationpar[i], contents[i] )
## }
## }

23
RBBGCMuso/man/#setup.Rd# Normal file
View File

@ -0,0 +1,23 @@
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/setup.r
\name{setup}
\alias{setup}
\title{This runs the Muso model}
\usage{
setup(executable = NULL, parallel = F, calibrationpar = c(1),
outputloc = NULL, inputloc = NULL, metinput = NULL, ininput = NULL,
epcinput = NULL)
}
\arguments{
\item{calibrationpar}{vector with line numbers}
}
\value{
No return, outputs are written to file
}
\description{
This runs the Muso model
}
\author{
Roland
}

View File

@ -0,0 +1,22 @@
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/changcontent.R
\name{changspecline}
\alias{changspecline}
\title{This function calls the UNIX(-like) sed program to change specific line to other, using the row numbers.}
\usage{
changspecline(filename, line_number, content)
}
\arguments{
\item{The}{name of the file which is needed to be changed in some lines, the numbers of this lines(vector), and
the contents(vector).}
}
\value{
void
}
\description{
This function calls the UNIX(-like) sed program to change specific line to other, using the row numbers.
}
\author{
Roland
}

View File

@ -0,0 +1,21 @@
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/other_usefull_functions.R
\name{getyearlycum}
\alias{getyearlycum}
\title{'Funtion for getting cumulative yearly data from observations}
\usage{
getyearlycum(daily_observations)
}
\arguments{
\item{A}{vector of the daily observations.}
}
\value{
A vector of yearly data
}
\description{
'Funtion for getting cumulative yearly data from observations
}
\author{
Roland Hollós
}

View File

@ -0,0 +1,21 @@
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/other_usefull_functions.R
\name{getyearlymax}
\alias{getyearlymax}
\title{'Function for getting the maximum values of the years, from daily data}
\usage{
getyearlymax(daily_observations)
}
\arguments{
\item{A}{vector of the daily observations}
}
\value{
A vector of yearly data
}
\description{
'Function for getting the maximum values of the years, from daily data
}
\author{
Roland Hollós
}

21
RBBGCMuso/man/runMuso.Rd Normal file
View File

@ -0,0 +1,21 @@
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/muso.R
\name{runMuso}
\alias{runMuso}
\title{This runs the Muso model}
\usage{
The function works only, if ...
}
\arguments{
\item{filename}{Name of the initialisation files}
}
\value{
No return, outputs are written to file
}
\description{
This runs the Muso model
}
\author{
Roland
}

23
RBBGCMuso/man/setup.Rd Normal file
View File

@ -0,0 +1,23 @@
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/setup.r
\name{setup}
\alias{setup}
\title{This runs the Muso model}
\usage{
setup(executable = NULL, parallel = F, calibrationpar = c(1),
outputloc = NULL, inputloc = NULL, metinput = NULL, ininput = NULL,
epcinput = NULL)
}
\arguments{
\item{calibrationpar}{vector with line numbers}
}
\value{
No return, outputs are written to file
}
\description{
This runs the Muso model
}
\author{
Roland
}

BIN
RBBGCMuso_0.1.7.tar.gz Normal file

Binary file not shown.

BIN
RBBGCMuso_0.1.7.tar.gz.bcg Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

3
README Normal file
View File

@ -0,0 +1,3 @@
README
This is one of the most important part of the package

7
RECOMENDATION Normal file
View File

@ -0,0 +1,7 @@
RECOMENDATIONS
-
-
-
-
-