eixport

Travis-CI Build
StatusBuild
status Coverage
Status DOI CRAN_Status_Badge CRAN
Downloads DOI cran
checks Github
Stars R build
status

Exporting emissions to atmospheric models, eixport: 0.5.0

Emissions are mass that affects atmosphere in complex ways, not only physical, but also, in the health of humans, ecosystems, economically, etc.

There are several models whose inputs are emissions, such as R-Line or WRF-Chem. This R-Package provide functions to read emissions from VEIN and from other models in different formats and export the emissions into the appropriate format suitable to other models.

Install

To install the CRAN version:

install.packages("eixport")

To install the development version:

devtools::install_github("atmoschem/eixport")

Some functions:

  • get_edgar: Download EDGAR emissions data.
  • to_rline: Export emissions to other formats
  • to_wrf: Combine total/spatial/temporal/split and write emission to file
  • to_brams_spm: inputs for SPM BRAMS
  • wrf_profile: Create spatial profile for WRF-Chem
  • wrf_create: Create emission files to the WRF-Chem
  • wrf_plot: simple but useful plot
  • wrf_get: Read variables
  • wrf_put: Write variables
  • to_as4wrf: Create WRF-Chem inputs using NCL scrip AS4WRF.ncl.
  • to_munich: To generate inputs for MUNICH model.

Download EDGAR 5

get_edgar(dataset = "v50_AP", destpath = tempdir(), sector = "TOTALS", year = 2014)

check this video

Summary

library(eixport)
file = paste0(system.file("extdata", package = "eixport"),"/wrfinput_d02")
wrf_summary(file = file)
#>   |                                                                              |                                                                      |   0%  |                                                                              |=======================                                               |  33%  |                                                                              |===============================================                       |  67%  |                                                                              |======================================================================| 100%
#>                Min.       1st Qu.        Median          Mean       3rd Qu.
#> Times  1.312168e+09  1.312168e+09  1.312168e+09  1.312168e+09  1.312168e+09
#> XLAT  -2.438538e+01 -2.405025e+01 -2.370471e+01 -2.370379e+01 -2.335773e+01
#> XLONG -4.742899e+01 -4.696930e+01 -4.650305e+01 -4.650304e+01 -4.603427e+01
#>                Max.        sum
#> Times  1.312168e+09         NA
#> XLAT  -2.301877e+01  -76160.28
#> XLONG -4.558643e+01 -149414.28

Attributes as data.frame

file = paste0(system.file("extdata", package = "eixport"),"/wrfinput_d02")
wrf_meta(file)
#> $global
#>                               att                                       vars
#> 1                           TITLE  OUTPUT FROM REAL_EM V3.9.1.1 PREPROCESSOR
#> 2                      START_DATE                        2011-08-01_00:00:00
#> 3           SIMULATION_START_DATE                        2011-08-01_00:00:00
#> 4        WEST-EAST_GRID_DIMENSION                                         64
#> 5      SOUTH-NORTH_GRID_DIMENSION                                         52
#> 6       BOTTOM-TOP_GRID_DIMENSION                                         35
#> 7                              DX                                       3000
#> 8                              DY                                       3000
#> 9                        GRIDTYPE                                          C
#> 10                       DIFF_OPT                                          1
#> 11                         KM_OPT                                          4
#> 12                       DAMP_OPT                                          3
#> 13                       DAMPCOEF                          0.200000002980232
#> 14                          KHDIF                                          0
#> 15                          KVDIF                                          0
#> 16                     MP_PHYSICS                                         10
#> 17                  RA_LW_PHYSICS                                          4
#> 18                  RA_SW_PHYSICS                                          4
#> 19              SF_SFCLAY_PHYSICS                                          1
#> 20             SF_SURFACE_PHYSICS                                          2
#> 21                 BL_PBL_PHYSICS                                          1
#> 22                     CU_PHYSICS                                          0
#> 23                SF_LAKE_PHYSICS                                          0
#> 24           SURFACE_INPUT_SOURCE                                          1
#> 25                     SST_UPDATE                                          0
#> 26                      GRID_FDDA                                          0
#> 27               GFDDA_INTERVAL_M                                          0
#> 28                    GFDDA_END_H                                          0
#> 29                     GRID_SFDDA                                          0
#> 30              SGFDDA_INTERVAL_M                                          0
#> 31                   SGFDDA_END_H                                          0
#> 32                HYPSOMETRIC_OPT                                          2
#> 33                    USE_THETA_M                                          0
#> 34                 USE_MAXW_LEVEL                                          0
#> 35                 USE_TROP_LEVEL                                          0
#> 36                        GWD_OPT                                          0
#> 37               SF_URBAN_PHYSICS                                          1
#> 38               SF_OCEAN_PHYSICS                                          0
#> 39 SIMULATION_INITIALIZATION_TYPE                             REAL-DATA CASE
#> 40   WEST-EAST_PATCH_START_UNSTAG                                          1
#> 41     WEST-EAST_PATCH_END_UNSTAG                                         63
#> 42     WEST-EAST_PATCH_START_STAG                                          1
#> 43       WEST-EAST_PATCH_END_STAG                                         64
#> 44 SOUTH-NORTH_PATCH_START_UNSTAG                                          1
#> 45   SOUTH-NORTH_PATCH_END_UNSTAG                                         51
#> 46   SOUTH-NORTH_PATCH_START_STAG                                          1
#> 47     SOUTH-NORTH_PATCH_END_STAG                                         52
#> 48  BOTTOM-TOP_PATCH_START_UNSTAG                                          1
#> 49    BOTTOM-TOP_PATCH_END_UNSTAG                                         34
#> 50    BOTTOM-TOP_PATCH_START_STAG                                          1
#> 51      BOTTOM-TOP_PATCH_END_STAG                                         35
#> 52                        GRID_ID                                          2
#> 53                      PARENT_ID                                          1
#> 54                 I_PARENT_START                                         48
#> 55                 J_PARENT_START                                         40
#> 56              PARENT_GRID_RATIO                                          3
#> 57                             DT                                         15
#> 58                        CEN_LAT                          -23.7047119140625
#> 59                        CEN_LON                          -46.5030517578125
#> 60                       TRUELAT1                                        -23
#> 61                       TRUELAT2                                        -24
#> 62                   MOAD_CEN_LAT                          -23.5499954223633
#> 63                      STAND_LON                                        -45
#> 64                       POLE_LAT                                         90
#> 65                       POLE_LON                                          0
#> 66                            GMT                                          0
#> 67                          JULYR                                       2011
#> 68                         JULDAY                                        213
#> 69                       MAP_PROJ                                          1
#> 70                  MAP_PROJ_CHAR                          Lambert Conformal
#> 71                         MMINLU                   MODIFIED_IGBP_MODIS_NOAH
#> 72                   NUM_LAND_CAT                                         21
#> 73                        ISWATER                                         17
#> 74                         ISLAKE                                         21
#> 75                          ISICE                                         15
#> 76                        ISURBAN                                         13
#> 77                     ISOILWATER                                         14
#> 78                     HYBRID_OPT                                         -1
#> 79                           ETAC                                          0
#> 
#> $vars
#>    vars MemoryOrder                 description        units stagger FieldType
#> 1  XLAT          XY LATITUDE, SOUTH IS NEGATIVE degree north               104
#> 2 XLONG          XY LONGITUDE, WEST IS NEGATIVE  degree east               104

Paper accepted on Journal of Open Source Software

https://doi.org/10.21105/joss.00607

@article{eixport,
    title = {eixport: An R package to export emissions to atmospheric models},
    journal = {The Journal of Open Source Software},
    author = {Sergio Ibarra-Espinosa and Daniel Schuch and Edmilson {Dias de Freitas}},
    year = {2018},
    doi = {10.21105/joss.00607},
    url = {http://joss.theoj.org/papers/10.21105/joss.00607},
  }

Contributing

Please, read this guide. Contributions of all sorts are welcome, issues and pull requests are the preferred ways of sharing them. When contributing pull requests, please follow the Google’s R Style Guide. This project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.