Giter VIP home page Giter VIP logo

makeini's Introduction

Perl scripts makedepos.pl and makeemiss.pl

Purpose

Auxiliary scripts for the box model DSMACC to generate KPP files with emission and deposition rates from data files. The scripts translate emission and deposition data that is arranged in columns with species names and rate data separated by whitespaces to KPP language that can be interpreted by the box model DSMACC. Only the data are treated for species that are part of the current mechanism. For deposition rates, you can specify to apply a standard deposition rate to all species for which no predefined values exist.

Running the script

Shell commands

The scripts can be run by themselves or with make within the model DSMACC (https://github.com/pb866/DSMACC-testing.git). To run by themselves use:

perl makeemiss.pl [<list of kpp input files.> [<data file> [<kpp output file>]]]
perl makedepos.pl [<list of kpp input files.> [<data file> [<kpp output file> [<flag for standard>]]]]

All parameter are optional, if you want to assign the second or third argument, you need to assign the arguments before as well. If arguments are obsolete, standard values will be assigned.

Script arguments and input data

KPP input files

The scripts check for emission and deposition data, whether the species are actually part of the current mechanism (as otherwise KPP will crash). Therefore, all KPP files of the current mechanism need to be specified in the first script argument. Files need to specified with the names of the KPP files without the file endings '.kpp' and the folder paths ./mechanisms/ as a list separated by whitespaces wrapped in quotes. The standard names in both files are defined as:

"inorganic organic"

Data files

The actual emission and deposition data to be included in the scenario are saved in text files. The script will stop, if this parameter is empty. The format of the data files is:

# Comments started by '#'
<column 1> <whitespace separator(s)> <column 1>
species names   emission/deposition rate # inline comment
DEPOS           <standard vd>

Data files consists of 2 columns separated by whitespace. The first column holds the MCM species names, the second column the emission or deposition rate in s-1 in FORTRAN format, i.e. X.XXD±XX. Comments can be added as line comments or at the end of the data with an initial #.

In the deposition data a standard value can be defined, which is then extended to all species in the mechanism except for those with definitions already in the data file. The key word for the standard value is DEPOS as species name followed by the value of the standard vd in the second column. If no value is assigned, but the option to extend a standard value to all species is used (see next section), the script assigns a standard vd of 5.00d-6.

KPP output files

The third programme argument defines the folder paths and name of the output kpp file. A default file will be generated in the mechanisms folder, if the argument is empty with the name of the data file preceeded by emiss_ or depos and the file ending kpp.

Default name:

./mechanisms/[emiss/depos]_<data file name>.kpp

Standard depositon rate

In makedepos.pl, a standard deposition rate can be assigned, which is assigned to every species in the mechanism (derived from the input KPP files) that has no predefined deposition velocity. The script uses a standard vd of 5.00d-6, but any other value can be assigned in the input data file using the keyword DEPOS to assign the standard rate. If you only want to use the measured emission values in your data file, assign a 0 to the 3rd script argument. The standard value is 1, which means the assignment of the standard deposition velocity.

Script output

The scipts produce KPP files with the above default names. Include the KPP code in your master KPP file or during make kpp and run KPP to use the emission and deposition rates in your model runs.

Links to DSMACC

The script is designed for the DSMACC version available on github. Place the scripts makeemiss.pl and makedepos.pl in ./src/background/ together with your KPP mechanism files in ./mechanisms/. Place the data files in your InitCons folder. Run make kpp and follow the on-screen instructions.

Julia scripts makeEMISS.jl / makeDEPOS.jl

The perl scripts have been re-written in julialang. The functionalities stay the same as for the perl script with refined on-screen warning messages and additional information about the scripts used and the date/time generated in the output file.

Call files using the same arguments/rules as defined [above](#shell commands):

julia makeEMISS.jl [ARGS]
julia makeDEPOS.jl [ARGS]

Version history

v2.1

  • Performance improvements in julia scripts: scripts are now callable from every directory without giving errors that the self-made modules are not found in the current path
  • bug fix in perl script makedepos.pl, which would not assign a standard deposition rate, if DEPOS was the only definition in the dep file

v2.0

  • Scripts re-written in julialang (julia 0.6.0)
  • Refined on-screen warnings about missing files and missing species in the mechanism
  • Additional information about script version and date/time generated in the output kpp files
  • Minor fixes in perl scripts

v1.3

  • Revised folder paths, so script is called from DSMACC main folder
  • New script argument for KPP output file name
  • Default KPP output file: ./mechanisms/[emiss/depos]\_<data file name>.kpp
  • No default data file name, script stops, if argument is empty of file doesn't exist

v1.2.2

  • Updated README

v1.2.1

  • Fix in assignment of vd that allows only the assignment of vd without any further definitions

v1.2

  • Omission of perl modules
  • Additional warnings for empty output files

v1.1

  • Generation of empty kpp output files, if second argument is 0 or - or data file doesn't exist
  • On-screen warnings

v1.0

  • First working version
  • Predefined vd
  • Script arguments for KPP files and data file
  • Switch to extend standard vd or use predefined values only

makeini's People

Watchers

James Cloos avatar Peter Bräuer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.